project QadFinancials > class BAPMatchingReport > method CalcAllCInvoiceForMatchingVariance

query calculated fields procedure

Description

Calculate the field MatchingType for the query CInvoiceForMatchingVariance.


Parameters


icFromCreditorCodeinputcharacter
icToCreditorCodeinputcharacter
icCompanyCodeinputcharacter
icFromLogisticChargeinputcharacter
iiCompanyIdinputinteger
icFromPurchaseOrderinputcharacter
icToPurchaseOrderinputcharacter
icFromIteminputcharacter
icToIteminputcharacter
itFromInvoiceDateinputdate
itToInvoiceDateinputdate
icReceiptSiteinputcharacter
icCurrencyCodeinputcharacter
icToLogisticChargeinputcharacter
ilIsLgChargeinputlogical
itFromInvoicePostingDtinputdate
itToInvoicePostingDtinputdate
icOrderTypeinputcharacter
iiDomainIdinputinteger
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
query CInvoiceForMatchingVariance


program code (program1/bapmatchingreport.p)

assign vcFinancialMatching = {&INVOICEMATCHING-FINANCIAL-TR}
           vcReceiverMatching  = {&INVOICEMATCHING-RECEIVER-TR}.
       
    create query vhQuery in widget-pool "non-persistent".
    vhQuery:forward-only = yes.
    vhQuery:set-buffers(ih_Buffer).
    vhQuery:query-prepare("for each ":U + ih_Buffer:table).
    vhQuery:query-open().
    vhQuery:get-first().
    do while not vhQuery:query-off-end:
        assign {&tcMatchingType} = (if {&tlCInvoiceIsLogisticMatching} = false
                                        then vcFinancialMatching
                                        else if {&tlCInvoiceIsLogisticMatching} = true
                                             then vcReceiverMatching
                                             else "?":U).
        vhQuery:get-next().
    end.
    vhQuery:query-close().
    delete object vhQuery.