project QadFinancials > class BDebtorReport > business logic query GetDebtorInvoicePrint


Parameters


iiCompanyIdinteger
itDInvoiceDateFromFilterdate
itDInvoiceDateToFilterdate
itDInvoiceDueDateFromFilterdate
itDInvoiceDueDateToFilterdate
icDInvoiceTypeFiltercharacter
icCandoJournalCodeFiltercharacter
icCurrencyCodeFiltercharacter
icCandoBRCodeFiltercharacter
iiAccYearinteger
ilDInvoiceIsOpenFilterlogical
icDInvoiceVoucherFromcharacter
icDInvoiceVoucherTocharacter
icToDebtorCodeFiltercharacter
icFromDebtorCodeFiltercharacter
icFromDebtorBillToCodeFiltercharacter
icToDebtorBillToCodeFiltercharacter
icFromDebtorShipToCodeFiltercharacter
icToDebtorShipToCodeFiltercharacter
icCompanyCodecharacter
icDebtorCodeCandocharacter


query condition


  each DInvoice where
DInvoice.Company_Id = iiCompanyId AND
(DInvoice.DInvoiceDate >= itDInvoiceDateFromFilter AND
DInvoice.DInvoiceDate <= itDInvoiceDateToFilter ) AND
(DInvoice.DInvoiceDueDate >= itDInvoiceDueDateFromFilter AND
DInvoice.DInvoiceDueDate <= itDInvoiceDueDateToFilter ) AND
DInvoice.DInvoiceType can-do icDInvoiceTypeFilter AND
DInvoice.DInvoicePostingYear = iiAccYear AND
DInvoice.DInvoiceIsOpen = ilDInvoiceIsOpenFilter AND
(DInvoice.DInvoiceVoucher >= icDInvoiceVoucherFrom AND
DInvoice.DInvoiceVoucher <= icDInvoiceVoucherTo ) AND
(DInvoice.DInvoiceShipToCode >= icFromDebtorShipToCodeFilter AND
DInvoice.DInvoiceShipToCode <= icToDebtorShipToCodeFilter )

      first Company (inner-join) where
Company.Company_Id = iiCompanyId AND
Company.Company_ID = DInvoice.Company_ID AND
Company.CompanyCode = icCompanyCode

      first Currency (inner-join) where
Currency.Currency_ID = DInvoice.DInvoiceCurrency_ID AND
Currency.CurrencyCode can-do icCurrencyCodeFilter

      first Debtor1 (inner-join) where
Debtor1.SharedSet_Id = vi_DEBTOR_sharedset(iiCompanyId) AND
Debtor1.Debtor_ID = DInvoice.Debtor_ID AND
Debtor1.DebtorCode can-do icDebtorCodeCando AND
Debtor1.DebtorCode >= icFromDebtorCodeFilter AND
Debtor1.DebtorCode <= icToDebtorCodeFilter

          first BusinessRelation (inner-join) where
BusinessRelation.BusinessRelation_ID = Debtor1.BusinessRelation_ID AND
BusinessRelation.BusinessRelationCode can-do icCandoBRCodeFilter

              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 = 'INVOICE' OR
AddressType.AddressTypeCode = 'HEADOFFICE' )

          first Debtor2 (conditional-join) where
Debtor2.SharedSet_Id = vi_DEBTOR_sharedset(iiCompanyId) AND
Debtor2.Debtor_ID = Debtor1.BillToDebtor_ID AND
(Debtor2.DebtorCode >= icFromDebtorBillToCodeFilter AND
Debtor2.DebtorCode <= icToDebtorBillToCodeFilter )

          first DebtorCreditRating (conditional-join) where
DebtorCreditRating.DebtorCreditRating_ID = Debtor1.DebtorCreditRating_ID AND

      first Debtor3 (inner-join) where
Debtor3.SharedSet_Id = vi_DEBTOR_sharedset(iiCompanyId) AND
Debtor3.Debtor_ID = DInvoice.SoldToDebtor_ID AND

      each DInvoiceVat (inner-join) where
DInvoiceVat.DInvoice_ID = DInvoice.DInvoice_ID AND

          first Vat (inner-join) where
Vat.Vat_ID = DInvoiceVat.Vat_ID AND

              first tx2_mstr (inner-join) where
tx2_mstr.tx2_tax_code = Vat.VatCode AND

      first Journal (inner-join) where
Journal.SharedSet_Id = vi_JOURNAL_sharedset(iiCompanyId) AND
Journal.Journal_ID = DInvoice.Journal_ID AND
Journal.JournalCode can-do icCandoJournalCodeFilter

      first PaymentCondition (inner-join) where
PaymentCondition.PaymentCondition_ID = DInvoice.NormalPaymentCondition_ID AND

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


query sort order


DInvoice.DInvoiceVoucher (ascending)


query resultset tqGetDebtorInvoicePrint


field namedata typedb fielddescription
tcAddressTaxIDStatecharacterAddress.AddressTaxIDStateState Tax. This field is for reference and documentation purposes, the value of the field is either a state or provincial tax identification number or a VAT registration number.
tcDebtorBillToCodecharacterDebtor2.DebtorCodeA code (maximum eight characters) that identifies a customer. If the code you specify matches an existing supplier code, a warning message displays. You can choose to ignore the warning, and create the record. However, when a supplier and customer share the same code, they must reference the same business relation.
api annotation:If you leave the Customer Code field blank, the system automatically generates a number for the record based on the sequence defined in Customer Autonumber Create.
tcDebtorCodecharacterDebtor1.DebtorCodeA code (maximum eight characters) that identifies a customer. If the code you specify matches an existing supplier code, a warning message displays. You can choose to ignore the warning, and create the record. However, when a supplier and customer share the same code, they must reference the same business relation.
api annotation:If you leave the Customer Code field blank, the system automatically generates a number for the record based on the sequence defined in Customer Autonumber Create.
tiDebtorCreditRating_IDintegerDebtorCreditRating.DebtorCreditRating_IDRecord ID
tcDebtorCreditRatingCodecharacterDebtorCreditRating.DebtorCreditRatingCodeA code (maximum eight characters) that identifies a customer credit rating.
tcDebtorSoldToCodecharacterDebtor3.DebtorCodeA code (maximum eight characters) that identifies a customer. If the code you specify matches an existing supplier code, a warning message displays. You can choose to ignore the warning, and create the record. However, when a supplier and customer share the same code, they must reference the same business relation.
api annotation:If you leave the Customer Code field blank, the system automatically generates a number for the record based on the sequence defined in Customer Autonumber Create.
tcDInvoiceInvCertCertificatecharacterDInvoice.DInvoiceInvCertCertificateDuplicate field from SysProperty
tcDInvoiceInvCertSignatureCurrcharacterDInvoice.DInvoiceInvCertSignatureCurrSignature Current Invoice
tiDInvoiceReminderCountintegerDInvoice.DInvoiceReminderCountReminder Counter. This field displays the reminder level that applies to this invoice.
tcDInvoiceTSMNumbercharacterDInvoice.DInvoiceTSMNumberPayment Reference. This field contains a reference number to identify a customer payment for this invoice.
Normally this could be a unique transaction structured message (TSM) number. The TSM is a standard reference numbering system for electronic transfers,used by many banks.
tdDInvoiceVatBaseCreditTCdecimalDInvoice.DInvoiceVatBaseCreditTCTC Base Amount CR. This field displays the credit base amount in the transaction currency.
This field is calculated by the system using the total invoice amount (TC) and the applicable tax rate code.
tdDInvoiceVatBaseDebitTCdecimalDInvoice.DInvoiceVatBaseDebitTCTC Base Amount DR. This field displays the debit base amount in the transaction currency.
This field is calculated by the system using the total invoice amount (TC) and the applicable tax rate code.
tlDInvoiceVatIsTaxablelogicalDInvoiceVat.DInvoiceVatIsTaxableTaxable. This field indicates if the invoice is taxable.
api annotation:This field defaults to true if the customer is taxable.
tdDInvoiceVatNTBaseCreditTCdecimalDInvoiceVat.DInvoiceVatNTBaseCreditTCTC Base Credit Non-taxable. This field displays the Non-taxable credit base amount in the transaction currency.
This is calculated by the system using the total invoice amount (TC) and the applicable tax rate code.
tdDInvoiceVatNTBaseDebitTCdecimalDInvoiceVat.DInvoiceVatNTBaseDebitTCTC Base Debit Non-taxable. This field displays the Non-taxable debit base amount in the transaction currency.
This is calculated by the system using the total invoice amount (TC) and the applicable tax rate code.
tdDInvoiceVatVatBaseCreditCCdecimalDInvoiceVat.DInvoiceVatVatBaseCreditCCSC Base Amount CR. This field displays the credit base amount in the statutory currency.
This field is calculated by the system using the TC Base Amount CR and the SC rate.
tdDInvoiceVatVatBaseCreditLCdecimalDInvoiceVat.DInvoiceVatVatBaseCreditLCBC Base Amount CR. This field displays the credit base amount in the base currency.
This field is calculated by the system using the TC Base Amount CR and the Exchange rate.
tdDInvoiceVatVatBaseCreditTCdecimalDInvoiceVat.DInvoiceVatVatBaseCreditTCTC Base Amount CR. This field displays the credit base amount in the transaction currency.
This field is calculated by the system using the total invoice amount (TC) and the applicable tax rate code.
tdDInvoiceVatVatBaseDebitTCdecimalDInvoiceVat.DInvoiceVatVatBaseDebitTCTC Base Amount DR. This field displays the debit base amount in the transaction currency.
This field is calculated by the system using the total invoice amount (TC) and the applicable tax rate code.
tdDInvoiceVatVatDebitTCdecimalDInvoiceVat.DInvoiceVatVatDebitTCTC 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.
tiPaymentCondition_IDintegerPaymentCondition.PaymentCondition_IDRecord ID
tcPaymentConditionCodecharacterPaymentCondition.PaymentConditionCodeCredit Terms Code
tcPaymentConditionDescriptcharacterPaymentCondition.PaymentConditionDescriptDescription
tiShipToAddress_IDintegerDInvoice.ShipToAddress_IDCity
tctx2_basecharactertx2_mstr.tx2_baseTaxable Base Code
tctx2_desccharactertx2_mstr.tx2_descDescription
tdtx2_tax_pctdecimaltx2_mstr.tx2_tax_pctTax Rate
tcTxclTaxClscharacterDInvoiceVat.TxclTaxClsTax Class. When taxes are defined to accrue at receipt for this receiver, this field indicates the tax class being applied, if any.
api annotation:This field default from the customer, and can be modified.
tcAddressCitycharacterAddress.AddressCityCity. The city for this address. This field can be used to decide the tax zone of the address.
tcAddressStatecharacterAddress.AddressStateObsolete field
tcAddressStreet1characterAddress.AddressStreet1Address: Line one of address details.
This field can be blank.
tcAddressStreet2characterAddress.AddressStreet2Address.Line two of address details.
This field can be blank.
tcAddressStreet3characterAddress.AddressStreet3Address.Line three of address details.
This field can be blank.
tcAddressTelephonecharacterAddress.AddressTelephoneTelephone. The telephone number for calling this business relation address.
This field can be blank.
tcAddressZipcharacterAddress.AddressZipZip. The postal code or US zip code associated with this address.
This field is used to decide the tax zone for the address.
This field can be blank.
tiAddressType_IDintegerAddressType.AddressType_IDRecord ID
tcAddressTypeCodecharacterAddressType.AddressTypeCodeAddress Type
tcReasonCodecharacterReason.ReasonCodeInvoice Status Code
tcCompanyCodecharacterCompany.CompanyCodeEntity Code
tcDebtorCreditRatingDescriptcharacterDebtorCreditRating.DebtorCreditRatingDescriptA brief description (maximum 40 characters) of the used rating.
tcJournalCodecharacterJournal.JournalCodeA daybook code (maximum eight characters).
tcBusinessRelationName1characterBusinessRelation.BusinessRelationName1Name: The full name of the business relation.
This field sets the default name for linked addresses such as customers and suppliers.
api annotation:PartialUpdate = yes - defaults to the BusinessRelationCode.
tcCurrencyCodecharacterCurrency.CurrencyCodeCurrency Code
tcDInvoiceDescriptioncharacterDInvoice.DInvoiceDescriptionDescription. A brief description of the invoice. This field is mandatory.
ttDInvoiceDiscountDueDatedateDInvoice.DInvoiceDiscountDueDateDiscount Due Date. This field displays the last date a discount applies, calculated by the system based on the credit terms and the invoice date.
You can modify the due date without affecting the credit terms.
If the credit terms have a base date specified, this is used in the due date calculations rather than the invoice creation date.
tlDInvoiceIsTaxablelogicalDInvoice.DInvoiceIsTaxableTaxable. This field indicates if the invoice is taxable.
api annotation:This field defaults to true if the customer is taxable.
tcDInvoicePurchaseOrdercharacterDInvoice.DInvoicePurchaseOrderPurchase Order.If a purchase order number was recorded on the original sales order, it displays in this field. This number indicates the original number of the document that initiated the sale, and can be useful when communicating with the customer.
tcDInvoiceShipToCodecharacterDInvoice.DInvoiceShipToCodeShip-To Code.The code that identifies the address receiving the items being invoiced. you can change it to another valid ship-to defined for the business relation in Customer Ship-To Create.
The system uses the tax detail for the ship-from and ship-to addresses to select the correct tax environment for tax calculation.
For the ship-from, this is the headoffice address of the business relation.
For the ship-to, the tax details defined for the customer record are used.
api annotation:This field defaults from the sold-to address.
tcDInvoiceSlsPsn1characterDInvoice.DInvoiceSlsPsn1Salesperson 1.This field displays the salesperson specified on the order to receive commission and quota credit for the order.
api annotation:The commission percentage defaults from the salesperson record.
ttDInvoiceTaxPointDatedateDInvoice.DInvoiceTaxPointDateTax Point Date. The date to be used in tax calculations. For sales-related invoices, this field displays the tax calculation date on the associated order.
api annotation:This field defaults to DInvoicePostingDate.
tlDInvoiceIsOpenlogicalDInvoice.DInvoiceIsOpenOpen.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
tiDInvoicePostingYearintegerDInvoice.DInvoicePostingYearYear.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.
tiDInvoice_IDintegerDInvoice.DInvoice_IDRecord ID
ttDInvoiceDatedateDInvoice.DInvoiceDateInvoice Date. This field indicates the invoice creation date.This field is normallly prior to the posting date and within the same accounting period as the posting date. The date must be within the upper and lower date limits of an open GL period.
The system uses the invoice date with the credit terms to calculate due date and discount date.
api annotation:This field defaults to the DInvoicePostingDate.
ttDInvoiceDueDatedateDInvoice.DInvoiceDueDateDue Date. This field displays the date when payment is due, calculated by the system based on the credit terms and the invoice date. User can modify the due date without affecting the credit terms.
If the credit terms have a base date specified, this is used in the due date calculations rather than the invoice creation date.
tdDInvoiceExchangeRatedecimalDInvoice.DInvoiceExchangeRateExchange Rate. The accounting 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.
tcDInvoiceTypecharacterDInvoice.DInvoiceTypeInvoice Type. This field displays the invoice type.
Invoice Correction and Credit Note Correction display as choices only when the appropriate daybook types have already been defined.
api annotation:PartialUpdate = yes - defaults to Invoice
tdDInvoiceBalanceCCdecimalDInvoice.DInvoiceBalanceCCSC Balance. This field displays the sum of the debit and credit amounts of all posting lines in statutory currency.
This field is calculated by the system using the TC Balance and the SC rate.
tdDInvoiceBalanceLCdecimalDInvoice.DInvoiceBalanceLCBC Balance. This field displays the sum of the debit and credit amounts of all posting lines in base currency.
This field is calculated by the system using the TC Balance and the Exchange rate.
tdDInvoiceBalanceTCdecimalDInvoice.DInvoiceBalanceTCBalance. This field displays the sum of the debit and credit amounts of all posting lines in transaction currency.
tcDInvoiceBatchcharacterDInvoice.DInvoiceBatchBatch Number. This field is used to identify a group of customer invoices created at one time using Evaluated Receipts Settlement (ERS) functions.
tcDInvoiceDITextcharacterDInvoice.DInvoiceDITextCIDescription. A brief description for the SI posting.
api annotation:This field defaults from the DInvoiceDescription.
tdDInvoiceVatVatCreditCCdecimalDInvoiceVat.DInvoiceVatVatCreditCCSC Tax Amount CR. This field displays the credit tax amount in the statutory currency.
This field is calculated by the system using the TC Tax Amount CR and the SC rate.
tdDInvoiceVatVatCreditLCdecimalDInvoiceVat.DInvoiceVatVatCreditLCBC Tax Amount CR. This field displays the debit tax amount in the base currency.
This field is calculated by the system using the TC Tax Amount CR and the Exchange rate.
tdDInvoiceVatVatCreditTCdecimalDInvoiceVat.DInvoiceVatVatCreditTCTC 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.
tiDInvoiceVoucherintegerDInvoice.DInvoiceVoucherVoucher.This field displays the numeric identifier assigned to the posting.
When the daybook of the journal entry is charged(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.


Internal usage


QadFinancials
method BDebtorReport.DebtorInvoicePrint