project QadFinancials > class BDInvoice > business logic (internal API) query DInvoiceDeductionByFilters (optimised)

Description

it will used be called by API method "APIGetDeductions" to Read deduction detail information.


query filter (table tFilter)


tcBusinessFieldNametcDataTypetcOperator
iiCompanyIdi
tBusinessRelation.BusinessRelationName1c=,>=,>,<>,<=,<,begins,can-do,matches
tCompany1.CompanyCodec=,>=,>,<>,<=,<,begins,can-do,matches
tCompany2.CompanyCodec=,>=,>,<>,<=,<,begins,can-do,matches
tCurrency.CurrencyCodec=,>=,>,<>,<=,<,begins,can-do,matches
tDebtor.DebtorCodec=,>=,>,<>,<=,<,begins,can-do,matches
tDeductionCat.DeductionCatCodec=,>=,>,<>,<=,<,begins,can-do,matches
tDeductionCat.DeductionCatDescriptionc=,>=,>,<>,<=,<,begins,can-do,matches
tDeductionCat.DeductionCatTypec=,>=,>,<>,<=,<,begins,can-do,matches
tDInvoice.DInvoiceBalanceTCd=,>=,>,<>,<=,<
tDInvoice.DInvoiceDatet=,>=,>,<>,<=,<
tDInvoiceDeduction.DInvoiceDeductionApRejComc=,>=,>,<>,<=,<,begins,can-do,matches
tDInvoiceDeduction.DInvoiceDeductionApRejDatet=,>=,>,<>,<=,<
tDInvoiceDeduction.DInvoiceDeductionCCd=,>=,>,<>,<=,<
tDInvoiceDeduction.DInvoiceDeductionCommentc=,>=,>,<>,<=,<,begins,can-do,matches
tDInvoiceDeduction.DInvoiceDeductionCreateDatet=,>=,>,<>,<=,<
tDInvoiceDeduction.DInvoiceDeductionCustRefc=,>=,>,<>,<=,<,begins,can-do,matches
tDInvoiceDeduction.DInvoiceDeductionLCd=,>=,>,<>,<=,<
tDInvoiceDeduction.DInvoiceDeductionPromotionCodec=,>=,>,<>,<=,<,begins,can-do,matches
tDInvoiceDeduction.DInvoiceDeductionSequencei=,>=,>,<>,<=,<
tDInvoiceDeduction.DInvoiceDeductionStatusc=,>=,>,<>,<=,<,begins,can-do,matches
tDInvoiceDeduction.DInvoiceDeductionTCd=,>=,>,<>,<=,<
tDInvoice.DInvoiceDescriptionc=,>=,>,<>,<=,<,begins,can-do,matches
tDInvoice.DInvoiceIsOpenl=,<>
tDInvoice.DInvoiceOriginalDebitCCd=,>=,>,<>,<=,<
tDInvoice.DInvoiceOriginalDebitLCd=,>=,>,<>,<=,<
tDInvoice.DInvoiceOriginalDebitTCd=,>=,>,<>,<=,<
tDInvoice.DInvoicePostingDatet=,>=,>,<>,<=,<
tDInvoice.DInvoicePostingYeari=,>=,>,<>,<=,<
tDInvoice.DInvoiceVoucheri=,>=,>,<>,<=,<
tJournal.JournalCodec=,>=,>,<>,<=,<,begins,can-do,matches


Parameters (internal)


iiCompanyIdintegerCompany id


query condition


  each DInvoice where
DInvoice.Company_Id = iiCompanyId AND

      first Company1 (inner-join) where
Company1.Company_Id = iiCompanyId AND
Company1.Company_ID = DInvoice.Company_ID AND

          first Domains (inner-join) where
Domains.Domain_ID = Company1.Domain_ID AND

      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

          first BusinessRelation (inner-join) where
BusinessRelation.BusinessRelation_ID = Debtor.BusinessRelation_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.Company_Id = iiCompanyId AND
DInvoice2.DInvoice_ID = DInvoiceDeduction.PaidDInvoice_ID AND

              first Company2 (conditional-join) where
Company2.Company_Id = iiCompanyId AND
Company2.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 tqDInvoiceDeductionByFilters


field namedata typedb fielddescription
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.
tiCompany_IDintegerCompany1.Company_IDRecord ID
tcCompanyCodecharacterCompany1.CompanyCodeEntity Code
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
tiDeductionCatLine_IDintegerDeductionCatLine.DeductionCatLine_IDRecord ID
tcDeductionCatTypecharacterDeductionCat.DeductionCatTypeType
tiDInvoice_IDintegerDInvoice.DInvoice_IDRecord ID
tdDInvoiceBalanceTCdecimalDInvoice.DInvoiceBalanceTCBalance. This field displays the sum of the debit and credit amounts of all posting lines in transaction currency.
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.
tiDInvoiceDeduction_IDintegerDInvoiceDeduction.DInvoiceDeduction_IDRecord ID
tcDInvoiceDeductionApRejComcharacterDInvoiceDeduction.DInvoiceDeductionApRejComApprove/Reject Comment
ttDInvoiceDeductionApRejDatedateDInvoiceDeduction.DInvoiceDeductionApRejDateApprove/Reject Date
tdDInvoiceDeductionCCdecimalDInvoiceDeduction.DInvoiceDeductionCCDeduction SC
tcDInvoiceDeductionCommentcharacterDInvoiceDeduction.DInvoiceDeductionCommentComment
ttDInvoiceDeductionCreateDatedateDInvoiceDeduction.DInvoiceDeductionCreateDateCreate Date
tcDInvoiceDeductionCustRefcharacterDInvoiceDeduction.DInvoiceDeductionCustRefCustomer Reference
tdDInvoiceDeductionLCdecimalDInvoiceDeduction.DInvoiceDeductionLCDeduction BC
tcDInvoiceDeductionPromotionCodecharacterDInvoiceDeduction.DInvoiceDeductionPromotionCodePromotion Code
tiDInvoiceDeductionSequenceintegerDInvoiceDeduction.DInvoiceDeductionSequenceSequence
tcDInvoiceDeductionStatuscharacterDInvoiceDeduction.DInvoiceDeductionStatusDeduction Status
tdDInvoiceDeductionTCdecimalDInvoiceDeduction.DInvoiceDeductionTCDeduction TC
tcDInvoiceDescriptioncharacterDInvoice.DInvoiceDescriptionDescription. A brief description of the invoice. This field is mandatory.
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
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_IDintegerCompany2.Company_IDRecord ID
tcExpenseCompanyCodecharacterCompany2.CompanyCodeEntity Code
tcJournalCodecharacterJournal.JournalCodeA daybook code (maximum eight characters).
tiPaidDInvoice_IDintegerDInvoiceDeduction.PaidDInvoice_IDLink to PaidDInvoice
DInvoiceCustomcharactercalculatedcustom fields
Company1Customcharactercalculatedcustom fields
DebtorCustomcharactercalculatedcustom fields
DInvoiceDeductionCustomcharactercalculatedcustom fields
DeductionCatLineCustomcharactercalculatedcustom fields
DeductionCatCustomcharactercalculatedcustom fields
CurrencyCustomcharactercalculatedcustom fields
Company2Customcharactercalculatedcustom fields
JournalCustomcharactercalculatedcustom fields
BusinessRelationCustomcharactercalculatedcustom fields
ti_sequenceintegercalculatedprimary index
tc_rowidcharactercalculated = rowid(DInvoice),rowid(Company1),rowid(Domains),rowid(Currency),rowid(Debtor),rowid(BusinessRelation),rowid(DInvoiceDeduction),rowid(DeductionCatLine),rowid(DeductionCat),rowid(DInvoice2),rowid(Company2),rowid(Journal)


Internal usage


QadFinancials
method BDInvoice.ApiGetDeductions
dataset BDInvoice.tApiGetDeductions
dataset BDInvoice.tApiGetDeductionsForReview
dataset BDInvoice.tDInvoiceDeductionByFilters
dataset BDInvoice.tDInvoiceDeductionByFiltersTmp
dataset BDInvoice.ttApiGetDeductionsForReview