project QadFinancials > class BFRWChart > method Calculate

Description

Add code here to initialize the calculated fields of the class temp-tables after loading existing records from the application database.


Parameters


oiReturnStatusoutputinteger


Internal usage


unused


program code (program/bfrwchart.p)

<ANCESTOR-CODE>

for each tFRWChart:
    /* Retrieve description values */
    if tFRWChart.FRWChartDefaultGLCode <> '':U
        AND tFRWChart.FRWChartDefaultGLCode <> ?
    then do:
        <Q-40 run GLForFRWBySharedSet (all) (Read) (NoCache)
           (input ?, (CompanyId)
            input ?, (GLID)
            input tFRWChart.FRWChartDefaultGLCode, (GLCode)
            input tFRWChart.GLSharedSet_ID, (SharedSetID)
            input ?, (SharedSetCode)
            output dataset tqGLForFRWBySharedSet) in BGL>
        find first tqGLForFRWBySharedSet no-error.
        if available tqGLForFRWBySharedSet 
        then assign tFRWChart.tcFRWChartDefaultGLCodeDesc = tqGLForFRWBySharedSet.tcGLDescription.
    end.
    if tFRWChart.FRWChartCurrTransAdjGLCode <> ?
        and tFRWChart.FRWChartCurrTransAdjGLCode <> '':U
    then do:
        <Q-18 run GLForFRWBySharedSet (all) (Read) (NoCache)
           (input ?, (CompanyId)
            input ?, (GLID)
            input tFRWChart.FRWChartCurrTransAdjGLCode, (GLCode)
            input tFRWChart.GLSharedSet_ID, (SharedSetID)
            input ?, (SharedSetCode)
            output dataset tqGLForFRWBySharedSet) in BGL>
        find first tqGLForFRWBySharedSet no-error.
        if available tqGLForFRWBySharedSet 
        then assign tFRWChart.tcFRWChartCurrTransAdjGLCodeDesc = tqGLForFRWBySharedSet.tcGLDescription.
    end. /* End for CTA Account description */
    if tFRWChart.FRWChartDefaultPrjCode <> ? 
        and tFRWChart.FRWChartDefaultPrjCode <> '':U 
    then do:
        <Q-27 run ProjectForFRWBySharedSet (all) (Read) (NoCache)
           (input ?, (CompanyId)
            input ?, (ProjectID)
            input tFRWChart.FRWChartDefaultPrjCode, (ProjectCode)
            input tFRWChart.ProjectSharedSet_ID, (SharedSetID)
            input ?, (SharedSetCode)
            output dataset tqProjectForFRWBySharedSet) in BProject>
    
        find first tqProjectForFRWBySharedSet no-error.
        if available tqProjectForFRWBySharedSet then
            assign tFRWChart.tcFRWChartDefaultPrjCodeDesc = tqProjectForFRWBySharedSet.tcProjectDescription.
    end. /* End for project description */
    if tFRWChart.FRWChartDefaultCCCode <> ? 
        and tFRWChart.FRWChartDefaultCCCode <> '':U 
    then do:
           <Q-57 run CostCenterForFRWBySharedSet (all) (Read) (NoCache)
              (input ?, (CompanyId)
               input ?, (CostCentreID)
               input tFRWChart.FRWChartDefaultCCCode, (CostCentreCode)
               input tFRWChart.CostCentreSharedSet_ID, (SharedSetID)
               input ?, (SharedSetCode)
               output dataset tqCostCenterForFRWBySharedSet) in BCostCentre>
           find first tqCostCenterForFRWBySharedSet no-error.
           if available tqCostCenterForFRWBySharedSet
           then assign tFRWChart.tcFRWChartDefaultCCCodeDesc = tqCostCenterForFRWBySharedSet.tcCostCentreDescription.
    end. /* End for cost centre description */

    if tFRWChart.FRWChartDefaultDivCode <> ? 
        and tFRWChart.FRWChartDefaultDivCode <> '':U
    then do:
            <Q-72 run DivisionForFRWBySharedSet (all) (Read) (NoCache)
               (input ?, (CompanyId)
                input ?, (DivisionID)
                input tFRWChart.FRWChartDefaultDivCode, (DivisionCode)
                input tFRWChart.DivisionSharedSet_ID, (SharedSetID)
                input ?, (SharedSetCode)
                output dataset tqDivisionForFRWBySharedSet) in BDivision>
            find first tqDivisionForFRWBySharedSet no-error.
            if available tqDivisionForFRWBySharedSet
            then assign tFRWChart.tcFRWChartDefaultDivCodeDesc = tqDivisionForFRWBySharedSet.tcDivisionDescription.
    end. /* End for division description */
    
    if tFRWChart.FRWChartSafConcept01 <> ? and
       tFRWChart.FRWChartSafConcept01 <> '':U
    then do:
        <Q-62 run GetSafConceptDesc (all) (Read) (NoCache)
           (input tFRWChart.FRWChartSafConcept01, (SafConceptCode)
            output dataset tqGetSafConceptDesc) in BSafConcept>
        find first tqGetSafConceptDesc no-error.
        if available tqGetSafConceptDesc
        then assign tFRWChart.tcFRWChartSafConcept01Desc = tqGetSafConceptDesc.tcSafConceptDescription.
    end. 
    
    if tFRWChart.FRWChartSafConcept02 <> ? and
       tFRWChart.FRWChartSafConcept02 <> '':U
    then do:
        <Q-21 run GetSafConceptDesc (all) (Read) (NoCache)
           (input tFRWChart.FRWChartSafConcept02, (SafConceptCode)
            output dataset tqGetSafConceptDesc) in BSafConcept>
        find first tqGetSafConceptDesc no-error.
        if available tqGetSafConceptDesc
        then assign tFRWChart.tcFRWChartSafConcept02Desc = tqGetSafConceptDesc.tcSafConceptDescription.
    end.
    
    if tFRWChart.FRWChartSafConcept03 <> ? and
       tFRWChart.FRWChartSafConcept03 <> '':U
    then do:
        <Q-56 run GetSafConceptDesc (all) (Read) (NoCache)
           (input tFRWChart.FRWChartSafConcept03, (SafConceptCode)
            output dataset tqGetSafConceptDesc) in BSafConcept>
        find first tqGetSafConceptDesc no-error.
        if available tqGetSafConceptDesc
        then assign tFRWChart.tcFRWChartSafConcept03Desc = tqGetSafConceptDesc.tcSafConceptDescription.
    end.
    
    if tFRWChart.FRWChartSafConcept04 <> ? and
       tFRWChart.FRWChartSafConcept04 <> '':U
    then do:
        <Q-15 run GetSafConceptDesc (all) (Read) (NoCache)
           (input tFRWChart.FRWChartSafConcept04, (SafConceptCode)
            output dataset tqGetSafConceptDesc) in BSafConcept>
        find first tqGetSafConceptDesc no-error.
        if available tqGetSafConceptDesc
        then assign tFRWChart.tcFRWChartSafConcept04Desc = tqGetSafConceptDesc.tcSafConceptDescription.
    end.
    
    if tFRWChart.FRWChartSafConcept05 <> ? and
       tFRWChart.FRWChartSafConcept05 <> '':U
    then do:
        <Q-45 run GetSafConceptDesc (all) (Read) (NoCache)
           (input tFRWChart.FRWChartSafConcept05, (SafConceptCode)
            output dataset tqGetSafConceptDesc) in BSafConcept>
        find first tqGetSafConceptDesc no-error.
        if available tqGetSafConceptDesc
        then assign tFRWChart.tcFRWChartSafConcept05Desc = tqGetSafConceptDesc.tcSafConceptDescription.
    end.
    
    if tFRWChart.FRWChartSafConcept06 <> ? and
       tFRWChart.FRWChartSafConcept06 <> '':U
    then do:
        <Q-73 run GetSafConceptDesc (all) (Read) (NoCache)
           (input tFRWChart.FRWChartSafConcept06, (SafConceptCode)
            output dataset tqGetSafConceptDesc) in BSafConcept>
        find first tqGetSafConceptDesc no-error.
        if available tqGetSafConceptDesc
        then assign tFRWChart.tcFRWChartSafConcept06Desc = tqGetSafConceptDesc.tcSafConceptDescription.
    end.
    
    if tFRWChart.FRWChartSafConcept07 <> ? and
       tFRWChart.FRWChartSafConcept07 <> '':U
    then do:
        <Q-7 run GetSafConceptDesc (all) (Read) (NoCache)
           (input tFRWChart.FRWChartSafConcept07, (SafConceptCode)
            output dataset tqGetSafConceptDesc) in BSafConcept>
        find first tqGetSafConceptDesc no-error.
        if available tqGetSafConceptDesc
        then assign tFRWChart.tcFRWChartSafConcept07Desc = tqGetSafConceptDesc.tcSafConceptDescription.
    end.
    
    if tFRWChart.FRWChartSafConcept08 <> ? and
       tFRWChart.FRWChartSafConcept08 <> '':U
    then do:
        <Q-89 run GetSafConceptDesc (all) (Read) (NoCache)
           (input tFRWChart.FRWChartSafConcept08, (SafConceptCode)
            output dataset tqGetSafConceptDesc) in BSafConcept>
        find first tqGetSafConceptDesc no-error.
        if available tqGetSafConceptDesc
        then assign tFRWChart.tcFRWChartSafConcept08Desc = tqGetSafConceptDesc.tcSafConceptDescription.
    end.
    
    if tFRWChart.FRWChartSafConcept09 <> ? and
       tFRWChart.FRWChartSafConcept09 <> '':U
    then do:
        <Q-78 run GetSafConceptDesc (all) (Read) (NoCache)
           (input tFRWChart.FRWChartSafConcept09, (SafConceptCode)
            output dataset tqGetSafConceptDesc) in BSafConcept>
        find first tqGetSafConceptDesc no-error.
        if available tqGetSafConceptDesc
        then assign tFRWChart.tcFRWChartSafConcept09Desc = tqGetSafConceptDesc.tcSafConceptDescription.
    end.
    
    if tFRWChart.FRWChartSafConcept10 <> ? and
       tFRWChart.FRWChartSafConcept10 <> '':U
    then do:
        <Q-95 run GetSafConceptDesc (all) (Read) (NoCache)
           (input tFRWChart.FRWChartSafConcept10, (SafConceptCode)
            output dataset tqGetSafConceptDesc) in BSafConcept>
        find first tqGetSafConceptDesc no-error.
        if available tqGetSafConceptDesc
        then assign tFRWChart.tcFRWChartSafConcept10Desc = tqGetSafConceptDesc.tcSafConceptDescription.
    end.

end. /* End for each t_iFRWChart */