project QadFinancials > class BCInvoice > method GetPostingInfoOfInstance

Description

GetPostingInfoOfInstance


Parameters


ocPostingIDsoutputcharacterPostingIDs; List with the IDs of the postings linked to all new cinvoices
ocPostingLineIDsoutputcharacterPostingLineIDs; List with the IDs of the posting-lines linked to all new cinvoicemovements
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BBankEntry.StopExternalInstances
method BOpenItemAdjustment.StopExternalInstancesExceptBJE


program code (program9/bcinvoice.p)

    /* ==================================================================== */
    /* Return a list containing all posting-ID and posting-line-ID linked   */
    /* to the newly created cinvoice and cinvoicemovement records           */
    /* ==================================================================== */
    for each tCInvoicePosting where 
             tCInvoicePosting.tc_Status = "N":U
             no-lock :    
        assign ocPostingIDs = ocPostingIDs + ",":U + string(tCInvoicePosting.Posting_ID).
        if tCInvoicePosting.CIRECPostingLine_ID <> 0 and 
           tCInvoicePosting.CIRECPostingLine_ID <> ?
        then assign ocPostingLineIDs = ocPostingLineIDs + ",":U + string(tCInvoicePosting.CIRECPostingLine_ID).
    end. /* for each tCInvoicePosting where */
    for each tCInvoiceMovement where 
             tCInvoiceMovement.tc_Status = "N":U
             no-lock :   
        assign ocPostingLineIDs = ocPostingLineIDs + ",":U + string(tCInvoiceMovement.PostingLine_ID).
        
        /* roll back the wht posting lines */
        if tCInvoiceMovement.tcWHTPostingLineIDs <> "":U and
           tCInvoiceMovement.tcWHTPostingLineIDs <> ?
        then assign ocPostingLineIDs = ocPostingLineIDs + ",":U + tCInvoiceMovement.tcWHTPostingLineIDs.
    end. /* for each tCInvoicePosting where */
    if ocPostingIDs <> "":U and length(ocPostingIDs,"CHARACTER":U) > 1 
    then assign ocPostingIDs = substring(ocPostingIDs,2,-1,"CHARACTER":U).
    if ocPostingLineIDs <> "":U and length(ocPostingLineIDs,"CHARACTER":U) > 1 
    then assign ocPostingLineIDs = substring(ocPostingLineIDs,2,-1,"CHARACTER":U).