Önceki Bakiye Kuralı 2

Önceki Bakiye Kuralı (Site takipçimden)

sub ProcessEvent(App)
strDBUser = ".." ' SQL Server kullanıcı adı
strDBPass = "..*" ' SQL Server kullanıcısının şifresi
strDBServer = ".." ' SQL Server
strDBName = ".." ' Veritabanı adı
Set conn = CreateObject("ADODB.Connection")
conn.ConnectionString = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=" + strDBUser + ";Password=" + strDBPass + ";Initial Catalog=" + strDBName+ ";Data Source=" + strDBServer
conn.Open
Set rs = CreateObject("adodb.recordset")
rs.ActiveConnection = conn

ST_CariId = App.Doc.FieldAsString("ARP_LOGICALREF")
ST_DocNumber = App.Doc.FieldAsString("NUMBER")
ST_strQuery = "SELECT (SELECT SUM(DEBIT)-SUM(CREDIT) FROM LV_022_01_GNTOTCL WITH(NOLOCK) WHERE (CARDREF =" + ST_CariId + "AND TOTTYP = 1)) - NETTOTAL FROM LG_022_01_INVOICE WHERE FICHENO='" + ST_DocNumber+ "'"
rs.Open ST_strQuery, conn
oncekibakiye = rs.Fields(0).value

App.Doc.WriteStartElement "ADDITIONALDOCUMENTS/ADDITIONALDOCUMENT"
App.Doc.WriteElementString "ID",Replace(cstr(oncekibakiye),",",".")
App.Doc.WriteElementString "ISSUEDATE", Year(Date) & "-" & Right("0" & Month(Date),2) & "-" & Right("0" & Day(Date), 2)
App.Doc.WriteElementString "DOCUMENTTYPE", "ONCEKIBAKIYE"
App.Doc.WriteEndElement

rs.close
conn.close
App.Doc.SaveData

end sub

Önceki Bakiye Kuralı 1

Önceki Bakiye Kuralı

sub ProcessEvent(App)

ST_ClRef = App.Doc.FieldAsInteger("ARP_LOGICALREF")
ST_CHRRef = CStr(ST_ClRef)
BAKIYE = App.UQUERY_GETFLD(60,"SUM(DEBIT)-SUM(CREDIT)",24,6,FALSE,"CARDREF ="+ST_CHRRef+" AND TOTTYP = 1" )
ST_DocNumber=App.Doc.FieldAsString("NUMBER")
St_Toplam = App.UQUERY_GETFLD(14,"NETTOTAL",24,6,FALSE,"FICHENO ='"+ST_DocNumber+"'" )

ONCEKIBAKIYE= ( CDbl(BAKIYE) - CDbl( St_Toplam)) /100

App.Doc.WriteStartElement "ADDITIONALDOCUMENTS/ADDITIONALDOCUMENT"
App.Doc.WriteElementString "ID",Replace(cstr(ONCEKIBAKIYE),",",".")
App.Doc.WriteElementString "ISSUEDATE", Year(Date) & "-" & Right("0" & Month(Date),2) & "-" & Right("0" & Day(Date), 2)
App.Doc.WriteElementString "DOCUMENTTYPE", "ONCEKIBAKIYE"
App.Doc.WriteEndElement
App.Doc.SaveData
end sub

Malzeme Kodu ile Özel kodu Yer değiştirme kuralı

sub ProcessEvent(App)

   Kontrol=App.Doc.FirstChild(“TRANSACTIONS.TRANSACTION”)
   while Kontrol
               Ref = App.Doc.FieldAsInteger(“TRANSACTIONS.TRANSACTION.MASTER_ORGLOGICALREF”)
               KODUU     = App.Doc.FieldAsInteger(“TRANSACTIONS.TRANSACTION.MASTER_CODE”)
               OZELKOD = App.UQuery_GetFld(1, “SPECODE”, 25, 52, FALSE, “LOGICALREF=”+ cstr(Ref))
               App.Doc.ModifyData “TRANSACTIONS.TRANSACTION.MASTER_CODE”, OZELKOD
   Kontrol=App.Doc.NextChild
    wend
App.Doc.SaveData

end sub

Logo Connect Sevkiyat Açıklamasını Fatura Alanına Getirme Kuralı

sub ProcessEvent(App)

strShipLoc_Code = App.Doc.FieldAsString(“SHIPLOC_CODE”)

SEVKIYATACIKLAMA = App.UQUERY_GETFLD(58, “NAME”, 200, 52, FALSE, “CODE = ‘”+strShipLoc_Code+”‘” )

App.Doc.WriteStartElement “ADDITIONALDOCUMENTS/ADDITIONALDOCUMENT”

App.Doc.WriteElementString “ID”, SEVKIYATACIKLAMA

App.Doc.WriteElementString “ISSUEDATE”, Year(Date()) & “-” & Right(“0” & Month(Date), 2) & “-” & Day(Date())

App.Doc.WriteElementString “DOCUMENTTYPE”, “SEVKIYATACIKLAMA”

App.Doc.WriteEndElement

App.Doc.SaveData

end sub

 

XSLT ye Eklenecek Kod

 

<xsl:for-each select=”//n1:Invoice/cac:AdditionalDocumentReference”>

<xsl:if test =”cbc:DocumentType = ‘SEVKIYATACIKLAMA'”>

<p style=’margin-left: 20px;’>

<b>SEVKİYAT BİLGİSİ :</b>

<b>

<xsl:value-of select=”cbc:ID”/>

</b>     

</p>                                                                                                             

</xsl:if>