project QadFinancials > class BPosting > method SetPostingIsZeroValueAllowed

Description

here you can update this field to make it possible to create zero postings


Parameters


icPostingRowIdinputcharacterPosting Row ID
iiPostingIdinputintegerPosting ID
ilPostingIsZeroValueAllowedinputlogicalPosting Is Zero Value Allowed Flag
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BBankEntry.CreatePostingHeader
method BCInvoice.AdditionalUpdatesAllAssignments
method BDInvoice.AdditionalUpdatesAllAssignments


program code (program6/bposting.p)

/* replace unknown values */
    if iiPostingId = ? then assign iiPostingId = 0.
    if icPostingRowID = ? then assign icPostingRowID = "":U.
    
    if icPostingRowID = "":U and iiPostingId = 0
    then return.

    /* Find the Posting in the instance */
    find first tPosting where 
               tPosting.tc_Rowid  = icPostingRowID and
               tPosting.tc_Status <> "D":U
               no-error.
    if not available tPosting
    then do :
        find first 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-2'Internal error: cannot find the posting based on the Row ID &1 or the Posting ID &2.':255(64372)t-2#, icPostingRowId, string(iiPostingID)))
                   oiReturnStatus = -3.
            <M-1 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-6785':U (icFcMsgNumber), 
                         input  '':U (icFcExplanation), 
                         input  '':U (icFcIdentification), 
                         input  '':U (icFcContext), 
                         output viFcReturnSuper (oiReturnStatus)) in BPosting>
            return.
        end.
    end. /* if not available tPosting */

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