project QadFinancials > class BPosting > method SetPostingInvoiceReferenceTxt

Description

Method that allows to set the PostingInvoiceReferenceTxt for a posting that is already loaded in the instance


Parameters


icPostingTcRowIDinputcharacterPosting Row ID
iiPostingIDinputintegerPosting ID
icPostingInvoiceReferenceTxtinputcharacterVlaue to set for PostingInvoiceReferenceTxt
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BAPMatching.AdditionalUpdatesAllExtCInvoice


program code (program6/bposting.p)

/* Replace unknown values - leave when there is no input */
    if iiPostingID      = ? then assign iiPostingID      = 0.
    if icPostingTcRowID = ? then assign icPostingTcRowID = "":U.
    if icPostingTcRowID = "":U and 
       iiPostingID      = 0
    then return.
    
    /* Find the Posting in the instance */ 
    if icPostingTcRowID <> "":U 
    then find tPosting where 
              tPosting.tc_Rowid  = icPostingTcRowID and
              tPosting.tc_Status <> "D":U
              no-error.
    else find tPosting where
              tPosting.Posting_ID = iiPostingID and
              tPosting.tc_Status  <> "D":U
              no-error.
    if not available tPosting
    then do:
        assign vcMessage      = trim(substitute(#T-3'Internal error: cannot find the posting based on the Row ID &1 or the Posting ID &2.':255(64372)t-3#, icPostingTcRowID, string(iiPostingID)))
               oiReturnStatus = -3.
        <M-2 run SetMessage
           (input  vcMessage (icMessage), 
            input  '':U (icArguments), 
            input  '':U (icFieldName), 
            input  '':U (icFieldValue), 
            input  'E':U (icType), 
            input  3 (iiSeverity), 
            input  '':U (icRowid), 
            input  'QadFin-9700':U (icFcMsgNumber), 
            input  '':U (icFcExplanation), 
            input  '':U (icFcIdentification), 
            input  '':U (icFcContext), 
            output viFcReturnSuper (oiReturnStatus)) in BPosting>
        return.
    end. /* if not available tPosting */

    /* update the value */
    if tPosting.PostingInvoiceReferenceTxt <> icPostingInvoiceReferenceTxt
    then assign tPosting.PostingInvoiceReferenceTxt = icPostingInvoiceReferenceTxt
                tPosting.tc_Status                  = if tPosting.tc_Status = "":U
                                                      then "C":U
                                                      else tPosting.tc_Status.