project QadFinancials > class BDDocument > method AdditionalUpdatesPostingXrefDIInt


Parameters


icPostingRowidinputcharacter
ilIsUndoPaymentinputlogical
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BDDocument.AdditionalUpdatesPostingXrefDI


program code (program5/bddocument.p)

if tDDocumentInvoiceXref.DDocumentInvoiceXrefIntTC <> 0
then do:    
    /* Get discount account as it is defined on Bank GL account */
    <M-64 run AdditionalUpdatesGetBankGLInfo
       (input  true (ilErrorIfNoDiscountAccount), 
        input  false (ilErrorIfNoCurrency), 
        output vcDiscBankGLAccount (ocDiscountGLAccount), 
        output vcIntBankGLAccount (ocInterestGLAccount), 
        output viFcReturnSuper (oiReturnStatus)) in BDDocument>
    if viFcReturnSuper <> 0 then assign oiReturnStatus = viFcReturnSuper.
    if viFcReturnSuper < 0 then return.        
    
    /* Create the interest Posting-Line */
                
    if tDDocumentInvoiceXref.tcAllocAmountCrDt = {&CREDITDEBITABBREVIATION-DEBIT} 
    then if ilIsUndoPayment 
         then assign vdDebitTC  = 0
                     vdCreditTC = - tDDocumentInvoiceXref.DDocumentInvoiceXrefIntTC.
         else assign vdDebitTC  = tDDocumentInvoiceXref.DDocumentInvoiceXrefIntTC
                     vdCreditTC = 0 .
    else if ilIsUndoPayment 
         then assign vdDebitTC  = - tDDocumentInvoiceXref.DDocumentInvoiceXrefIntTC
                     vdCreditTC = 0.
         else assign vdDebitTC  = 0
                     vdCreditTC = tDDocumentInvoiceXref.DDocumentInvoiceXrefIntTC.                         
                     
    do on error undo, return:
        <M-66 run AddStandardPosting
           (input  icPostingRowid (icPostingtcRowid), 
            input  vcIntBankGLAccount (icGLCode), 
            input  '':U (icDivisionCode), 
            input  '':U (icCostCentreCode), 
            input  '':U (icCostCentreText), 
            input  '':U (icProjectCode), 
            input  '':U (icProjectText), 
            input  '':U (icIntercoBusinessRelationCode), 
            input  tDDocumentInvoiceXref.tcCurrencyCode (icCurrencyCode), 
            input  vdDebitTC (idDebitTC), 
            input  ? (idDebitLC), 
            input  ? (idDebitCC), 
            input  ? (idDebitPC), 
            input  vdCreditTC (idCreditTC), 
            input  ? (idCreditLC), 
            input  ? (idCreditCC), 
            input  ? (idCreditPC), 
            input  0 (idQty), 
            input  tDDocument.tcPostingText (icLineText), 
            input  '':U (icSafText), 
            input  tDefaultSafsDDoc (tDefaultSafs), 
            input  {&EXCHANGERATETYPE-ACCOUNTING} (icExchangeRateType), 
            input  tDDocumentInvoiceXref.tdLCExchangeRate (idExchangeRate), 
            input  tDDocumentInvoiceXref.tdLCExchangeRateScale (idExchangeRateScale), 
            input  tDDocumentInvoiceXref.tdCCExchangeRate (idPostingLineCCRate), 
            input  tDDocumentInvoiceXref.tdCCExchangeRateScale (idPostingLineCCScale), 
            output viDummy (oiPostingLineId), 
            input  ? (iiSafStructureId), 
            input  ? (icSafStructureCode), 
            input  ? (icAllocationKey), 
            input  false (ilLinkedCrCyDaemonReqExists), 
            output viFcReturnSuper (oiReturnStatus)) in BJournalEntry>
        if viFcReturnSuper <> 0 then assign oiReturnStatus = viFcReturnSuper.
        if viFcReturnSuper <  0 then return.

    end. /* posting block */
end.