project QadFinancials > class BAPMatchingReport > business logic query CInvoiceForMatchingVariance


Parameters


icFromCreditorCodecharacter
icToCreditorCodecharacter
icCompanyCodecharacter
icFromLogisticChargecharacter
iiCompanyIdinteger
icFromPurchaseOrdercharacter
icToPurchaseOrdercharacter
icFromItemcharacter
icToItemcharacter
itFromInvoiceDatedate
itToInvoiceDatedate
icReceiptSitecharacter
icCurrencyCodecharacter
icToLogisticChargecharacter
ilIsLgChargelogical
itFromInvoicePostingDtdate
itToInvoicePostingDtdate
icOrderTypecharacter
iiDomainIdinteger


query condition


  each CInvoice where
CInvoice.Company_Id = iiCompanyId AND
CInvoice.CInvoiceDate >= itFromInvoiceDate AND
CInvoice.CInvoiceDate <= itToInvoiceDate AND
CInvoice.CInvoicePostingDate >= itFromInvoicePostingDt AND
CInvoice.CInvoicePostingDate <= itToInvoicePostingDt AND
CInvoice.CInvoiceIsLogisticMatching = true

      each APMatching (inner-join) where
APMatching.CInvoice_ID = CInvoice.CInvoice_ID AND
APMatching.APMatchingStatus = {&APMATCHINGSTATUS-FINISHED} AND
APMatching.Company_ID = CInvoice.Company_ID

          each APMatchingLn (inner-join) where
APMatchingLn.APMatching_ID = APMatching.APMatching_ID AND
APMatchingLn.APMatchingLnPvodOrder >= icFromPurchaseOrder AND
APMatchingLn.APMatchingLnPvodOrder <= icToPurchaseOrder AND
APMatchingLn.APMatchingLnPvodItem >= icFromItem AND
APMatchingLn.APMatchingLnPvodItem <= icToItem AND
APMatchingLn.APMatchingLnPvodLgCharge >= icFromLogisticCharge AND
APMatchingLn.APMatchingLnPvodLgCharge <= icToLogisticCharge AND
APMatchingLn.APMatchingLnPvodSite can-do icReceiptSite AND
APMatchingLn.APMatchingLnPvodIsLgCharge = ilIsLgCharge AND
APMatchingLn.APMatchingLnPvodOrderType can-do icOrderType

          first Currency (inner-join) where
Currency.Currency_ID = APMatching.Currency_ID AND
Currency.CurrencyCode can-do icCurrencyCode

      first Company (inner-join) where
Company.Company_Id = iiCompanyId AND
Company.Company_ID = CInvoice.Company_ID AND
Company.CompanyCode can-do icCompanyCode AND
Company.Domain_ID = iiDomainId

      first Creditor (inner-join) where
Creditor.SharedSet_Id = vi_CREDITOR_sharedset(iiCompanyId) AND
Creditor.Creditor_ID = CInvoice.Creditor_ID AND
Creditor.CreditorCode >= icFromCreditorCode AND
Creditor.CreditorCode <= icToCreditorCode

      first Journal (inner-join) where
Journal.SharedSet_Id = vi_JOURNAL_sharedset(iiCompanyId) AND
Journal.Journal_ID = CInvoice.Journal_ID AND

      first Period (inner-join) where
Period.Company_Id = iiCompanyId AND
Period.Period_ID = CInvoice.Period_ID AND


query resultset tqCInvoiceForMatchingVariance


field namedata typedb fielddescription
ttAPMatchingDatedateAPMatching.APMatchingDateDate
tiAPMatchingLn_IDintegerAPMatchingLn.APMatchingLn_IDRecord ID
tlAPMatchingLnIsPvodFinishedlogicalAPMatchingLn.APMatchingLnIsPvodFinishedFinished
tdAPMatchingLnMatchQtydecimalAPMatchingLn.APMatchingLnMatchQtyMatched Quantity
tdAPMatchingLnMatchUnitPricedecimalAPMatchingLn.APMatchingLnMatchUnitPriceMatched Unit Price
tdAPMatchingLnPvodExchRatedecimalAPMatchingLn.APMatchingLnPvodExchRateExchange Rate
tdAPMatchingLnPvodExchRate2decimalAPMatchingLn.APMatchingLnPvodExchRate2Exchange Rate 2
tlAPMatchingLnPvodIsLgChargelogicalAPMatchingLn.APMatchingLnPvodIsLgChargeLog Charge
tcAPMatchingLnPvodItemcharacterAPMatchingLn.APMatchingLnPvodItemItem
tcAPMatchingLnPvodItemDescr1characterAPMatchingLn.APMatchingLnPvodItemDescr1Item Description
tcAPMatchingLnPvodItemTypecharacterAPMatchingLn.APMatchingLnPvodItemTypePossible values: Normal, Memo or Sub-contract
tcAPMatchingLnPvodLgChargecharacterAPMatchingLn.APMatchingLnPvodLgChargeLogistic Charge
tdAPMatchingLnPvodOpenQtydecimalAPMatchingLn.APMatchingLnPvodOpenQtyOpen Quantity
tcAPMatchingLnPvodOrdercharacterAPMatchingLn.APMatchingLnPvodOrderOrder
tiAPMatchingLnPvodOrderLnNbrintegerAPMatchingLn.APMatchingLnPvodOrderLnNbrOrder Line Nbr
tdAPMatchingLnPvodReceiptQtydecimalAPMatchingLn.APMatchingLnPvodReceiptQtyReceipt Quantity
tcAPMatchingLnPvodSitecharacterAPMatchingLn.APMatchingLnPvodSiteAPMatchingLnPvodSite
tcAPMatchingLnPvodUoMcharacterAPMatchingLn.APMatchingLnPvodUoMGL Unit of Measure
tdAPMatchingLnReceiptAmtLCdecimalAPMatchingLn.APMatchingLnReceiptAmtLCBC Receipt Amt
tdAPMatchingLnVarExchRateLCdecimalAPMatchingLn.APMatchingLnVarExchRateLCBC Exch Rate Variance
tdAPMatchingLnVarRateLCdecimalAPMatchingLn.APMatchingLnVarRateLCBC Rate Variance
tdAPMatchingLnVarRateTCdecimalAPMatchingLn.APMatchingLnVarRateTCTC Rate Variance
tdAPMatchingLnVarUsageLCdecimalAPMatchingLn.APMatchingLnVarUsageLCBC Usage Variance
tdAPMatchingLnVarUsageTCdecimalAPMatchingLn.APMatchingLnVarUsageTCTC Usage Variance
tcAPMatchingStatuscharacterAPMatching.APMatchingStatusStatus
tiCInvoice_IDintegerCInvoice.CInvoice_IDRecord ID
ttCInvoiceDatedateCInvoice.CInvoiceDateInvoice Date. This field indicates the invoice creation date.
The system uses this field with the credit terms to calculate due date and discount date.
api annotation:This field defaults from the system date.
tdCInvoiceExchangeRatedecimalCInvoice.CInvoiceExchangeRateExchange Rate. The exchange rate used by the invoice.
The BC Invoice Amount is calculated based on the exchange rate.
If user modify the TC Invoice Amount, the BC invoice amount is automatically adjusted.
tlCInvoiceIsLogisticMatchinglogicalCInvoice.CInvoiceIsLogisticMatchingReceiver Matching.This field indicates If the Receiver Matching function is enabled.
This field is calculated by the system using the invoice status code.
tcCinvoiceJournalcharacterJournal.JournalCodeA daybook code (maximum eight characters).
ttCInvoicePostingDatedateCInvoice.CInvoicePostingDatePosting Date. This filed indicates the date on which the invoice is to be posted.
api annotation:This field defaults from the invoice creation date.
tdCInvoiceRateScaledecimalCInvoice.CInvoiceRateScaleScale Factor. This field indicates the scale factor applying to the exchange rate in use for foreign currency payments.
tcCInvoiceReferencecharacterCInvoice.CInvoiceReferenceReference. An alphanumeric reference to help identify the invoice in the system.
This reference is typically the ID number of the invoice received from the supplier.
tiCInvoiceVoucherintegerCInvoice.CInvoiceVoucherVoucher. This field displays the numeric identifier assigned to the posting.
When the daybook of the journal entry is changed (after transfer), the voucher is cleared.
Voucher must be unique in one GL period.
When the user input is zero, the system automatically assign a value not used yet for this field.
tcCompanyCodecharacterCompany.CompanyCodeEntity Code
tcCreditorCodecharacterCreditor.CreditorCodeSupplier Code
tcCurrencyCodecharacterCurrency.CurrencyCodeCurrency Code
tcMatchingTypecharactercalculated
tiPeriodYearintegerPeriod.PeriodYearGL Calendar Year
tiPvodLineIDintegerAPMatchingLn.PvodLineIDPinv Line ID
tcPvoDomaincharacterAPMatchingLn.PvoDomainDomain
tiPvoIDintegerAPMatchingLn.PvoIDPinv ID
tiPvoPostingLine_IDintegerAPMatchingLn.PvoPostingLine_IDLink to PostingLine
tiVarExchRatePostingLine_IDintegerAPMatchingLn.VarExchRatePostingLine_IDExch Rate Posting Line
tiVarRatePostingLine_IDintegerAPMatchingLn.VarRatePostingLine_IDLink to PostingLine
tiVarUsagePostingLine_IDintegerAPMatchingLn.VarUsagePostingLine_IDLink to PostingLine


Internal usage


QadFinancials
method BAPMatchingReport.MatchingVariance
method BAPMatchingReport.MatchingVarianceForLC
dataset BAPMatchingReport.tGetMatchingVariance