İlginizi Çekebilir
  1. Ana Sayfa
  2. Logo Tanımlamalar

Logo Connect Kural Tanımlama ve Tasarıma Getirme

Logo Connect Kural Tanımlama ve Tasarıma Getirme
logo connect kural tanımlama
0

e-Devlet içerikli Logo ERP programlarını kullanan firmalar, logo connect programına aşinadır. Logo connect ile ERP programda hazırlanan faturalar ve irsaliyeler, elektronik belge olarak connect programı aracılığıyla Gelir İdaresi Başkanlığı’na ve alıcı firmanın entegratörlük portalına gönderilebilmektedir. Bu gönderim esnasında xslt uzantılı görüntü şablonları kullanılır. Bu yazıda, fatura tasarımına kural ile farklı alanlar nasıl getirilir bunların kodlarını paylaşacağım.

Logo Connect Kural Örnekleri

Aşağıda paylaşacağım örnek kurallar ile, mevcut tasarımınızda olmayan veya standart fatura şablonunda bulunmayan verileri fatura şablonuna getirebilirsiniz.

1- Malzeme Açıklama2 Alanını Satır Açıklaması Alanına Getirme

sub ProcessEvent(App)
ok1=App.Doc.FirstChild(“TRANSACTIONS.TRANSACTION”)
while ok1
name = App.Doc.FieldAsString(“TRANSACTIONS.TRANSACTION.MASTER_DEF3”)
App.Doc.ModifyData “TRANSACTIONS.TRANSACTION.DESCRIPTION”, name
ok1=App.Doc.NextChild
wend
App.Doc.SaveData
end sub

2- Cari Hesap Son 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″ )
App.Doc.WriteStartElement “ADDITIONALDOCUMENTS/ADDITIONALDOCUMENT” App.Doc.WriteElementString “ID”,Replace(cstr(BAKIYE),”,”,”.”) App.Doc.WriteElementString “ISSUEDATE”, Year(Date) & “-” & Right(“0” & Month(Date),
2) & “-” & Right(“0” & Day(Date), 2) App.Doc.WriteElementString “DOCUMENTTYPE”, “BAKIYE” App.Doc.WriteEndElement
App.Doc.SaveData end sub

3- Description ile Name Alanını Değiştirme

sub ProcessEvent(App)
TAX=App.Doc.FieldAsString(“ARP_CODE”)
If TAX= “120.01.002.0” then
rOk=App.Doc.FirstRoot
while rOk
ok1=App.Doc.FirstChild(“TRANSACTIONS.TRANSACTION”)
while ok1
KOD =
App.Doc.FieldAsString(“TRANSACTIONS.TRANSACTION.MASTER_CODE”)
DEF =
App.Doc.FieldAsString(“TRANSACTIONS.TRANSACTION.MASTER_DEF”)
App.Doc.ModifyData
“TRANSACTIONS.TRANSACTION.MASTER_DEF”, KOD
App.Doc.ModifyData
“TRANSACTIONS.TRANSACTION.MASTER_CODE”, DEF ok1=App.Doc.NextChild
wend
rOk=App.Doc.NextRoot
wend
App.Doc.SaveData
end If
end sub

4- e-Arşiv Faturalarında Sevkiyat Adresi Bilgilerini Getirme

Aşağıdaki 2 kural ile sevkiyat adresi açıklaması, sevkiyat adresi il, ilçe ve adres bilgilerini fatura ubl’ine getirebilirsiniz;

Sevkiyat adresi açıklaması

sub ProcessEvent(App)
DETAY = App.Doc.FieldAsString(“SHIPLOC_DEF”)
App.Doc.WriteStartElement “ADDITIONALDOCUMENTS/ADDITIONALDOCUMENT”
App.Doc.WriteElementString “ID”, DETAY
App.Doc.WriteElementString “ISSUEDATE”, Year(Date) & “-” & Right(“0” & Month(Date), 2)
& “-” & Right(“0” & Day(Date), 2) App.Doc.WriteElementString “DOCUMENTTYPE”, “SEVKIYAT” App.Doc.WriteEndElement
App.Doc.SaveData end sub

İl, ilçe, adres

sub ProcessEvent(App)
DETAY =
App.Doc.FieldAsString(“EINVOICE_EXTENSIONS.EXTENSIONS.SHIPINFO_ADDRES”) App.Doc.WriteStartElement “ADDITIONALDOCUMENTS/ADDITIONALDOCUMENT” App.Doc.WriteElementString “ID”, DETAY
App.Doc.WriteElementString “ISSUEDATE”, Year(Date) & “-” & Right(“0” & Month(Date), 2)
& “-” & Right(“0” & Day(Date), 2) App.Doc.WriteElementString “DOCUMENTTYPE”, “ADRES” App.Doc.WriteEndElement
App.Doc.SaveData
DETAY =
App.Doc.FieldAsString(“EINVOICE_EXTENSIONS.EXTENSIONS.SHIPINFO_TOWNDIST”) App.Doc.WriteStartElement “ADDITIONALDOCUMENTS/ADDITIONALDOCUMENT” App.Doc.WriteElementString “ID”, DETAY
App.Doc.WriteElementString “ISSUEDATE”, Year(Date) & “-” & Right(“0” & Month(Date), 2)
& “-” & Right(“0” & Day(Date), 2)
App.Doc.WriteElementString “DOCUMENTTYPE”, “ILCE”
App.Doc.WriteEndElement
App.Doc.SaveData
DETAY =
App.Doc.FieldAsString(“EINVOICE_EXTENSIONS.EXTENSIONS.SHIPINFO_CITY”)
App.Doc.WriteStartElement “ADDITIONALDOCUMENTS/ADDITIONALDOCUMENT”
App.Doc.WriteElementString “ID”, DETAY
App.Doc.WriteElementString “ISSUEDATE”, Year(Date) & “-” & Right(“0” & Month(Date), 2)
& “-” & Right(“0” & Day(Date), 2) App.Doc.WriteElementString “DOCUMENTTYPE”, “SEHIR” App.Doc.WriteEndElement
App.Doc.SaveData end sub

Tasarıma da gelmesi için;

<xsl:for-each select=”//n1:Invoice/cac:AdditionalDocumentReference”> <xsl:if test =”cbc:DocumentType = ‘SEVKIYAT'”> <xsl:value-of select=”cbc:ID”></xsl:value-of> </xsl:if> </xsl:for-each>
<xsl:for-each select=”//n1:Invoice/cac:AdditionalDocumentReference”> <xsl:if test =”cbc:DocumentType = ‘ADRES'”> <xsl:value-of select=”cbc:ID”></xsl:value-of> </xsl:if> </xsl:for-each>
<xsl:for-each select=”//n1:Invoice/cac:AdditionalDocumentReference”> <xsl:if test =”cbc:DocumentType = ‘SEHIR'”> <xsl:value-of select=”cbc:ID”></xsl:value-of> </xsl:if> </xsl:for-each>
<xsl:for-each select=”//n1:Invoice/cac:AdditionalDocumentReference”> <xsl:if test =”cbc:DocumentType = ‘ILCE'”> <xsl:value-of select=”cbc:ID”></xsl:value-of> </xsl:if> </xsl:for-each>

5- Genel Açıklamalar Kısmına Cari Hesap Bakiyesini Getirme

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″ )
App.Doc.WriteStartElement “ADDITIONALDOCUMENTS/ADDITIONALDOCUMENT” App.Doc.WriteElementString “ID”,Replace(cstr(BAKIYE),”,”,”.”) App.Doc.WriteElementString “ISSUEDATE”, Year(Date) & “-” & Right(“0” & Month(Date),
2) & “-” & Right(“0” & Day(Date), 2) App.Doc.WriteElementString “DOCUMENTTYPE”, “BAKIYE” App.Doc.WriteEndElement
App.Doc.SaveData end sub

6 – Detaylı Bilgi Alanını Genel Açıklama Alanına Getirme

sub ProcessEvent(App)
DETAY = App.Doc.FieldAsString(“ITEXT”)
App.Doc.ModifyData “NOTES5”,DETAY
App.Doc.SaveData
end sub

7 – Karma Koli Kuralı

“Karma Koli satırına KDV Oranı ve Toplamı gelsin fakat alt satırlar silinsin, e-Fatura gönderirken ise dizaynda ve UBL’de bu satırlar silinsin” isteniyorsa eğer, aşağıdaki kural kullanılmalıdır;
sub ProcessEvent(App)
okay=App.Doc.FirstChild(“TRANSACTIONS.TRANSACTION”)
While okay
sTip=App.Doc.FieldAsInteger(“TRANSACTIONS.TRANSACTION.TYPE”)
if sTip=6 Then
App.Doc.ModifyData “TRANSACTIONS.TRANSACTION.VAT_RATE”,18 elseif sTip=7 Then
App.Doc.RemoveChild “TRANSACTION.TYPE”
end if
okay = App.Doc.NextChild
Wend
App.Doc.SaveData
end sub

8 – Karma Koli Malzeme Kuralı

Karma Koli’nin içerisindeki malzemelerin faturada görünmemesi için aşağıdaki kural kullanılabilir.
Doküman: e-Fatura/e-Arşiv
Olay: Onaylanmadan/İmzalanmadan Önce
sub ProcessEvent(App)
okay=App.Doc.FirstChild(“TRANSACTIONS.TRANSACTION”)
While okay
sTip=App.Doc.FieldAsInteger(“TRANSACTIONS.TRANSACTION.TYPE”)
if sTip=6 Then
App.Doc.ModifyData “TRANSACTIONS.TRANSACTION.VAT_RATE”,18 elseif sTip=7 Then
App.Doc.RemoveChild “TRANSACTION.TYPE”
end if
okay = App.Doc.NextChild
Wend
App.Doc.SaveData
end sub

9 – Sipariş Numarasının Sipariş Fiş Numarasına Getirilmesi

sub ProcessEvent(App)
ORDER =
App.Doc.FieldAsString(“TRANSACTIONS.TRANSACTION.ORDER_FICHENO”)
ok1=App.Doc.FirstChild(“TRANSACTIONS.TRANSACTION”)
while ok1
App.Doc.ModifyData “CUSTORDNO”, ORDER
ok1=App.Doc.NextChild
wend
App.Doc.SaveData
end sub

10 – Barkod Numarasının Fatura Satırına Getirme Kuralı

sub ProcessEvent(App)
rOk=App.Doc.FirstRoot
while rOk
ok1=App.Doc.FirstChild(“TRANSACTIONS.TRANSACTION”)
while ok1
barkod = App.Doc.FieldAsString(“TRANSACTIONS.TRANSACTION.BARCODE”)
App.Doc.ModifyData “TRANSACTIONS.TRANSACTION.ITEM_SUPPLIERCODE”, barkod
ok1=App.Doc.NextChild
wend
rOk=App.Doc.NextRoot
wend
App.Doc.SaveData
end sub

11 – Sipariş No ve Tarihinin Açıklama 3 ve 4 satırından okunması

sub ProcessEvent(App)
rOk=App.Doc.FirstRoot
while rOk
ST_DEGISKEN1 =App.Doc.FieldAsString(“NOTES3”)
ST_DEGISKEN2 = App.Doc.FieldAsString(“NOTES4”)
ok1=App.Doc.FirstChild(“TRANSACTIONS.TRANSACTION”)
while ok1
App.Doc.ModifyData “CUSTORDNO”,ST_DEGISKEN1
App.Doc.ModifyData “ORDER_FICHENO”,ST_DEGISKEN1
App.Doc.ModifyData “ORDER_FICHEDATE”,ST_DEGISKEN2
ok1=App.Doc.FirstChild(“TRANSACTIONS.TRANSACTION”)
ok1=App.Doc.NextChild
wend
rOk=App.Doc.NextRoot
wend
App.Doc.SaveData
end sub

12 – Tedarikçi Kodunun Fatura Satırına Getirilmesi

sub ProcessEvent(App)
rOk=App.Doc.FirstRoot
while rOk
okay=App.Doc.FirstChild(“TRANSACTIONS.TRANSACTION”)
while okay
OZELKOD =
App.Doc.FieldAsString(“TRANSACTIONS.TRANSACTION.MASTER_AUXIL_CODE”)
App.Doc.ModifyData
“TRANSACTIONS.TRANSACTION.ITEM_CUSTOMERCODE”, OZELKOD
okay=App.Doc.NextChild
wend
rOk=App.Doc.NextRoot
wend
App.Doc.SaveData ‘ Yapılan değişiklikler kaydediliyor end sub

13 – İhracat faturalarında satır miktar toplamının açıklamaya getirilmesi

sub ProcessEvent(App)
Type1 = App.Doc.FieldAsString(“EXIM_FICHE_TYPE”)
If Type1 = 2 or 3 Then
b = 0.0
okay=App.Doc.FirstChild(“TRANSACTIONS.TRANSACTION”)
while okay
Type2 = App.Doc.FieldAsInteger(“TRANSACTIONS.TRANSACTION.TYPE”)
If Type2 = 0 Then
Quantity = App.Doc.FieldAsFloat(“TRANSACTIONS.TRANSACTION.QUANTITY”)
a = (Quantity) + b
b = a
end if
okay=App.Doc.NextChild
wend
App.Doc.WriteStartElement “ADDITIONALDOCUMENTS/ADDITIONALDOCUMENT” App.Doc.WriteElementString “ID”, b
App.Doc.WriteElementString “ISSUEDATE”, Year(Date) & “-” & Right(“0” & Month(Date), 2) & “-” & Right(“0” & Day(Date), 2)
App.Doc.WriteElementString “DOCUMENTTYPE”, “TOPLAMMIKTAR”
App.Doc.WriteEndElement
end if
App.Doc.SaveData
end sub

Tasarıma gelmesi için ek alan xslt kodu:

<xsl:for-each select=”//n1:Invoice/cac:AdditionalDocumentReference”> <xsl:if test =”cbc:DocumentType = ‘TOPLAMMIKTAR'”>
<xsl:value-of select=”cbc:ID”/>
</xsl:if>
</xsl:for-each>

14 – Malzemenin ingilizce kod ve açıklamasının getirilmesi

İNGİLİZCE KOD VE AÇIKLAMA
sub ProcessEvent(App)
‘Tip = App.Doc.FieldAsInteger(“EXIM_FICHE_TYPE”)
‘if Tip = 5 then
strDBUser = “sa” ‘ SQL Server kullanıcı adı strDBPass = “123456” ‘ SQL Server kullanıcısının şifresi strDBServer = “SERRASARIKAYA” ‘ SQL Server strDBName = “TIGER” ‘ Veritabanı adı
‘ ADODB bağlantısı için standart yaratılması gereken nesne ve yazılması gereken cümleler
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
ok1=App.Doc.FirstChild(“TRANSACTIONS.TRANSACTION”)
while ok1
Ref =
App.Doc.FieldAsInteger(“TRANSACTIONS.TRANSACTION.MASTER_ORGLOGICALREF”)
strRef = CStr(Ref) ‘ Referans Bilgisi Stringe çevriliyor
strQuery = ” SELECT A.FIELDCONT,B.FIELDCONT FROM LG_001_LNGEXCSETS
A,LG_001_LNGEXCSETS B WHERE A.DOCREF=B.DOCREF AND A.DOCID=1 AND A.LANGID=2 AND
A.FIELDID=10 AND B.FIELDID=1 AND A.DOCREF= ” + strRef ‘ Sorgu oluşturuluyor
rs.Open strQuery, conn ‘ Querymizi çalıştırdığımız kısım
strCode = rs.Fields(0).value ‘ ADODB bağlantısından sorgudan dönen değer okunuyor strAciklama = rs.Fields(1).value
App.Doc.ModifyData “TRANSACTIONS.TRANSACTION.MASTER_CODE”, strCode App.Doc.ModifyData “TRANSACTIONS.TRANSACTION.MASTER_DEF”, strAciklama
do while (rs.EOF = false)
rs.MoveNext()
loop
rs.close
App.Doc.SaveData
ok1=App.Doc.NextChild
wend
‘end if
‘ rs.close’ RecordSet kapatılıyor
conn.close’ ADODB bağlantısı kapatılıyor
end sub

15 – Hizmet kartı açıklama 2’nin açıklamaya getirilmesi

sub ProcessEvent(App)
okay=App.Doc.FirstChild(“TRANSACTIONS.TRANSACTION”)
while okay
sType = App.Doc.FieldAsInteger(“TRANSACTIONS.TRANSACTION.TYPE”)
If sType = 4 Then
rOK=App.Doc.FirstChild(“SALES_SERVICES.SERVICE”)
while rOk
ACIKLAMA2 = App.Doc.FieldAsString(“SALES_SERVICES.SERVICE.DESCRIPTION2”)
rOk=App.Doc.NextChild
wend
App.Doc.ModifyData “TRANSACTIONS.TRANSACTION.MASTER_DEF”, ACIKLAMA2 end if
okay=App.Doc.NextChild
wend
App.Doc.SaveData
end sub

16 – Tanımlı alanların Başlık ile beraber açıklamalar alanına getirilmesi

sub ProcessEvent(App)
DETAY = App.Doc.FieldAsString(“DEFNFLDSLIST.DEFNFLD.TEXTFLDS1”) DETAY1 = App.Doc.FieldAsString(“DEFNFLDSLIST.DEFNFLD.TEXTFLDS2”) App.Doc.ModifyData “NOTES5”, “Başlık: ” + DETAY App.Doc.ModifyData “NOTES6”, “Başlık2: ” + DETAY1
App.Doc.SaveData
end sub

17 – Tesis devri kuralı

Özelkod: TESISDEVRI
sub ProcessEvent(App)
OZELKOD=App.Doc.FieldAsString(“AUXIL_CODE”)
If OZELKOD= “TESISDEVRI” then
rOk=App.Doc.FirstRoot
while rOk
ToplamTutarA= App.Doc.FieldAsFloat(“TOTAL_NET”)
ToplamTutarB= App.Doc.FieldAsFloat(“TC_NET”)
Geneltutar=App.Doc.FieldAsFloat(“EXPENSE_DISTRB”)
Geneltutarnew=CDbl(geneltutar)
ToplamTutar1=CDbl(ToplamTutarA)
ToplamTutar2=CDbl(ToplamTutarB)
Toplambedel1=Geneltutarnew+ToplamTutarA
Toplambedel2=Geneltutarnew+ToplamTutarA
App.Doc.ModifyData “TOTAL_VAT”,Replace(cstr(Geneltutarnew),”,”,”.”)
App.Doc.ModifyData “TOTAL_NET”,Replace(cstr(toplambedel1),”,”,”.”)
App.Doc.ModifyData “TC_NET”,Replace(cstr(toplambedel2),”,”,”.”)
ok1=App.Doc.FirstChild(“DISPATCHES.DISPATCH”)
while ok1
App.Doc.ModifyData “TOTAL_VAT”,Replace(cstr(Geneltutarnew),”,”,”.”) App.Doc.ModifyData “TOTAL_NET”,Replace(cstr(toplambedel),”,”,”.”) ok1=App.Doc.NextChild
wend
ok1=App.Doc.FirstChild(“TRANSACTIONS.TRANSACTION”)
while ok1
App.Doc.ModifyData “VAT_AMOUNT”,Replace(cstr(Geneltutarnew),”,”,”.”)
ok1=App.Doc.NextChild
wend
ok1=App.Doc.FirstChild(“TRANSACTIONS.TRANSACTION.EINVOICE_EXTENSIONS.EXTENSIONS.TA XSUBTOTALS.TAXSUBTOTAL”)
while ok1
App.Doc.ModifyData “TAXAMOUNT”,Replace(cstr(Geneltutarnew),”,”,”.”)
ok1=App.Doc.NextChild
wend
ok1=App.Doc.FirstChild(“TRANSACTIONS.TRANSACTION.EINVOICE_EXTENSIONS.EXTENSIONS.
TAXSUBTOTALS”)
while ok1
App.Doc.ModifyData “TAXAMOUNT”,Replace(cstr(Geneltutarnew),”,”,”.”)
ok1=App.Doc.NextChild
wend
ok1=App.Doc.FirstChild(“EINVOICE_EXTENSIONS.EXTENSIONS.TAXSUBTOTALS.TAXSUBTOTAL”) while ok1
App.Doc.ModifyData “TAXAMOUNT”,Replace(cstr(Geneltutarnew),”,”,”.”)
App.Doc.ModifyData “PERCENT”,18
ok1=App.Doc.NextChild
wend
ok1=App.Doc.FirstChild(“EINVOICE_EXTENSIONS.EXTENSIONS.TAXSUBTOTALS”) while ok1
App.Doc.ModifyData “TAXAMOUNT”,Replace(cstr(Geneltutarnew),”,”,”.”)
ok1=App.Doc.NextChild
wend
rOk=App.Doc.NextRoot
wend
App.Doc.SaveData
end If
end sub
Dağıtılacak Toplam : KDV Tutarı

18 – Ana birim kodu getirme

sub ProcessEvent(App)
okay=App.Doc.FirstChild(“TRANSACTIONS.TRANSACTION”)
while okay
Quantity = App.Doc.FieldAsFloat(“TRANSACTIONS.TRANSACTION.QUANTITY”)
‘msgbox(Quantity)
GBKod = App.Doc.FieldAsString(“TRANSACTIONS.TRANSACTION.UNIT_GLOBAL_CODE”)
ok1=App.Doc.FirstChild(“UNIT_SETS.UNIT_SET.UNITS.UNIT”)
while ok1
GBKod2 = App.Doc.FieldAsString(“GLOBAL_CODE”)
If GBKod = GBKod2 Then
value = App.Doc.FieldAsFloat(“CONV_FACT1”)
‘msgbox(value)
end if
ok1=App.Doc.NextChild
wend
a = ((Quantity) * (value))
App.Doc.ModifyData “TRANSACTIONS.TRANSACTION.DESCRIPTION”, a okay=App.Doc.NextChild
wend
App.Doc.SaveData
end sub

19 – Ana birim çevrim kuralı

sub ProcessEvent(App)
b = 0.0
okay=App.Doc.FirstChild(“TRANSACTIONS.TRANSACTION”)
while okay
Quantity = App.Doc.FieldAsFloat(“TRANSACTIONS.TRANSACTION.QUANTITY”)
‘msgbox(Quantity)
GBKod = App.Doc.FieldAsString(“TRANSACTIONS.TRANSACTION.UNIT_GLOBAL_CODE”)
ok1=App.Doc.FirstChild(“UNIT_SETS.UNIT_SET.UNITS.UNIT”)
while ok1
GBKod2 = App.Doc.FieldAsString(“GLOBAL_CODE”)
If GBKod = GBKod2 Then
value = App.Doc.FieldAsFloat(“CONV_FACT1”)
‘msgbox(value)
end if
ok1=App.Doc.NextChild
wend
a = ((Quantity) * (value))
‘msgbox(a)
c = b + a
b = c
‘msgbox(b)
okay=App.Doc.NextChild
wend
App.Doc.WriteStartElement “ADDITIONALDOCUMENTS/ADDITIONALDOCUMENT” App.Doc.WriteElementString “ID”, b
App.Doc.WriteElementString “ISSUEDATE”, Year(Date) & “-” & Right(“0” & Month(Date), 2) & “-” & Right(“0” & Day(Date), 2)
App.Doc.WriteElementString “DOCUMENTTYPE”, “KILOTOPLAM”
App.Doc.WriteEndElement
App.Doc.SaveData
end sub

20 – Gelen faturada satırları tek bir malzeme ile eşleme

sub ProcessEvent(App)
ok1=App.Doc.FirstChild(“TRANSACTIONS.TRANSACTION”)
while ok1
Code = App.Doc.FieldAsString(“TRANSACTIONS.TRANSACTION.MASTER_CODE”) App.Doc.ModifyData “TRANSACTIONS.TRANSACTION.TYPE”, “0” App.Doc.ModifyData “TRANSACTIONS.TRANSACTION.UNITSET_CODE”, “05” App.Doc.ModifyData “TRANSACTIONS.TRANSACTION.UNIT_GLOBAL_CODE”, “C62” App.Doc.ModifyData “TRANSACTIONS.TRANSACTION.UNIT_CODE”, “ADET” App.Doc.ModifyData ” TRANSACTIONS.TRANSACTION.MASTER_CODE”, “TM-001”
ok1=App.Doc.NextChild
wend
App.Doc.SaveData
end sub

21 – Dovizli faturalarda Yalnız TL ibaresinin kaldırılması

sub ProcessEvent(App)
sTip=App.Doc.FieldAsInteger(“CURR_INVOICE”)
if sTip <> Empty Then
App.Doc.RemoveChild “TOTAL_NET_STR”
end if
App.Doc.SaveData
end sub

22 – İş yeri bazlı adres bilgilerinin e-faturaya getirilmesi

sub ProcessEvent(App)
strDBUser = “sa” ‘ SQL Server kullanıcı adı
strDBPass = “xxxxxx” ‘ SQL Server kullanıcısının şifresi
strDBServer = “xxxxxx” ‘ SQL Server
strDBName = “xxxxx” ‘ Veritabanı adı
‘ ADODB bağlantısı için standart yaratılması gereken nesne ve yazılması gereken cümleler
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”) Ref = App.Doc.FieldAsString(“NUMBER”)
strRef = CStr(Ref) ‘ Referans Bilgisi Stringe çevriliyor
‘strQuery = ” SELECT A.FIELDCONT,B.FIELDCONT FROM LG_001_LNGEXCSETS A,LG_001_LNGEXCSETS B WHERE A.DOCREF=B.DOCREF AND A.DOCID=1 AND A.LANGID=2 AND A.FIELDID=10 AND B.FIELDID=1 AND A.DOCREF= ” + strRef ‘ Sorgu oluşturuluyor
strQuery = “SELECT STREET,ROAD,DOORNR,DISTRICT,CITY FROM L_CAPIDIV WHERE FIRMNR=1 AND NR IN (SELECT BRANCH FROM LG_001_03_INVOICE WHERE FICHENO =” + “‘” + strRef +”‘)”
rs.Open strQuery, conn ‘ Querymizi çalıştırdığımız kısım
strStreet = rs.Fields(0).value ‘ ADODB bağlantısından sorgudan dönen değer
okunuyor
‘msgbox(strStreet)
strRoad = rs.Fields(1).value
strDoorNr = rs.Fields(2).value
strDistrict = rs.Fields(3).value
strCity = rs.Fields(4).value
App.Doc.ModifyData “SND_STREET”, strStreet
App.Doc.ModifyData “SND_ROAD”, strRoad
App.Doc.ModifyData “SND_CITY”, strCity
App.Doc.ModifyData “SND_DOORNR”, strDoorNr
App.Doc.ModifyData “SND_DISTRICT”, strDistrict
do while (rs.EOF = false)
rs.MoveNext() ‘ birden fazla değer okunacaksa bir sonraki satıra
konumlanılıyor
loop
rs.close
App.Doc.SaveData
‘ rs.close’ RecordSet kapatılıyor
conn.close’ ADODB bağlantısı kapatılıyor
end sub

23 – Detaylı bilgi alanının “;” karakteri olmadan genel açıklamaya getirilmesi

KURAL (Her faturada çalışır)
sub ProcessEvent(App)
rOk=App.Doc.FirstRoot
while rOk
ST_DETAY=App.Doc.FieldAsString(“ITEXT”)
App.Doc.ModifyData “NOTES12″,Replace((ST_DETAY),”¦”,”\\YS_ST#”)
rOk=App.Doc.NextRoot
wend
App.Doc.SaveData
end sub
XSLT İlk Adım (Genel Açıklamalar kısmı aranır ve silinir. Alttaki kod yapıştırılır.)
<xsl:if test=”//n1:Invoice/cbc:Note”>
<b>&#160;&#160;&#160;&#160;&#160; Genel Açıklamalar</b> <br/>
<xsl:for-each select=”//n1:Invoice/cbc:Note”>
<b>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</b> <xsl:call-template name=”insertBreaks”>
<xsl:with-param name =”pText” select=”.” />
</xsl:call-template>
</xsl:for-each>
</xsl:if>
XSLT En Alt alana gelir. (</xsl:template> bundan sonraya eklenir.)
<xsl:template match=”text()” name=”insertBreaks”> <xsl:param name=”pText” select=”.”/> <xsl:choose>
<xsl:when test=”not(contains($pText, ‘\\YS_ST#’))”> <xsl:copy-of select=”$pText”/> </xsl:when>
<xsl:otherwise>
<xsl:value-of select=”substring-before($pText, ‘\\YS_ST#’)”/>
<br /><b>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</b> <xsl:call-template name=”insertBreaks”>
<xsl:with-param name=”pText” select=”substring-after($pText, ‘\\YS_ST#’)”/> </xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

24 – Varyant kodu ve açıklamasının malzeme kodu ve açıklamasına getirilmesi

sub ProcessEvent(App)
ok1=App.Doc.FirstChild(“TRANSACTIONS.TRANSACTION”)
while ok1
Var = App.Doc.FieldAsInteger(“CANCONFIG”)
if Var = 1 then
Code = App.Doc.FieldAsString(“TRANSACTIONS.TRANSACTION.VARIANTCODE”)
Desc = App.Doc.FieldAsString(“TRANSACTIONS.TRANSACTION.VARIANTNAME”)
App.Doc.ModifyData ” TRANSACTIONS.TRANSACTION.MASTER_CODE”,Code App.Doc.ModifyData ” TRANSACTIONS.TRANSACTION.MASTER_DEF”,Desc
end if
ok1=App.Doc.NextChild
wend
App.Doc.SaveData
end sub

25 – Malzeme açıklaması ile malzeme kodunun değiştirilmesi (cari hesap kodu koşullu)

sub ProcessEvent(App)
TAX=App.Doc.FieldAsString(“ARP_CODE”)
If TAX= “120.01.002.0” then
rOk=App.Doc.FirstRoot
while rOk
ok1=App.Doc.FirstChild(“TRANSACTIONS.TRANSACTION”)
while ok1
KOD = App.Doc.FieldAsString(“TRANSACTIONS.TRANSACTION.MASTER_CODE”) DEF = App.Doc.FieldAsString(“TRANSACTIONS.TRANSACTION.MASTER_DEF”) App.Doc.ModifyData “TRANSACTIONS.TRANSACTION.MASTER_DEF”, KOD App.Doc.ModifyData “TRANSACTIONS.TRANSACTION.MASTER_CODE”, DEF
ok1=App.Doc.NextChild
wend
rOk=App.Doc.NextRoot
wend
App.Doc.SaveData
end If
end sub

26 – Malzeme kodu ile üretici kodunun, malzeme açıklaması ile açıklama2 nin yanyana gelmesi

sub ProcessEvent(App)
rOk=App.Doc.FirstRoot
while rOk
ok1=App.Doc.FirstChild(“TRANSACTIONS.TRANSACTION”)
while ok1
ST_DEGISKEN1=App.Doc.FieldAsString(“TRANSACTIONS.TRANSACTION.MASTER_CODE”)
ST_DEGISKEN2=App.Doc.FieldAsString(“TRANSACTIONS.TRANSACTION.PROCEDUCER_CODE”)
ST_DEGISKEN3=App.Doc.FieldAsString(“TRANSACTIONS.TRANSACTION.MASTER_DEF”)
ST_DEGISKEN4=App.Doc.FieldAsString(“TRANSACTIONS.TRANSACTION.MASTER_DEF3”)
App.Doc.ModifyData “MASTER_CODE”, ST_DEGISKEN1+” / “+ ST_DEGISKEN2
App.Doc.ModifyData “MASTER_DEF”, ST_DEGISKEN3+” / “+ ST_DEGISKEN4
ok1=App.Doc.NextChild
wend
rOk=App.Doc.NextRoot
wend
App.Doc.SaveData
end sub

27 – Ürün menşei bilgisinin satır açıklamasına getirilmesi (ihracat fatura koşullu)

sub ProcessEvent(App)
strDBUser = “xx”
strDBPass = “xxxxx”
strDBServer = “xx”
strDBName = “xxxxx”
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
okay=App.Doc.FirstChild(“TRANSACTIONS.TRANSACTION”)
while okay
Type2 = App.Doc.FieldAsInteger(“TRANSACTIONS.TRANSACTION.TYPE”)
If Type2 = 0 then
intItemRef = App.Doc.FieldAsInteger(“TRANSACTIONS.TRANSACTION.MASTER_ORGLOGICALREF”)
strItemRef = CStr(intItemRef)
strQuery = “SELECT DEFINITION_ FROM LG_xxx_SPECODES WHERE”
strQuery = strQuery + “(((CODETYPE = 8) AND (SPECODETYPE = 1)) OR ((CODETYPE = 8) AND (SPECODETYPE > 1))”
strQuery = strQuery + “OR ((CODETYPE > 8))) AND (((CODETYPE = 8) AND (SPECODETYPE <= 1)) OR ((CODETYPE < 8)))”
strQuery = strQuery + “AND SPECODE IN (SELECT PRODCOUNTRY FROM LG_xxxx_ITEMS ITMSC WHERE LOGICALREF =” + “‘” + strItemRef + “‘” + “)”
rs.Open strQuery, conn
strPro = rs.Fields(0).value
App.Doc.ModifyData “TRANSACTIONS.TRANSACTION.DESCRIPTION”, strPro
do while (rs.EOF = false)
rs.MoveNext()
loop
rs.close
App.Doc.SaveData
end if
okay=App.Doc.NextChild
wend
conn.close
end sub

28 – Satır açıklaması dolu ise satır açıklamasının malzeme açıklamasına gelmesi

sub ProcessEvent(App)
okay=App.Doc.FirstChild(“TRANSACTIONS.TRANSACTION”)
while okay
ACIKLAMA = App.Doc.FieldAsString(“TRANSACTIONS.TRANSACTION.DESCRIPTION”) if ACIKLAMA <> Empty then
App.Doc.ModifyData “TRANSACTIONS.TRANSACTION.MASTER_DEF”, ACIKLAMA end if
okay=App.Doc.NextChild
wend
App.Doc.SaveData
end sub

29 – Satır açıklamasının malzeme koduna getirilmesi (cari hesap kodu koşullu)

sub ProcessEvent(App)
CariKod = App.Doc.FieldAsString(“ARP_CODE”)
if CariKod = “” Then
rOk=App.Doc.FirstRoot
while rOk
okay=App.Doc.FirstChild(“TRANSACTIONS.TRANSACTION”)
while okay
ASIN = App.Doc.FieldAsString(“TRANSACTIONS.TRANSACTION.DESCRIPTION”) App.Doc.ModifyData “TRANSACTIONS.TRANSACTION.MASTER_CODE”, ASIN okay=App.Doc.NextChild
wend
rOk=App.Doc.NextRoot
wend
App.Doc.SaveData ‘ Yapılan değişiklikler kaydediliyor
End if
end sub

30 – Perakende satış faturasında kdvli birim fiyatı satıra getirme

sub ProcessEvent(App)
ok1=App.Doc.FirstChild(“TRANSACTIONS.TRANSACTION”)
while ok1
name = App.Doc.FieldAsString(“TRANSACTIONS.TRANSACTION.PRICE”) App.Doc.ModifyData “TRANSACTIONS.TRANSACTION.ITEM_SUPPLIERCODE”, name
ok1=App.Doc.NextChild
wend
App.Doc.SaveData
end sub

31 – İrsaliye numarası ve tarihinin sipariş numarası ve tarihine getirilmesi

sub ProcessEvent(App)
ARPCODE=App.Doc.FieldAsString(“ARP_CODE”)
If ARPCODE = “XXX” then
rOk=App.Doc.FirstRoot
while rOk
MusteriSiparisNo = App.Doc.FieldAsString(“DISPATCHES.DISPATCH_NUMBER”)
IrsaliyeTarihi=App.Doc.FieldAsString(“DISPATCHES.DISPATCH.DATE”)
ok1=App.Doc.FirstChild(“TRANSACTIONS.TRANSACTION”)
while ok1
App.Doc.ModifyData “CUSTORDNO”, MusteriSiparisNo
App.Doc.ModifyData “ORDER_FICHEDATE”, IrsaliyeTarihi ok1=App.Doc.NextChild
wend
rOk=App.Doc.NextRoot
wend
App.Doc.SaveData
end If
end sub

32 – Doküman izleme numarasının “BAYINO” alanına getirilmesi (cari hesap kodu koşullu)

sub ProcessEvent(App)
ARPCODE=App.Doc.FieldAsString(“ARP_CODE”)
If ARPCODE = “XXXX” then
DETAY = App.Doc.FieldAsString(“DOC_TRACK_NR”)
App.Doc.ModifyData “SHIPLOC_CODE”,DETAY
App.Doc.SaveData
End if
end sub

33 – Malzeme özel kod1 değerinin satır açıklamasına getirilmesi (ihracat fatura koşullu)

sub ProcessEvent(App)
Type1 = App.Doc.FieldAsString(“EXIM_FICHE_TYPE”)
If Type1 = 2 or 3 Then
strDBUser = “xx”
strDBPass = “xxxxx”
strDBServer = “xxxxxx”
strDBName = “xxxxxx”
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
okay=App.Doc.FirstChild(“TRANSACTIONS.TRANSACTION”)
while okay
Type2 = App.Doc.FieldAsInteger(“TRANSACTIONS.TRANSACTION.TYPE”)
If Type2 = 0 then
intItemRef = App.Doc.FieldAsInteger(“TRANSACTIONS.TRANSACTION.MASTER_ORGLOGICALREF”)
strItemRef = CStr(intItemRef)
strQuery = “SELECT DEFINITION_ FROM LG_001_SPECODES WHERE”
strQuery = strQuery + “(((CODETYPE = 1) AND (SPECODETYPE = 1)) OR ((CODETYPE = 1) AND (SPECODETYPE > 1)) OR ((CODETYPE > 1)))”
strQuery = strQuery + “AND (((CODETYPE = 1) AND (SPECODETYPE <= 1)) OR ((CODETYPE < 1)))” strQuery = strQuery + ” AND SPECODE IN (SELECT SPECODE FROM LG_001_ITEMS WHERE
LOGICALREF =” + “‘” + strItemRef + “‘” + “)”
rs.Open strQuery, conn
strPro = rs.Fields(0).value
App.Doc.ModifyData “TRANSACTIONS.TRANSACTION.DESCRIPTION”, strPro do while (rs.EOF = false)
rs.MoveNext()
loop
rs.close
App.Doc.SaveData
end if
okay=App.Doc.NextChild
wend
end if
conn.close
end sub

34 – Satıcı kod ve satıcı adının genel açıklamalara getirilmesi

sub ProcessEvent(App)
DETAY = App.Doc.FieldAsString(“SALESMAN_CODE”)
DETAY1 = App.Doc.FieldAsString(“SALESMAN_DEF”)
App.Doc.ModifyData “NOTES5”, “Satıcı Kodu:” + DETAY App.Doc.ModifyData “NOTES6”, “Satıcı Adı:” + DETAY1
App.Doc.SaveData
end sub

35 – Malzeme barkodunun satıra getirilmesi

sub ProcessEvent(App)
rOk=App.Doc.FirstRoot
while rOk
okay=App.Doc.FirstChild(“TRANSACTIONS.TRANSACTION”)
while okay
OZELKOD = App.Doc.FieldAsString(“TRANSACTIONS.TRANSACTION.BARCODE”) App.Doc.ModifyData “TRANSACTIONS.TRANSACTION.PROCEDUCER_CODE”, OZELKOD
okay=App.Doc.NextChild
wend
rOk=App.Doc.NextRoot
wend
App.Doc.SaveData ‘ Yapılan değişiklikler kaydediliyor end sub

36 – E-arşiv faturada malzeme barkodunun satıra getirilmesi

sub ProcessEvent(App)
strDBUser = ” XXXX ”
strDBPass = ” XXXX ”
strDBServer = “XXXXX”
strDBName = “XXXX”
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
okay=App.Doc.FirstChild(“TRANSACTIONS.TRANSACTION”) ‘ Faturanın ilk satırına konumlanılıyor.
while okay
sType = App.Doc.FieldAsInteger(“TRANSACTIONS.TRANSACTION.TYPE”) ‘ Satır tipi okunuyor
StrOrflineRef =
App.Doc.FieldAsString(“TRANSACTIONS.TRANSACTION.MASTER_CODE”)
strQuery = “SELECT BRK.BARCODE FROM LG_001_UNITBARCODE BRK ” + _
“LEFT OUTER JOIN LG_001_ITMUNITA ITA ON ITA.LOGICALREF=BRK.ITMUNITAREF ” + _ “LEFT OUTER JOIN LG_001_ITEMS ITM ON ITM.LOGICALREF=ITA.ITEMREF ” + _
“LEFT OUTER JOIN LG_001_01_STLINE STL ON STL.STOCKREF=ITM.LOGICALREF ” + _ “LEFT OUTER JOIN LG_001_01_INVOICE INV ON STL.INVOICEREF=INV.LOGICALREF ” + _ “WHERE ITM.CODE= ‘” + StrOrflineRef + “‘”
rs.Open strQuery, conn
do while (rs.EOF = false)
StrOrflineNo =rs.Fields(0).value
rs.MoveNext()
loop
rs.close
StrDescription = StrOrflineNo
App.Doc.ModifyData “TRANSACTIONS.TRANSACTION.PROCEDUCER_CODE”, StrDescription
okay=App.Doc.NextChild
wend
conn.close
App.Doc.SaveData
end sub

37 – GTIP kodunun satıra getirilmesi

sub ProcessEvent(App)
rOk=App.Doc.FirstRoot
while rOk
okay=App.Doc.FirstChild(“TRANSACTIONS.TRANSACTION”)
while okay
GTIP = App.Doc.FieldAsString(“TRANSACTIONS.TRANSACTION.MASTER_GTIPCODE”) App.Doc.ModifyData “TRANSACTIONS.TRANSACTION.ITEM_SUPPLIERCODE”, GTIP
okay=App.Doc.NextChild
wend
rOk=App.Doc.NextRoot
wend
App.Doc.SaveData ‘ Yapılan değişiklikler kaydediliyor end sub

Yazar Hakkında

Bilgisayarla 2001 yılında tanıştım. 2005 yılında ilk web sitemi kurdum ve o saatten sonra bu sanal dünyadan hiç kopmak istemedim. Web site kurulumu, wordpress, php, html, css konularında kendimi geliştirdim. 2017 yılında LOGO Yazılım ile tanıştım. Aynı yıl sertifikalı Logo Sistem Uzmanı oldum. MSSQL ve C# konusunda kendimi geliştirip müşteriye özel raporlamalar yaptım.

Yorum Yap