project QadFinancials > class BDInvoice > business logic query GetDeductionDetailByInvoiceID


Parameters


iiCompanyIdintegerCompany id
iiInvoiceIDinteger


query condition


  each DInvoice where
DInvoice.Company_Id = iiCompanyId AND
DInvoice.DInvoice_ID = iiInvoiceID

      first Company (inner-join) where
Company.Company_Id = iiCompanyId AND
Company.Company_ID = DInvoice.Company_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 Journal (inner-join) where
Journal.SharedSet_Id = vi_JOURNAL_sharedset(iiCompanyId) AND
Journal.Journal_ID = DInvoice.Journal_ID AND


query resultset tqGetDeductionDetailByInvoiceID


field namedata typedb fielddescription
tiApprovePosting_IDintegerDInvoiceDeduction.ApprovePosting_IDLink to ApprovePosting
tcCompanyCodecharacterCompany.CompanyCodeEntity Code
tcDeductionCatCodecharacterDeductionCat.DeductionCatCodeDeduction Category Code
tcDeductionCatDescriptioncharacterDeductionCat.DeductionCatDescriptionDescription
tiDeductionCatLine_IDintegerDInvoiceDeduction.DeductionCatLine_IDLink to DeductionCatLine
tcDeductionCatTypecharacterDeductionCat.DeductionCatTypeType
tiDInvoice_IDintegerDInvoice.DInvoice_IDRecord ID
tiDInvoiceDeduction_IDintegerDInvoiceDeduction.DInvoiceDeduction_IDRecord ID
ttDInvoiceDeductionAprRejectDatedateDInvoiceDeduction.DInvoiceDeductionApRejDateApprove/Reject Date
tdDInvoiceDeductionCCdecimalDInvoiceDeduction.DInvoiceDeductionCCDeduction SC
tcDInvoiceDeductionCommentcharacterDInvoiceDeduction.DInvoiceDeductionCommentComment
ttDInvoiceDeductionCreateDatedateDInvoiceDeduction.DInvoiceDeductionCreateDateCreate Date
tcDInvoiceDeductionCustRefcharacterDInvoiceDeduction.DInvoiceDeductionCustRefCustomer Reference
tdDInvoiceDeductionLCdecimalDInvoiceDeduction.DInvoiceDeductionLCDeduction BC
tcDInvoiceDeductionPromotionCodecharacterDInvoiceDeduction.DInvoiceDeductionPromotionCodePromotion Code
tcDInvoiceDeductionReasoncharacterDInvoiceDeduction.DInvoiceDeductionApRejComApprove/Reject Comment
tiDInvoiceDeductionSequenceintegerDInvoiceDeduction.DInvoiceDeductionSequenceSequence
tcDInvoiceDeductionStatuscharacterDInvoiceDeduction.DInvoiceDeductionStatusDeduction Status
tdDInvoiceDeductionTCdecimalDInvoiceDeduction.DInvoiceDeductionTCDeduction TC
tcDInvoiceDescriptioncharacterDInvoice.DInvoiceDescriptionDescription. A brief description of the invoice. This field is mandatory.
tcDInvoiceDITextcharacterDInvoice.DInvoiceDITextCIDescription. A brief description for the SI posting.
api annotation:This field defaults from the DInvoiceDescription.
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.
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.
tcJournalCodecharacterJournal.JournalCodeA daybook code (maximum eight characters).
tiPaidDInvoice_IDintegerDInvoiceDeduction.PaidDInvoice_IDLink to PaidDInvoice
tiRejectPosting_IDintegerDInvoiceDeduction.RejectPosting_IDLink to RejectPosting
ti_sequenceintegercalculatedprimary index
tc_rowidcharactercalculated = rowid(DInvoice),rowid(Company),rowid(DInvoiceDeduction),rowid(DeductionCatLine),rowid(DeductionCat),rowid(Journal)


Internal usage


QadFinancials
method BBankEntry.CalculateAll
method BBill.GetToBillDInvoice
method BDDocument.ApiLoadDeductionDetail
method BDDocument.ApiLoadDeductionDetailForReview
method BDDocument.Calculate
method BDDocument.GetPossibleAllocationsByBank
dataset BDDocument.tApiDInvoiceDeductionForReview