project QadFinancials > class BYearClosing > method AdditionalUpdatesPosting

Description

Additional Updates Posting


Parameters


oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BYearClosing.AdditionalUpdates


program code (program5/byearclosing.p)

/* ============================================================== */
/* Create all postings that needed to be created for Year Closing */
/* ============================================================== */

assign oiReturnStatus = -98.

POSTINGBLOCK:
do:
    /* ========================== */                                
    /* Start / Open BJournalEntry */
    /* ========================== */
    if viBJournalEntryYearClosingID = 0 or
       viBJournalEntryYearClosingID = ?
    then do:
        <I-1 {bFcStartAndOpenInstance
                &ADD-TO-TRANSACTION = "true"
                &CLASS              = "BJournalEntry"}>
    end.
    else if not valid-handle(vhBJournalEntryYearClosingInst)
    then do:
        <I-4 {bFcOpenInstance
                &CLASS           = "BJournalEntry"}>
    end.
    
    <M-69 run SetBPostingIsStartedFromBYrClose
       (input  true (ilBPostingIsStartedFromBYrClose), 
        output viFcReturnSuper (oiReturnStatus)) in BJournalEntry>
    if viFcReturnSuper <> 0 and viLocalReturnStatus >= 0 then assign viLocalReturnStatus = viFcReturnSuper.
    if viFcReturnSuper < 0 then leave POSTINGBLOCK.

    /* ============================= */
    /* Transfer P&L to Balance Sheet */
    /* ============================= */
    <M-5 run AdditionalUpdatesPostingTrans (output viFcReturnSuper (oiReturnStatus)) in BYearClosing>
    if viFcReturnSuper <> 0 and viLocalReturnStatus >= 0
    then assign viLocalReturnStatus = viFcReturnSuper.
    if viFcReturnSuper < 0
    then leave POSTINGBLOCK.

    /* ============================ */                          
    /* Closing & Reopening Postings */
    /* ============================ */
    <M-7 run AdditionalUpdatesPostingCloseOpen (output viFcReturnSuper (oiReturnStatus)) in BYearClosing>
    if viFcReturnSuper <> 0 and viLocalReturnStatus >= 0
    then assign viLocalReturnStatus = viFcReturnSuper.
    if viFcReturnSuper < 0
    then leave POSTINGBLOCK.
        
    /* ================================ */    
    /* ValidateBC and AdditionalUpdates */
    /* ================================ */
    <M-6 run ValidateBCAndAdditionalUpdates (output viFcReturnSuper (oiReturnStatus)) in BJournalEntry>
    if viFcReturnSuper <> 0 and viLocalReturnStatus >= 0
    then assign viLocalReturnStatus = viFcReturnSuper.
    if viFcReturnSuper < 0
    then leave POSTINGBLOCK.    
end.
                         
/* =================== */                         
/* Close BJournalEntry */
/* =================== */
<I-3 {bFcCloseInstance
            &CLASS           = "BJournalEntry"}>

assign oiReturnStatus = viLocalReturnStatus.

if oiReturnStatus < 0
then return.