LOD LOGO OBJECTS DESIGNER

STRUCTURE – > CUSTENTR1
EVENTS BEFORESAVEE AŞAĞIDAKINI YAPIŞTIR
Sub BeforeSave(proceed as Integer)
      MaxGridLine=MGridLines(“InvoiceGrid”)-1
     for i=0 to MaxGridLine
       GetGridRowHandle(“InvoiceGrid”,i,recH)
       AppTables[9].GetIntFieldR(recH,”LINETYPE”,intLineType)
       AppTables[9].GetIntFieldR(recH,”GLOBTRANS”,intGlobTrans)
       AppTables[9].GetIntFieldR(recH,”PARENTLNREF”,intPARENTLNREF)
       AppTables[9].GetIntFieldR(recH,”TRCODE”,intTRCODE)
        if (intLineType = 1) and (intGlobTrans = 1) and (intPARENTLNREF = 0) and (intTRCODE = 1) then
          warn(“Fiş Genelindeki Promosyonları silmelisiniz”)
          proceed = 0
       end if
     next i
End Sub

 

 
Sub BeforeSave(proceed as Integer)
trcode=0
dontsave=1
      MaxGridLine=MGridLines("InvoiceGrid")-1
     for i=0 to MaxGridLine
       GetGridRowHandle("InvoiceGrid",i,recH)
       AppTables[9].GetIntFieldR(recH,"LINETYPE",intLineType)
       AppTables[9].GetIntFieldR(recH,"GLOBTRANS",intGlobTrans)
       AppTables[9].GetIntFieldR(recH,"PARENTLNREF",intPARENTLNREF)
       AppTables[9].GetIntFieldR(recH,"TRCODE",intTRCODE)
       AppTables[9].GetFltFieldR(recH,"DISCPER",floatDISCPER)
       if   intTRCODE>0 then
         trcode=intTRCODE
       end if
        'if (intLineType = 1) and (intGlobTrans = 1) and (intPARENTLNREF = 0) and (intTRCODE = 1) then
        'warn(floatDISCPER)
        if intGlobTrans = 1 and trcode=1 then

        if intLineType=2 and floatDISCPER>0 then 
        dontsave = 0
        end if

        if intLineType=1 then 
        dontsave = 0
        end if
        
        if dontsave=0 then 
        warn("Fiş Geneline(Çift Çizgi Altına) Promosyon/Indirim Eklenemez")
        proceed=dontsave
        end if
       
       end if
     next i
End Sub
'LINETYPE 0 MALZEME
'LINETYPE 1 PROMOSYON
'LINETYPE 2 INDIRIM