project QadFinancials > class BCInvoice > business logic query CInvoiceByPaymentInfo

Annotation

GetCInvoiceForPaymentSelection


Parameters


iiCompanyIdintegerCompany id
icBusinessRelationCodecharacterBusiness Relation Code
iiCInvoice_IDinteger
icPaymentGroupCodecharacterPayment Group Code
icCurrencyCodecharacterCurrency Code
icDivisionCodecharacterSub-Account Code
ilBusinessRelationIsIntercologicalBusiness Relation Interco
icCInvoiceTypecharacterSInvoiceType
ilIsInvoiceApprovedlogicalInvoice Approved
ilIsLockPaymentlogicalLock Payment
ilCInvoiceIsSelectedlogicalCinvoice Selected
ilCInvoiceIsOpenlogicalCinvoice Open
icBusinessRelationCountryCodecharacterBusinessRelationCountryCode
icAddressTypeCodecharacter


query condition


  each CInvoice where
CInvoice.Company_Id = iiCompanyId AND
CInvoice.CInvoice_ID = iiCInvoice_ID AND
CInvoice.CInvoiceType can-do icCInvoiceType AND
CInvoice.CInvoiceIsInvoiceApproved = ilIsInvoiceApproved AND
CInvoice.CInvoiceIsLockPayment = ilIsLockPayment AND
CInvoice.CInvoiceIsOpen = ilCInvoiceIsOpen AND
CInvoice.CInvoiceIsSelected = ilCInvoiceIsSelected

      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
BusinessRelation.BusinessRelationCode matches icBusinessRelationCode AND
BusinessRelation.BusinessRelationIsInterco = ilBusinessRelationIsInterco

              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 = icAddressTypeCode

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

          first PaymentGroup (conditional-join) where
PaymentGroup.PaymentGroup_ID = Creditor.PaymentGroup_ID AND
PaymentGroup.PaymentGroupCode matches icPaymentGroupCode

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

      first Division (conditional-join) where
Division.SharedSet_Id = vi_DIVISION_sharedset(iiCompanyId) AND
Division.Division_ID = CInvoice.Division_ID AND
Division.DivisionCode matches icDivisionCode

      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


query resultset tqCInvoiceByPaymentInfo


field namedata typedb fielddescription
tcAddressTypeCodecharacterAddressType.AddressTypeCodeAddress Type
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.
tlBusinessRelationIsIntercologicalBusinessRelation.BusinessRelationIsIntercoIntercompany. This field Indicates if the business relation identifies an entity that is a member of a group of entities that trade with each other.
If the business relation is identified as an internal entity,this field is true and cannot be changed.
api annotation:PartialUpdate = yes - defaults to false.
tiCInvoice_IDintegerCInvoice.CInvoice_IDRecord ID
tdCInvoiceBalanceCreditTCdecimalCInvoice.CInvoiceBalanceCreditTCTC Balance Amount CR. This field displays the sum of the credit amounts of all posting lines in transaction currency.
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.
tlCInvoiceIsInvoiceApprovedlogicalCInvoice.CInvoiceIsInvoiceApprovedInvoice Approved. This field indicates if the invoice is already approved for payment.
api annotation:PartialUpdate = yes - defaults to false
tlCInvoiceIsLockPaymentlogicalCInvoice.CInvoiceIsLockPaymentLock Payment. This field indicates if the invoice is locked for payment. The invoice cannot be included in any automatic payment selections if this field is true.
api annotation:PartialUpdate = yes - defaults to false
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
tlCInvoiceIsSelectedlogicalCInvoice.CInvoiceIsSelectedSelected. This field indicates whether the invoice is included in a payment selection.
This field is read-only.
tdCInvoiceNonDiscAmtTCdecimalCInvoice.CInvoiceNonDiscAmtTCTC Non-discount Amount. This field display the invoice amount without discount in base currency.
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.
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.
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.
tcCInvoiceTSMNumbercharacterCInvoice.CInvoiceTSMNumberPayment Reference. This field displays a unique reference number to be included in the supplier payment file.
This reference can consist of a Transfer with Structured Message (TSM) number.
This field can be blank.
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.
tdCInvoiceVatCreditTCdecimalCInvoice.CInvoiceVatCreditTCTC Tax Amount CR. This field displays the credit tax amount (TC) calculated by the system using the total invoice amount (TC) and the applicable tax rate code.
tdCInvoiceVatDebitTCdecimalCInvoice.CInvoiceVatDebitTCTC Tax Amount DR. This field displays the debit tax amount (TC) calculated by the system using the total invoice amount (TC) and the applicable tax rate code.
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.
tcCountryCodecharacterCountry.CountryCodeCountry Code
tiCreditor_IDintegerCInvoice.Creditor_IDLink to Creditor
tcCreditorCodecharacterCreditor.CreditorCodeSupplier Code
tlCreditorIsIndividualPaymntlogicalCreditor.CreditorIsIndividualPaymntIndividual Payments
tlCreditorIsWHTlogicalCreditor.CreditorIsWHTWithholding Tax
tcCurrencyCodecharacterCurrency.CurrencyCodeCurrency Code
tcDivisionCodecharacterDivision.DivisionCodeSub-Account
tcJournalCodecharacterJournal.JournalCodeA daybook code (maximum eight characters).
tcPaymentConditionPaymentTypcharacterPaymentCondition.PaymentConditionPaymentTypPayment Type
tdPaymentConditionPercentagedecimalPaymentCondition.PaymentConditionPercentageDiscount Percentage
tcPaymentGroupCodecharacterPaymentGroup.PaymentGroupCodePayment Group
tiPeriodYearintegerPeriod.PeriodYearGL Calendar Year


Internal usage


QadFinancials
method BPaymentSelection.ExportBEAbroad
method BPaymentSelection.ExportBEInland
method BPaymentSelection.ExportNLInland
method BPaymentSelection.PaySelLineCalcValues
method BPaymentSelection.ValidateComponentPostSummary