project QadFinancials > class BCreditorReport > business logic query GetAllInvoiceForWHT


Parameters


iiCompanyIdintegerCompany id
icFromCreditorcharacter
icToCreditorcharacter
iiPostingYearinteger
icCDocumentStatusListcharactercontains a collection of cdocument statusses
iiYearintegerYear
iiPeriodintegerPeriod
icFromJournalcharacterJournal From
icToJournalcharacterJournal till
iiFromVoucherintegerFrom Vouchernumber
iiToVoucherintegerTill vouchernumber


query condition


  each CInvoice where
CInvoice.Company_Id = iiCompanyId AND
CInvoice.CInvoiceIsWHT = yes AND
CInvoice.CInvoicePostingYear = iiPostingYear AND
CInvoice.CInvoiceVoucher >= iiFromVoucher AND
CInvoice.CInvoiceVoucher <= iiToVoucher

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

          first Vat (outer-join) where
Vat.Vat_ID = CInvoiceWHT.Vat_ID AND

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

          each WHT (outer-join) where
WHT.Company_Id = iiCompanyId AND
WHT.CInvoiceWHT_ID = CInvoiceWHT.CInvoiceWHT_ID AND
WHT.WHTStatus can-do icCDocumentStatusList AND
WHT.WHTPeriodYear = iiYear AND
WHT.WHTPeriodPeriod = iiPeriod

      first Creditor (inner-join) where
Creditor.SharedSet_Id = vi_CREDITOR_sharedset(iiCompanyId) AND
Creditor.Creditor_ID = CInvoice.Creditor_ID AND
Creditor.CreditorCode >= icFromCreditor AND
Creditor.CreditorCode <= icToCreditor

      first Journal (inner-join) where
Journal.SharedSet_Id = vi_JOURNAL_sharedset(iiCompanyId) AND
Journal.Journal_ID = CInvoice.Journal_ID AND
Journal.JournalCode >= icFromJournal AND
Journal.JournalCode <= icToJournal


query resultset tqGetAllInvoiceForWHT


field namedata typedb fielddescription
tiCInvoice_IDintegerCInvoice.CInvoice_IDRecord ID
tiCInvoiceCurrency_IDintegerCInvoice.CInvoiceCurrency_IDCurrency Code
ttCInvoiceDatedateCInvoice.CInvoiceDateInvoice Date. This field indicates the invoice creation date.
The system uses this field with the credit terms to calculate due date and discount date.
api annotation:This field defaults from the system date.
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.
tcCInvoiceReferencecharacterCInvoice.CInvoiceReferenceReference. An alphanumeric reference to help identify the invoice in the system.
This reference is typically the ID number of the invoice received from the supplier.
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)
tdCInvoiceWHTTotAmtCreditTCdecimalCInvoice.CInvoiceWHTTotAmtCreditTCTC WHT Total Amount (CR)
tdCInvoiceWHTTotAmtDebitTCdecimalCInvoice.CInvoiceWHTTotAmtDebitTCTC WHT Total Amount (DR)
tiCreditor_IDintegerCreditor.Creditor_IDRecord ID
tcCreditorCodecharacterCreditor.CreditorCodeSupplier Code
tcJournalCodecharacterJournal.JournalCodeA daybook code (maximum eight characters).
tctx2_groupcharactertx2_mstr.tx2_groupTax Group
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


Internal usage


QadFinancials
method BCreditorReport.CreditorWithholdingTax