project QadFinancials > class BCInvoice > business logic query CInvoiceMovementByCreditor

Description

Get Supplier invoice movement by suplier code,posting date,selected companies.


Parameters


iiCompanyIdintegerCompany id
icCompanyListIDcharacter
iiCreditorIDinteger
itPostingStartDatedate
itPostingEndDatedate
icCreditorCodecharacter
itPostingDatedate
icCInvoiceMovementTypecharacter
icCreditorCodeListcharacter


query condition


  each CInvoice where
CInvoice.Company_Id = iiCompanyId AND
CInvoice.Creditor_ID = iiCreditorID AND
string(CInvoice.Company_ID) can-do icCompanyListID

      each CInvoiceMovement (inner-join) where
CInvoiceMovement.Company_Id = iiCompanyId AND
CInvoiceMovement.CInvoice_ID = CInvoice.CInvoice_ID AND
CInvoiceMovement.CInvoiceMovementType = icCInvoiceMovementType

          first PostingLine (inner-join) where
PostingLine.Company_Id = iiCompanyId AND
PostingLine.PostingLine_ID = CInvoiceMovement.PostingLine_ID AND

              first Posting (inner-join) where
Posting.Company_Id = iiCompanyId AND
Posting.Posting_ID = PostingLine.Posting_ID AND
Posting.PostingDate >= itPostingStartDate AND
Posting.PostingDate <= itPostingEndDate AND
Posting.PostingDate = itPostingDate

                  first Journal1 (inner-join) where
Journal1.SharedSet_Id = vi_JOURNAL_sharedset(iiCompanyId) AND
Journal1.Journal_ID = Posting.Journal_ID AND
Journal1.JournalTypeCode <> {&JOURNALTYPE-CREDITORPAYMENT}

      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 Journal2 (inner-join) where
Journal2.SharedSet_Id = vi_JOURNAL_sharedset(iiCompanyId) AND
Journal2.Journal_ID = CInvoice.Journal_ID AND


query resultset tqCInvoiceMovementByCreditor


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.
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.
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
tdCInvoiceMovementDiscountTCdecimalCInvoiceMovement.CInvoiceMovementDiscountTCCInvoiceMovementDiscountTC. The amount of payment discount in TC.
tcCInvoiceMovementTypecharacterCInvoiceMovement.CInvoiceMovementTypeCInvoiceMovementType. "Initial" indicates that the movement represents the initial creation of the invoice, "movement" stands for all subsequent modifications of the invoice balance (payments, adjustments etc).
tcCInvoiceNumbercharactercalculated
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.
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.
tiCompany_IDintegerCInvoice.Company_IDLink to Company
tcCompanyCodecharacterCompany.CompanyCodeEntity Code
tiCreditor_IDintegerCInvoice.Creditor_IDLink to Creditor
tiCreditor_ID2integerCInvoiceMovement.Creditor_IDLink to Creditor
tcCreditorCodecharacterCreditor.CreditorCodeSupplier Code
tcCurrencyCodecharacterCurrency1.CurrencyCodeCurrency Code
tcDocumentNumbercharactercalculated
tcJournalCodecharacterJournal1.JournalCodeA daybook code (maximum eight characters).
tcJournalInvoiceCodecharacterJournal2.JournalCodeA daybook code (maximum eight characters).
tcJournalTypeCodecharacterJournal1.JournalTypeCodeA daybook type code.
api annotation:Value for this field defaults to "Journal Entries".
tdOpenAmountCCdecimalcalculated
tdOpenAmountLCdecimalcalculated
tdOpenAmountTCdecimalcalculated
tdOriginalAmountCCdecimalcalculated
tdOriginalAmountLCdecimalcalculated
tdOriginalAmountTCdecimalcalculated
tiOverdueDaysintegercalculated
tdPaymentAmountTCdecimalcalculated
tiPosting_IDintegerPosting.Posting_IDRecord ID
ttPostingDatedatePosting.PostingDateThe accounting date on which the journal entry is posted. The posting date must be a valid calendar date and must be within the GL calendar year (PostingYear) and period (PostingPeriod).
tdPostingLineCreditTCdecimalPostingLine.PostingLineCreditTCTC Credit
tdPostingLineDebitTCdecimalPostingLine.PostingLineDebitTCTC Debit
tcPostingTextcharacterPosting.PostingTextFree text describing the posting.
api annotation:Value for this field defaults to blank
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.
tiWeekNumbersintegercalculated


Internal usage


QadFinancials
method BCreditor.GetCInvoicePayment