project QadFinancials > class BBankEntry > method UpdatePostingHeader

Description

Update the posting header record : change year, period, posting date based on rowid


Parameters


iiBJournalEntryIdinputintegerInstance of Journal Entry
icPostingRowIdinputcharacterRowId of Posting
iiPeriodYearinputintegerYear of Accounting Period
iiPeriodPeriodinputintegerPeriod of Accounting Period
itPostingDateinputdateposting date
icPostingTextinputcharacterHeader Description
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


unused


program code (program4/bbankentry.p)

if iiBJournalEntryId = ? then assign iiBJournalEntryId = 0.
    if iiPeriodYear = ? then assign iiPeriodYear = 0.
    if iiPeriodPeriod = ? then assign iiPeriodPeriod = 0.
    if icPostingRowId = ? then assign icPostingRowId = "":U.
    if icPostingText = ? then assign icPostingText = "":U.  /*Defect: 10333-0184*/

    if iiBJournalEntryId <> 0  and
       icPostingRowId    <> ""       /*Defect: 10333-0184*/ 
    then do:  
        <I-1 {bFcOpenInstance
            &CLASS           = "BJournalEntry"}>

        <M-2 run UpdatePostingHeaderInInstance
           (input  icPostingRowId (icPostingRowId), 
            input  iiPeriodYear (iiPeriodYear), 
            input  iiPeriodPeriod (iiPeriodPeriod), 
            input  itPostingDate (itPostingDate), 
            input  icPostingText (icPostingText), 
            output viFcReturnSuper (oiReturnStatus)) in BJournalEntry>
    
        <I-3 {bFcCloseInstance
            &CLASS           = "BJournalEntry"}>
        if viFcReturnSuper < 0
        then do :          
           assign vcMessage      = trim(substitute(#T-5'An error (&1) has occurred while updating the posting header.':200(345)T-5#, string(viFcReturnSuper)))
                  oiReturnStatus = viFcReturnSuper. 
           <M-4 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-1834':U (icFcMsgNumber),
                     input  '' (icFcExplanation),
                     input  '' (icFcIdentification),
                     input  '' (icFcContext),
                     output viFcReturnSuper (oiReturnStatus)) in BBankEntry>
        end.
    end.