project QadFinancials > class BCInvoice > method ClearAllData

Description

Clear data in this component and all components that were already started.


Parameters


oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BCInvoice.ReverseCInvoice


program code (program6/bcinvoice.p)

assign viLocalReturnStatus = 0
       oiReturnStatus      = -98.

CLEARBLOCK:
do:
    /* BJOURNALENTRY */    
    if viBJournalEntryCIID <> 0 and viBJournalEntryCIID <> ?
    then do:
        <I-47 {bFcOpenInstance
             &CLASS           = "BJournalEntry"}>
        
        <M-39 run ClearData  (output viFcReturnSuper (oiReturnStatus)) in BJournalEntry>
        if viFcReturnSuper <> 0
        then assign viLocalReturnStatus = viFcReturnSuper.
        
        <I-67 {bFcCloseInstance
             &CLASS           = "BJournalEntry"}>             
        if viLocalReturnStatus < 0
        then leave CLEARBLOCK.
    end. /* if viBJournalEntryCIID <> 0 and viBJournalEntryCIID <> ? */
    
    /* BAPMATCHING */
    if viBAPMatchingCIID <> 0 and viBAPMatchingCIID <> ?
    then do:
        <I-72 {bFcOpenInstance
             &CLASS           = "BAPMatching"}>
             
        <M-61 run ClearData  (output viFcReturnSuper (oiReturnStatus)) in BAPMatching>
        if viFcReturnSuper <> 0
        then assign viLocalReturnStatus = viFcReturnSuper.        
             
        <I-24 {bFcCloseInstance
             &CLASS           = "BAPMatching"}>     
        if viLocalReturnStatus < 0
        then leave CLEARBLOCK.             
    end. /* if viBAPMatchingCIID <> 0 and viBAPMatchingCIID <> ? */
    
    /* BQCINVOICEMOVEMENT */
    if viBQCInvoiceMovementID <> 0 and viBQCInvoiceMovementID <> ?
    then do:
        <I-23 {bFcOpenInstance
             &CLASS           = "BQCInvoiceMovement"}>

        <M-75 run ClearData  (output viFcReturnSuper (oiReturnStatus)) in BQCInvoiceMovement>
        if viFcReturnSuper <> 0
        then assign viLocalReturnStatus = viFcReturnSuper.        
             
        <I-4 {bFcCloseInstance
             &CLASS           = "BQCInvoiceMovement"}>  
        if viLocalReturnStatus < 0
        then leave CLEARBLOCK.          
    end. /* if viBQCInvoiceMovementID <> 0 and viBQCInvoiceMovementID <> ? */
    
    /* BWORKOBJECT */
    if viBWorkObjectID <> 0 and viBWorkObjectID <> ?
    then do:
        <I-14 {bFcOpenInstance
             &CLASS           = "BWorkObject"}>

        <M-43 run ClearData  (output viFcReturnSuper (oiReturnStatus)) in BWorkObject>
        if viFcReturnSuper <> 0
        then assign viLocalReturnStatus = viFcReturnSuper.
                     
        <I-66 {bFcCloseInstance
             &CLASS           = "BWorkObject"}>     
        if viLocalReturnStatus < 0
        then leave CLEARBLOCK.                       
    end. /* if viBWorkObjectID <> 0 and viBWorkObjectID <> ? */
    
    /* BPAYMENTCONDITION */
    if viBPaymentConditionCIID <> 0 and viBPaymentConditionCIID <> ?
    then do:
        <I-74 {bFcOpenInstance
             &CLASS           = "BPaymentCondition"}>
        
        <M-89 run ClearData  (output viFcReturnSuper (oiReturnStatus)) in BPaymentCondition>         
        if viFcReturnSuper <> 0
        then assign viLocalReturnStatus = viFcReturnSuper.
        
        <I-82 {bFcCloseInstance
             &CLASS           = "BPaymentCondition"}>
        if viLocalReturnStatus < 0
        then leave CLEARBLOCK.                       
    end. /* if viBPaymentConditionCIID <> 0 and viBPaymentConditionCIID <> ? */       
            
    /* BQCROSSCYPOSTING */
    if viBQCrossCyPostingID <> 0 and viBQCrossCyPostingID <> ?
    then do:
        <I-54 {bFcOpenInstance
             &CLASS           = "BQCrossCyPosting"}>
             
        <M-6 run ClearData  (output viFcReturnSuper (oiReturnStatus)) in BQCrossCyPosting>     
        if viFcReturnSuper <> 0
        then assign viLocalReturnStatus = viFcReturnSuper.
    
        <I-46 {bFcCloseInstance
             &CLASS           = "BQCrossCyPosting"}>
        if viLocalReturnStatus < 0
        then leave CLEARBLOCK.                           
    end. /* if viBQCrossCyPostingID <> 0 and viBQCrossCyPostingID <> ? */
    
    /* BDOCUMENTLINK */
    if viBDocumentLinkCIID <> 0 and viBDocumentLinkCIID <> ?
    then do:
        <I-20 {bFcOpenInstance
             &CLASS           = "BDocumentLink"}>
             
        <M-35 run ClearData  (output viFcReturnSuper (oiReturnStatus)) in BDocumentLink>     
        if viFcReturnSuper <> 0
        then assign viLocalReturnStatus = viFcReturnSuper.
        
        <I-31 {bFcCloseInstance
             &CLASS           = "BDocumentLink"}>
        if viLocalReturnStatus < 0
        then leave CLEARBLOCK.                       
    end. /* if viBDocumentLinkCIID <> 0 and viBDocumentLinkCIID <> ? */
    
    /* BCINVOICE */
    <M-21 run ClearData  (output viFcReturnSuper (oiReturnStatus)) in BCInvoice>
    if viFcReturnSuper <> 0
    then assign viLocalReturnStatus = viFcReturnSuper.
    if viFcReturnSuper < 0
    then leave CLEARBLOCK.    
end. /* CLEARBLOCK */    
 
assign oiReturnStatus = viLocalReturnStatus.