project QadFinancials > class BCreditorReport > business logic query CreditorBalanceSummary

Description

This query can be sued to get all the balances using cHist. You should specify the from/till you are interested in.


Parameters


iiCompanyIdintegerCompany id
icCandoCreditorCodecharacter
icCandoBRCodecharacter
icFromBRCodecharacter
icFromCreditorCodecharacter
iiAccYearPeriodinteger
icToBRCodecharacter
icToCreditorCodecharacter
icFromGLCodecharacter
icToGLCodecharacter
icCandoGLCodecharacter


query condition


  each Creditor where
Creditor.SharedSet_Id = vi_CREDITOR_sharedset(iiCompanyId) AND
Creditor.CreditorCode >= icFromCreditorCode AND
Creditor.CreditorCode <= icToCreditorCode AND
Creditor.CreditorCode can-do icCandoCreditorCode

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

      each CHist (inner-join) where
CHist.Company_Id = iiCompanyId AND
CHist.Creditor_ID = Creditor.Creditor_ID AND
CHist.CHistYearPeriodFrom <= iiAccYearPeriod AND
CHist.CHistYearPeriodTill >= iiAccYearPeriod

          first CostCentre (conditional-join) where
CostCentre.SharedSet_Id = vi_COSTCENTRE_sharedset(iiCompanyId) AND
CostCentre.CostCentre_ID = CHist.CostCentre_ID AND

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

          first Division (conditional-join) where
Division.SharedSet_Id = vi_DIVISION_sharedset(iiCompanyId) AND
Division.Division_ID = CHist.Division_ID AND

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

          first Journal (inner-join) where
Journal.SharedSet_Id = vi_JOURNAL_sharedset(iiCompanyId) AND
Journal.Journal_ID = CHist.Journal_ID AND

          first Project (conditional-join) where
Project.SharedSet_Id = vi_PROJECT_sharedset(iiCompanyId) AND
Project.Project_ID = CHist.Project_ID AND


query resultset tqCreditorBalanceSummary


field namedata typedb fielddescription
tiBusinessRelation_IDintegerCreditor.BusinessRelation_IDName
tiBusinessRelation_ID2integerBusinessRelation.BusinessRelation_IDRecord ID
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.
tdCHistBalanceCCdecimalCHist.CHistBalanceCCSC Balance
tdCHistBalanceLCdecimalCHist.CHistBalanceLCBC Balance
tdCHistBalanceTCdecimalCHist.CHistBalanceTCTC Balance
tiCHistYearPeriodFromintegerCHist.CHistYearPeriodFromFrom Year GL Period
tiCHistYearPeriodTillintegerCHist.CHistYearPeriodTillTo Year GL Period
tiCostCentre_IDintegerCostCentre.CostCentre_IDRecord ID
tcCostCentreCodecharacterCostCentre.CostCentreCodeCost Center: A code that identifies the cost center.
tcCostCentreDescriptioncharacterCostCentre.CostCentreDescriptionDescription: a brief description of the cost center.
tiCreditor_IDintegerCreditor.Creditor_IDRecord ID
tcCreditorCodecharacterCreditor.CreditorCodeSupplier Code
tiCurrency_IDintegerCurrency.Currency_IDRecord ID
tcCurrencyCodecharacterCurrency.CurrencyCodeCurrency Code
tcCurrencyDescriptioncharacterCurrency.CurrencyDescriptionCurrency Description
tiCurrencyNumberOfDecimalsintegerCurrency.CurrencyNumberOfDecimalsNumber of Decimals
tiDivision_IDintegerDivision.Division_IDRecord ID
tcDivisionCodecharacterDivision.DivisionCodeSub-Account
tcDivisionDescriptioncharacterDivision.DivisionDescriptionDescription
tiGL_IDintegerGL.GL_IDRecord ID
tcGLCodecharacterGL.GLCodeA code identifying the GL account.
tcGLDescriptioncharacterGL.GLDescriptionA description of the GL account.
tiJournal_IDintegerJournal.Journal_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.
tiProject_IDintegerProject.Project_IDRecord ID
tcProjectCodecharacterProject.ProjectCodeProject
tcProjectDescriptioncharacterProject.ProjectDescriptionDescription


Internal usage


QadFinancials
method BCreditorReport.CreditorAccountsSummary