Parameters
| iiCompanyID | input | integer | |
| icLayerTypeCode | input | character | |
| iiYearPeriodFrom | input | integer | |
| iiYearPeriodTill | input | integer | |
| odSumMovemntDebitLC | output | decimal | |
| odSumMovemntDebitCC | output | decimal | |
| odSumMovemntCreditLC | output | decimal | |
| odSumMovemntCreditCC | output | decimal | |
| odSumMovemntPLDebitLC | output | decimal | |
| odSumMovemntPLDebitCC | output | decimal | |
| odSumMovemntPLCreditLC | output | decimal | |
| odSumMovemntPLCreditCC | output | decimal | |
| oiPostingHistRecordsRead | output | integer | |
| icLayerCode | input | character | Input parameter: layer code. |
| oiReturnStatus | output | integer | Return status of the method. |
Internal usage
QadFinancials
program code (program1/byearclosing.p)
/* ============================================================================== */
/* This method builds up the Balances for the Official Layer */
/* It queries PostingHist directly for this */
/* Input: */
/* iiCompanyID */
/* iiYearPeriodFrom */
/* iiYearPeriodTill */
/* Output */
/* odSumMovemnt<Type><Curr> */
/* odSumMovemntPL<Type><Curr> */
/* ============================================================================== */
assign odSumMovemntDebitLC = 0
odSumMovemntCreditLC = 0
odSumMovemntDebitCC = 0
odSumMovemntCreditCC = 0
odSumMovemntPLDebitLC = 0
odSumMovemntPLCreditLC = 0
odSumMovemntPLDebitCC = 0
odSumMovemntPLCreditCC = 0.
/* Ensure, all parameters are passed */
if iiCompanyID = ? or iiCompanyID = 0 or
icLayerTypeCode = ? or icLayerTypeCode = "":U or
iiYearPeriodFrom = ? or iiYearPeriodFrom = 0 or
iiYearPeriodTill = ? or iiYearPeriodTill = 0 or
icLayerCode = ? or icLayerCode = '':U
then do:
assign vcMessage = #T-34'Not all mandatory input parameters are populated or they have wrong value.':255(999890330)T-34#
vcContext = "iiCompanyID=&1|icLayerTypeCode=&2|iiYearPeriodFrom=&3|iiYearPeriodTill=&4|icLayerCode=&5":U
vcContext = replace(vcContext, "|":U, chr(2))
vcContext = substitute(vcContext, iiCompanyID, icLayerTypeCode, iiYearPeriodFrom, iiYearPeriodTill, icLayerCode).
<M-87 run SetMessage
(input vcMessage (icMessage),
input '':U (icArguments),
input '':U (icFieldName),
input '':U (icFieldValue),
input 'S':U (icType),
input 3 (iiSeverity),
input '':U (icRowid),
input 'qadfin-537543':U (icFcMsgNumber),
input '':U (icFcExplanation),
input '':U (icFcIdentification),
input vcContext (icFcContext),
output viFcReturnSuper (oiReturnStatus)) in BYearClosing>
assign oiReturnStatus = -1.
leave.
end. /* if iiCompanyID = ? or iiCompanyID = 0 or */
for each Company no-lock where
Company.Company_ID = iiCompanyID,
each Layer no-lock where
Layer.LayerTypeCode = icLayerTypeCode and
Layer.LayerCode = icLayerCode
:
for each PostingHist where
PostingHist.Company_ID = Company.Company_ID and
PostingHist.Layer_ID = Layer.Layer_ID and
PostingHist.PostingHistYearPeriodFrom >= iiYearPeriodFrom and
PostingHist.PostingHistYearPeriodFrom <= iiYearPeriodTill
no-lock,
first GL of PostingHist no-lock :
assign oiPostingHistRecordsRead = oiPostingHistRecordsRead + 1.
assign odSumMovemntDebitLC = odSumMovemntDebitLC + PostingHist.PostingHistMovemntDebitLC
odSumMovemntCreditLC = odSumMovemntCreditLC + PostingHist.PostingHistMovemntCreditLC
odSumMovemntDebitCC = odSumMovemntDebitCC + PostingHist.PostingHistMovemntDebitCC
odSumMovemntCreditCC = odSumMovemntCreditCC + PostingHist.PostingHistMovemntCreditCC.
if GL.GLIsBalanceAccount = False
then assign odSumMovemntPLDebitLC = odSumMovemntPLDebitLC + PostingHist.PostingHistMovemntDebitLC
odSumMovemntPLCreditLC = odSumMovemntPLCreditLC + PostingHist.PostingHistMovemntCreditLC
odSumMovemntPLDebitCC = odSumMovemntPLDebitCC + PostingHist.PostingHistMovemntDebitCC
odSumMovemntPLCreditCC = odSumMovemntPLCreditCC + PostingHist.PostingHistMovemntCreditCC.
end. /* for each PostingHist */
end. /* for each Company */