project QadFinancials > class BDDocument > method ValidateComponentPreInvXref


Parameters


oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BDDocument.ValidateComponentPre


program code (program4/bddocument.p)

/* ====================================================================================== *
 * Method       : ValidateComponentPreInvXref                                             *
 * Description  : Complete calcualted fields in DDocumentInvoiceXrefTable                 *
 * -------------------------------------------------------------------------------------- *
 * Parameters   :                                                                         *
 * ====================================================================================== */
 
assign oiReturnStatus = -98
       viLocalReturn  = 0.

MAIN_BLOCK:
do on error undo, return:
    for each t_sDDocument,
        each t_sDDocumentInvoiceXref where
             t_sDDocumentInvoiceXref.tc_ParentRowid = t_sDDocument.tc_Rowid and
             t_sDDocumentInvoiceXref.tc_Status <> "D":U
             on error undo, throw:
        

        /* ====================================================================================== *
         * Customer invoice                                                                       *
         * ====================================================================================== */
        if t_sDDocumentInvoiceXref.DInvoice_ID <> ? and
           t_sDDocumentInvoiceXref.DInvoice_ID <> 0
        then do:
            <M-76 run ValidateComponentPreInvXrefDI  (output viFcReturnSuper (oiReturnStatus)) in BDDocument>
            if viFcReturnSuper < 0 or viLocalReturn = 0 then assign viLocalReturn = viFcReturnSuper.
            if viFcReturnSuper < 0 then leave MAIN_BLOCK.
        end. /* of if t_sDDocumentInvoiceXref.DInvoice_ID <> ? and */

        /* ====================================================================================== *
         * Prepayment                                                                             *
         * ====================================================================================== */
        else do:
            <M-7 run ValidateComponentPreInvXrefPrep  (output viFcReturnSuper (oiReturnStatus)) in BDDocument>
            if viFcReturnSuper < 0 or viLocalReturn = 0 then assign viLocalReturn = viFcReturnSuper.
            if viFcReturnSuper < 0 then leave MAIN_BLOCK.
        end. 
    end. /* of for each t_sDDocument, */
end. /* MAIN_BLOCK */

/* Error handling */
assign oiReturnStatus = viLocalReturn.