project QadFinancials > class BDInvoice > business logic query DInvoiceDeductionByFilters2


Parameters


iiCompanyIdintegerCompany id
icDInvoiceIdscharacter


query condition


  each DInvoice where
DInvoice.Company_ID <> ? AND
DInvoice.DInvoice_ID can-do icDInvoiceIds

      first Currency (inner-join) where
Currency.Currency_ID = DInvoice.DInvoiceCurrency_ID AND

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

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

          first DeductionCatLine (inner-join) where
DeductionCatLine.DeductionCatLine_ID = DInvoiceDeduction.DeductionCatLine_ID AND

              first DeductionCat (inner-join) where
DeductionCat.DeductionCat_ID = DeductionCatLine.DeductionCat_ID AND

          first DInvoice2 (conditional-join) where
DInvoice2.DInvoice_ID = DInvoiceDeduction.PaidDInvoice_ID AND
DInvoice2.Company_ID <> ?

              first Company (conditional-join) where
Company.Company_Id = iiCompanyId AND
Company.Company_ID = DInvoice2.Company_ID AND

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


query resultset tqDInvoiceDeductionByFilters2


field namedata typedb fielddescription
tcCurrencyCodecharacterCurrency.CurrencyCodeCurrency Code
tcDebtorCodecharacterDebtor.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.
tcDeductionCatCodecharacterDeductionCat.DeductionCatCodeDeduction Category Code
tcDeductionCatDescriptioncharacterDeductionCat.DeductionCatDescriptionDescription
tcDeductionCatTypecharacterDeductionCat.DeductionCatTypeType
tiDInvoice_IDintegerDInvoice.DInvoice_IDRecord ID
tiDInvoiceDeduction_IDintegerDInvoiceDeduction.DInvoiceDeduction_IDRecord ID
tcDInvoiceDeductionApRejComcharacterDInvoiceDeduction.DInvoiceDeductionApRejComApprove/Reject Comment
tdDInvoiceDeductionCCdecimalDInvoiceDeduction.DInvoiceDeductionCCDeduction SC
tcDInvoiceDeductionCommentcharacterDInvoiceDeduction.DInvoiceDeductionCommentComment
tcDInvoiceDeductionCustRefcharacterDInvoiceDeduction.DInvoiceDeductionCustRefCustomer Reference
tdDInvoiceDeductionLCdecimalDInvoiceDeduction.DInvoiceDeductionLCDeduction BC
tcDInvoiceDeductionPromotionCodecharacterDInvoiceDeduction.DInvoiceDeductionPromotionCodePromotion Code
tiDInvoiceDeductionSequenceintegerDInvoiceDeduction.DInvoiceDeductionSequenceSequence
tcDInvoiceDeductionStatuscharacterDInvoiceDeduction.DInvoiceDeductionStatusDeduction Status
tdDInvoiceDeductionTCdecimalDInvoiceDeduction.DInvoiceDeductionTCDeduction TC
tdDInvoiceOriginalDebitCCdecimalDInvoice.DInvoiceOriginalDebitCCSC 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.
tdDInvoiceOriginalDebitLCdecimalDInvoice.DInvoiceOriginalDebitLCBC 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.
tdDInvoiceOriginalDebitTCdecimalDInvoice.DInvoiceOriginalDebitTCTC 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.
ttDInvoicePostingDatedateDInvoice.DInvoicePostingDatePosting Date. This field displays the date the sales-related invoice was generated by Invoice Post and Print.
This field is updated when the invoice is validated and saved.
api annotation:This field defaults from the invoice creation date.
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.
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.
tiExpenseCompany_IDintegerCompany.Company_IDRecord ID
tcExpenseCompanyCodecharacterCompany.CompanyCodeEntity Code
tcJournalCodecharacterJournal.JournalCodeA daybook code (maximum eight characters).
tiPaidDInvoice_IDintegerDInvoiceDeduction.PaidDInvoice_IDLink to PaidDInvoice


Internal usage


QadFinancials
method BDInvoice.ApiGetDeductions