project QadFinancials > class BAPMatchingReport > business logic query CInvoiceForUnmatchedReceipt


Parameters


iiCompanyIdintegerCompany id
icFromCreditorCodecharacter
icToCreditorCodecharacter
icFromInvoiceJournalcharacter
icToInvoiceJournalcharacter
icFromInvoiceVouchercharacter
icToInvoiceVouchercharacter
itFromPostingDatedate
itToPostingDatedate
icInvoiceReferencecharacter
ilIsLogisticMatchinglogical
iiPeriod_IDinteger
iiJournal_IDinteger
iiCreditorIDinteger


query condition


  each CInvoice where
CInvoice.Company_Id = iiCompanyId AND
CInvoice.CInvoiceVoucher >= icFromInvoiceVoucher AND
CInvoice.CInvoiceVoucher <= icToInvoiceVoucher AND
CInvoice.CInvoicePostingDate >= itFromPostingDate AND
CInvoice.CInvoicePostingDate <= itToPostingDate AND
CInvoice.CInvoiceIsLogisticMatching = ilIsLogisticMatching AND
CInvoice.CInvoiceReference can-do icInvoiceReference AND
CInvoice.CInvoiceAllocationStatus = {&ALLOCSTATUS-NOALLOC} AND
CInvoice.Creditor_ID = iiCreditorID AND
CInvoice.Journal_ID = iiJournal_ID AND
CInvoice.Period_ID = iiPeriod_ID

      each APMatching (conditional-join) where
APMatching.Company_Id = iiCompanyId AND
APMatching.CInvoice_ID = CInvoice.CInvoice_ID AND

      each CInvoicePosting (inner-join) where
CInvoicePosting.CInvoice_ID = CInvoice.CInvoice_ID AND
CInvoicePosting.CInvoicePostingType = {&INVOICEPOSTINGTYPE-INITIAL}

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

              first Journal1 (inner-join) where
Journal1.SharedSet_Id = vi_JOURNAL_sharedset(iiCompanyId) AND
Journal1.Journal_ID = Posting.Journal_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 BusinessRelation (inner-join) where
BusinessRelation.BusinessRelation_ID = Creditor.BusinessRelation_ID AND

              each Address (inner-join) where
Address.BusinessRelation_ID = BusinessRelation.BusinessRelation_ID AND

                  first AddressType (inner-join) where
AddressType.AddressType_ID = Address.AddressType_ID AND
AddressType.AddressTypeCode = {&ADDRESSTYPECODESYSTEM-HEADOFFICE}

                  first Country (inner-join) where
Country.Country_ID = Address.Country_ID AND

      first Currency (inner-join) where
Currency.Currency_ID = CInvoice.CInvoiceCurrency_ID AND

      first Journal2 (inner-join) where
Journal2.SharedSet_Id = vi_JOURNAL_sharedset(iiCompanyId) AND
Journal2.Journal_ID = CInvoice.Journal_ID AND
Journal2.JournalCode >= icFromInvoiceJournal AND
Journal2.JournalCode <= icToInvoiceJournal


query resultset tqCInvoiceForUnmatchedReceipt


field namedata typedb fielddescription
tcAddressCitycharacterAddress.AddressCityCity. The city for this address. This field can be used to decide the tax zone of the address.
tcAddressCountycharacterAddress.AddressCountyObsolete field
tcAddressNamecharacterAddress.AddressNameName. The full name of this particular address.
The name of a headoffice address is the same as the name of the business relationship and can not be modified.
api annotation:PartialUpdate = yes - defaults to the name of the businessRelation.
tcAddressZipcharacterAddress.AddressZipZip. The postal code or US zip code associated with this address.
This field is used to decide the tax zone for the address.
This field can be blank.
ttAPMatchingDatedateAPMatching.APMatchingDateDate
tcAPMatchingStatuscharacterAPMatching.APMatchingStatusStatus
tcBusinessRelationCodecharacterBusinessRelation.BusinessRelationCodeBusiness Relation. A code to identify the business relation.
If this field does not have a input from the user, the system automatically generates a number for the record based on the sequence defined in Business Relation Autonumber Create.
tcBusinessRelationNamecharacterBusinessRelation.BusinessRelationName1Name: The full name of the business relation.
This field sets the default name for linked addresses such as customers and suppliers.
api annotation:PartialUpdate = yes - defaults to the BusinessRelationCode.
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.
tcCInvoiceCurrencycharacterCurrency.CurrencyCodeCurrency Code
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.
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.
tcCinvoiceJournalcharacterJournal2.JournalCodeA daybook code (maximum eight characters).
tdCInvoiceOriginalCreditCCdecimalCInvoice.CInvoiceOriginalCreditCCSC Invoice Amount (CR). This field displays the credit total invoice amount in the statutory currency.
This field is calculated by the system using the TC Invoice Amount(CR) and the SC Rate.
tdCInvoiceOriginalCreditLCdecimalCInvoice.CInvoiceOriginalCreditLCBC Invoice Amount(CR). This field displays the credit total invoice amount in the base currency.
This field is calculated by the system using the TC Invoice Amount(CR) and the Exchange rate.
tdCInvoiceOriginalCreditTCdecimalCInvoice.CInvoiceOriginalCreditTCTC Invoice Amount CR. This field displays the credit total invoice amount in the transaction currency.
If you modify this field, the system automatically recalculates the exchange rate to ensure that the BC Invoice Amount remains the same.
tdCInvoiceOriginalDebitCCdecimalCInvoice.CInvoiceOriginalDebitCCSC Invoice Amount (DR). This field displays the debit total invoice amount in the statutory currency.
This field is calculated by the system using the TC Invoice Amount(CR) and the SC Rate.
tdCInvoiceOriginalDebitLCdecimalCInvoice.CInvoiceOriginalDebitLCBC Invoice Amount(DR). This field displays the debit total invoice amount in the base currency.
This field is calculated by the system using the TC Invoice Amount(DR) and the Exchange rate.
tdCInvoiceOriginalDebitTCdecimalCInvoice.CInvoiceOriginalDebitTCTC AP Amount. This field displays the debit total invoice amount in the transaction currency.
If you modify this field, the system automatically recalculates the exchange rate to ensure that the TC Invoice Amount remains the same.
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.
tiCInvoicePostingYearintegerCInvoice.CInvoicePostingYearYear.This field indicates the accounting year for the invoice.
If you modify these fields, the posting and tax dates are changed correspondingly.
api annotation:This field defaults to the accounting year associated with the posting date.
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
tiCompanyPropertyQtyNumDecintegerCompanyProperty.CompanyPropertyQtyNumDecDecimals for Qty
tiCountry_IDintegerCountry.Country_IDRecord ID
tcCountryCodecharacterCountry.CountryCodeCountry Code
tcCountryDescriptioncharacterCountry.CountryDescriptionDescription
tcCreditorCodecharacterCreditor.CreditorCodeSupplier Code
tiCurrencyNumberOfDecimalsintegerCurrency.CurrencyNumberOfDecimalsNumber of Decimals
tcJournalCodecharacterJournal1.JournalCodeA daybook code (maximum eight characters).
tiPostingVoucherintegerPosting.PostingVoucherVoucher is a sequential number that uniquely identifies the journal entry (within the combination of an entity and a daybook code).
api annotation:In create mode,enter 0 in this field - the voucher number is generated by the system. In Modify/Delete, the correct voucher number must be entered because this identifies the record.
tiPostingYearintegerPosting.PostingYearThe GL calendar year for the posting.


Internal usage


QadFinancials
method BAPMatchingReport.InvoiceMatching