project QadFinancials > class BDivision > method DefaultValuesCOAMask
Description
This procedure is executed to default COA Mask based on Division code
Parameters
icDivisionCode | input | character | Code of Division |
ocCOAMaskCode | output | character | Defaulted code of division |
oiReturnStatus | output | integer | Return status of the method. |
Internal usage
unused
program code (program7/bdivision.p)
/* ====================================================================================== *
* Method : DefaultValuesCOAMask *
* Description : This method is used for defaulting of COA Mask code based on Code of *
* Division *
* -------------------------------------------------------------------------------------- *
* Parameters : (I) DivisionCode Code of division *
* (O) COAMaskCode Code of COA Mask *
* ====================================================================================== */
assign oiReturnStatus = -98
viLocalReturn = 0.
MAIN_BLOCK:
do on error undo, return:
/* Default output parameters */
assign ocCOAMaskCode = ?.
/* Pre-validation block */
if icDivisionCode = "":U then assign icDivisionCode = ?.
if icDivisionCode = ?
then do:
assign viLocalReturn = -1.
leave MAIN_BLOCK.
end.
/* Try to find COA Mask with the same code as code of Division */
<Q-1 run COAMaskDivPrim (all) (Read) (NoCache)
(input icDivisionCode, (COAMaskDivCode)
input ?, (COAMaskDivID)
input viCompanyId, (CompanyId)
output dataset tqCOAMaskDivPrim) in BCOAMaskDiv >
find first tqCOAMaskDivPrim where
tqCOAMaskDivPrim.tcCOAMaskDivCode = icDivisionCode
no-error.
if available tqCOAMaskDivPrim
then assign ocCOAMaskCode = tqCOAMaskDivPrim.tcCOAMaskDivCode.
end. /* MAIN_BLOCK */
assign oiReturnStatus = viLocalReturn.