project QadFinancials > class BAPMatching > method ValCInvoice

validation procedure


Parameters


icTargetFieldinputcharacterValue of the business field to validate.
icTargetFieldNameinputcharacterName of the business field to validate.
icRowidinputcharacterContents of field tc_Rowid, if the target field is a field of a component temp-table.
icYearJournalVoucherinputcharacterYear + / + Journal + / + Voucher
icCInvoiceTypeinputcharacter
ilCInvoiceIsLogisticMatchinginputlogical
icCInvoiceAllocationStatusinputcharacter
ilCInvoiceIsInvoiceApprovedinputlogical
iiCInvoiceCompanyIDinputinteger
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BAPMatching.DefaultValuesInvoice
validation on relation CINVOICEINAPMATCHING


program code (program4/bapmatching.p)

if icCInvoiceType <> {&INVOICETYPE-INVOICE}             and
       icCInvoiceType <> {&INVOICETYPE-CREDITNOTE}          and 
       icCInvoiceType <> {&INVOICETYPE-INVOICECORRECTION}   and
       icCInvoiceType <> {&INVOICETYPE-CREDITNOTECORRECTION}
    then do:
        assign vcMsgAPMatching = trim(substitute(#T-8'The invoice (&1-&2) must be of type &3, &4, &5, or &6.':255(69242)t-8#,icYearJournalVoucher, icTargetField,{&INVOICETYPE-INVOICE-TR},{&INVOICETYPE-CREDITNOTE-TR},{&INVOICETYPE-INVOICECORRECTION-TR},{&INVOICETYPE-CREDITNOTECORRECTION-TR}))
               oiReturnStatus  = -1.
        <M-13 run SetMessage
           (input  vcMsgAPMatching (icMessage), 
            input  '':U (icArguments), 
            input  icTargetFieldName (icFieldName), 
            input  icTargetField (icFieldValue), 
            input  'E':U (icType), 
            input  3 (iiSeverity), 
            input  icRowid (icRowid), 
            input  'QadFin-7964':U (icFcMsgNumber), 
            input  '':U (icFcExplanation), 
            input  '':U (icFcIdentification), 
            input  '':U (icFcContext), 
            output viFcReturnSuper (oiReturnStatus)) in BAPMatching>
    end.
    
    if ilCInvoiceIsLogisticMatching <> true
    then do:
        assign vcMsgAPMatching = trim(substitute(#T-10'You must select the Receiver Matching field for the invoice (&1-&2).':255(69222)t-10#,icYearJournalVoucher,icTargetField))
               oiReturnStatus  = -1.
        <M-9 run SetMessage
           (input  vcMsgAPMatching (icMessage), 
            input  '':U (icArguments), 
            input  icTargetFieldName (icFieldName), 
            input  icTargetField (icFieldValue), 
            input  'E':U (icType), 
            input  3 (iiSeverity), 
            input  icRowid (icRowid), 
            input  'QadFin-7963':U (icFcMsgNumber), 
            input  '':U (icFcExplanation), 
            input  '':U (icFcIdentification), 
            input  '':U (icFcContext), 
            output viFcReturnSuper (oiReturnStatus)) in BAPMatching>
    end.
    
    if icCInvoiceAllocationStatus <> {&ALLOCSTATUS-NOALLOC}
    then do:
        assign vcMsgAPMatching = trim(substitute(#T-11'The invoice (&1-&2) must have allocation status &3.':255(69223)t-11#,icYearJournalVoucher,icTargetField,{&ALLOCSTATUS-NOALLOC-TR}))
               oiReturnStatus  = -1.
        <M-14 run SetMessage
           (input  vcMsgAPMatching (icMessage), 
            input  '':U (icArguments), 
            input  icTargetFieldName (icFieldName), 
            input  icTargetField (icFieldValue), 
            input  'E':U (icType), 
            input  3 (iiSeverity), 
            input  icRowid (icRowid), 
            input  'QadFin-7965':U (icFcMsgNumber), 
            input  '':U (icFcExplanation), 
            input  '':U (icFcIdentification), 
            input  '':U (icFcContext), 
            output viFcReturnSuper (oiReturnStatus)) in BAPMatching>
    end.
    
    if iiCInvoiceCompanyID <> viCompanyId
    then do:
        assign vcMsgAPMatching = trim(substitute(#T-12'The invoice (&1-&2) must be located in the current entity.':255(69224)t-12#,icYearJournalVoucher,icTargetField))
               oiReturnStatus  = -1.
        <M-5 run SetMessage
           (input  vcMsgAPMatching (icMessage), 
            input  '':U (icArguments), 
            input  icTargetFieldName (icFieldName), 
            input  icTargetField (icFieldValue), 
            input  'E':U (icType), 
            input  3 (iiSeverity), 
            input  icRowid (icRowid), 
            input  'QadFin-5646':U (icFcMsgNumber), 
            input  '':U (icFcExplanation), 
            input  '':U (icFcIdentification), 
            input  '':U (icFcContext), 
            output viFcReturnSuper (oiReturnStatus)) in BAPMatching>
    end.