project QadFinancials > class BBankNumber > method CalculateCompanySharedSet

Description

Converts CompanySharedSet_Id to its business representation that is in this case CompanyCode.
Note: work with buffer tBankNumber


Parameters


oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BBankNumber.Calculate


program code (program1/bbanknumber.p)

/*CompanySharedSet_ID is only relevant for GL bank accounts 
in all other cases it shouldn't be specified*/
if tBankNumber.CompanySharedSet_ID > 0 and 
   tBankNumber.BankNumberParentType = {&BANKNUMBERPARENTTYPE-GL}
then do:
    <Q-2 run CompanySSByIds (all) (Read) (NoCache)
          (input ?, (CompanyId)
           input tBankNumber.CompanySharedSet_ID, (CompanySharedSetId)
           input ?, (SharedSetId)
           output dataset tqCompanySSByIds) in BCompany >
                         
    find first tqCompanySSByIds where
               tqCompanySSByIds.tiCompanySharedSet_ID = tBankNumber.CompanySharedSet_ID no-error.
    if available tqCompanySSByIds
    then assign tBankNumber.tcCompanyCode = tqCompanySSByIds.tcCompanyCode. 
    else assign tBankNumber.tcCompanyCode = "":U. 
end.
else assign tBankNumber.tcCompanyCode = "":U.