project QadFinancials > class TSetStatutoryCurrency > method SetStatutoryCurrencyNoStatCurr

Description

No Statutory Currency --> SC = BC


Parameters


icDomainCodeinputcharacter
ocErrorMessageoutputcharacterError Message
oiPostingLineCounteroutputinteger
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method TSetStatutoryCurrency.SetStatutoryCurrency


program code (program1/tsetstatutorycurrency.p)

assign oiReturnStatus      = -98
       viLocalReturnStatus = 0.

NOSTATCURRBLOCK: 
do:    
    /* Get DomainProperty */
    find Domains where
         Domains.DomainCode = icDomainCode
         no-lock no-error.
    if not available Domains
    then do:
        assign viLocalReturnStatus = -200
               ocErrorMessage      = substitute("Unable to get the Domain with code &1", icDomainCode).
        leave NOSTATCURRBLOCK.
    end. /* if not available Domains */    

    find DomainProperty where 
         DomainProperty.Domain_ID = Domains.Domain_ID
         no-lock no-error.
    if not available DomainProperty
    then do:
        assign viLocalReturnStatus = -201
               ocErrorMessage      = substitute("Unable to get the Domain with code &1", icDomainCode).
        leave NOSTATCURRBLOCK.
    end. /* if not available DomainProperty */    

    for each company where
             company.domain_id = DomainProperty.Domain_ID
             no-lock: 
      
        /* ConsolidDump */
        for each ConsolidDump of company exclusive-lock Transaction:
          assign ConsolidDump.ConsolidDumpConsolCCRate  = ConsolidDump.ConsolidDumpConsolRate
                 ConsolidDump.ConsolidDumpConsolCCScale = ConsolidDump.ConsolidDumpConsolRteScale.
        end. /* for each ConsolidDump of company Transaction */
        
        /* CashReport */ 
        for each CashReport of company no-lock:
          /* CashReportGL  */ 
          for each CashReportGL of CashReport exclusive-lock Transaction: 
              assign CashReportGL.CashReportGLActualAmountCC = CashReportGL.CashReportGLActualAmountLC
                     CashReportGL.CashReportGLAmountCC       = CashReportGL.CashReportGLAmountLC
                     CashReportGL.CashReportGLCorrAmountCC   = CashReportGL.CashReportGLCorrAmountLC .
          end. /* CashReportGL */ 
          /* Tackled fields: CashReportGLActualAmountCC,CashReportGLAmountCC,CashReportGLCorrAmountCC */
          /* CashReportGLLine  */
          for each  CashReportGL of CashReport no-lock, 
              each CashReportGLLine of CashReportGL 
              exclusive-lock Transaction :    
              assign CashReportGLLine.CashReportGLLineCC = CashReportGLLine.CashReportGLLineLC .
          end. /* CashReportGLLine */ 
          /* Tackled fields: CashReportGLLineCC */          
        end. /* CashReport  */
                 
        /* APMatchingLn */
        for each APMatching of company no-lock, 
          each APMatchingLn of APMatching exclusive-lock Transaction : 
          assign APMatchingLn.APMatchingLnMatchAmtCC    = APMatchingLn.APMatchingLnMatchAmtLC 
                 APMatchingLn.APMatchingLnReceiptAmtCC  = APMatchingLn.APMatchingLnReceiptAmtLC
                 APMatchingLn.APMatchingLnVarUsageCC    = APMatchingLn.APMatchingLnVarUsageLC
                 APMatchingLn.APMatchingLnVarRateCC     = APMatchingLn.APMatchingLnVarRateLC
                 APMatchingLn.APMatchingLnVarExchRateCC = APMatchingLn.APMatchingLnVarExchRateLC
                 APMatchingLn.APMatchingLnPvodCCRate    = 1
                 APMatchingLn.APMatchingLnPvodCCScale   = 1. /* Rate and Scale bwteen LC and CC */       
        end. /* APMatchingLn */ 
        /* Tackled fields: APMatchingLnMatchAmtCC,APMatchingLnReceiptAmtCC,APMatchingLnVarUsageCC */
            
        /* BankStateAlloc */
        for each BankStateAlloc of company exclusive-lock Transaction:        
          assign BankStateAlloc.BankStateAllocDifferenceCC = 0
                 BankStateAlloc.BankStateAllocCCRate       = BankStateAlloc.BankStateAllocBankRate
                 BankStateAlloc.BankStateAllocCCScale      = BankStateAlloc.BankStateAllocBankRteScale
                 BankStateAlloc.BankStateAllocWHTAmtCC     = BankStateAlloc.BankStateAllocWHTAmtLC
                 BankStateAlloc.BankStateAllocWHTCCRate    = BankStateAlloc.BankStateAllocWHTLCRate
                 BankStateAlloc.BankStateAllocWHTCCScale   = BankStateAlloc.BankStateAllocWHTLCScale.
        end. /* BankStateAlloc */ 
        /* Tackled fields: BankStateAllocDifferenceCC ,BankStateAlloc.BankStateAllocCCRate,BankStateAlloc.BankStateAllocCCScale,BankStateAlloc.BankStateAllocWHTAmtCC,BankStateAlloc.BankStateAllocWHTCCRate,BankStateAlloc.BankStateAllocWHTCCScale */      
        
        /* BankStateAllocColl */
        for each BankStateAllocColl of company exclusive-lock Transaction:        
          assign BankStateAllocColl.BankStateAllocCollDiffCC  = 0
                 BankStateAllocColl.BankStateAllocCollCCRate  = BankStateAllocColl.BankStateAllocCollBankRate
                 BankStateAllocColl.BankStateAllocCollCCScale = BankStateAllocColl.BankStateAllocCollRteScale.
        end. /* BankStateAllocColl */ 
        /* Tackled fields: BankStateAllocCollDiffCC */
        
        /* CBalance */
        for each CBalance of company exclusive-lock Transaction: 
          assign CBalance.CBalanceCC = CBalance.CBalanceLC.
        end. /* CBalance */ 
        /* Tackled fields: CBalanceCC */      
        
        /* CCollection */
        for each CCollection of company exclusive-lock Transaction: 
          assign CCollection.CCollectionBalanceCC       = CCollection.CCollectionBalanceLC
                 CCollection.CCollectionBalanceCreditCC = CCollection.CCollectionBalanceCreditLC
                 CCollection.CCollectionBalanceDebitCC  = CCollection.CCollectionBalanceDebitLC
                 CCollection.CCollectionOrigCreditCC    = CCollection.CCollectionOrigCreditLC
                 CCollection.CCollectionOrigDebitCC     = CCollection.CCollectionOrigDebitLC.
        end. /* CCollection */ 
        /* Tackled fields: CCollectionBalanceCC,CCollectionBalanceCreditCC,CCollectionBalanceDebitCC,CCollectionOrigCreditCC,CCollectionOrigDebitCC */
        
        /* CDocument */
        for each CDocument of company exclusive-lock Transaction: 
          assign CDocument.CDocumentOriginalCreditCC = CDocument.CDocumentOriginalCreditLC
                 CDocument.CDocumentOriginalDebitCC  = CDocument.CDocumentOriginalDebitLC
                 CDocument.CDocumentCCRate           = CDocument.CDocumentExchangeRate
                 CDocument.CDocumentCCScale          = CDocument.CDocumentRateScale.
            for each CDocumentInvoiceXref of CDocument exclusive-lock :
                assign CDocumentInvoiceXref.CDocumentInvoiceXRefWHTAmtCC   = CDocumentInvoiceXref.CDocumentInvoiceXRefWHTAmtLC
                       CDocumentInvoiceXref.CDocumentInvoiceXRefWHTCCRate  = CDocumentInvoiceXref.CDocumentInvoiceXRefWHTLCRate
                       CDocumentInvoiceXref.CDocumentInvoiceXRefWHTCCScale = CDocumentInvoiceXref.CDocumentInvoiceXRefWHTLCScale.
            end. /* for each CDocumentInvoiceXref or CDocument exclusive-lock : */
        end. /* CDocument */ 
        /* Tackled fields: CDocumentOriginalCreditCC,CDocumentOriginalDebitCC,CDocumentInvoiceXRefWHTAmtCC,CDocumentInvoiceXRefWHTCCRate,CDocumentInvoiceXRefWHTCCScale */      
        
        /* CHist */
        for each CHist of company exclusive-lock Transaction: 
          assign CHist.CHistBalanceCC        = CHist.CHistBalanceLC
                 CHist.CHistGrossCredNoteCC  = CHist.CHistGrossCredNoteLC
                 CHist.CHistGrossInvoiceCC   = CHist.CHistGrossInvoiceLC
                 CHist.CHistMovementCreditCC = CHist.CHistMovementCreditLC
                 CHist.CHistMovementDebitCC  = CHist.CHistMovementDebitLC
                 CHist.CHistNettoCredNoteCC  = CHist.CHistNettoCredNoteLC
                 CHist.CHistNettoInvoiceCC   = CHist.CHistNettoInvoiceLC.
        end. /* CHist */ 
        /* Tackled fields: CHistBalanceCC,CHistGrossCredNoteCC,CHistGrossInvoiceCC,CHistMovementCreditCC,CHistMovementDebitCC,CHistNettoCredNoteCC,CHistNettoInvoiceCC */
        
        /* CInvoice */
        for each CInvoice of company exclusive-lock Transaction: 
            assign   CInvoice.CInvoiceBalanceCC          = CInvoice.CInvoiceBalanceLC
                     CInvoice.CInvoiceBalanceCreditCC    = CInvoice.CInvoiceBalanceCreditLC
                     CInvoice.CInvoiceBalanceDebitCC     = CInvoice.CInvoiceBalanceDebitLC
                     CInvoice.CInvoiceNonDiscAmtCC       = CInvoice.CInvoiceNonDiscAmtLC
                     CInvoice.CInvoiceOriginalCreditCC   = CInvoice.CInvoiceOriginalCreditLC
                     CInvoice.CInvoiceOriginalDebitCC    = CInvoice.CInvoiceOriginalDebitLC
                     CInvoice.CInvoiceVatBaseCreditCC    = CInvoice.CInvoiceVatBaseCreditLC
                     CInvoice.CInvoiceVatBaseDebitCC     = CInvoice.CInvoiceVatBaseDebitLC
                     CInvoice.CInvoiceVatCreditCC        = CInvoice.CInvoiceVatCreditLC
                     CInvoice.CInvoiceVatDebitCC         = CInvoice.CInvoiceVatDebitLC
                     CInvoice.CInvoiceCCRate             = CInvoice.CInvoiceExchangeRate
                     CInvoice.CInvoiceCCScale            = CInvoice.CInvoiceRateScale
                     CInvoice.CInvoiceWHTTotAmtDebitCC   = CInvoice.CInvoiceWHTTotAmtDebitLC
                     CInvoice.CInvoiceWHTTotAmtCreditCC  = CInvoice.CInvoiceWHTTotAmtCreditLC
                     CInvoice.CInvoiceWHTBaseAmtDebitCC  = CInvoice.CInvoiceWHTBaseAmtDebitLC
                     CInvoice.CInvoiceWHTBaseAmtCreditCC = CInvoice.CInvoiceWHTBaseAmtCreditLC.
            
            /* CInvoiceStage */
            for each CInvoiceStage of CInvoice exclusive-lock : 
                assign CInvoiceStage.CInvoiceStageAmountCC = CInvoiceStage.CInvoiceStageAmountLC.
            end. /* CInvoiceStage */ 
            /* Tackled fields: CInvoiceStageAmountCC */
            
            /* CInvoiceVat */
            for each CInvoiceVat of CInvoice exclusive-lock:
                assign CInvoiceVat.CInvoiceVatVatBaseCreditCC = CInvoiceVat.CInvoiceVatVatBaseCreditLC
                       CInvoiceVat.CInvoiceVatVatBaseDebitCC  = CInvoiceVat.CInvoiceVatVatBaseDebitLC
                       CInvoiceVat.CInvoiceVatVatCreditCC     = CInvoiceVat.CInvoiceVatVatCreditLC
                       CInvoiceVat.CInvoiceVatVatDebitCC      = CInvoiceVat.CInvoiceVatVatDebitLC.
            end. /* CInvoiceVat */ 
            /* Tackled fields: CInvoiceVatVatBaseCreditCC,CInvoiceVatVatBaseDebitCC,CInvoiceVatVatCreditCC,CInvoiceVatVatDebitCC */
            
            for each CInvoiceWHT of CInvoice exclusive-lock: 
                assign CInvoiceWHT.CInvoiceWHTAmtDebitCC     = CInvoiceWHT.CInvoiceWHTAmtDebitLC
                       CInvoiceWHT.CInvoiceWHTAmtCreditCC    = CInvoiceWHT.CInvoiceWHTAmtCreditLC
                       CInvoiceWHT.CInvoiceWHTTaxFeeDebitCC  = CInvoiceWHT.CInvoiceWHTTaxFeeDebitLC
                       CInvoiceWHT.CInvoiceWHTTaxFeeCreditCC = CInvoiceWHT.CInvoiceWHTTaxFeeCreditLC.
            end. /* CInvoiceWHT */
          
        end. /* CInvoice */ 
        /* Tackled fields: CInvoiceBalanceCC,CInvoiceBalanceCreditCC,CInvoiceBalanceDebitCC,CInvoiceNonDiscAmtCC,CInvoiceOriginalCreditCC,CInvoiceOriginalDebitCC,CInvoiceVatBaseCreditCC,CInvoiceVatBaseDebitCC,CInvoiceVatCreditCC,CInvoiceVatDebitCC */
        
        /* DBalance */
        for each DBalance of company exclusive-lock Transaction: 
          assign DBalance.DBalanceCC = DBalance.DBalanceLC .
        end. /* DBalance */ 
        /* Tackled fields: DBalanceCC */      
        
        /* DCollection */
        for each DCollection of company exclusive-lock Transaction: 
          assign DCollection.DCollectionBalanceCC       = DCollection.DCollectionBalanceLC
                 DCollection.DCollectionBalanceCreditCC = DCollection.DCollectionBalanceCreditLC
                 DCollection.DCollectionBalanceDebitCC  = DCollection.DCollectionBalanceDebitLC
                 DCollection.DCollectionOrigCreditCC    = DCollection.DCollectionOrigCreditLC
                 DCollection.DCollectionOrigDebitCC     = DCollection.DCollectionOrigDebitLC.
        end. /* DCollection */ 
        /* Tackled fields: DCollectionBalanceCC,DCollectionBalanceCreditCC,DCollectionBalanceDebitCC,DCollectionOrigCreditCC,DCollectionOrigDebitCC */
        
        /* DDocument */
        for each DDocument of company exclusive-lock Transaction: 
          assign DDocument.DDocumentOriginalCreditCC = DDocument.DDocumentOriginalCreditLC
                 DDocument.DDocumentOriginalDebitCC  = DDocument.DDocumentOriginalDebitLC
                 DDocument.DDocumentCCRate           = DDocument.DDocumentExchangeRate
                 DDocument.DDocumentCCScale          = DDocument.DDocumentRateScale.
        end. /* DDocument */ 
        /* Tackled fields: DDocumentOriginalCreditCC,DDocumentOriginalDebitCC */
        
        /* DHist */
        for each DHist of company exclusive-lock Transaction: 
          assign DHist.DHistBalanceCC        = DHist.DHistBalanceLC
                 DHist.DHistGrossCredNoteCC  = DHist.DHistGrossCredNoteLC
                 DHist.DHistGrossInvoiceCC   = DHist.DHistGrossInvoiceLC
                 DHist.DHistMovementCreditCC = DHist.DHistMovementCreditLC
                 DHist.DHistMovementDebitCC  = DHist.DHistMovementDebitLC
                 DHist.DHistNettoCredNoteCC  = DHist.DHistNettoCredNoteLC
                 DHist.DHistNettoInvoiceCC   = DHist.DHistNettoInvoiceLC.
        end. /* DHist */ 
        /* Tackled fields: DHistBalanceCC,DHistGrossCredNoteCC,DHistGrossInvoiceCC,DHistMovementCreditCC,DHistMovementDebitCC,DHistNettoCredNoteCC,DHistNettoInvoiceCC */
        
        /* **** Start code for table: DInvoice  */
        for each DInvoice of company exclusive-lock Transaction: 
          assign DInvoice.DInvoiceBalanceCC = DInvoice.DInvoiceBalanceLC
                 DInvoice.DInvoiceBalanceCreditCC  = DInvoice.DInvoiceBalanceCreditLC
                 DInvoice.DInvoiceBalanceDebitCC   = DInvoice.DInvoiceBalanceDebitLC
                 DInvoice.DInvoiceNonDiscAmtCC     = DInvoice.DInvoiceNonDiscAmtLC
                 DInvoice.DInvoiceOriginalCreditCC = DInvoice.DInvoiceOriginalCreditLC
                 DInvoice.DInvoiceOriginalDebitCC  = DInvoice.DInvoiceOriginalDebitLC
                 DInvoice.DInvoiceVatBaseCreditCC  = DInvoice.DInvoiceVatBaseCreditLC
                 DInvoice.DInvoiceVatBaseDebitCC   = DInvoice.DInvoiceVatBaseDebitLC
                 DInvoice.DInvoiceVatCreditCC      = DInvoice.DInvoiceVatCreditLC
                 DInvoice.DInvoiceVatDebitCC       = DInvoice.DInvoiceVatDebitLC
                 DInvoice.DInvoiceCCRate           = DInvoice.DInvoiceExchangeRate
                 DInvoice.DInvoiceCCScale          = DInvoice.DInvoiceRateScale.
        
            /* DInvoiceStage */
            for each DInvoiceStage of DInvoice exclusive-lock:
                assign DInvoiceStage.DInvoiceStageAmountCC = DInvoiceStage.DInvoiceStageAmountLC.
            end. /* DInvoiceStage */ 
            /* Tackled fields: DInvoiceStageAmountCC */
        
            /* DInvoiceVat */
            for each DInvoiceVat of DInvoice exclusive-lock: 
                assign DInvoiceVat.DInvoiceVatVatBaseCreditCC = DInvoiceVat.DInvoiceVatVatBaseCreditLC
                       DInvoiceVat.DInvoiceVatVatBaseDebitCC  = DInvoiceVat.DInvoiceVatVatBaseDebitLC
                       DInvoiceVat.DInvoiceVatVatCreditCC     = DInvoiceVat.DInvoiceVatVatCreditLC
                       DInvoiceVat.DInvoiceVatVatDebitCC      = DInvoiceVat.DInvoiceVatVatDebitLC.
            end. /* DInvoiceVat */ 

            /* DInvoiceDeduction */
            for each DInvoiceDeduction of DInvoice exclusive-lock:
                assign DInvoiceDeduction.DInvoiceDeductionCC = DInvoiceDeduction.DInvoiceDeductionLC.
            end. /* DInvoiceDeduction */

            /* Tackled fields: DInvoiceVatVatBaseCreditCC,DInvoiceVatVatBaseDebitCC,DInvoiceVatVatCreditCC,DInvoiceVatVatDebitCC */
        end. /* DInvoice */ 
        /* Tackled fields: DInvoiceBalanceCC,DInvoiceBalanceCreditCC,DInvoiceBalanceDebitCC,DInvoiceNonDiscAmtCC,DInvoiceOriginalCreditCC,DInvoiceOriginalDebitCC,DInvoiceVatBaseCreditCC,DInvoiceVatBaseDebitCC,DInvoiceVatCreditCC,DInvoiceVatDebitCC */
        
        /* ExpNote */
        for each ExpNote of company exclusive-lock Transaction:
          assign ExpNote.ExpNoteCCRate  = ExpNote.ExpNoteRateLCXC
                 ExpNote.ExpNoteCCScale = ExpNote.ExpNoteRateScale.
          /* ExpNoteLine */
          for each ExpNoteLine of ExpNote exclusive-lock: 
              assign ExpNoteLine.ExpNoteLineAmountCC = ExpNoteLine.ExpNoteLineAmountLC
                     ExpNoteLine.ExpNoteLineCCRate   = ExpNoteLine.ExpNoteLineLCRate
                     ExpNoteLine.ExpNoteLineCCScale  = ExpNoteLine.ExpNoteLineLCScale.
          end. /* ExpNoteLine */
          /* Tackled fields: ExpNoteLineAmountCC,ExpNoteLineCCRate,ExpNoteLineCCScale */      
        end. /* ExpNote */ 
        /* Tackled fields: ExpNoteCCRate,ExpNoteCCScale */
        
        /* FAAssetBook */
        for each FAAsset of company exclusive-lock Transaction:
          assign FAAsset.FAAssetExchangeRateCC      = 1
                 FAAsset.FAAssetExchangeRateScaleCC = 1. /* This is the rate between LC and CC */
          for each  FAAssetBook of FAAsset exclusive-lock: 
              assign FAAssetBook.FAAssetBookAmountCC        = FAAssetBook.FAAssetBookAmountLC
                     FAAssetBook.FAAssetBookDeprAmountCC    = FAAssetBook.FAAssetBookDeprAmountLC
                     FAAssetBook.FAAssetBookDisposedCC      = FAAssetBook.FAAssetBookDisposedLC
                     FAAssetBook.FAAssetBookDisposedDeprCC  = FAAssetBook.FAAssetBookDisposedDeprLC
                     FAAssetBook.FAAssetBookSalvageAmountCC = FAAssetBook.FAAssetBookSalvageAmountLC.
        
              /* FADisposal */
              for each FADisposal of FAAssetBook exclusive-lock: 
                  assign FADisposal.FADisposalAmountCC = FADisposal.FADisposalAmountLC.
                  /* FADisposalDet */
                  for each FADisposalDet of FADisposal exclusive-lock: 
                      assign FADisposalDet.FADisposalDetAmountCC = FADisposalDet.FADisposalDetAmountLC.
                  end. /* FADisposalDet */ 
                  /* Tackled fields: FADisposalDetAmountCC */
              end. /* FADisposal */ 
              /* Tackled fields: FADisposalAmountCC */
        
              /* FAReval */
              for each FAReval of FAAssetBook exclusive-lock: 
                  assign FAReval.FARevalAmountCC = FAReval.FARevalAmountLC.                  
        
                  /* FARevalDet */
                  for each FARevalDet of FAReval exclusive-lock: 
                      assign FARevalDet.FARevalDetAmountCC = FARevalDet.FARevalDetAmountLC.
                  end. /* FARevalDet */ 
                  /* Tackled fields: FARevalDetAmountCC */                  
              end. /* FAReval */
              /* Tackled fields: FARevalAmountCC */
          end. /* FAAssetBook */ 
          /* Tackled fields: FAAssetBookAmountCC,FAAssetBookDeprAmountCC,FAAssetBookDisposedCC,FAAssetBookDisposedDeprCC,FAAssetBookSalvageAmountCC */
        end.  /* FAAsset */
        
        /* FADepreciation */
        for each FADepreciation of company exclusive-lock Transaction: 
          assign FADepreciation.FADepreciationAmountCC = FADepreciation.FADepreciationAmountLC.
        
          /* FADepreciationDet */
          for each FADepreciationDet of FADepreciation exclusive-lock: 
              assign FADepreciationDet.FADepreciationDetAmountCC = FADepreciationDet.FADepreciationDetAmountLC.
          end. /* FADepreciationDet */ 
          /* Tackled fields: FADepreciationDetAmountCC */
        end. /* FADepreciation */ 
        /* Tackled fields: FADepreciationAmountCC */
        
        /* GLOpenItem */
        for each GLOpenItem of company exclusive-lock Transaction: 
          assign GLOpenItem.GLOpenItemBalanceCC        = GLOpenItem.GLOpenItemBalanceLC
                 GLOpenItem.GLOpenItemBalanceCreditCC  = GLOpenItem.GLOpenItemBalanceCreditLC
                 GLOpenItem.GLOpenItemBalanceDebitCC   = GLOpenItem.GLOpenItemBalanceDebitLC
                 GLOpenItem.GLOpenItemOriginalCreditCC = GLOpenItem.GLOpenItemOriginalCreditLC
                 GLOpenItem.GLOpenItemOriginalDebitCC  = GLOpenItem.GLOpenItemOriginalDebitLC.
        end. /* GLOpenItem */ 
        /* Tackled fields: GLOpenItemBalanceCC,GLOpenItemBalanceCreditCC,GLOpenItemBalanceDebitCC,GLOpenItemOriginalCreditCC,GLOpenItemOriginalDebitCC */
        
        /* PostingHist */
        for each PostingHist of company exclusive-lock Transaction: 
          assign PostingHist.PostingHistBalanceCreditCC = PostingHist.PostingHistBalanceCreditLC
                 PostingHist.PostingHistBalanceDebitCC  = PostingHist.PostingHistBalanceDebitLC
                 PostingHist.PostingHistMovemntCreditCC = PostingHist.PostingHistMovemntCreditLC
                 PostingHist.PostingHistMovemntDebitCC  = PostingHist.PostingHistMovemntDebitLC
                 PostingHist.PostingHistYTDCreditCC     = PostingHist.PostingHistYTDCreditLC
                 PostingHist.PostingHistYTDDebitCC      = PostingHist.PostingHistYTDDebitLC.
        end. /* PostingHist */ 
        /* Tackled fields: PostingHistBalanceCreditCC,PostingHistBalanceDebitCC,PostingHistMovemntCreditCC,PostingHistMovemntDebitCC,PostingHistYTDCreditCC,PostingHistYTDDebitCC */
        
        /* Posting */
        for each Posting of company no-lock Transaction:
          /* PostingLine */
          for each PostingLine of posting exclusive-lock:
              assign oiPostingLineCounter            = oiPostingLineCounter + 1
                     PostingLine.PostingLineCreditCC = PostingLine.PostingLineCreditLC
                     PostingLine.PostingLineDebitCC  = PostingLine.PostingLineDebitLC
                     PostingLine.PostingLineCCRate   = PostingLine.PostingLineExchangeRate
                     PostingLine.PostingLineCCScale  = PostingLine.PostingLineRateScale.
                
              /* PostingVat */
              for each PostingVat of PostingLine exclusive-lock: 
                  assign PostingVat.PostingVatBaseCreditCC = PostingVat.PostingVatBaseCreditLC
                         PostingVat.PostingVatBaseDebitCC  = PostingVat.PostingVatBaseDebitLC
                         PostingVat.PostingVatTaxCreditCC  = PostingVat.PostingVatTaxCreditLC
                         PostingVat.PostingVatTaxDebitCC   = PostingVat.PostingVatTaxDebitLC.
              end. /* PostingVat */ 
              /* Tackled fields: PostingVatBaseCreditCC,PostingVatBaseDebitCC,PostingVatTaxCreditCC,PostingVatTaxDebitCC */
                
              /* PostingVatDelay */
              for each PostingVatDelay of PostingLine exclusive-lock: 
                  assign PostingVatDelay.PostingVatDelayBaseCredCC = PostingVatDelay.PostingVatDelayBaseCredLC
                         PostingVatDelay.PostingVatDelayBaseDebCC  = PostingVatDelay.PostingVatDelayBaseDebLC.
              end. /* PostingVatDelay */ 
              /* Tackled fields: PostingVatDelayBaseCredCC,PostingVatDelayBaseDebCC */
          end. /* PostingLine */ 
          /* Tackled fields: PostingLineCreditCC,PostingLineDebitCC,PostingLine.PostingLineCCRate,PostingLine.PostingLineCCScale */
        end. /* for each Posting of company */
        
        /* QCInvoiceMovement */
        for each QCInvoiceMovement of company exclusive-lock Transaction: 
          assign QCInvoiceMovement.CInvoiceMovementCreditCC  = QCInvoiceMovement.CInvoiceMovementCreditLC
                 QCInvoiceMovement.CInvoiceMovementDebitCC   = QCInvoiceMovement.CInvoiceMovementDebitLC
                 QCInvoiceMovement.CInvoiceMovementVatCredCC = QCInvoiceMovement.CInvoiceMovementVatCredLC
                 QCInvoiceMovement.CInvoiceMovementVatDebCC  = QCInvoiceMovement.CInvoiceMovementVatDebLC.
        end. /* QCInvoiceMovement */ 
        /* Tackled fields: CInvoiceMovementCreditCC,CInvoiceMovementDebitCC,CInvoiceMovementVatCredCC,CInvoiceMovementVatDebCC */
        
        /* QCrossCyPosting */
        for each QCrossCyPosting of company exclusive-lock Transaction: 
          assign QCrossCyPosting.QCrossCyPostingAmountCC = QCrossCyPosting.QCrossCyPostingAmountLC.
        end. /* QCrossCyPosting */ 
        /* Tackled fields: QCrossCyPostingAmountCC */      

        /* QDInvoiceMovement */
        for each QDInvoiceMovement of company exclusive-lock Transaction: 
          assign QDInvoiceMovement.DInvoiceMovementCreditCC  = QDInvoiceMovement.DInvoiceMovementCreditLC
                 QDInvoiceMovement.DInvoiceMovementDebitCC   = QDInvoiceMovement.DInvoiceMovementDebitLC
                 QDInvoiceMovement.DInvoiceMovementVatCredCC = QDInvoiceMovement.DInvoiceMovementVatCredLC
                 QDInvoiceMovement.DInvoiceMovementVatDebCC  = QDInvoiceMovement.DInvoiceMovementVatDebLC.
        end. /* QDInvoiceMovement */ 
        /* Tackled fields: DInvoiceMovementCreditCC,DInvoiceMovementDebitCC,DInvoiceMovementVatCredCC,DInvoiceMovementVatDebCC */

        /* QPostingLine */
        for each QPostingLine of company exclusive-lock Transaction: 
            assign QPostingLine.QPostingLineCreditCC = QPostingLine.QPostingLineCreditLC
                   QPostingLine.QPostingLineDebitCC  = QPostingLine.QPostingLineDebitLC.
        end. /* QPostingLine */ 
        /* Tackled fields: QPostingLineCreditCC,QPostingLineDebitCC */      

        /* RevalDet */
        for each RevalHeader of Company where 
                 RevalHeader.RevalHeaderIsForCC = true no-lock, 
            each Reval of RevalHeader no-lock,
            each RevalGL of Reval exclusive-lock Transaction :
            assign RevalGL.RevalGLCreditCC            = RevalGL.RevalGLCreditLC
                   RevalGL.RevalGLDebitCC             = RevalGL.RevalGLDebitLC
                   RevalGL.RevalGLRevCreditCC         = RevalGL.RevalGLRevCreditLC
                   RevalGL.RevalGLRevDebitCC          = RevalGL.RevalGLRevDebitLC
                   RevalGL.RevalGLCCExchangeRate      = RevalGL.RevalGLTCExchangeRate
                   RevalGL.RevalGLCCExchangeRateScale = RevalGL.RevalGLTCExchangeRateScale.
            /* RevalDet */
            for each RevalDet of RevalGL exclusive-lock: 
              assign RevalDet.RevalDetCreditCC          = RevalDet.RevalDetCreditLC
                     RevalDet.RevalDetDebitCC           = RevalDet.RevalDetDebitLC
                     RevalDet.RevalDetRevCreditCC       = RevalDet.RevalDetRevCreditLC
                     RevalDet.RevalDetRevDebitCC        = RevalDet.RevalDetRevDebitLC
                     RevalDet.RevalDetCCExchangeRate    = RevalDet.RevalDetTCExchangeRate
                     RevalDet.RevalDetCCExchangeScale   = RevalDet.RevalDetTCExchangeScale.
            end. /* RevalDet */ 
            /* Tackled fields: RevalDetCreditCC,RevalDetDebitCC,RevalDetRevCreditCC,RevalDetRevDebitCC */
        end. /* RevalGL */ 
        /* Tackled fields: RevalGLCreditCC,RevalGLDebitCC,RevalGLRevCreditCC,RevalGLRevDebitCC */
        
        /* OIAdjustLn */
        for each OIAdjust of company no-lock,
            each OIAdjustLn of OIAdjust where 
                 OIAdjustLn.CInvoice_ID <> 0 and 
                 OIAdjustLn.CInvoice_ID <> ?
                 Exclusive-lock Transaction : 
            assign OIAdjustLn.OIAdjustLnWHTCCRate  = OIAdjustLn.OIAdjustLnWHTLCRate
                   OIAdjustLn.OIAdjustLnWHTCCScale = OIAdjustLn.OIAdjustLnWHTLCScale
                   OIAdjustLn.OIAdjustLnWHTAmtCC   = OIAdjustLn.OIAdjustLnWHTAmtLC.
        end. /* for each OIAdjust of company exclusive-lock Transaction: */
        
        /* DPaySelLine */
        for each DPaySel of company no-lock,
            each DPaySelLine of DPaySel where 
                 DPaySelLine.DPaySelLineWHTAmtTC <> 0 and 
                 DPaySelLine.DPaySelLineWHTAmtTC <> ?
                 exclusive-lock Transaction:                 
            assign DPaySelLine.DPaySelLineWHTAmtCC = DPaySelLine.DPaySelLineWHTAmtLC.
        end. /* for each DPaySel of company exclusive-lock Transaction: */
        
        /* WHT */
        for each WHT of company exclusive-lock Transaction :
            assign  WHT.WHTChargeAmtDebitCC    = WHT.WHTChargeAmtDebitLC
                    WHT.WHTChargeAmtCreditCC   = WHT.WHTChargeAmtCreditLC 
                    WHT.WHTTaxableFeesDebitCC  = WHT.WHTTaxableFeesDebitLC
                    WHT.WHTTaxableFeesCreditCC = WHT.WHTTaxableFeesCreditLC 
                    WHT.WHTVATAmtDebitCC       = WHT.WHTVATAmtDebitLC
                    WHT.WHTVATAmtCreditCC      = WHT.WHTVATAmtCreditLC
                    WHT.WHTTotAmtDebitCC       = WHT.WHTTotAmtDebitLC 
                    WHT.WHTTotAmtCreditCC      = WHT.WHTTotAmtCreditLC
                    WHT.WHTPaidAmtDebitCC      = WHT.WHTPaidAmtDebitLC 
                    WHT.WHTPaidAmtCreditCC     = WHT.WHTPaidAmtCreditLC
                    WHT.WHTAmtDebitCC          = WHT.WHTAmtDebitLC
                    WHT.WHTAmtCreditCC         = WHT.WHTAmtCreditLC 
                    WHT.WHTRetainedAmtDebitCC  = WHT.WHTRetainedAmtDebitLC 
                    WHT.WHTRetainedAmtCreditCC = WHT.WHTRetainedAmtCreditLC.
        end. /* for each WHT of company Transaction : */
      
    end. /* for each company of Domains */        
end. /* NOSTATCURRBLOCK */

assign oiReturnStatus = viLocalReturnStatus.