project QadFinancials > class BBusinessRelation > business logic query VatPostingsByDebtor


Parameters


iiCompanyIdintegerCompany id
itFromTaxpointDatedateFromTaxPointDate
iiFromVatPeriodintegerFromVatPeriod
iiFromVatYearintegerFromVatYear
icGLTypeCodecharacterGLTypeCode
icPeriodMarkcharacterPeriodMark
itToTaxpointDatedate
iiToVatPeriodintegerFromVatPeriod
iiToVatYearintegerToVatYear
icVatNumberIdentitycharacterVatNumberIdentity
icVatNumberDeclarationcharacterVatNumberDeclaration


query condition


  each VatNumber where
VatNumber.VatNumberIdentity = icVatNumberIdentity AND
VatNumber.VatNumberDeclaration = icVatNumberDeclaration

      first BusinessRelation (inner-join) where
BusinessRelation.BusinessRelation_ID = VatNumber.BusinessRelation_ID AND

          each Debtor (conditional-join) where
Debtor.SharedSet_Id = vi_DEBTOR_sharedset(iiCompanyId) AND
Debtor.BusinessRelation_ID = BusinessRelation.BusinessRelation_ID AND

              each DInvoice (conditional-join) where
DInvoice.Company_Id = iiCompanyId AND
DInvoice.Debtor_ID = Debtor.Debtor_ID AND

                  each DInvoicePosting (conditional-join) where
DInvoicePosting.DInvoice_ID = DInvoice.DInvoice_ID AND

                      first Posting (conditional-join) where
Posting.Company_Id = iiCompanyId AND
Posting.Posting_ID = DInvoicePosting.Posting_ID AND

                          each PostingLine (conditional-join) where
PostingLine.Company_Id = iiCompanyId AND
PostingLine.Posting_ID = Posting.Posting_ID AND

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

                              each PostingVat (conditional-join) where
PostingVat.PostingLine_ID = PostingLine.PostingLine_ID AND
PostingVat.PostingVatTaxPointDate >= itFromTaxpointDate AND
PostingVat.PostingVatTaxPointDate <= itToTaxpointDate

                                  first PeriodMark (conditional-join) where
PeriodMark.Company_Id = iiCompanyId AND
PeriodMark.PeriodMark_ID = PostingVat.PeriodMark_ID AND
PeriodMark.PeriodMarkCode = icPeriodMark

                                  first VatPeriod (conditional-join) where
VatPeriod.Company_Id = iiCompanyId AND
VatPeriod.VatPeriod_ID = PostingVat.VatPeriod_ID AND
VatPeriod.VatPeriodYear >= iiFromVatYear AND
VatPeriod.VatPeriodPeriod <= iiFromVatPeriod AND
VatPeriod.VatPeriodYear <= iiToVatYear AND
VatPeriod.VatPeriodPeriod <= iiToVatPeriod

      first Country (inner-join) where
Country.Country_ID = VatNumber.IdentityCountry_ID AND


query resultset tqVatPostingsByDebtor


field namedata typedb fielddescription
tcCountryCodecharacterCountry.CountryCodeCountry Code
tcDebtorCodecharacterDebtor.DebtorCodeA code (maximum eight characters) that identifies a customer. If the code you specify matches an existing supplier code, a warning message displays. You can choose to ignore the warning, and create the record. However, when a supplier and customer share the same code, they must reference the same business relation.
api annotation:If you leave the Customer Code field blank, the system automatically generates a number for the record based on the sequence defined in Customer Autonumber Create.
tcGLTypeCodecharacterGL.GLTypeCodeA code identifying the type of account.
tcPeriodMarkCodecharacterPeriodMark.PeriodMarkCodeMark
ttPostingVatTaxPointDatedatePostingVat.PostingVatTaxPointDateThe date when this posting is taken into account in the Tax sub-adminstration.
api annotation:?
tiVatPeriodPeriodintegerVatPeriod.VatPeriodPeriodTax Period
tiVatPeriodYearintegerVatPeriod.VatPeriodYearTax Year
tiBusinessRelation_IDintegerVatNumber.BusinessRelation_IDLink to BusinessRelation
tiVatNumber_IDintegerVatNumber.VatNumber_IDRecord ID
tiCurrency_IDintegerPostingLine.Currency_IDCurrency Code
tcVatNumberDeclarationcharacterVatNumber.VatNumberDeclarationObsolete field
tcVatNumberIdentitycharacterVatNumber.VatNumberIdentityObsolete field
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
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
tdPostingVatBaseCreditLCdecimalPostingVat.PostingVatBaseCreditLCBC (Base/Local Currency) Base Credit amount.
tdPostingVatBaseCreditTCdecimalPostingVat.PostingVatBaseCreditTCTC (Transaction Currency) Base Credit amount.
tdPostingVatBaseDebitLCdecimalPostingVat.PostingVatBaseDebitLCBC (Base/Local Currency) Base Debit amount.
tdPostingVatBaseDebitTCdecimalPostingVat.PostingVatBaseDebitTCTC (Transaction Currency) Base Debit amount.


Internal usage


QadFinancials
method BVATExportListing.ApiExportYearlyVatBE