project QadFinancials > class BYearClosing > method AdditionalUpdatesClosePeriods
Description
Additional Updates Close Period
Parameters
oiReturnStatus | output | integer | Return status of the method. |
Internal usage
QadFinancials
program code (program5/byearclosing.p)
/* ==================================================== */
/* Method to close periods of the Year that is closed */
/* ==================================================== */
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-2 {bFcOpenInstance
&CLASS = "BPeriod"}>
end.
for each tYearClosing where
tYearClosing.tc_Status = 'N':U:
/* ============= */
/* Close Periods */
/* ============= */
<M-4 run YearClosingClosePeriods
(input tYearClosing.Company_ID (iiCompanyID),
input tYearClosing.YearClosingAccountingYear (iiYearClosingAccountingYear),
input tYearClosing.tcLayerTypeCode (icLayerTypeCode),
output viFcReturnSuper (oiReturnStatus)) in BPeriod>
if viFcReturnSuper <> 0 and viLocalReturnStatus >= 0
then assign viLocalReturnStatus = viFcReturnSuper.
end. /* for each tYearClosing */
/* ============================================ */
/* ValidateBC and AdditionalUpdates for periods */
/* ============================================ */
if vlBPeriodStartedYearClosing = true
then do:
<M-5 run ValidateBCAndAdditionalUpdates (output viFcReturnSuper (oiReturnStatus)) in BPeriod>
if viFcReturnSuper <> 0 and viLocalReturnStatus >= 0
then assign viLocalReturnStatus = viFcReturnSuper.
end. /* if vlBPeriodStartedYearClosing = true */
/* ================== */
/* Close the instance */
/* ================== */
<I-3 {bFcCloseInstance
&CLASS = "BPeriod"}>
assign oiReturnStatus = viLocalReturnStatus.
if oiReturnStatus < 0
then return.