project QadFinancials > class BBankEntry > method RemovePosting

Description

Remove the posting from the instance


Parameters


iiPostingIdinputintegerPosting ID
iiBJournalEntryIdinputintegerInstance of BJournalEntry
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BBankEntry.MarkAllBankEntryLinesAsUnallocated


program code (program3/bbankentry.p)

/* ====================== */
/* replace unknown values */
/* ====================== */
if iiPostingId = ? then assign iiPostingId = 0.
if iiBJournalEntryId = ? then assign iiBJournalEntryId = 0.
assign viBJournalEntryBEID = iiBJournalEntryId.

/* =========================== */
/* if no posting id, then return */
/* =========================== */
if iiPostingId = 0
then return.

/* ================= */
/* Get info from DB  */
/* ================= */
if viBJournalEntryBEID <> 0 
then do :
    <I-1 {bFcOpenInstance
         &CLASS           = "BJournalEntry"}>
    <M-6 run RemovePostingFromInstance
       (input  iiPostingId (iiPostingID), 
        output viFcReturnSuper (oiReturnStatus)) in BJournalEntry>
    <I-2 {bFcCloseInstance
         &CLASS           = "BJournalEntry"}>
    if viFcReturnSuper <> 0
    then assign oiReturnStatus = viFcReturnSuper.
    if oiReturnStatus < 0 
    then do :
        assign vcMessage      = trim(substitute(#T-5'An error (&1) has occurred while removing the posting.':200(357)T-5#, string(viFcReturnSuper)))
               oiReturnStatus = -1. 
        <M-3 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-1996':U (icFcMsgNumber),
                     input  '' (icFcExplanation),
                     input  '' (icFcIdentification),
                     input  '' (icFcContext),
                     output viFcReturnSuper (oiReturnStatus)) in BBankEntry>
        return.
    end.
end.