project QadFinancials > class BWithholdingTax > API query SelectWHT (optimised)

Description

select all withholding tax records


query filter (table tFilter)


tcBusinessFieldNametcDataTypetcOperator
iiCompanyIdi
tCurrency.CurrencyCodec=,>=,>,<>,<=,<,begins,can-do,matches
tWHT.LastModifiedDatet=,>=,>,<>,<=,<
tWHT.LastModifiedTimei=,>=,>,<>,<=,<
tWHT.LastModifiedUserc=,>=,>,<>,<=,<,begins,can-do,matches
tVat.VatCodec=,>=,>,<>,<=,<,begins,can-do,matches
tWHT.WHTAdditionalNumberi=,>=,>,<>,<=,<
tWHT.WHTAmtCreditCCd=,>=,>,<>,<=,<
tWHT.WHTAmtCreditLCd=,>=,>,<>,<=,<
tWHT.WHTAmtCreditTCd=,>=,>,<>,<=,<
tWHT.WHTAmtDebitCCd=,>=,>,<>,<=,<
tWHT.WHTAmtDebitLCd=,>=,>,<>,<=,<
tWHT.WHTAmtDebitTCd=,>=,>,<>,<=,<
tWHT.WHTChargeAmtCreditCCd=,>=,>,<>,<=,<
tWHT.WHTChargeAmtCreditLCd=,>=,>,<>,<=,<
tWHT.WHTChargeAmtCreditTCd=,>=,>,<>,<=,<
tWHT.WHTChargeAmtDebitCCd=,>=,>,<>,<=,<
tWHT.WHTChargeAmtDebitLCd=,>=,>,<>,<=,<
tWHT.WHTChargeAmtDebitTCd=,>=,>,<>,<=,<
tWHT.WHTChargeTypec=,>=,>,<>,<=,<,begins,can-do,matches
tWHT.WHTCInvoicePostingDatet=,>=,>,<>,<=,<
tWHT.WHTCInvoiceReferencec=,>=,>,<>,<=,<,begins,can-do,matches
tWHT.WHTCompanyCodec=,>=,>,<>,<=,<,begins,can-do,matches
tWHT.WHTCompanyLCCurrencyCodec=,>=,>,<>,<=,<,begins,can-do,matches
tWHT.WHTCreditorCodec=,>=,>,<>,<=,<,begins,can-do,matches
tWHT.WHTCreditorSharedSetCodec=,>=,>,<>,<=,<,begins,can-do,matches
tWHT.WHTIsPrintedl=,<>
tWHT.WHTNumberi=,>=,>,<>,<=,<
tWHT.WHTPaidAmtCreditCCd=,>=,>,<>,<=,<
tWHT.WHTPaidAmtCreditLCd=,>=,>,<>,<=,<
tWHT.WHTPaidAmtCreditTCd=,>=,>,<>,<=,<
tWHT.WHTPaidAmtDebitCCd=,>=,>,<>,<=,<
tWHT.WHTPaidAmtDebitLCd=,>=,>,<>,<=,<
tWHT.WHTPaidAmtDebitTCd=,>=,>,<>,<=,<
tWHT.WHTPaymentDatet=,>=,>,<>,<=,<
tWHT.WHTPaymentReferencec=,>=,>,<>,<=,<,begins,can-do,matches
tWHT.WHTPercentaged=,>=,>,<>,<=,<
tWHT.WHTPeriodPeriodi=,>=,>,<>,<=,<
tWHT.WHTPeriodYeari=,>=,>,<>,<=,<
tWHT.WHTRetainedAmtCreditCCd=,>=,>,<>,<=,<
tWHT.WHTRetainedAmtCreditLCd=,>=,>,<>,<=,<
tWHT.WHTRetainedAmtCreditTCd=,>=,>,<>,<=,<
tWHT.WHTRetainedAmtDebitCCd=,>=,>,<>,<=,<
tWHT.WHTRetainedAmtDebitLCd=,>=,>,<>,<=,<
tWHT.WHTRetainedAmtDebitTCd=,>=,>,<>,<=,<
tWHT.WHTSettlementDatet=,>=,>,<>,<=,<
tWHT.WHTStatusc=,>=,>,<>,<=,<,begins,can-do,matches
tWHT.WHTTaxableFeesCreditCCd=,>=,>,<>,<=,<
tWHT.WHTTaxableFeesCreditLCd=,>=,>,<>,<=,<
tWHT.WHTTaxableFeesCreditTCd=,>=,>,<>,<=,<
tWHT.WHTTaxableFeesDebitCCd=,>=,>,<>,<=,<
tWHT.WHTTaxableFeesDebitLCd=,>=,>,<>,<=,<
tWHT.WHTTaxableFeesDebitTCd=,>=,>,<>,<=,<
tWHT.WHTTaxTypec=,>=,>,<>,<=,<,begins,can-do,matches
tWHT.WHTTotAmtCreditCCd=,>=,>,<>,<=,<
tWHT.WHTTotAmtCreditLCd=,>=,>,<>,<=,<
tWHT.WHTTotAmtCreditTCd=,>=,>,<>,<=,<
tWHT.WHTTotAmtDebitCCd=,>=,>,<>,<=,<
tWHT.WHTTotAmtDebitLCd=,>=,>,<>,<=,<
tWHT.WHTTotAmtDebitTCd=,>=,>,<>,<=,<
tWHT.WHTVATAmtCreditCCd=,>=,>,<>,<=,<
tWHT.WHTVATAmtCreditLCd=,>=,>,<>,<=,<
tWHT.WHTVATAmtCreditTCd=,>=,>,<>,<=,<
tWHT.WHTVATAmtDebitCCd=,>=,>,<>,<=,<
tWHT.WHTVATAmtDebitLCd=,>=,>,<>,<=,<
tWHT.WHTVATAmtDebitTCd=,>=,>,<>,<=,<


Parameters (internal)


iiCompanyIdintegerCompany id


query condition


  each WHT where
WHT.Company_Id = iiCompanyId AND

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

      first Vat (conditional-join) where
Vat.Vat_ID = WHT.Vat_ID AND


query resultset tqSelectWHT


field namedata typedb fielddescription
tiCACInvoice_IDintegerWHT.CACInvoice_IDLink to CA-CInvoice
tiWHTAdditionalNumberintegerWHT.WHTAdditionalNumberAdditional WHT Additional WHT Number
tcWHTCompanyCodecharacterWHT.WHTCompanyCodeEntity Code
tcVatCodecharacterVat.VatCodeTax Code
tcCurrencyCodecharacterCurrency.CurrencyCodeCurrency Code
tcWHTCreditorCodecharacterWHT.WHTCreditorCodeSupplier Code
tiWHTPeriodPeriodintegerWHT.WHTPeriodPeriodGL Period
tiWHTPeriodYearintegerWHT.WHTPeriodYearGL Calendar Year
tcWHTTaxTypecharacterWHT.WHTTaxTypeTax Type
ttWHTPaymentDatedateWHT.WHTPaymentDatePayment Date
tcWHTPaymentReferencecharacterWHT.WHTPaymentReferencePayment Reference
tcWHTStatuscharacterWHT.WHTStatusWHT Status
tiWHTNumberintegerWHT.WHTNumberWHT Number
tiBankStateAlloc_IDintegerWHT.BankStateAlloc_IDLink to BankStateAlloc
tiCDocumentInvoiceXref_IDintegerWHT.CDocumentInvoiceXref_IDLink to CDocumentInvoiceXref
tiCInvoice_IDintegerWHT.CInvoice_IDLink to CInvoice
tiCInvoiceWHT_IDintegerWHT.CInvoiceWHT_IDLink to CInvoiceWHT
tiCompany_IDintegerWHT.Company_IDLink to Company
tiCostCentre_IDintegerWHT.CostCentre_IDLink to CostCentre
tiCreditor_IDintegerWHT.Creditor_IDLink to Creditor
tiCurrency_IDintegerWHT.Currency_IDLink to Currency
tiDivision_IDintegerWHT.Division_IDLink to Division
tiGL_IDintegerWHT.GL_IDLink to GL
tiProject_IDintegerWHT.Project_IDLink to Project
tiVat_IDintegerWHT.Vat_IDLink to Vat
tiWHT_IDintegerWHT.WHT_IDRecord ID
tdWHTAmtCreditCCdecimalWHT.WHTAmtCreditCCWHT Amount Cr SC
tdWHTAmtCreditLCdecimalWHT.WHTAmtCreditLCWHT Amount Cr BC
tdWHTAmtCreditTCdecimalWHT.WHTAmtCreditTCWHT Amount Cr TC
tdWHTAmtDebitCCdecimalWHT.WHTAmtDebitCCWHT Amount Dr SC
tdWHTAmtDebitLCdecimalWHT.WHTAmtDebitLCWHT Amount Dr LC
tdWHTAmtDebitTCdecimalWHT.WHTAmtDebitTCWHT Amount Dr TC
tiWHTCertFormat_IDintegerWHT.WHTCertFormat_IDLink to WHTCertFormat
tdWHTChargeAmtCreditCCdecimalWHT.WHTChargeAmtCreditCCCharge Amount Cr SC
tdWHTChargeAmtCreditLCdecimalWHT.WHTChargeAmtCreditLCCharge Amount Cr BC
tdWHTChargeAmtCreditTCdecimalWHT.WHTChargeAmtCreditTCCharge Amount Cr TC
tdWHTChargeAmtDebitCCdecimalWHT.WHTChargeAmtDebitCCCharge Amount Dr SC
tdWHTChargeAmtDebitLCdecimalWHT.WHTChargeAmtDebitLCCharge Amount Dr LC
tdWHTChargeAmtDebitTCdecimalWHT.WHTChargeAmtDebitTCCharge Amount Dr TC
tcWHTChargeTypecharacterWHT.WHTChargeTypeCharge Type
ttWHTCInvoicePostingDatedateWHT.WHTCInvoicePostingDateInvoice Posting Date
tcWHTCInvoiceReferencecharacterWHT.WHTCInvoiceReferenceInvoice Reference
tlWHTIsPrintedlogicalWHT.WHTIsPrintedPrinted
tdWHTPaidAmtCreditCCdecimalWHT.WHTPaidAmtCreditCCPaid Amount Cr SC
tdWHTPaidAmtCreditLCdecimalWHT.WHTPaidAmtCreditLCPaid Amount Cr BC
tdWHTPaidAmtCreditTCdecimalWHT.WHTPaidAmtCreditTCPaid Amount Cr TC
tdWHTPaidAmtDebitCCdecimalWHT.WHTPaidAmtDebitCCPaid Amount Dr SC
tdWHTPaidAmtDebitLCdecimalWHT.WHTPaidAmtDebitLCPaid Amount Dr LC
tdWHTPaidAmtDebitTCdecimalWHT.WHTPaidAmtDebitTCPaid Amount Dr TC
tdWHTPercentagedecimalWHT.WHTPercentageWHT Tax Rate Perc
tdWHTRetainedAmtCreditCCdecimalWHT.WHTRetainedAmtCreditCCRetained Amount Cr SC
tdWHTRetainedAmtCreditLCdecimalWHT.WHTRetainedAmtCreditLCRetained Amount Cr BC
tdWHTRetainedAmtCreditTCdecimalWHT.WHTRetainedAmtCreditTCRetained Amount Cr TC
tdWHTRetainedAmtDebitCCdecimalWHT.WHTRetainedAmtDebitCCRetained Amount Dr SC
tdWHTRetainedAmtDebitLCdecimalWHT.WHTRetainedAmtDebitLCRetained Amount Dr LC
tdWHTRetainedAmtDebitTCdecimalWHT.WHTRetainedAmtDebitTCRetained Amount Dr TC
ttWHTSettlementDatedateWHT.WHTSettlementDateSettlement Date
tdWHTTaxableFeesCreditCCdecimalWHT.WHTTaxableFeesCreditCCTaxable Fee Amount Cr SC
tdWHTTaxableFeesCreditLCdecimalWHT.WHTTaxableFeesCreditLCTaxable Fee Amount Cr BC
tdWHTTaxableFeesCreditTCdecimalWHT.WHTTaxableFeesCreditTCTaxable Fee Amount Cr TC
tdWHTTaxableFeesDebitCCdecimalWHT.WHTTaxableFeesDebitCCTaxable Fee Amount Dr SC
tdWHTTaxableFeesDebitLCdecimalWHT.WHTTaxableFeesDebitLCTaxable Fee Amount Dr LC
tdWHTTaxableFeesDebitTCdecimalWHT.WHTTaxableFeesDebitTCTaxable Fee Amount Dr TC
tdWHTTotAmtCreditCCdecimalWHT.WHTTotAmtCreditCCTotal Amount Cr SC
tdWHTTotAmtCreditLCdecimalWHT.WHTTotAmtCreditLCTotal Amount Cr BC
tdWHTTotAmtCreditTCdecimalWHT.WHTTotAmtCreditTCTotal Amount Cr TC
tdWHTTotAmtDebitCCdecimalWHT.WHTTotAmtDebitCCTotal Amount Dr SC
tdWHTTotAmtDebitLCdecimalWHT.WHTTotAmtDebitLCTotal Amount Dr LC
tdWHTTotAmtDebitTCdecimalWHT.WHTTotAmtDebitTCTotal Amount Dr TC
tdWHTVATAmtCreditCCdecimalWHT.WHTVATAmtCreditCCTax Amount Cr SC
tdWHTVATAmtCreditLCdecimalWHT.WHTVATAmtCreditLCTax Amount Cr BC
tdWHTVATAmtCreditTCdecimalWHT.WHTVATAmtCreditTCTax Amount Cr TC
tdWHTVATAmtDebitCCdecimalWHT.WHTVATAmtDebitCCTax Amount Dr SC
tdWHTVATAmtDebitLCdecimalWHT.WHTVATAmtDebitLCTax Amount Dr LC
tdWHTVATAmtDebitTCdecimalWHT.WHTVATAmtDebitTCTax Amount Dr TC
ttLastModifiedDatedateWHT.LastModifiedDateLast Modified Date
tiLastModifiedTimeintegerWHT.LastModifiedTimeLast Modified Time
tcLastModifiedUsercharacterWHT.LastModifiedUserLast Modified User
tcWHTCompanyLCCurrencyCodecharacterWHT.WHTCompanyLCCurrencyCodeBase Currency
tcWHTCreditorSharedSetCodecharacterWHT.WHTCreditorSharedSetCodeSupplier Shared Set Code
WHTCustomcharactercalculatedcustom fields
CurrencyCustomcharactercalculatedcustom fields
VatCustomcharactercalculatedcustom fields
ti_sequenceintegercalculatedprimary index
tc_rowidcharactercalculated = rowid(WHT),rowid(Currency),rowid(Vat)


Internal usage


unused


Sample code: how to call this query through RPCRequestService (QXtend Inbound)

define temp-table ttContext no-undo
    field propertyQualifier as character
    field propertyName as character
    field propertyValue as character
    index entityContext is primary unique
        propertyQualifier
        propertyName
    index propertyQualifier
        propertyQualifier.

define dataset dsContext for ttContext.

define variable vhContextDS as handle no-undo.
define variable vhExceptionDS as handle no-undo.
define variable vhServer as handle no-undo.
define variable vhInputDS as handle no-undo.
define variable vhInputOutputDS as handle no-undo.
define variable vhOutputDS as handle no-undo.
define variable vhParameter as handle no-undo.

/* Create context */
create ttContext.
assign ttContext.propertyName = "programName"
       ttContext.propertyValue = "BWithholdingTax".
create ttContext.
assign ttContext.propertyName = "methodName"
       ttContext.propertyValue = "SelectWHT".
create ttContext.
assign ttContext.propertyName = "applicationId"
       ttContext.propertyValue = "fin".
create ttContext.
assign ttContext.propertyName = "entity"
       ttContext.propertyValue = "1000".
create ttContext.
assign ttContext.propertyName = "userName"
       ttContext.propertyValue = "mfg".
create ttContext.
assign ttContext.propertyName = "password"
       ttContext.propertyValue = "".

/* Create input dataset */
create dataset vhInputDS.
vhInputDS:read-xmlschema("file", "xml/bwithholdingtax.selectwht.i.xsd", ?).
vhParameter = vhInputDS:get-buffer-handle("tParameterI").
vhParameter:buffer-create().

assign vhParameter::icRange = "A"
       vhParameter::icRowid = ""
       vhParameter::iiRownum = 0
       vhParameter::iiNumber = 5 /* Number of records to read */
       vhParameter::icSortColumns = ""
       vhParameter::ilCountOnly = false
       vhParameter::ilForwardRead = true
       vhParameter::iiMaximumBrowseRecordsToCount = 0.

vhParameter = vhInputDS:get-buffer-handle("tFilter").
vhParameter:buffer-create().

assign vhParameter::<field-name-1> = <field-value-1>
       vhParameter::<field-name-2> = <field-value-2>
       ...

/* Connect the AppServer */
create server vhServer.
vhServer:connect("-URL <appserver-url>").

if not vhServer:connected()
then do:
    message "Could not connect AppServer" view-as alert-box error title "Error".
    return.
end.

/* Run */
assign vhContextDS = dataset dsContext:handle.

run program/rpcrequestservice.p on vhServer
    (input-output dataset-handle vhContextDS by-reference,
           output dataset-handle vhExceptionDS,
     input        dataset-handle vhInputDS by-reference,
     input-output dataset-handle vhInputOutputDS by-reference,
           output dataset-handle vhOutputDS).

/* Handle output however you want, in this example, we dump it to xml */
if valid-handle(vhExceptionDS)
then vhExceptionDS:write-xml("file", "Exceptions.xml", true).

if valid-handle(vhOutputDS)
then vhOutputDS:write-xml("file", "Output.xml", true).

/* Cleanup */
vhServer:disconnect().
assign vhServer = ?.

if valid-handle(vhInputDS)
then delete object vhInputDS.

if valid-handle(vhOutputDS)
then delete object vhOutputDS.

if valid-handle(vhExceptionDS)
then delete object vhExceptionDS.