project QadFinancials > class BDebtorReport > business logic query DebtorAgeingAnalysisCurrMR

Description

Base query for the DebtorAgeingAnalysisCurrent report


Parameters


iiCompanyIdintegerCompany id
icFromDebtorCodecharacterFromDebtorCode
icToDebtorCodecharacterToDebtorCode
icCandoDebtorCodecharacterCandoDebtorCode
icFromBRCodecharacterFromBRCode
icToBRCodecharacterToBRCode
icCandoBRCodecharacterCandoBRCode
icFromDivisionCodecharacterFromDivisionCode
icToDivisionCodecharacterToDivisionCode
icCandoDivisionCodecharacterCandoDivisionCode
icFromJournalCodecharacterFromJournalCode
icToJournalCodecharacterToJournalCode
icCandoJournalCodecharacterCandoJournalCode
icCurrencyCodecharacter
iiToAccPeriodinteger
icFromProjectCodecharacter
icToProjectCodecharacter
icCandoProjectCodecharacter
icFromCCCodecharacter
icToCCCodecharacter
icCanDoCCCodecharacter
icFromGLCodecharacter
icToGLCodecharacter
icCanDoGLCodecharacter
icDebtorTypeCodecharacter
icSalespersoncharacter
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

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

      each DInvoice (inner-join) where
DInvoice.Company_Id = iiCompanyId AND
DInvoice.Debtor_ID = Debtor.Debtor_ID AND
DInvoice.DInvoiceIsOpen = true AND
DInvoice.DInvoiceSlsPsn1 = icSalesperson

          first Journal (inner-join) where
Journal.SharedSet_Id = vi_JOURNAL_sharedset(iiCompanyId) AND
Journal.Journal_ID = DInvoice.Journal_ID AND
Journal.JournalCode >= icFromJournalCode AND
Journal.JournalCode <= icToJournalCode AND
Journal.JournalCode can-do icCandoJournalCode

          first PaymentCondition (inner-join) where
PaymentCondition.PaymentCondition_ID = DInvoice.NormalPaymentCondition_ID AND

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

          first Project (conditional-join) where
Project.SharedSet_Id = vi_PROJECT_sharedset(iiCompanyId) AND
Project.Project_ID = DInvoice.Project_ID AND
Project.ProjectCode >= icFromProjectCode AND
Project.ProjectCode <= icToProjectCode AND
Project.ProjectCode can-do icCanDoProjectCode

          first Reason (inner-join) where
Reason.Reason_ID = DInvoice.Reason_ID AND
Reason.ReasonIsInitialStatus <> Yes

          first CostCentre (conditional-join) where
CostCentre.SharedSet_Id = vi_COSTCENTRE_sharedset(iiCompanyId) AND
CostCentre.CostCentre_ID = DInvoice.CostCentre_ID AND
CostCentre.CostCentreCode >= icFromCCCode AND
CostCentre.CostCentreCode <= icToCCCode AND
CostCentre.CostCentreCode can-do icCanDoCCCode

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

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

          first Division (conditional-join) where
Division.SharedSet_Id = vi_DIVISION_sharedset(iiCompanyId) AND
Division.Division_ID = DInvoice.Division_ID AND
Division.DivisionCode >= icFromDivisionCode AND
Division.DivisionCode <= icToDivisionCode AND
Division.DivisionCode can-do icCandoDivisionCode

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

      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 tqDebtorAgeingAnalysisCurrMR


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.
tiControlGL_IDintegerGL.GL_IDRecord ID
tiCostCentre_IDintegerCostCentre.CostCentre_IDRecord ID
tcCostCentreCodecharacterCostCentre.CostCentreCodeCost Center: A code that identifies the cost center.
tcCostCentreDescriptioncharacterCostCentre.CostCentreDescriptionDescription: a brief description of the cost center.
tiCurrency_IDintegerCurrency1.Currency_IDRecord ID
tcCurrencyCodecharacterCurrency1.CurrencyCodeCurrency Code
tcCurrencyDescriptioncharacterCurrency1.CurrencyDescriptionCurrency Description
tiCurrencyNumberOfDecimalsintegerCurrency1.CurrencyNumberOfDecimalsNumber of Decimals
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.
tcDebtorCommentNotecharacterDebtor.DebtorCommentNoteFree-form text related to this customer that is saved with the customer record.
api annotation:Value for this field defaults to null.
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.
tiDInvoice_IDintegerDInvoice.DInvoice_IDRecord ID
tiDInvoice_ID2integerDInvoiceStage.DInvoice_IDLink to DInvoice
tdDInvoiceBalanceCreditCCdecimalDInvoice.DInvoiceBalanceCreditCCBC Balance Amount CR. This field displays the sum of the credit amounts of all posting lines in transaction currency.
This field is calculated by the system using the TC Base Amount CR and the SC rate.
tdDInvoiceBalanceCreditLCdecimalDInvoice.DInvoiceBalanceCreditLCBC Balance Amount CR. This field displays the sum of the credit amounts of all posting lines in transaction currency.
This field is calculated by the system using the TC Base Amount CR and the Exchange rate.
tdDInvoiceBalanceCreditTCdecimalDInvoice.DInvoiceBalanceCreditTCTC Balance Amount CR. This field displays the sum of the credit amounts of all posting lines in transaction currency.
tdDInvoiceBalanceDebitCCdecimalDInvoice.DInvoiceBalanceDebitCCSC Balance Amount DR. This field displays the sum of the debit amounts of all posting lines in statutory currency.
This field is calculated by the system using the TC Base Amount DR and the SC rate.
tdDInvoiceBalanceDebitLCdecimalDInvoice.DInvoiceBalanceDebitLCBC Balance Amount DR. This field displays the sum of the debit amounts of all posting lines in transaction currency.
This field is calculated by the system using the TC Base Amount DR and the Exchange rate.
tdDInvoiceBalanceDebitTCdecimalDInvoice.DInvoiceBalanceDebitTCTC Balance Amount DR. This field displays the sum of the debit amounts of all posting lines in transaction currency.
tcDInvoiceCommentNotecharacterDInvoice.DInvoiceCommentNoteComment. This field contains user's comment of the invoice.
ttDInvoiceDatedateDInvoice.DInvoiceDateInvoice Date. This field indicates the invoice creation date.This field is normallly prior to the posting date and within the same accounting period as the posting date. The date must be within the upper and lower date limits of an open GL period.
The system uses the invoice date with the credit terms to calculate due date and discount date.
api annotation:This field defaults to the DInvoicePostingDate.
tcDInvoiceDescriptioncharacterDInvoice.DInvoiceDescriptionDescription. A brief description of the invoice. This field is mandatory.
ttDInvoiceDiscountDueDatedateDInvoice.DInvoiceDiscountDueDateDiscount Due Date. This field displays the last date a discount applies, calculated by the system based on the credit terms and the invoice date.
You can modify the due date without affecting the credit terms.
If the credit terms have a base date specified, this is used in the due date calculations rather than the invoice creation date.
tcDInvoiceDITextcharacterDInvoice.DInvoiceDITextCIDescription. A brief description for the SI posting.
api annotation:This field defaults from the DInvoiceDescription.
ttDInvoiceDueDatedateDInvoice.DInvoiceDueDateDue Date. This field displays the date when payment is due, calculated by the system based on the credit terms and the invoice date. User can modify the due date without affecting the credit terms.
If the credit terms have a base date specified, this is used in the due date calculations rather than the invoice creation date.
tcDInvoiceGoldenTaxInvoiceListcharacterDInvoice.DInvoiceGoldenTaxInvoiceListGolden Tax Invoices
tcDInvoiceLegalDocumentListcharacterDInvoice.DInvoiceLegalDocumentListLegal Documents
tdDInvoiceOriginalCreditCCdecimalDInvoice.DInvoiceOriginalCreditCCSC Invoice Amount (CR). This field displays the credit total invoice amount in the statutory currency.
This field is calculated by the system using the TC Invoice Amount(CR) and the SC Rate.
tdDInvoiceOriginalCreditLCdecimalDInvoice.DInvoiceOriginalCreditLCBC Invoice Amount(CR). This field displays the credit total invoice amount in the base currency.
This field is calculated by the system using the TC Invoice Amount(CR) and the Exchange rate.
tdDInvoiceOriginalCreditTCdecimalDInvoice.DInvoiceOriginalCreditTCTC 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.
tdDInvoiceOriginalDebitCCdecimalDInvoice.DInvoiceOriginalDebitCCSC Invoice Amount (DR). This field displays the debit total invoice amount in the statutory currency.
This field is calculated by the system using the TC Invoice Amount(CR) and the SC Rate.
tdDInvoiceOriginalDebitLCdecimalDInvoice.DInvoiceOriginalDebitLCBC Invoice Amount(DR). This field displays the debit total invoice amount in the base currency.
This field is calculated by the system using the TC Invoice Amount(DR) and the Exchange rate.
tdDInvoiceOriginalDebitTCdecimalDInvoice.DInvoiceOriginalDebitTCTC 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.
ttDInvoicePostingDatedateDInvoice.DInvoicePostingDatePosting Date. This field displays the date the sales-related invoice was generated by Invoice Post and Print.
This field is updated when the invoice is validated and saved.
api annotation:This field defaults from the invoice creation date.
tcDInvoiceSalesOrderListcharacterDInvoice.DInvoiceSalesOrderListSales Orders
tcDInvoiceShipperListcharacterDInvoice.DInvoiceShipperListShippers
tcDInvoiceSlsPsn1characterDInvoice.DInvoiceSlsPsn1Salesperson 1.This field displays the salesperson specified on the order to receive commission and quota credit for the order.
api annotation:The commission percentage defaults from the salesperson record.
tiDInvoiceStage_IDintegerDInvoiceStage.DInvoiceStage_IDRecord ID
tdDInvoiceStageAmountCCdecimalDInvoiceStage.DInvoiceStageAmountCCSC Amount. CInvoiceStageAmountSC Staged payments credit terms details of the invoice. The amount to pay in SC for this stage.
tdDInvoiceStageAmountLCdecimalDInvoiceStage.DInvoiceStageAmountLCBC Amount. CInvoiceStageAmountBC Staged payments credit terms details of the invoice. The amount to pay in BC for this stage.
tdDInvoiceStageAmountTCdecimalDInvoiceStage.DInvoiceStageAmountTCTC Amount. CInvoiceStageAmountTC Staged payments credit terms details of the invoice. The amount to pay in TC for this stage.
tdDInvoiceStageAmtAppliedTCdecimalDInvoiceStage.DInvoiceStageAmtAppliedTCTC Applied Amount. CInvoiceStageAmtAppliedTC Staged payments credit terms details of the invoice. The amount paid in TC for this stage.
ttDInvoiceStageDiscDatedateDInvoiceStage.DInvoiceStageDiscDateCInvoiceDiscDate Payment discount due date. When the invoice is paid before this date a payment discount can be given.
ttDInvoiceStageDueDatedateDInvoiceStage.DInvoiceStageDueDateDue Date. The date when this stage should end.
tcDInvoiceTypecharacterDInvoice.DInvoiceTypeInvoice Type. This field displays the invoice type.
Invoice Correction and Credit Note Correction display as choices only when the appropriate daybook types have already been defined.
api annotation:PartialUpdate = yes - defaults to Invoice
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.
tiDivision_IDintegerDivision.Division_IDRecord ID
tcDivisionCodecharacterDivision.DivisionCodeSub-Account
tcDivisionDescriptioncharacterDivision.DivisionDescriptionDescription
tcGLCodecharacterGL.GLCodeA code identifying the GL account.
tcGLDescriptioncharacterGL.GLDescriptionA description of the GL account.
tcJournalCodecharacterJournal.JournalCodeA daybook code (maximum eight characters).
tcPaymentConditionPaymentTypcharacterPaymentCondition.PaymentConditionPaymentTypPayment Type
tiPaymentGroup_IDintegerPaymentGroup.PaymentGroup_IDRecord ID
tcPaymentGroupCodecharacterPaymentGroup.PaymentGroupCodePayment Group
tcPaymentGroupDescriptioncharacterPaymentGroup.PaymentGroupDescriptionDescription
tiPeriodPeriodintegerPeriod.PeriodPeriodGL Period
tiPeriodYearintegerPeriod.PeriodYearGL Calendar Year
tiProject_IDintegerProject.Project_IDRecord ID
tcProjectCodecharacterProject.ProjectCodeProject
tcProjectDescriptioncharacterProject.ProjectDescriptionDescription
tlReasonIsInitialStatuslogicalReason.ReasonIsInitialStatusInitial Status


Internal usage


QadFinancials
method BDebtorReport.DebtorAgeingAnalysisCurrent
dataset BDebtorReport.tqBaseDebtorAgeingAnalysisCurr