project QadFinancials > class BCInvoice > business logic query CInvoiceByCreditorAllInfo

Description

Get supplier invoice by selected company,supplier, invoice date from date to.


Parameters


iiCompanyIdintegerCompany id
iiCreditorIDinteger
itInvoiceStartDatedate
itInvoiceEndDatedate
ilCInvoiceIsOpenlogical
icCompanyListIDcharacter
icCreditorCodecharacter
itCInvoiceDatedate
icCreditorCodeListcharacter


query condition


  each CInvoice where
CInvoice.Company_Id = iiCompanyId AND
CInvoice.Creditor_ID = iiCreditorID AND
CInvoice.CInvoiceDate <= itInvoiceEndDate AND
CInvoice.CInvoiceDate >= itInvoiceStartDate AND
CInvoice.CInvoiceIsOpen = ilCInvoiceIsOpen AND
string(CInvoice.Company_ID) can-do icCompanyListID AND
CInvoice.CInvoiceDate = itCInvoiceDate

      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 Currency2 (inner-join) where
Currency2.Currency_ID = CompanyProperty.Currency_ID AND

      first Creditor (inner-join) where
Creditor.SharedSet_Id = vi_CREDITOR_sharedset(iiCompanyId) AND
Creditor.Creditor_ID = CInvoice.Creditor_ID AND
Creditor.CreditorCode = icCreditorCode AND
Creditor.CreditorCode can-do icCreditorCodeList

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

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

      first Reason (inner-join) where
Reason.Reason_ID = CInvoice.Reason_ID AND


query resultset tqCInvoiceByCreditorAllInfo


field namedata typedb fielddescription
tcBaseCurrencyCodecharacterCurrency2.CurrencyCodeCurrency Code
tiCInvoice_IDintegerCInvoice.CInvoice_IDRecord ID
tdCInvoiceBalanceCreditCCdecimalCInvoice.CInvoiceBalanceCreditCCBC Balance Amount CR. This field displays the sum of the credit amounts of all posting lines in transaction currency.
This field is calculated by the system using the TC Base Amount CR and the SC rate.
tdCInvoiceBalanceCreditLCdecimalCInvoice.CInvoiceBalanceCreditLCBC Balance Amount CR. This field displays the sum of the credit amounts of all posting lines in transaction currency.
This field is calculated by the system using the TC Base Amount CR and the Exchange rate.
tdCInvoiceBalanceCreditTCdecimalCInvoice.CInvoiceBalanceCreditTCTC Balance Amount CR. This field displays the sum of the credit amounts of all posting lines in transaction currency.
tdCInvoiceBalanceDebitCCdecimalCInvoice.CInvoiceBalanceDebitCCSC Balance Amount DR. This field displays the sum of the debit amounts of all posting lines in statutory currency.
This field is calculated by the system using the TC Base Amount DR and the SC rate.
tdCInvoiceBalanceDebitLCdecimalCInvoice.CInvoiceBalanceDebitLCBC Balance Amount DR. This field displays the sum of the debit amounts of all posting lines in transaction currency.
This field is calculated by the system using the TC Base Amount DR and the Exchange rate.
tdCInvoiceBalanceDebitTCdecimalCInvoice.CInvoiceBalanceDebitTCTC Balance Amount DR. This field displays the sum of the debit amounts of all posting lines in transaction currency.
ttCInvoiceClosingDatedateCInvoice.CInvoiceClosingDateClosing Date. This field displays the date on which the open balance became zero.
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.
ttCInvoiceDiscountDueDatedateCInvoice.CInvoiceDiscountDueDateDiscount Due Date.This field indicates the last date a discount applies, calculated by the system based on the credit terms and the invoice date.
User can modify this field without affecting the credit terms.
ttCInvoiceDueDatedateCInvoice.CInvoiceDueDateDue Date.This field indicates the date when payment become due.
This field can be modified without affecting the credit terms.
This field is calculated by the system based on the credit terms and the invoice 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.
tdCInvoiceHoldAmountTCdecimalCInvoice.CInvoiceHoldAmountTCTC Hold Amount. This field displays the amount of the invoice total that is not to be paid.
If this field is not blank, the hold amount is taken into account during payment processing.
Hold amounts must be:
For invoices or correction invoices: Less than the invoice total and greater than zero.
For credit notes or correction credit notes: Greater than the document total and less than zero.
The hold amount for a negative payment must always be set to zero.
tlCInvoiceIsOpenlogicalCInvoice.CInvoiceIsOpenOpen.This field indicates if the invoice has been completely paid.
This field is updated automatically when complete payment is confirmed.
This field is read-only.
api annotation:PartialUpdate = yes - defaults to true
tlCInvoiceIsWHTlogicalCInvoice.CInvoiceIsWHTWithholding Tax
tcCInvoiceNumbercharactercalculated
tcCInvoiceNumberOperationalcharactercalculatedoperational invoice number : year/daybookvoucher
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.
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.
tiCInvoiceRegistrationNrintegerCInvoice.CInvoiceRegistrationNrRegistration number. This field displays the sequential number assigned to each invoice upon initial entry in the system.
tcCInvoiceTypecharacterCInvoice.CInvoiceTypeInvoice Type. This field identifies the invoice type.
The value can be Invoice Correction and Credit Note Correction type only when the appropriate daybook types have already been defined.
tcCInvoiceTypeForSalescharactercalculated
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.
tdCInvoiceWHTBaseAmtCreditCCdecimalCInvoice.CInvoiceWHTBaseAmtCreditCCSC WHT Base Amount (CR)
tdCInvoiceWHTBaseAmtCreditLCdecimalCInvoice.CInvoiceWHTBaseAmtCreditLCBC WHT Base Amount (CR)
tdCInvoiceWHTBaseAmtCreditTCdecimalCInvoice.CInvoiceWHTBaseAmtCreditTCTC WHT Base Amount (CR)
tdCInvoiceWHTBaseAmtDebitCCdecimalCInvoice.CInvoiceWHTBaseAmtDebitCCSC WHT Base Amount (DR)
tdCInvoiceWHTBaseAmtDebitLCdecimalCInvoice.CInvoiceWHTBaseAmtDebitLCBC WHT Base Amount (DR)
tdCInvoiceWHTBaseAmtDebitTCdecimalCInvoice.CInvoiceWHTBaseAmtDebitTCTC WHT Base Amount (DR)
tdCInvoiceWHTTotAmtCreditCCdecimalCInvoice.CInvoiceWHTTotAmtCreditCCSC WHT Total Amount (CR)
tdCInvoiceWHTTotAmtCreditLCdecimalCInvoice.CInvoiceWHTTotAmtCreditLCBC WHT Total Amount (CR)
tdCInvoiceWHTTotAmtCreditTCdecimalCInvoice.CInvoiceWHTTotAmtCreditTCTC WHT Total Amount (CR)
tdCInvoiceWHTTotAmtDebitCCdecimalCInvoice.CInvoiceWHTTotAmtDebitCCSC WHT Total Amount (DR)
tdCInvoiceWHTTotAmtDebitLCdecimalCInvoice.CInvoiceWHTTotAmtDebitLCBC WHT Total Amount (DR)
tdCInvoiceWHTTotAmtDebitTCdecimalCInvoice.CInvoiceWHTTotAmtDebitTCTC WHT Total Amount (DR)
tiCompany_IDintegerCInvoice.Company_IDLink to Company
tcCompanyCodecharacterCompany.CompanyCodeEntity Code
tiCreditor_IDintegerCInvoice.Creditor_IDLink to Creditor
tcCreditorCodecharacterCreditor.CreditorCodeSupplier Code
tcCurrencyCodecharacterCurrency1.CurrencyCodeCurrency Code
tcJournalCodecharacterJournal.JournalCodeA daybook code (maximum eight characters).
tdOpenAmountCCdecimalcalculated
tdOpenAmountLCdecimalcalculated
tdOpenAmountTCdecimalcalculated
tdOriginalAmountCCdecimalcalculated
tdOriginalAmountLCdecimalcalculated
tdOriginalAmountTCdecimalcalculated
tiOverdueDaysintegercalculated
tiOverdueWeeksintegercalculated
tcReasonCodecharacterReason.ReasonCodeInvoice Status Code
tiWeekNumbersintegercalculated


Internal usage


QadFinancials
method BCreditor.GetCreditorInvoice