project QadFinancials > class BAPMatching > method GetPendingVouchersNoLogChargesQuery

Description

Submethod of GetPendingVouchersNoLogCharges


Parameters


icAPMatchingTcRowidinputcharactericAPMatchingTcRowid: Rowid (converted to character) of the matching. This corresponds with field tAPMatching.tc_rowid.
icCreditorCodeinputcharacter
idCInvoiceTCLCRateinputdecimal
idCInvoiceTCLCScaleinputdecimal
idCInvoiceTCCCRateinputdecimal
idCInvoiceTCCCScaleinputdecimal
icCurrencyCodeinputcharacter
idCInvoiceTotalAmountTCinputdecimal
idCInvoiceARRecTaxTCinputdecimal
idCInvoiceARNRecTaxTCinputdecimal
itTransactionDateFrominputdate
itTransactionDateTillinputdate
itTransactionDateinputdate
itTransactionDetailDateFrominputdate
itTransactionDetailDateTillinputdate
itTransactionDetailDateinputdate
icExternalReferenceFrominputcharacter
icExternalReferenceToinputcharacter
icExternalReferenceinputcharacter
icInternalReferenceFrominputcharacter
icInternalReferenceToinputcharacter
icInternalReferenceinputcharacter
icShipToFrominputcharacter
icShipToToinputcharacter
icShipToinputcharacter
icItemNumberFrominputcharacter
icItemNumberToinputcharacter
icItemNumberinputcharacter
icBuyerinputcharacter
icApprovedByinputcharacter
icLogisticChargeFrominputcharacter
icLogisticChargeToinputcharacter
icLogisticChargeinputcharacter
icShipFromFrominputcharacter
icShipFromToinputcharacter
icShipFrominputcharacter
ilAutoSelectinputlogical
icPOShipperInvoiceinputcharacter
icOrderListinputcharacter
ilCallGTMinputlogicalilCallGTM: Set to true in case you want this method to call GTM to recalculate the taxes. If false, then the taxes will just be taken from the pending-voucher
iiApiPvodIDinputintegerPending voucher ID (in case of API integration)
iiApiPvodLineIdinputintegerPending voucher line ID (in case of API integration)
idApiMatchUnitPriceinputdecimalApiMatchUnitPrice
Matched unit price (in case of API integration)
idApiMatchQtyinputdecimalApiMatchQty
Match quantity (in case of API integration)
ilApiIsPvodFinishedinputlogicalApiIsPvodFinished
Is Pending voucher finished (in case of API integration)
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BAPMatching.GetPendingVouchersNoLogCharges


program code (program7/bapmatching.p)

/* =================================================================================================================== */
/* GetPendingVouchersNoLogChargesQuery: submethod of GetPendingVouchersNoLogCharges that holds the query-call to query */
/* BMfgPendingVoucher:PendingVoucherForMatchingNoLC(). This metthod can be used for customisations and thus provides   */
/* customers to take actions to extend the content of tqPendingVoucherForMatchingNoLC                                  */
/* =================================================================================================================== */

/* =========================================================== */
/* Query the correct pending-vouchers                          */
/* if company_id = 0 it takes all companies (not only current) */
/* =========================================================== */
<Q-46 run PendingVoucherForMatchingNoLC (all) (Read) (NoCache)
   (input itTransactionDateFrom, (TransactionDateFrom)
    input itTransactionDateTill, (TransactionDateTill)
    input itTransactionDate, (TransactionDate)
    input icExternalReferenceFrom, (ExternalReferenceFrom)
    input icExternalReferenceTo, (ExternalReferenceTo)
    input icExternalReference, (ExternalReference)
    input icInternalReferenceFrom, (InternalReferenceFrom)
    input icInternalReferenceTo, (InternalReferenceTo)
    input icInternalReference, (InternalReference)
    input icShipToFrom, (ShipToFrom)
    input icShipToTo, (ShipToTo)
    input icShipTo, (ShipTo)
    input icItemNumberFrom, (ItemNumberFrom)
    input icItemNumberTo, (ItemNumberTo)
    input icItemNumber, (ItemNumber)
    input icBuyer, (Buyer)
    input icApprovedBy, (ApprovedBy)
    input icCurrencyCode, (CurrencyCode)
    input icOrderList, (OrderList)
    input vcDomainCode, (DomainCode)
    input ?, (CompanyId)
    input iiApiPvodID, (PvoID)
    input iiApiPvodLineId, (PvodIDLine)
    input ?, (CreditorCode)
    input itTransactionDetailDateTill, (TransactionDetailDateTill)
    input itTransactionDetailDateFrom, (TransactionDetailDateFrom)
    input itTransactionDetailDate, (TransactionDetailDate)
    output dataset tqPendingVoucherForMatchingNoLC) in BMfgPendingVoucher>

/* When running APMatching via the normal UI (idApiMatchAmtTC empty) then we will simply not return any Pending-vouchers that relate to Fiscal Receipts */
if idApiMatchQty = 0 or 
   idApiMatchQty = ?
then do :
    if vlDomainIsFiscalConfirm
    then do: 
        for each tqPendingVoucherForMatchingNoLC where
             num-entries(tqPendingVoucherForMatchingNoLC.tcpvo_external_ref,',':U) = 2 :
            assign vcLegalDocumentNbr  = entry(1,tqPendingVoucherForMatchingNoLC.tcpvo_external_ref)
                   vcDateformat        = session:date-format
                   session:date-format = 'ymd'
                   vtEffectiveDate     = date(entry(2,tqPendingVoucherForMatchingNoLC.tcpvo_external_ref))
                   session:date-format = vcDateformat.
    
            <Q-30 run LegalDocumentByLegalDocNbr (all) (Read) (NoCache)
               (input vcDomainCode, (DomainCode)
                input vcLegalDocumentNbr, (LegalDocNbr)
                input vtEffectiveDate, (EffIssueDate)
                input ?, (Supplier)
                output dataset tqLegalDocumentByLegalDocNbr) in BMFGLegalDocument>
     
            find first tqLegalDocumentByLegalDocNbr where
                       tqLegalDocumentByLegalDocNbr.tclgd_domain      = vcDomainCode                                      and
                       tqLegalDocumentByLegalDocNbr.tclgd_nbr         = vcLegalDocumentNbr                                and
                       tqLegalDocumentByLegalDocNbr.ttlgd_effdate     = vtEffectiveDate                                   and
                      (tqLegalDocumentByLegalDocNbr.tclgd_shipfrom    = tqPendingVoucherForMatchingNoLC.tcpvo_supplier    or
                       tqLegalDocumentByLegalDocNbr.tclgd_shipfrom    = tqPendingVoucherForMatchingNoLC.tcpvo_shipto     )and 
                       tqLegalDocumentByLegalDocNbr.tclgdd_order      = tqPendingVoucherForMatchingNoLC.tcpvo_order       and
                       tqLegalDocumentByLegalDocNbr.tilgdd_order_line = tqPendingVoucherForMatchingNoLC.tipvod_order_line
            no-lock no-error.
         
            if available tqLegalDocumentByLegalDocNbr   
            then do:
                delete tqPendingVoucherForMatchingNoLC.
            end. /* if available tqLegalDocumentByLegalDocNbr */
        end. /*for each tqPendingVoucherForMatchingNoLC where */
    end. /*if vlDomainIsFiscalConfirm*/ 
end. /* if idApiMatchQty = 0 or  */