project QadFinancials > class BDebtorReport > business logic query GetDraftInvoicesforDAAB

Description

Get draft records for the DebtorAgeingAnalysisBackwards report


Parameters


iiCompanyIdintegerCompany id
icFromDebtorCodecharacterFromDebtorCode
icToDebtorCodecharacterToDebtorCode
icCandoDebtorCodecharacterCandoDebtorCode
icFromBRCodecharacterFromBRCode
icToBRCodecharacterToBRCode
icCandoBRCodecharacterCandoBRCode
icCurrencyCodecharacter
itAgeingDatedateAgeing Date
icCanDoGLCodecharacter
icFromGLCodecharacter
icToGLCodecharacter
icDDocumentDraftTypecharacter
icDebtorTypeCodecharacter
icPaymentGroupcharacter


query condition


  each Debtor where
Debtor.SharedSet_Id = vi_DEBTOR_sharedset(iiCompanyId) AND
Debtor.DebtorCode >= icFromDebtorCode AND
Debtor.DebtorCode <= icToDebtorCode AND
Debtor.DebtorCode can-do icCandoDebtorCode

      first BusinessRelation (inner-join) where
BusinessRelation.BusinessRelation_ID = Debtor.BusinessRelation_ID AND
BusinessRelation.BusinessRelationCode >= icFromBRCode AND
BusinessRelation.BusinessRelationCode <= icToBRCode AND
BusinessRelation.BusinessRelationCode can-do icCandoBRCode

      each DDocument (inner-join) where
DDocument.Company_Id = iiCompanyId AND
DDocument.Debtor_ID = Debtor.Debtor_ID AND
DDocument.DDocumentType = icDDocumentDraftType AND
DDocument.DDocumentClosingDate > itAgeingDate

          first BankNumber (inner-join) where
BankNumber.BankNumber_ID = DDocument.BankNumber_ID AND

              first BankPayFormat (inner-join) where
BankPayFormat.BankPayFormat_ID = BankNumber.BankPayFormat_ID AND

                  first PayFormatType (inner-join) where
PayFormatType.PayFormatTypeCode = BankPayFormat.PayFormatTypeCode AND

          first Company (inner-join) where
Company.Company_Id = iiCompanyId AND
Company.Company_ID = DDocument.Company_ID AND

          first Currency1 (inner-join) where
Currency1.Currency_ID = DDocument.Currency_ID AND
Currency1.CurrencyCode = icCurrencyCode

          each DDocumentPostingLine (inner-join) where
DDocumentPostingLine.DDocument_ID = DDocument.DDocument_ID AND

              first PostingLine (inner-join) where
PostingLine.Company_Id = iiCompanyId AND
PostingLine.PostingLine_ID = DDocumentPostingLine.PostingLine_ID AND
PostingLine.PostingDate <= itAgeingDate

                  first GL (inner-join) where
GL.SharedSet_Id = vi_GL_sharedset(iiCompanyId) AND
GL.GL_ID = PostingLine.GL_ID AND
GL.GLCode >= icFromGLCode AND
GL.GLCode <= icToGLCode AND
GL.GLCode can-do icCanDoGLCode

      first DebtorType (conditional-join) where
DebtorType.DebtorType_ID = Debtor.DebtorType_ID AND
DebtorType.DebtorTypeCode can-do icDebtorTypeCode

      first PaymentGroup (conditional-join) where
PaymentGroup.PaymentGroup_ID = Debtor.PaymentGroup_ID AND
PaymentGroup.PaymentGroupCode = icPaymentGroup

      first Currency2 (inner-join) where
Currency2.Currency_ID = Debtor.Currency_ID AND


query resultset tqGetDraftInvoicesforDAAB


field namedata typedb fielddescription
tiBusinessRelation_IDintegerDebtor.BusinessRelation_IDBusiness Relation
tcBusinessRelationCodecharacterBusinessRelation.BusinessRelationCodeBusiness Relation. A code to identify the business relation.
If this field does not have a input from the user, the system automatically generates a number for the record based on the sequence defined in Business Relation Autonumber Create.
tcBusinessRelationName1characterBusinessRelation.BusinessRelationName1Name: The full name of the business relation.
This field sets the default name for linked addresses such as customers and suppliers.
api annotation:PartialUpdate = yes - defaults to the BusinessRelationCode.
tcBusinessRelationName2characterBusinessRelation.BusinessRelationName2Second Name. An extended name when the Name field is not large enough to contain all information.
This fielsd can be blank.
tcBusinessRelationSearchNamecharacterBusinessRelation.BusinessRelationSearchNameSearch Name: An alternate name for finding the business relation. This field can be useful for sorting and filtering.
api annotation:PartialUpdate = yes - defaults to the BusinessRelationCode.
tiCompany_IDintegerCompany.Company_IDRecord ID
tcCompanyCodecharacterCompany.CompanyCodeEntity Code
tiCurrency_IDintegerCurrency1.Currency_IDRecord ID
tcCurrencyCodecharacterCurrency1.CurrencyCodeCurrency Code
tcCurrencyDescriptioncharacterCurrency1.CurrencyDescriptionCurrency Description
tiCurrencyNumberOfDecimalsintegerCurrency1.CurrencyNumberOfDecimalsNumber of Decimals
tiDDocument_IDintegerDDocument.DDocument_IDRecord ID
ttDDocumentCreationDatedateDDocument.DDocumentCreationDateCreation Date.This field indicate the payment creation date.
This field is read-only.
ttDDocumentDueDatedateDDocument.DDocumentDueDateDue Date. The date on which the payment is receivable.
tiDDocumentNumberintegerDDocument.DDocumentNumberDocument Number. This field hold a unified number for report use.
tdDDocumentOriginalCreditCCdecimalDDocument.DDocumentOriginalCreditCCSC Original Credit. This field hold the amount of the payment in management currency.
tdDDocumentOriginalCreditLCdecimalDDocument.DDocumentOriginalCreditLCBC Original Credit.This field holds the amount of the Payment in baisc currency.
tdDDocumentOriginalCreditTCdecimalDDocument.DDocumentOriginalCreditTCTC Original Credit. This field holds the debit value of the payment in transaction currency.
tdDDocumentOriginalDebitCCdecimalDDocument.DDocumentOriginalDebitCCTC Original Debit. This field holds the debit value of the payment in management currency.
tdDDocumentOriginalDebitLCdecimalDDocument.DDocumentOriginalDebitLCTC Original Debit. This field holds the debit value of the payment in base currency.
tdDDocumentOriginalDebitTCdecimalDDocument.DDocumentOriginalDebitTCAmount.This field hold the value of the payment in the transaction currency. This field must be positive and can be entered manually or automatically by linking the payment to an open item.
tcDDocumentReferencecharacterDDocument.DDocumentReferenceReference. Reference text for the payment.
tcDDocumentTypecharacterDDocument.DDocumentTypePayment Instrument. The system displays the payment instrument associated with the payment format linked to the customer bank.
tiDDocumentYearintegerDDocument.DDocumentYearYear/Number. This field displays the accounting year and payment sequence number, which is automatically generated by the accounting year.
tiDebtor_IDintegerDebtor.Debtor_IDRecord ID
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.
tcDebtorCurrencycharacterCurrency2.CurrencyCodeCurrency Code
tdDebtorFixedCredLimTCdecimalDebtor.DebtorFixedCredLimTCWhen Apply Fixed Ceiling is selected, specify the currency amount that determines the maximum credit extended to this customer.
api annotation:Value for this field defaults to 0.0000 .
tdDebtorPercTurnOverCredLimdecimalDebtor.DebtorPercTurnOverCredLimWhen Apply % of Turnover is selected,specify a percentage value. The system applies this percentage to the last year turnover and displays the result in the Credit on Turnover field. The amount is recalculated when you change the percentage.
api annotation:Value for this field defaults to 0.00 .
tiDebtorType_IDintegerDebtorType.DebtorType_IDRecord ID
tcDebtorTypeCodecharacterDebtorType.DebtorTypeCodeA code (maximum four characters) that identifies a customer type.
tcDebtorTypeDescriptioncharacterDebtorType.DebtorTypeDescriptionA brief description (maximum 40 characters) of the customer type.
tiGL_IDintegerGL.GL_IDRecord ID
tcGLCodecharacterGL.GLCodeA code identifying the GL account.
tcGLDescriptioncharacterGL.GLDescriptionA description of the GL account.
tcPayFormatTypeCodecharacterPayFormatType.PayFormatTypeCodeFormat Name
tiPaymentGroup_IDintegerPaymentGroup.PaymentGroup_IDRecord ID
tcPaymentGroupCodecharacterPaymentGroup.PaymentGroupCodePayment Group
tcPaymentGroupDescriptioncharacterPaymentGroup.PaymentGroupDescriptionDescription
ttPostingDatedatePostingLine.PostingDatePosting Date.
api annotation:If this field is blank, it gets a default value equal to the value of PostingDate in tPosting.
tdPostingLineCreditCCdecimalPostingLine.PostingLineCreditCCSC Credit
api annotation:Partial Update = yes - it will get a default value depending on the value of PostingLinCreditTC, PostingLineCCRate & PostingLineCCScale.
SC Amount = TC Amount * Exchange rate (TC/SC) * Scale Factor (TC/SC). If Partial Update is false, you should enter the correct value for this 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
tdPostingLineDebitCCdecimalPostingLine.PostingLineDebitCCSC Debit
api annotation:Partial Update = yes - it will get a default value depending on the value of PostingLineDebitTC, PostingLineCCRate & PostingLineCCScale.
SC Amount = TC Amount * Exchange rate (TC/SC) * Scale Factor (TC/SC). If Partial Update is false, enter the correct value for this field.
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
tiPostingYearPeriodintegerPostingLine.PostingYearPeriodThe GL calendar year/period for the journal entry.
api annotation:In Create mode, it will get be defaulted to the value for the field PostingYearPeriod of tPosting.
ti_sequenceintegercalculatedprimary index
tc_rowidcharactercalculated = rowid(Debtor),rowid(BusinessRelation),rowid(DDocument),rowid(BankNumber),rowid(BankPayFormat),rowid(PayFormatType),rowid(Company),rowid(Currency1),rowid(DDocumentPostingLine),rowid(PostingLine),rowid(GL),rowid(DebtorType),rowid(PaymentGroup),rowid(Currency2)


Internal usage


QadFinancials
method BDebtorReport.DebtorAgeingAnalysisBackwards
method BDebtorReport.DebtorAgingHistAcroDomain
method BDebtorReport.DebtorBillingAAB