project QadFinancials > class BCInvoice > business logic query CInvoiceForReplace


Parameters


iiCompanyIdintegerCompany id
iiOrigCInvoiceIdinteger


query condition


  each CInvoice where
CInvoice.Company_Id = iiCompanyId AND
CInvoice.CInvoice_ID = iiOrigCInvoiceId

      first CInvoice2 (inner-join) where
CInvoice2.Company_Id = iiCompanyId AND
CInvoice2.ReplacedCInvoice_ID = CInvoice.CInvoice_ID AND

          first Creditor (inner-join) where
Creditor.SharedSet_Id = vi_CREDITOR_sharedset(iiCompanyId) AND
Creditor.Creditor_ID = CInvoice2.Creditor_ID AND

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

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


query resultset tqCInvoiceForReplace


field namedata typedb fielddescription
tiCInvoice_IDintegerCInvoice.CInvoice_IDRecord ID
tiCInvoice_ID2integerCInvoice2.CInvoice_IDRecord ID
tiCInvoicePostingYearintegerCInvoice2.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.
tcCInvoiceReferencecharacterCInvoice2.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.
tiCInvoiceRegistrationNrintegerCInvoice2.CInvoiceRegistrationNrRegistration number. This field displays the sequential number assigned to each invoice upon initial entry in the system.
tiCInvoiceVoucherintegerCInvoice2.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.
tcCreditorCodecharacterCreditor.CreditorCodeSupplier Code
tcJournalCodecharacterJournal.JournalCodeA daybook code (maximum eight characters).
tiReason_IDintegerCInvoice2.Reason_IDInvoice Status Code
tcReasonCodecharacterReason.ReasonCodeInvoice Status Code


Internal usage


QadFinancials
method BAPMatching.ReplaceAPMatching