project QadFinancials > class BCompanyProperty > method AdditionalUpdates

Description

This empty method allows to do additional updates on class temp-tables after records were received (and validated) from outside, using method SetPublicTables.
You can start instances of other business classes to do those updates.

Replicate the intercompany accounts for any new company being added or when a company is changed to a domain whose setup is already complete.


Parameters


oiReturnStatusoutputinteger


Internal usage


QadFinancials
method BCompanyProperty.UpdateCompanyProperty
method BCompanyProperty.ValidateBCAndAdditionalUpdates

QadFitnesse
method BCompanyProperty.ApiCompanyUpdate
method BCompanyProperty.ApiUpdateARAPTaxDateProperties


program code (program/bcompanyproperty.p)

<ANCESTOR-CODE>

/* ============================== */
/* Check ReturnStatus of Ancestor */
/* Set default ReturnStatus       */
/* ============================== */
if oiReturnStatus < 0 then return.

assign 
    viLocalReturnStatus = oiReturnStatus 
    oiReturnStatus = -98.

/* Replicate the intercompany accounts for any new company being added
 * or when a company is changed to a domain whose setup is already complete...
 */

for each tCompanyProperty
    where tCompanyProperty.tc_Status = "N":U
      or tCompanyProperty.tc_Status = "C":U:

    if not vlDomainForInterCompanyStarted then do:
        <Q-21 run DomainForInterCompany
           (Start) in BDomain >
        assign vlDomainForInterCompanyStarted = yes.
    end.

    <Q-18 run DomainForInterCompany (all) (Read) (NoCache)
       (input ?, (DomainID)
        input tCompanyProperty.tcDomainCode, (DomainCode)
        input ?, (CompanyID)
        output dataset tqDomainForInterCompany) in BDomain >

    find first tqDomainForInterCompany no-error.
    if not available tqDomainForInterCompany then next.

    /* Only deal with those domains which are setup-complete... */
    if tqDomainForInterCompany.tlDomainPropertyIsSetupCompl <> yes then next.

    assign
        vcGLCodes = substitute("&1,&2,&3,&4":U,
            tqDomainForInterCompany.tcIntercoAPGLCode,
            tqDomainForInterCompany.tcIntercoARGLCode,
            tqDomainForInterCompany.tcIntercoFAGLCode,
            tqDomainForInterCompany.tcIntercoICGLCode
        ).
    
    <M-17 run CreateInterCoAccounts
       (input  tCompanyProperty.tcDomainCode (icDomainCode), 
        input  tCompanyProperty.CompanyPropertyCode (icCompanyCode), 
        input  '':U (icStatus), 
        input  vcGLCodes (icGLCodes), 
        output viFcReturnSuper (oiReturnStatus)) in BCompanyProperty>

    if viFcReturnSuper <> 0 and viLocalReturnStatus >= 0 then 
        assign viLocalReturnStatus = viFcReturnSuper.
end.

if vlDomainForInterCompanyStarted then do:
    <Q-20 run DomainForInterCompany
       (Stop) in BDomain >
    assign vlDomainForInterCompanyStarted = no.
end.

/* ======================== */
/* Set ReturnStatus = OK    */
/* ======================== */
assign oiReturnStatus = viLocalReturnStatus.