project QadFinancials > class BDDocument > method AdditionalUpdatesDPay


Parameters


iiPostingLineIdinputinteger
ilGLIsDivisionAccountinputlogical
icDivisionCodeinputcharacter
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BDDocument.AdditionalUpdatesPostingDocCtrl2


program code (program5/bddocument.p)

/* Create DPay records */
if ilGLIsDivisionAccount
then for each tDDocumentInvoiceXref where
              tDDocumentInvoiceXref.tcDivisionCode = icDivisionCode      and
              tDDocumentInvoiceXref.tc_ParentRowid = tDDocument.tc_Rowid and
              tDDocumentInvoiceXref.tc_Status     <> "":U                and
              tDDocumentInvoiceXref.DInvoice_ID   <> 0                   and
              tDDocumentInvoiceXref.DInvoice_ID   <> ?:
    create tApiDPayDDoc.

    assign viRowIdDDoc                 = viRowIdDDoc - 1
           tApiDPayDDoc.DDocument_ID   = tDDocument.DDocument_ID
           tApiDPayDDoc.DInvoice_ID    = tDDocumentInvoiceXref.DInvoice_ID
           tApiDPayDDoc.DPayTypeCode   = tDDocument.DDocumentStatus
           tApiDPayDDoc.PostingLine_ID = iiPostingLineId
           tApiDPayDDoc.tc_Rowid       = string(viRowIdDDoc).
end.
else for each tDDocumentInvoiceXref where
              tDDocumentInvoiceXref.tc_ParentRowid = tDDocument.tc_Rowid and
              tDDocumentInvoiceXref.tc_Status     <> "":U                and
              tDDocumentInvoiceXref.DInvoice_ID   <> 0                   and
              tDDocumentInvoiceXref.DInvoice_ID   <> ?:
    create tApiDPayDDoc.

    assign viRowIdDDoc                 = viRowIdDDoc - 1
           tApiDPayDDoc.DDocument_ID   = tDDocument.DDocument_ID
           tApiDPayDDoc.DInvoice_ID    = tDDocumentInvoiceXref.DInvoice_ID
           tApiDPayDDoc.DPayTypeCode   = tDDocument.DDocumentStatus
           tApiDPayDDoc.PostingLine_ID = iiPostingLineId
           tApiDPayDDoc.tc_Rowid       = string(viRowIdDDoc).
end.