project QadFinancials > class BSystem > method ApiSynchroniseCustom2

Description

Submethod of ApiSynchroniseCustom


Parameters


oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BSystem.ApiSynchroniseCustom


program code (program9/bsystem.p)

/* =========================== */
/* Start SCBATWOSYNCHROBLOCK   */
/* =========================== */
SCBATWOSYNCHROBLOCK : DO :
    
    /* =================== */                                
    /* When ROUNDINGMETHOD */
    /* =================== */
    find tTopic where 
         tTopic.tiTopicNumber = 112 and 
         tTopic.tlSelected    = true
         no-error.
    if available tTopic and
      (vcSynchronizeType = {&SYNCHRONIZETYPE-FULL} or
       tTopic.tcSynchronizeType = vcSynchronizeType)
    then do :
        <I-47 {bFcStartAndOpenInstance
             &CLASS                = "BRoundingMethod"}>
        
        output to value (vcSynchroniseLogFile) append.
        put unformatted string (now) '> ':U
            "BRoundingMethod.ApiSynchronise Start":U skip.
        output close.
        
        /*  Set indication in the logging.  */
        publish "Logging.LogSetIndication" (input 'BRoundingMethod':U, output viFcReturnSuper).
                
        <M-49 run ApiSynchronise (output vlUpdatesDone (olUpdatesDone), 
                          output viSynchroniseError (oiReturnStatus)) in BRoundingMethod>                
        
        <I-50 {bFcCloseAndStopInstance
             &CLASS           = "BRoundingMethod"}>

        output to value (vcSynchroniseLogFile) append.
        put unformatted string (now) '> ':U
            "BRoundingMethod.ApiSynchronise End : ":U string (viSynchroniseError) ' ':U string (vlUpdatesDone) skip.
        output close.
                           
        if viSynchroniseError < 0
        or (oiReturnStatus = 0 and viSynchroniseError > 0)
        then assign oiReturnStatus = viSynchroniseError.

        if viSynchroniseError < 0
        then assign tTopic.tcUpdateInformation = #T-80'Update Failed':30(2976562)T-80#.
        else
        if vlUpdatesDone 
        then assign tTopic.tcUpdateInformation = trim(#T-51'Updates Done':30(3760)T-51#).
        else assign tTopic.tcUpdateInformation = trim(#T-52'No Updates Required':30(3761)T-52#).
    end. /* if available tTopic 112 */
    
    /* =================== */
    /* WHEN CURRENCIES     */
    /* =================== */
    find tTopic where 
         tTopic.tiTopicNumber = 108 and 
         tTopic.tlSelected    = true
         no-error.
    if available tTopic and
      (vcSynchronizeType = {&SYNCHRONIZETYPE-FULL} or
       tTopic.tcSynchronizeType = vcSynchronizeType)
    then do :
        <I-1 {bFcStartAndOpenInstance
             &CLASS                = "BCurrency"}>
        
        output to value (vcSynchroniseLogFile) append.
        put unformatted string (now) '> ':U
            "BCurrency.ApiSynchronise Start":U skip.
        output close.
        
        /*  Set indication in the logging.  */
        publish "Logging.LogSetIndication" (input 'BCurrency':U, output viFcReturnSuper).
                
        <M-3 run ApiSynchronise (output vlUpdatesDone (olUpdatesDone), 
                      output viSynchroniseError (oiReturnStatus)) in BCurrency>
        
        <I-4 {bFcCloseAndStopInstance
             &CLASS           = "BCurrency"}>

        output to value (vcSynchroniseLogFile) append.
        put unformatted string (now) '> ':U
            "BCurrency.ApiSynchronise End : ":U string (viSynchroniseError) ' ':U string (vlUpdatesDone) skip.
        output close.
                           
        if viSynchroniseError < 0
        or (oiReturnStatus = 0 and viSynchroniseError > 0)
        then assign oiReturnStatus = viSynchroniseError.

        if viSynchroniseError < 0
        then assign tTopic.tcUpdateInformation = #T-70'Update Failed':30(2976562)T-70#.
        else
        if vlUpdatesDone 
        then assign tTopic.tcUpdateInformation = trim(#T-13'Updates Done':30(3760)T-13#).
        else assign tTopic.tcUpdateInformation = trim(#T-14'No Updates Required':30(3761)T-14#).
    end. /* if available tTopic 90 */
            
            
    /* =================== */
    /* WHEN Countries      */
    /* =================== */
    find tTopic where 
         tTopic.tiTopicNumber = 111 and 
         tTopic.tlSelected    = true
         no-error.
    if available tTopic and
      (vcSynchronizeType = {&SYNCHRONIZETYPE-FULL} or
       tTopic.tcSynchronizeType = vcSynchronizeType)
    then do :
        <I-19 {bFcStartAndOpenInstance
             &CLASS                = "BCountry"}>
        
        output to value (vcSynchroniseLogFile) append.
        put unformatted string (now) '> ':U
            "BCountry.ApiSynchronise Start":U skip.
        output close.
        
        /*  Set indication in the logging.  */
        publish "Logging.LogSetIndication" (input 'BCountry':U, output viFcReturnSuper).
                
        <M-25 run ApiSynchronise (output vlUpdatesDone (olUpdatesDone), 
                          output viSynchroniseError (oiReturnStatus)) in BCountry>
                             
        <I-22 {bFcCloseAndStopInstance
             &CLASS           = "BCountry"}>
                       
        output to value (vcSynchroniseLogFile) append.
        put unformatted string (now) '> ':U
            "BCountry.ApiSynchronise End : ":U string (viSynchroniseError) ' ':U string (vlUpdatesDone) skip.
        output close.
                         
        if viSynchroniseError < 0
        or (oiReturnStatus = 0 and viSynchroniseError > 0)
        then assign oiReturnStatus = viSynchroniseError.

        if viSynchroniseError < 0
        then assign tTopic.tcUpdateInformation = #T-29'Update Failed':30(2976562)T-29#.
        else
        if vlUpdatesDone 
        then assign tTopic.tcUpdateInformation = trim(#T-23'Updates Done':30(3760)T-23#).
        else assign tTopic.tcUpdateInformation = trim(#T-24'No Updates Required':30(3761)T-24#).
    end. /* if available tTopic 111 */
                             
            
    /* ========================== */
    /* WHEN Non Taxable Tax Group */
    /* ========================== */
    find tTopic where 
         tTopic.tiTopicNumber = 117 and 
         tTopic.tlSelected    = true
         no-error.
    if available tTopic and
      (vcSynchronizeType = {&SYNCHRONIZETYPE-FULL} or
       tTopic.tcSynchronizeType = vcSynchronizeType)
    then do :
        <I-82 {bFcStartAndOpenInstance
             &CLASS                = "BVATGroup"}>
        
        output to value (vcSynchroniseLogFile) append.
        put unformatted string (now) '> ':U
            "BVatGroup.ApiSynchronise Start":U skip.
        output close.
        
        /*  Set indication in the logging.  */
        publish "Logging.LogSetIndication" (input 'BVatGroup':U, output viFcReturnSuper).
                
        <M-88 run ApiSynchronise
           (output vlUpdatesDone (olUpdatesDone), 
            output viSynchroniseError (oiReturnStatus)) in BVATGroup>

        <I-85 {bFcCloseAndStopInstance
             &CLASS           = "BVATGroup"}>
                       
        output to value (vcSynchroniseLogFile) append.
        put unformatted string (now) '> ':U
            "BVatGroup.ApiSynchronise End : ":U string (viSynchroniseError) ' ':U string (vlUpdatesDone) skip.
        output close.
                         
        if viSynchroniseError < 0
        or (oiReturnStatus = 0 and viSynchroniseError > 0)
        then assign oiReturnStatus = viSynchroniseError.

        if viSynchroniseError < 0
        then assign tTopic.tcUpdateInformation = #T-98'Update Failed':30(2976562)T-98#.
        else
        if vlUpdatesDone 
        then assign tTopic.tcUpdateInformation = trim(#T-86'Updates Done':30(3760)T-86#).
        else assign tTopic.tcUpdateInformation = trim(#T-87'No Updates Required':30(62653)T-87#).
    end. /* if available tTopic 111 */

    /* =================== */                                
    /* When DOMAINS        */
    /* =================== */
    find tTopic where 
         tTopic.tiTopicNumber = 113 and 
         tTopic.tlSelected    = true
         no-error.
    if available tTopic and
      (vcSynchronizeType = {&SYNCHRONIZETYPE-FULL} or
       tTopic.tcSynchronizeType = vcSynchronizeType)
    then do :
        <I-43 {bFcStartAndOpenInstance
             &CLASS                = "BDomain"}>
        
        output to value (vcSynchroniseLogFile) append.
        put unformatted string (now) '> ':U
            "BDomain.ApiSynchronise Start":U skip.
        output close.
        
        /*  Set indication in the logging.  */
        publish "Logging.LogSetIndication" (input 'BDomain':U, output viFcReturnSuper).
                
        <M-46 run ApiSynchronise
           (output vlUpdatesDone (olUpdatesDone), 
            output viSynchroniseError (oiReturnStatus)) in BDomain>                 
        
        <I-45 {bFcCloseAndStopInstance
             &CLASS           = "BDomain"}>  
             
        output to value (vcSynchroniseLogFile) append.
        put unformatted string (now) '> ':U
            "BDomain.ApiSynchronise End : ":U string (viSynchroniseError) ' ':U string (vlUpdatesDone) skip.
        output close.
                           
        if viSynchroniseError < 0
        or (oiReturnStatus = 0 and viSynchroniseError > 0)
        then assign oiReturnStatus = viSynchroniseError.

        if viSynchroniseError < 0
        then assign tTopic.tcUpdateInformation = #T-34'Update Failed':30(2976562)T-34#.
        else
        if vlUpdatesDone 
        then assign tTopic.tcUpdateInformation = trim(#T-41'Updates Done':30(3760)T-41#).
        else assign tTopic.tcUpdateInformation = trim(#T-42'No Updates Required':30(3761)T-42#).
    end. /* if available tTopic 113 */            
            
    /* =================== */
    /* WHEN BUSREL     */
    /* =================== */
    find tTopic where 
         tTopic.tiTopicNumber = 109 and 
         tTopic.tlSelected    = true
         no-error.
    if available tTopic and
      (vcSynchronizeType = {&SYNCHRONIZETYPE-FULL} or
       tTopic.tcSynchronizeType = vcSynchronizeType)
    then do :
        <I-5 {bFcStartAndOpenInstance
             &CLASS                = "BBusinessRelation"}>
        
        output to value (vcSynchroniseLogFile) append.
        put unformatted string (now) '> ':U
            "BBusinessRelation.ApiSynchronise Start":U skip.
        output close.
        
        /*  Set indication in the logging.  */
        publish "Logging.LogSetIndication" (input 'BBusinessRelation':U, output viFcReturnSuper).
                
        <M-7 run ApiSynchronise (output vlUpdatesDone (olUpdatesDone), 
                         output viSynchroniseError (oiReturnStatus)) in BBusinessRelation>
                      
        <I-8 {bFcCloseAndStopInstance
             &CLASS           = "BBusinessRelation"}>
                       
        output to value (vcSynchroniseLogFile) append.
        put unformatted string (now) '> ':U
            "BBusinessRelation.ApiSynchronise End : ":U string (viSynchroniseError) ' ':U string (vlUpdatesDone) skip.
        output close.
                         
        if viSynchroniseError < 0
        or (oiReturnStatus = 0 and viSynchroniseError > 0)
        then assign oiReturnStatus = viSynchroniseError.

        if viSynchroniseError < 0
        then assign tTopic.tcUpdateInformation = #T-89'Update Failed':30(2976562)T-89#.
        else
        if vlUpdatesDone 
        then assign tTopic.tcUpdateInformation = trim(#T-15'Updates Done':30(3760)T-15#).
        else assign tTopic.tcUpdateInformation = trim(#T-16'No Updates Required':30(3761)T-16#).
    end. /* if available tTopic 100 */
                    
    /* =================== */
    /* WHEN SAF CONCEPT    */
    /* =================== */
    find tTopic where 
         tTopic.tiTopicNumber = 110 and 
         tTopic.tlSelected    = true
         no-error.
    if available tTopic and
      (vcSynchronizeType = {&SYNCHRONIZETYPE-FULL} or
       tTopic.tcSynchronizeType = vcSynchronizeType)
    then do :
        <I-9 {bFcStartAndOpenInstance
             &CLASS                = "BSafConcept"}>
        
        output to value (vcSynchroniseLogFile) append.
        put unformatted string (now) '> ':U
            "BSafConcept.ApiSynchronise Start":U skip.
        output close.
        
        /*  Set indication in the logging.  */
        publish "Logging.LogSetIndication" (input 'BSafConcept':U, output viFcReturnSuper).
        
        <M-11 run ApiSynchronise (output vlUpdatesDone (olUpdatesDone), 
                          output viSynchroniseError (oiReturnStatus)) in BSafConcept>
        
        <I-12 {bFcCloseAndStopInstance
             &CLASS           = "BSafConcept"}>
                        
        output to value (vcSynchroniseLogFile) append.
        put unformatted string (now) '> ':U
            "BSafConcept.ApiSynchronise End : ":U string (viSynchroniseError) ' ':U string (vlUpdatesDone) skip.
        output close.
                                
        if viSynchroniseError < 0
        or (oiReturnStatus = 0 and viSynchroniseError > 0)
        then assign oiReturnStatus = viSynchroniseError.

        if viSynchroniseError < 0
        then assign tTopic.tcUpdateInformation = #T-96'Update Failed':30(2976562)T-96#.
        else
        if vlUpdatesDone 
        then assign tTopic.tcUpdateInformation = trim(#T-17'Updates Done':30(3760)T-17#).
        else assign tTopic.tcUpdateInformation = trim(#T-18'No Updates Required':30(3761)T-18#).
    end. /* if available tTopic 120 */ 
    
    /* ===================                        */                                
    /* When China Accounting Interface Reports    */
    /* ===================                         */
    find tTopic where 
         tTopic.tiTopicNumber = 114 and 
         tTopic.tlSelected    = true
         no-error.
    if available tTopic and
      (vcSynchronizeType = {&SYNCHRONIZETYPE-FULL} or
       tTopic.tcSynchronizeType = vcSynchronizeType)
    then do :
        <I-53 {bFcStartAndOpenInstance
             &CLASS                = "BAccountingInterface"}>
        
        output to value (vcSynchroniseLogFile) append.
        put unformatted string (now) '> ':U
            "BAccountingInterface.ApiSynchronise Start":U skip.
        output close.
        
        /*  Set indication in the logging.  */
        publish "Logging.LogSetIndication" (input 'BAccountingInterface':U, output viFcReturnSuper).
                
        <M-59 run ApiSynchronise
           (output vlUpdatesDone (olUpdatesDone), 
            output viSynchroniseError (oiReturnStatus)) in BAccountingInterface>                
        
        <I-56 {bFcCloseAndStopInstance
             &CLASS           = "BAccountingInterface"}>  
             
        output to value (vcSynchroniseLogFile) append.
        put unformatted string (now) '> ':U
            "BAccountingInterface.ApiSynchronise End : ":U string (viSynchroniseError) ' ':U string (vlUpdatesDone) skip.
        output close.
                           
        if viSynchroniseError < 0
        or (oiReturnStatus = 0 and viSynchroniseError > 0)
        then assign oiReturnStatus = viSynchroniseError.

        if viSynchroniseError < 0
        then assign tTopic.tcUpdateInformation = #T-84'Update Failed':30(2976562)T-84#.
        else
        if vlUpdatesDone 
        then assign tTopic.tcUpdateInformation = trim(#T-57'Updates Done':30(3760)T-57#).
        else assign tTopic.tcUpdateInformation = trim(#T-58'No Updates Required':30(62653)T-58#).
    end. /* if available tTopic 114 */            
            
    
    /* ===================                        */                                
    /* When China Accounting Interface Filter     */
    /* ===================                        */
    find tTopic where 
         tTopic.tiTopicNumber = 115 and 
         tTopic.tlSelected    = true
         no-error.
    if available tTopic and
      (vcSynchronizeType = {&SYNCHRONIZETYPE-FULL} or
       tTopic.tcSynchronizeType = vcSynchronizeType)
    then do :
        <I-60 {bFcStartAndOpenInstance
             &CLASS                = "BAcctIFFilters"}>
        
        output to value (vcSynchroniseLogFile) append.
        put unformatted string (now) '> ':U
            "BAcctIFFilters.ApiSynchronise Start":U skip.
        output close.
        
        /*  Set indication in the logging.  */
        publish "Logging.LogSetIndication" (input 'BAcctIFFilters':U, output viFcReturnSuper).
                
        <M-72 run ApiSynchronise
           (output vlUpdatesDone (olUpdatesDone), 
            output viFcReturnSuper (oiReturnStatus)) in BAcctIFFilters>                       

        <I-63 {bFcCloseAndStopInstance
             &CLASS           = "BAcctIFFilters"}>  
             
        output to value (vcSynchroniseLogFile) append.
        put unformatted string (now) '> ':U
            "BAcctIFFilters.ApiSynchronise End : ":U string (viSynchroniseError) ' ':U string (vlUpdatesDone) skip.
        output close.
                           
        if viSynchroniseError < 0
        or (oiReturnStatus = 0 and viSynchroniseError > 0)
        then assign oiReturnStatus = viSynchroniseError.

        if viSynchroniseError < 0
        then assign tTopic.tcUpdateInformation = #T-35'Update Failed':30(2976562)T-35#.
        else
        if vlUpdatesDone 
        then assign tTopic.tcUpdateInformation = trim(#T-64'Updates Done':30(3760)T-64#).
        else assign tTopic.tcUpdateInformation = trim(#T-65'No Updates Required':30(62653)T-65#).
    end. /* if available tTopic 115 */  

    /* ======================== */
    /* WHEN Syst/SysProperty    */
    /* ======================== */
    /*moved to QADFC*/
        
    /* ==================================== */                                
    /* When Bank Account Validations        */
    /* ==================================== */
    find tTopic where 
         tTopic.tiTopicNumber = 116 and 
         tTopic.tlSelected    = true
         no-error.
    if available tTopic and
      (vcSynchronizeType = {&SYNCHRONIZETYPE-FULL} or
       tTopic.tcSynchronizeType = vcSynchronizeType)
    then do :
        <I-79 {bFcStartAndOpenInstance
             &CLASS                = "BBankAccountFormat"}>
        
        output to value (vcSynchroniseLogFile) append.
        put unformatted string (now) '> ':U
            "BBankAccountFormat.ApiSynchronise Start":U skip.
        output close.
        
        /*  Set indication in the logging.  */
        publish "Logging.LogSetIndication" (input 'BBankAccountFormat':U, output viFcReturnSuper).
                
        <M-81 run ApiSynchronise
           (output vlUpdatesDone (olUpdatesDone), 
            output viSynchroniseError (oiReturnStatus)) in BBankAccountFormat>
        
        <I-76 {bFcCloseAndStopInstance
             &CLASS           = "BBankAccountFormat"}>  
             
        output to value (vcSynchroniseLogFile) append.
        put unformatted string (now) '> ':U
            "BBankAccountFormat.ApiSynchronise End : ":U string (viSynchroniseError) ' ':U string (vlUpdatesDone) skip.
        output close.
                           
        if viSynchroniseError < 0
        or (oiReturnStatus = 0 and viSynchroniseError > 0)
        then assign oiReturnStatus = viSynchroniseError.

        if viSynchroniseError < 0
        then assign tTopic.tcUpdateInformation = #T-30'Update Failed':30(2976562)T-30#.
        else
        if vlUpdatesDone 
        then assign tTopic.tcUpdateInformation = trim(#T-77'Updates Done':30(3760)T-77#).
        else assign tTopic.tcUpdateInformation = trim(#T-78'No Updates Required':30(62653)T-78#).
    end. /* if available tTopic 113 */            
            
END. /* SCBATWOSYNCHROBLOCK */