project QadFinancials > class BPosting > business logic query PostingVatByPeriod

Description

GetPostingVatDetail


Parameters


iiCompanyIdintegerCompany id
icDeliveryTypecharacterDelivery Type
iiFromAccPeriodinteger
iiToAccPeriodintegerTo Account Period
itFromPostingDatedateFromPostingDate
itToPostingDatedateToPostingDate
itFromTaxpointDatedate
itToTaxpointDatedate
icGLTypeCodecharacter
icJournalCodecharacterDaybook Code
icJournalTypeCodecharacter
icVatCodecharacterVatCode
icVatInOutcharacterVatInOut
icVatPeriodMarkcharacterVatPeriodMark
icVatTransactionTypecharacterVatTransactionType
iiFromVoucherintegerFromVoucher
iiToVoucherintegerToVoucher


query condition


  each PostingVat where
PostingVat.PostingVatTaxPointDate >= itToTaxPointDate AND
PostingVat.PostingVatTaxPointDate <= itFromTaxpointDate

      first Vat (inner-join) where
Vat.Vat_ID = PostingVat.Vat_ID AND
Vat.VatCode can-do icVatCode AND
Vat.VatInOut can-do icVatInOut AND
Vat.VatTransactionType can-do icVatTransactionType AND
Vat.VatDeliveryType matches icDeliveryType

      first VatPeriod (inner-join) where
VatPeriod.Company_Id = iiCompanyId AND
VatPeriod.VatPeriod_ID = PostingVat.VatPeriod_ID AND
(VatPeriod.VatPeriodYear > if iiFromVatYear = -99999 then 0 else iiFromVatYear OR
(VatPeriod.VatPeriodYear = if iiFromVatYear = -99999 then 0 else iiFromVatYear AND
VatPeriod.VatPeriodPeriod >= if iiFromVatPeriod = -99999 then 0 else iiFromVatPeriod )) AND
(VatPeriod.VatPeriodYear < if iiToVatYear = -99999 then 0 else iiToVatYear OR
(VatPeriod.VatPeriodYear = if iiToVatYear = -99999 then 0 else iiToVatYear AND
VatPeriod.VatPeriodPeriod <= if iiToVatPeriod = -99999 then 0 else iiToVatPeriod ))

          first PeriodMark (inner-join) where
PeriodMark.Company_Id = iiCompanyId AND
PeriodMark.PeriodMark_ID = VatPeriod.PeriodMark_ID AND
PeriodMark.PeriodMarkCode matches icVatPeriodMark

      first PostingLine (inner-join) where
PostingLine.Company_Id = iiCompanyId AND
PostingLine.PostingLine_ID = PostingVat.PostingLine_ID AND

          first GL (inner-join) where
GL.SharedSet_Id = vi_GL_sharedset(iiCompanyId) AND
GL.GL_ID = PostingLine.GL_ID AND
GL.GLTypeCode matches icGLTypeCode

          first Posting (inner-join) where
Posting.Company_Id = iiCompanyId AND
Posting.Posting_ID = PostingLine.Posting_ID AND
Posting.PostingVoucher >= iiFromVoucher AND
Posting.PostingVoucher <= iiToVoucher AND
Posting.PostingDate >= itFromPostingDate AND
Posting.PostingDate <= itToPostingDate

              each CInvoicePosting (conditional-join) where
CInvoicePosting.Posting_ID = Posting.Posting_ID AND

                  first CInvoice (conditional-join) where
CInvoice.Company_Id = iiCompanyId AND
CInvoice.CInvoice_ID = CInvoicePosting.CInvoice_ID AND

              each DInvoicePosting (conditional-join) where
DInvoicePosting.Posting_ID = Posting.Posting_ID AND

                  first DInvoice (conditional-join) where
DInvoice.Company_Id = iiCompanyId AND
DInvoice.DInvoice_ID = DInvoicePosting.DInvoice_ID AND

              first Journal (inner-join) where
Journal.SharedSet_Id = vi_JOURNAL_sharedset(iiCompanyId) AND
Journal.Journal_ID = Posting.Journal_ID AND
Journal.JournalCode can-do icJournalCode AND
Journal.JournalTypeCode can-do icJournalTypeCode

              first Period (inner-join) where
Period.Company_Id = iiCompanyId AND
Period.Period_ID = Posting.Period_ID AND
Period.PeriodYearPeriod >= iiFromAccPeriod AND
Period.PeriodYearPeriod <= iiToAccPeriod

      first VatRule (inner-join) where
VatRule.VatRule_ID = PostingVat.VatRule_ID AND


query resultset tqPostingVatByPeriod


field namedata typedb fielddescription
tiJournal_IDintegerJournal.Journal_IDRecord ID
tiVat_IDintegerVat.Vat_IDRecord ID
tiCreditor_IDintegerCInvoice.Creditor_IDLink to Creditor
tiCTransActionStartCountry_IDintegerCInvoice.TransactionStartCountry_IDCountry Code
tiCTransActionEndCountry_IDintegerCInvoice.TransactionEndCountry_IDCountry Code
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.
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.
tiCInvoice_IDintegerCInvoice.CInvoice_IDRecord ID
tiDTransActionEndCountry_IDintegerDInvoice.TransactionEndCountry_IDCountry Code
tiDTransActionStartCountry_IDintegerDInvoice.TransactionStartCountry_IDCountry Code
tiDebtor_IDintegerDInvoice.Debtor_IDLink to Debtor
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.
tiDInvoice_IDintegerDInvoice.DInvoice_IDRecord ID
tcJournalCodecharacterJournal.JournalCodeA daybook code (maximum eight characters).
tcJournalDescriptioncharacterJournal.JournalDescriptionA brief description of the daybook.
api annotation:Value for this field defaults to null.
tcJournalTypeCodecharacterJournal.JournalTypeCodeA daybook type code.
api annotation:Value for this field defaults to "Journal Entries".
tiPeriodYearPeriodintegerPeriod.PeriodYearPeriodGL Calendar Year/GL Period
tcVatCodecharacterVat.VatCodeTax Code
tcVatDescriptioncharacterVat.VatDescriptionDescription
tcVatInOutcharacterVat.VatInOutTax In/Out
tcVatTransactionTypecharacterVat.VatTransactionTypeTransaction Type
tcTxuTaxUsage2characterVat.TxuTaxUsageTax Usage
tdPostingLineDebitLCdecimalPostingLine.PostingLineDebitLCBC Debit
api annotation:Partial Update = yes - it will get a default value depending on the value of PostingLineDebitTC, PostingLineExchangeRate and PostingLineRateScale.
BC Amount = TC Amount * Exchange rate (TC/BC) * Scale Factor (TC/BC). If Partial Update = false, enter the correct value into this field.
tdPostingLineDebitTCdecimalPostingLine.PostingLineDebitTCTC Debit
tiPostingLine_IDintegerPostingLine.PostingLine_IDRecord ID
tiPosting_IDintegerPostingLine.Posting_IDLink to Posting
tiCurrency_IDintegerPostingLine.Currency_IDCurrency Code
tdPostingLineCreditLCdecimalPostingLine.PostingLineCreditLCBC Credit
api annotation:Partial Update = yes - it will get a default value depends on the value of PostingLineCreditTC, PostingLineExchangeRate & PostingLineRateScale.
BC Amount = TC Amount * Exchange rate (TC/BC) * Scale Factor (TC/BC). If Partial Update is false, enter a value for this field.
tdPostingLineCreditTCdecimalPostingLine.PostingLineCreditTCTC Credit
tcGLTypeCodecharacterGL.GLTypeCodeA code identifying the type of account.
ttPostingDatedatePosting.PostingDateThe accounting date on which the journal entry is posted. The posting date must be a valid calendar date and must be within the GL calendar year (PostingYear) and period (PostingPeriod).
tcPostingParentTextcharacterPosting.PostingParentTextContains the description field from the parent object that triggered the posting. When the posting is an invoice posting, this field contains the invoice description. When the posting is a banking entry posting, the description of the bank statement line is copied to this field, etc. Used for information purposes on reports and browses.
api annotation:Value for this field defaults to blank.
tiPostingVoucherintegerPosting.PostingVoucherVoucher is a sequential number that uniquely identifies the journal entry (within the combination of an entity and a daybook code).
api annotation:In create mode,enter 0 in this field - the voucher number is generated by the system. In Modify/Delete, the correct voucher number must be entered because this identifies the record.
tcTxtyTaxTypecharacterPostingVat.TxtyTaxTypeTax Type
tcTxuTaxUsagecharacterPostingVat.TxuTaxUsageTax Usage. A tax usage code previously defined in Tax Usage Maintenance. Tax usage codes identify the normal use of items sold to this address. Common tax usages are retail, manufacturing, and industrialization.
api annotation:The value of Tax Usage defaults to the header of transactions created for this address.
tdPostingVatBaseDebitLCdecimalPostingVat.PostingVatBaseDebitLCBC (Base/Local Currency) Base Debit amount.
tdPostingVatBaseDebitTCdecimalPostingVat.PostingVatBaseDebitTCTC (Transaction Currency) Base Debit amount.
ttPostingVatTaxPointDatedatePostingVat.PostingVatTaxPointDateThe date when this posting is taken into account in the Tax sub-adminstration.
api annotation:?
tiPostingVat_IDintegerPostingVat.PostingVat_IDRecord ID
tdPostingVatBaseCreditLCdecimalPostingVat.PostingVatBaseCreditLCBC (Base/Local Currency) Base Credit amount.
tdPostingVatBaseCreditTCdecimalPostingVat.PostingVatBaseCreditTCTC (Transaction Currency) Base Credit amount.
tcPostingVatInOutcharacterPostingVat.PostingVatInOutIn/Out?
api annotation:Aivalable value for this field: "INPUT" represents purchases, "OUTPUT" represents sales.
tdPostingVatTaxCreditTCdecimalPostingVat.PostingVatTaxCreditTCTC (Transaction Currency) Tax Credit amount.
api annotation:?
tdPostingVatTaxDebitTCdecimalPostingVat.PostingVatTaxDebitTCTC (Transaction Currency) Tax Debit amount.
api annotation:?
tcPostingVatTaxTransTypecharacterPostingVat.PostingVatTaxTransTypeTax Transaction Type?
api annotation:Available value for this field: 29 represents "AP Payment Check (Discount at Payment)", 55 represents "AP Transactions", 22 represents "AP Invoice", 18 represents "AR Invoice", 16 represents "AR Operational Invoice", 19 represents "AR Payment (Discount at Payment)", 56 represents "AR Transactions", 45 represents "Logistic Accounting - DO Shipment", 27 represents "Logistic Accounting - PO Receipt", 43 represents "Logistic Accounting - SO Shipment", 20 represents "Purchase Order", 21 represents "Purchase Order Receipt", 25 represents "Purchase Order Return"
tcPostingVatTransTypecharacterPostingVat.PostingVatTransTypeTransaction Type?
api annotation:Available value for this field is: ACQUISITION represents "IC Acquisition", BOTH represents "Both", EXPORT represents "Export", IN represents "IN", OUT represents "OUT", IMPORT represents "Import", INLAND-PURCHASE represents "INLAND-PURCHASE", INLAND-SALES represents "INLAND-SALES", PURCHASE represents "Inland Purchase", SALES represents "Inland Sales", SUPPLY represents "IC Supply", TRIANGULARPURCHASE represents "Triangular Purchase", TRIANGULARSALES represents "Triangular Sales".
tiCreditNoteVatGroup_IDintegerVatRule.CreditNoteVatGroup_IDCredit Note Tax Group
tiInvoiceVatGroup_IDintegerVatRule.InvoiceVatGroup_IDInvoice Tax Group
tiVatPeriodYearintegerVatPeriod.VatPeriodYearTax Year
ttVatPeriodEndDatedateVatPeriod.VatPeriodEndDateEnd Date
tiVatPeriodPeriodintegerVatPeriod.VatPeriodPeriodTax Period
ttVatPeriodStartDatedateVatPeriod.VatPeriodStartDateStart Date
tcPeriodMarkCodecharacterPeriodMark.PeriodMarkCodeMark
tcFromTxzTaxZonecharacterPostingVat.FromTxzTaxZoneFrom Tax Zone.
api annotation:?
tcToTxzTaxZonecharacterPostingVat.ToTxzTaxZoneTo Tax Zone
api annotation:?
tcTxclTaxClscharacterPostingVat.TxclTaxClsTax Class. A tax class previously defined in Tax Class Maintenance. Tax classes group addresses taxed at specific rates or that are tax-exempt and help determine the default tax environment (set of tax types) for related transactions.
api annotation:The value of Tax Class defaults to the header of transactions created for this address
tcTxenvTaxEnvcharacterPostingVat.TxenvTaxEnvTax Environment. A code (maximum 16 characters) that
identifies a set of tax types for a tax zone/tax class combination. On transactions, this code identifies the transaction or line-item tax environment.
api annotation:?


Internal usage


QadFinancials
method BVATExportListing.ApiExportQuarterSum