project QadFinancials > class BPosting > method GetPostingLineDataForPosting

Description

GetPostingLineDataForPosting: this method will return some minimal information on the postinglines of a certain posting


Parameters


icPostingTcRowidinputcharacterPostingTcRowid; tc_rowid of the posting:
If a value is passed for this parameter then parameter iiPostingID is of no use
iiPostingIDinputintegerPostingID; _ID of the posting:
If a value is passed for parameter icPostingTcRowid then this parameter is of no use
tPostingLineMinimalDataoutputtemp-tabletemp-table holding some elementary fields of the postinglines
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BCInvoice.CreateMFPosting
method BOpenItemAdjustment.OIAdjCommitSubOpenItemAdj


program code (program6/bposting.p)

/* ======================================= */
    /* Exception handling and empty result set */
    /* ======================================= */
    assign oiReturnStatus = -98.
    empty temp-table tPostingLineMinimalData.
    
    /* ========================================================================== */
    /* Try to find the posting based on rowid when provided, else based on the ID */
    /* If posting is not found then exit without errors                           */
    /* ========================================================================== */
    if icPostingTcRowid <> "":U and 
       icPostingTcRowid <> ?
    then find tPosting where 
              tPosting.tc_Rowid   = icPostingTcRowid and 
              tPosting.tc_Status <> "D":U
              no-lock no-error.
    else find tPosting where 
              tPosting.Posting_ID = iiPostingID and 
              tPosting.tc_Status <> "D":U
              no-lock no-error.
    if not available tPosting
    then do :
        assign oiReturnStatus = 0.
        Return.
    end. /* if not available tPosting */ 
    
    /* ============================================================================== */
    /* Create records in the output temp-table for every posting-line of the posting  */
    /* ============================================================================== */
   for each tPostingLine where 
            tPostingLine.tc_ParentRowid  = tPosting.tc_Rowid and 
            tPostingLine.tc_Status      <> "D":U
            no-lock :
        create tPostingLineMinimalData.
        assign tPostingLineMinimalData.tiPostingLineID           = tPostingLine.PostingLine_ID
               tPostingLineMinimalData.tcPostingLineTcRowid      = tPostingLine.tc_Rowid
               tPostingLineMinimalData.tcPostingLineGLCode       = tPostingLine.tcGLCode
               tPostingLineMinimalData.tcPostingLineCurrencyCode = tPostingLine.tcCurrencyCode
               tPostingLineMinimalData.tdPostingLineDebitTC      = tPostingLine.PostingLineDebitTC
               tPostingLineMinimalData.tdPostingLineCreditTC     = tPostingLine.PostingLineCreditTC
               tPostingLineMinimalData.tdPostingLineDebitLC      = tPostingLine.PostingLineDebitLC  
               tPostingLineMinimalData.tdPostingLineCreditLC     = tPostingLine.PostingLineCreditLC.
    end. /* for each tPostingLine where */ 
    
    /* ======================================= */
    /* Exception handling                      */
    /* ======================================= */
    assign oiReturnStatus = 0.