project QadFinancials > class BCreditorReport > business logic query GetAllWHTByInvoiceID


Parameters


iiCompanyIdintegerCompany id
iiInvoiceIDinteger
iiVatIDinteger


query condition


  each CInvoice where
CInvoice.Company_Id = iiCompanyId AND
CInvoice.CInvoiceIsWHT = yes AND
CInvoice.CInvoice_ID = iiInvoiceID

      each CDocumentInvoiceXref (inner-join) where
CDocumentInvoiceXref.CInvoice_ID = CInvoice.CInvoice_ID AND

          each WHT (inner-join) where
WHT.Company_Id = iiCompanyId AND
WHT.CDocumentInvoiceXref_ID = CDocumentInvoiceXref.CDocumentInvoiceXref_ID AND
(WHT.WHTStatus = 'WHTINITIAL' OR
WHT.WHTStatus = 'WHTDUE' ) AND
WHT.Vat_ID = iiVatID

              first CInvoiceWHT (inner-join) where
CInvoiceWHT.CInvoiceWHT_ID = WHT.CInvoiceWHT_ID AND

              first Vat (inner-join) where
(vat.vat_id = wht.vat_id OR
0 = wht.vat_id )

                  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 = CInvoice.Journal_ID AND


query resultset tqGetAllWHTByInvoiceID


field namedata typedb fielddescription
tiCInvoice_IDintegerCInvoice.CInvoice_IDRecord ID
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.
tiCInvoicePostingYearintegerCInvoice.CInvoicePostingYearYear.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.
tdCInvoiceVatBaseCreditTCdecimalCInvoice.CInvoiceVatBaseCreditTCTC 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.
tdCInvoiceVatBaseDebitTCdecimalCInvoice.CInvoiceVatBaseDebitTCTC 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.
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.
tdCInvoiceWHTAmtCreditTCdecimalCInvoiceWHT.CInvoiceWHTAmtCreditTCTC WHT Amount (CR)
tdCInvoiceWHTAmtDebitTCdecimalCInvoiceWHT.CInvoiceWHTAmtDebitTCTC WHT Amount (DR)
tdCInvoiceWHTBaseAmtCreditTCdecimalCInvoice.CInvoiceWHTBaseAmtCreditTCTC WHT Base Amount (CR)
tdCInvoiceWHTBaseAmtDebitTCdecimalCInvoice.CInvoiceWHTBaseAmtDebitTCTC WHT Base Amount (DR)
tdCInvoiceWHTExpenseCreditTCdecimalCInvoiceWHT.CInvoiceWHTExpenseCreditTCTC Expense (CR)
tdCInvoiceWHTExpenseDebitTCdecimalCInvoiceWHT.CInvoiceWHTExpenseDebitTCTC Expense (DR)
tdCInvoiceWHTFeeCreditTCdecimalCInvoiceWHT.CInvoiceWHTFeeCreditTCTC Fee (CR)
tdCInvoiceWHTFeeDebitTCdecimalCInvoiceWHT.CInvoiceWHTFeeDebitTCTC Fee (DR)
tdCInvoiceWHTTaxFeeCreditTCdecimalCInvoiceWHT.CInvoiceWHTTaxFeeCreditTCTC Taxable Fee (CR)
tdCInvoiceWHTTaxFeeDebitTCdecimalCInvoiceWHT.CInvoiceWHTTaxFeeDebitTCTC Taxable Fee (DR)
tcJournalCodecharacterJournal.JournalCodeA daybook code (maximum eight characters).
tdtx2_pct_recvdecimaltx2_mstr.tx2_pct_recvPercent Recoverable
tdtx2_tax_pctdecimaltx2_mstr.tx2_tax_pctTax Rate
tiVat_IDintegerVat.Vat_IDRecord ID
tcVatCodecharacterVat.VatCodeTax Code
tcVatDescriptioncharacterVat.VatDescriptionDescription
tdWHTAmtCreditTCdecimalWHT.WHTAmtCreditTCWHT Amount Cr TC
tdWHTAmtDebitTCdecimalWHT.WHTAmtDebitTCWHT Amount Dr TC
tdWHTChargeAmtCreditTCdecimalWHT.WHTChargeAmtCreditTCCharge Amount Cr TC
tdWHTChargeAmtDebitTCdecimalWHT.WHTChargeAmtDebitTCCharge Amount Dr TC
tcWHTChargeTypecharacterWHT.WHTChargeTypeCharge Type
tdWHTPaidAmtCreditTCdecimalWHT.WHTPaidAmtCreditTCPaid Amount Cr TC
tdWHTPaidAmtDebitTCdecimalWHT.WHTPaidAmtDebitTCPaid Amount Dr TC
tdWHTRetainedAmtCreditTCdecimalWHT.WHTRetainedAmtCreditTCRetained Amount Cr TC
tdWHTRetainedAmtDebitTCdecimalWHT.WHTRetainedAmtDebitTCRetained Amount Dr TC
tdWHTTaxableFeesCreditTCdecimalWHT.WHTTaxableFeesCreditTCTaxable Fee Amount Cr TC
tdWHTTaxableFeesDebitTCdecimalWHT.WHTTaxableFeesDebitTCTaxable Fee Amount Dr TC
tdWHTTotAmtCreditTCdecimalWHT.WHTTotAmtCreditTCTotal Amount Cr TC
tdWHTTotAmtDebitTCdecimalWHT.WHTTotAmtDebitTCTotal Amount Dr TC
tdWHTVATAmtCreditTCdecimalWHT.WHTVATAmtCreditTCTax Amount Cr TC
tdWHTVATAmtDebitTCdecimalWHT.WHTVATAmtDebitTCTax Amount Dr TC


Internal usage


QadFinancials
method BCreditorReport.CreditorWithholdingTax