project QadFinancials > class BAPMatchingReport > business logic query CInvoiceForMatchingPosting


Parameters


iiCompanyIdintegerCompany id
icFromCreditorCodecharacter
icToCreditorCodecharacter
icFromInvoiceJournalcharacter
icToInvoiceJournalcharacter
icFromInvoiceVouchercharacter
icToInvoiceVouchercharacter
icInvoiceReferencecharacter
ilIsLogisticMatchinglogical
iiInvoiceNumberinteger
itFromInvoiceDatedate
itToInvoiceDatedate
itInvoiceDatedate
iiCreditorIDinteger
iiPeriod_IDinteger
iiJournal_IDinteger


query condition


  each CInvoice where
CInvoice.Company_Id = iiCompanyId AND
CInvoice.CInvoiceVoucher >= icFromInvoiceVoucher AND
CInvoice.CInvoiceVoucher <= icToInvoiceVoucher AND
CInvoice.CInvoiceIsLogisticMatching = ilIsLogisticMatching AND
CInvoice.CInvoiceReference can-do icInvoiceReference AND
CInvoice.Creditor_ID = iiCreditorID AND
CInvoice.CInvoiceDate = itInvoiceDate AND
CInvoice.CInvoiceDate <= itToInvoiceDate AND
CInvoice.CInvoiceDate >= itFromInvoiceDate AND
CInvoice.CInvoiceVoucher = iiInvoiceNumber AND
CInvoice.Journal_ID = iiJournal_ID AND
CInvoice.Period_ID = iiPeriod_ID

      each CInvoicePosting (conditional-join) where
CInvoicePosting.CInvoice_ID = CInvoice.CInvoice_ID AND

          first Posting (conditional-join) where
Posting.Company_Id = iiCompanyId AND
Posting.Posting_ID = CInvoicePosting.Posting_ID AND

              each PostingLine (conditional-join) where
PostingLine.Company_Id = iiCompanyId AND
PostingLine.Posting_ID = Posting.Posting_ID AND

                  first CostCentre (conditional-join) where
CostCentre.SharedSet_Id = vi_COSTCENTRE_sharedset(iiCompanyId) AND
CostCentre.CostCentre_ID = PostingLine.CostCentre_ID AND

                  first Currency (conditional-join) where
Currency.Currency_ID = PostingLine.Currency_ID AND

                  first Division (conditional-join) where
Division.SharedSet_Id = vi_DIVISION_sharedset(iiCompanyId) AND
Division.Division_ID = PostingLine.Division_ID AND

                  first GL (conditional-join) where
GL.SharedSet_Id = vi_GL_sharedset(iiCompanyId) AND
GL.GL_ID = PostingLine.GL_ID AND

                  first Project (conditional-join) where
Project.SharedSet_Id = vi_PROJECT_sharedset(iiCompanyId) AND
Project.Project_ID = PostingLine.Project_ID AND

      first Company (inner-join) where
Company.Company_Id = iiCompanyId AND
Company.Company_ID = CInvoice.Company_ID AND

          each CompanyProperty (inner-join) where
CompanyProperty.Company_Id = iiCompanyId AND
CompanyProperty.Company_ID = Company.Company_ID AND

      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
Journal.JournalCode >= icFromInvoiceJournal AND
Journal.JournalCode <= icToInvoiceJournal


query resultset tqCInvoiceForMatchingPosting


field namedata typedb fielddescription
tiCompanyPropertyQtyNumDecintegerCompanyProperty.CompanyPropertyQtyNumDecDecimals for Qty
tiCostCentre_IDintegerCostCentre.CostCentre_IDRecord ID
tcCostCentreCodecharacterCostCentre.CostCentreCodeCost Center: A code that identifies the cost center.
tcCurrencyCodecharacterCurrency.CurrencyCodeCurrency Code
tiDivision_IDintegerDivision.Division_IDRecord ID
tcDivisionCodecharacterDivision.DivisionCodeSub-Account
tiGL_IDintegerGL.GL_IDRecord ID
tcGLCodecharacterGL.GLCodeA code identifying the GL account.
tiProject_IDintegerProject.Project_IDRecord ID
tcProjectCodecharacterProject.ProjectCodeProject
tiPostingLine_IDintegerPostingLine.PostingLine_IDRecord ID
tdPostingLineCreditCCdecimalPostingLine.PostingLineCreditCCSC Credit
api annotation:Partial Update = yes - it will get a default value depending on the value of PostingLinCreditTC, PostingLineCCRate & PostingLineCCScale.
SC Amount = TC Amount * Exchange rate (TC/SC) * Scale Factor (TC/SC). If Partial Update is false, you should enter the correct value for this field
tdPostingLineCreditLCdecimalPostingLine.PostingLineCreditLCBC Credit
api annotation:Partial Update = yes - it will get a default value depends on the value of PostingLineCreditTC, PostingLineExchangeRate & PostingLineRateScale.
BC Amount = TC Amount * Exchange rate (TC/BC) * Scale Factor (TC/BC). If Partial Update is false, enter a value for this field.
tdPostingLineCreditTCdecimalPostingLine.PostingLineCreditTCTC Credit
tdPostingLineDebitCCdecimalPostingLine.PostingLineDebitCCSC Debit
api annotation:Partial Update = yes - it will get a default value depending on the value of PostingLineDebitTC, PostingLineCCRate & PostingLineCCScale.
SC Amount = TC Amount * Exchange rate (TC/SC) * Scale Factor (TC/SC). If Partial Update is false, enter the correct value for this field.
tdPostingLineDebitLCdecimalPostingLine.PostingLineDebitLCBC Debit
api annotation:Partial Update = yes - it will get a default value depending on the value of PostingLineDebitTC, PostingLineExchangeRate and PostingLineRateScale.
BC Amount = TC Amount * Exchange rate (TC/BC) * Scale Factor (TC/BC). If Partial Update = false, enter the correct value into this field.
tdPostingLineDebitTCdecimalPostingLine.PostingLineDebitTCTC Debit
tiPosting_IDintegerPosting.Posting_IDRecord ID
tiCInvoicePosting_IDintegerCInvoicePosting.CInvoicePosting_IDRecord ID
tcCInvoicePostingTypecharacterCInvoicePosting.CInvoicePostingTypeInvoice Type. This field displays the invoice type.
Invoice Correction and Credit Note Correction display as choices only when the appropriate daybook types have already been defined.
tcCompanyCodecharacterCompany.CompanyCodeEntity Code
tiCInvoice_IDintegerCInvoice.CInvoice_IDRecord ID
tcCInvoiceAllocationStatuscharacterCInvoice.CInvoiceAllocationStatusAllocation Status.This field indicates whether postings occur and if they affect transient or official layers.
User can not delete an invoice which has a non-initial invoice status code.
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.
tiCurrencyNumberOfDecimalsintegerCurrency.CurrencyNumberOfDecimalsNumber of Decimals


Internal usage


QadFinancials
method BAPMatchingReport.InvoiceMatching