project QadFinancials > class BMfgPurchaseVoucherHist > business logic query VoucherInvoiceHistoryForERSExp


Parameters


icDomainCodecharacter
icEDIBatchNumbercharacter
iiCompanyIdintegerCompany id
icAddressTypeRemmitancecharacter


query condition


  each vph_hist where
vph_hist.vph_domain = icDomainCode AND
vph_hist.vph__qadc02 = icEDIBatchNumber

      first CInvoice (inner-join) where
CInvoice.Company_Id = iiCompanyId AND
CInvoice.CInvoice_ID = vph_hist.vph_cinvoice_id AND

          first Address1 (inner-join) where
Address1.Address_ID = CInvoice.ShipToAddress_ID AND

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

              first BusinessRelation (inner-join) where
BusinessRelation.BusinessRelation_ID = Creditor.BusinessRelation_ID AND

                  each Address2 (outer-join) where
Address2.BusinessRelation_ID = BusinessRelation.BusinessRelation_ID AND

                      first AddressType (outer-join) where
AddressType.AddressType_ID = Address2.AddressType_ID AND
AddressType.AddressTypeCode = icAddressTypeRemmitance

          first Currency (inner-join) where
Currency.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 PaymentCondition (inner-join) where
PaymentCondition.PaymentCondition_ID = CInvoice.NormalPaymentCondition_ID AND

          first Period (inner-join) where
Period.Company_Id = iiCompanyId AND
Period.Period_ID = CInvoice.Period_ID AND

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


query resultset tqVoucherInvoiceHistoryForERSExp


field namedata typedb fielddescription
tcAddressNamecharacterAddress1.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.
tcAddressTypeCodecharacterAddressType.AddressTypeCodeAddress Type
tiCInvoice_IDintegerCInvoice.CInvoice_IDRecord ID
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.
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.
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.
tlCInvoiceIsInitialStatuslogicalCInvoice.CInvoiceIsInitialStatusInitial Status. This field indicates if the invoice is in initial status.
api annotation:This field defaults from the Initial Status field of the 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.
tlCInvoiceIsTaxablelogicalCInvoice.CInvoiceIsTaxableTaxable. This field indicates if the invoice is taxable.
This field defaults to true if the supplier is taxable.
tdCInvoiceNonDiscAmtLCdecimalCInvoice.CInvoiceNonDiscAmtLCBC Non-discount Amount. This field display the invoice amount without discount in base currency.
This field is calculated by the system using the TC Non-discount Amount and the Exchange rate.
tdCInvoiceNonDiscAmtTCdecimalCInvoice.CInvoiceNonDiscAmtTCTC Non-discount Amount. This field display the invoice amount without discount in base currency.
ttCInvoicePostingDatedateCInvoice.CInvoicePostingDatePosting Date. This filed indicates the date on which the invoice is to be posted.
api annotation:This field defaults from the invoice creation date.
tdCInvoiceRateScaledecimalCInvoice.CInvoiceRateScaleScale Factor. This field indicates the scale factor applying to the exchange rate in use for foreign currency payments.
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.
ttCInvoiceTaxPointDatedateCInvoice.CInvoiceTaxPointDateTax Point Date.This field indicates the date to be used in tax calculations.
api annotation:This field defaults from the posting date.
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
tcCurrencyCodecharacterCurrency.CurrencyCodeCurrency Code
tcJournalCodecharacterJournal.JournalCodeA daybook code (maximum eight characters).
tcPaymentConditionCodecharacterPaymentCondition.PaymentConditionCodeCredit Terms Code
tiPeriodPeriodintegerPeriod.PeriodPeriodGL Period
tiPeriodYearintegerPeriod.PeriodYearGL Calendar Year
tcReasonAllocationStatuscharacterReason.ReasonAllocationStatusAllocation Status
tcRemitToAddressNamecharacterAddress2.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.
tcvph__qadc02charactervph_hist.vph__qadc02
tcvph_domaincharactervph_hist.vph_domainDomain


Internal usage


QadFinancials
method BCInvoiceAPMatching.ApiGetCInvoiceAPMatchingDetails