project QadFinancials > class BCreditorReport > business logic query CreditorBalanceCHist
Description
This query gives all the chist records which are needed to calculate the balance at the end of the selected period. Note only balance fields ca n be used, no movements fields.
Parameters
iiCompanyId | integer | Company id |
icCandoBrCode | character | |
icCandoCreditorCode | character | |
icCandoGLCode | character | |
iiEndOfYearPeriod | integer | |
icFromBRCode | character | |
icFromCreditorCode | character | |
icFromGLCode | character | |
icToBRCode | character | |
icToCreditorCode | character | |
icToGLCode | character | |
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 <= iiEndOfYearPeriod AND
CHist.CHistYearPeriodTill >= iiEndOfYearPeriod
first Currency (inner-join) where
Currency.Currency_ID = CHist.Currency_ID AND
first GL (inner-join) where
GL.SharedSet_Id = vi_GL_sharedset(iiCompanyId) AND
GL.GL_ID = CHist.GL_ID AND
GL.GLCode >= icFromGLCode AND
GL.GLCode <= icToGLCode AND
GL.GLCode can-do icCandoGLCode
first Journal (inner-join) where
Journal.SharedSet_Id = vi_JOURNAL_sharedset(iiCompanyId) AND
Journal.Journal_ID = CHist.Journal_ID AND
query resultset tqCreditorBalanceCHist
field name | data type | db field | description |
tcBusinessRelationCode | character | BusinessRelation.BusinessRelationCode | Business 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. |
tdCHistBalanceCC | decimal | CHist.CHistBalanceCC | SC Balance |
tdCHistBalanceLC | decimal | CHist.CHistBalanceLC | BC Balance |
tdCHistBalanceTC | decimal | CHist.CHistBalanceTC | TC Balance |
tiCreditor_ID | integer | Creditor.Creditor_ID | Record ID |
tcCreditorCode | character | Creditor.CreditorCode | Supplier Code |
tcCurrencyCode | character | Currency.CurrencyCode | Currency Code |
tiCurrencyNumberOfDecimals | integer | Currency.CurrencyNumberOfDecimals | Number of Decimals |
tiGL_ID | integer | GL.GL_ID | Record ID |
tcGLCode | character | GL.GLCode | A code identifying the GL account. |
tcGLDescription | character | GL.GLDescription | A description of the GL account. |
tcGLTypeCode | character | GL.GLTypeCode | A code identifying the type of account. |
tiJournal_ID | integer | Journal.Journal_ID | Record ID |
tcJournalCode | character | Journal.JournalCode | A daybook code (maximum eight characters). |
tcJournalDescription | character | Journal.JournalDescription | A brief description of the daybook. |
| api annotation: | | Value for this field defaults to null. |
tcJournalTypeCode | character | Journal.JournalTypeCode | A daybook type code. |
| api annotation: | | Value for this field defaults to "Journal Entries". |
Internal usage
QadFinancials