project QadFinancials > class BYearClosing > method AdditionalUpdatesCreatePeriods

Description

Additional Updates Create Periods


Parameters


oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BYearClosing.AdditionalUpdates


program code (program5/byearclosing.p)

/* ==================================================== */
/* Method to create periods needed for the Year Closing */
/* ==================================================== */

assign oiReturnStatus = -98.

/* ========================= */                               
/* Start / Open the instance */
/* ========================= */
if viBPeriodYearClosingID = 0 or viBPeriodYearClosingID = ?
then do:
    <I-1 {bFcStartAndOpenInstance
            &ADD-TO-TRANSACTION = "true"
            &CLASS              = "BPeriod"}>
    assign vlBPeriodStartedYearClosing = true.                              
end.
else do:
    <I-3 {bFcOpenInstance
            &CLASS           = "BPeriod"}>
end.

for each tYearClosing where
         tYearClosing.tc_Status = 'N':U:         
    /* ============================================ */                                                  
    /* Call method in BPeriod to create the periods */
    /* ============================================ */
    <M-5 run YearClosingCreatePeriods (input  tYearClosing.Company_ID (iiCompanyID), 
                                       input  tYearClosing.YearClosingAccountingYear (iiYearClosingAccountingYear), 
                                       output viFcReturnSuper (oiReturnStatus)) in BPeriod>
    if viFcReturnSuper <> 0 and viLocalReturnStatus >= 0
    then assign viLocalReturnStatus = viFcReturnSuper.
end. /* for each tYearClosing ... */

/* ================== */                        
/* Close the instance */
/* ================== */
<I-4 {bFcCloseInstance
            &CLASS           = "BPeriod"}>

assign oiReturnStatus = viLocalReturnStatus.

if oiReturnStatus < 0
then return.