project QadFinancials > class BCreditorReport > business logic query CInvoiceForCInvoicePosting


Parameters


iiCompanyIdintegerCompany id
icCreditorTypecharacter
icFromCreditorCodecharacter
icToCreditorCodecharacter
icPurchaseTypecharacter
icCurrencyCodecharacter
itFromPostingDatedate
itToPostingDatedate
ilCInvoiceIsOpenlogical


query condition


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

      first BusinessRelation2 (inner-join) where
BusinessRelation2.BusinessRelation_ID = Creditor.BusinessRelation_ID AND

      each CInvoice (inner-join) where
CInvoice.Company_Id = iiCompanyId AND
CInvoice.Creditor_ID = Creditor.Creditor_ID AND
CInvoice.CInvoicePostingDate >= itFromPostingDate AND
CInvoice.CInvoicePostingDate <= itToPostingDate AND
CInvoice.CInvoiceIsOpen = ilCInvoiceIsOpen AND
CInvoice.CInvoiceType <> {&INVOICETYPE-ADJUSTMENT} AND
CInvoice.CInvoiceType <> {&INVOICETYPE-PREPAYMENT}

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

          first Currency2 (inner-join) where
Currency2.Currency_ID = CInvoice.CInvoiceCurrency_ID AND
Currency2.CurrencyCode = icCurrencyCode

          first Journal2 (inner-join) where
Journal2.SharedSet_Id = vi_JOURNAL_sharedset(iiCompanyId) AND
Journal2.Journal_ID = CInvoice.Journal_ID AND

          first PurchaseType (conditional-join) where
PurchaseType.PurchaseType_ID = CInvoice.PurchaseType_ID AND
PurchaseType.PurchaseTypeCode can-do icPurchaseType

          first Address (inner-join) where
Address.Address_ID = CInvoice.ShipToAddress_ID AND

              first BusinessRelation1 (inner-join) where
BusinessRelation1.BusinessRelation_ID = Address.BusinessRelation_ID AND

          each CInvoicePosting (inner-join) where
CInvoicePosting.CInvoice_ID = CInvoice.CInvoice_ID AND

              first Posting (inner-join) where
Posting.Company_Id = iiCompanyId AND
Posting.Posting_ID = CInvoicePosting.Posting_ID AND

                  first Usr (inner-join) where
Usr.Usr_ID = Posting.CreatorUsr_ID AND

                  first Journal1 (inner-join) where
Journal1.SharedSet_Id = vi_JOURNAL_sharedset(iiCompanyId) AND
Journal1.Journal_ID = Posting.Journal_ID AND

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

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

                      first GL (inner-join) where
GL.SharedSet_Id = vi_GL_sharedset(iiCompanyId) AND
GL.GL_ID = PostingLine.GL_ID AND

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

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

                      first Currency1 (inner-join) where
Currency1.Currency_ID = PostingLine.Currency_ID AND

      first CreditorType (conditional-join) where
CreditorType.CreditorType_ID = Creditor.CreditorType_ID AND
CreditorType.CreditorTypeCode can-do icCreditorType


query resultset tqCInvoiceForCInvoicePosting


field namedata typedb fielddescription
tcBusinessRelationCodecharacterBusinessRelation1.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.
tcBusinessRelationName1characterBusinessRelation2.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.
tiCInvoice_IDintegerCInvoice.CInvoice_IDRecord ID
tdCInvoiceBalanceTCdecimalCInvoice.CInvoiceBalanceTCBalance. This field displays the sum of the debit and credit amounts of all posting lines in transaction currency.
ttCInvoiceDatedateCInvoice.CInvoiceDateInvoice Date. This field indicates the invoice creation date.
The system uses this field with the credit terms to calculate due date and discount date.
api annotation:This field defaults from the system date.
ttCInvoiceDiscountDueDatedateCInvoice.CInvoiceDiscountDueDateDiscount Due Date.This field indicates the last date a discount applies, calculated by the system based on the credit terms and the invoice date.
User can modify this field without affecting the credit terms.
ttCInvoiceDueDatedateCInvoice.CInvoiceDueDateDue Date.This field indicates the date when payment become due.
This field can be modified without affecting the credit terms.
This field is calculated by the system based on the credit terms and the invoice date.
tdCInvoiceHoldAmountTCdecimalCInvoice.CInvoiceHoldAmountTCTC Hold Amount. This field displays the amount of the invoice total that is not to be paid.
If this field is not blank, the hold amount is taken into account during payment processing.
Hold amounts must be:
For invoices or correction invoices: Less than the invoice total and greater than zero.
For credit notes or correction credit notes: Greater than the document total and less than zero.
The hold amount for a negative payment must always be set to zero.
tlCInvoiceIsInitialStatuslogicalCInvoice.CInvoiceIsInitialStatusInitial Status. This field indicates if the invoice is in initial status.
api annotation:This field defaults from the Initial Status field of the Invoice status code.
tlCInvoiceIsLogisticMatchinglogicalCInvoice.CInvoiceIsLogisticMatchingReceiver Matching.This field indicates If the Receiver Matching function is enabled.
This field is calculated by the system using the invoice status code.
tdCInvoiceNonDiscAmtTCdecimalCInvoice.CInvoiceNonDiscAmtTCTC Non-discount Amount. This field display the invoice amount without discount in base currency.
tdCInvoiceOriginalCreditTCdecimalCInvoice.CInvoiceOriginalCreditTCTC 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.
tdCInvoiceOriginalDebitTCdecimalCInvoice.CInvoiceOriginalDebitTCTC 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.
tcCInvoicePoDomaincharacterCInvoice.CInvoicePoDomainPO Domain. This field indicates which domain the purchase order belongs to.
tcCInvoicePoNbrcharacterCInvoice.CInvoicePoNbrPO Number. This fields identifies the PO receipts which the invoice matches.
ttCInvoicePostingDatedateCInvoice.CInvoicePostingDatePosting Date. This filed indicates the date on which the invoice is to be posted.
api annotation:This field defaults from the invoice creation date.
tcCInvoicePostingTypecharacterCInvoicePosting.CInvoicePostingTypeInvoice 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.
tiCInvoicePostingYearintegerCInvoice.CInvoicePostingYearYear.This field indicates the accounting year for the invoice.
If you modify these fields, the posting and tax dates are changed correspondingly.
api annotation:This field defaults to the accounting year associated with the posting date.
tcCInvoiceReferencecharacterCInvoice.CInvoiceReferenceReference. An alphanumeric reference to help identify the invoice in the system.
This reference is typically the ID number of the invoice received from the supplier.
tcCInvoiceTypecharacterCInvoice.CInvoiceTypeInvoice Type. This field identifies the invoice type.
The value can be Invoice Correction and Credit Note Correction type only when the appropriate daybook types have already been defined.
tiCInvoiceVoucherintegerCInvoice.CInvoiceVoucherVoucher. This field displays the numeric identifier assigned to the posting.
When the daybook of the journal entry is changed (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.
tcCompanyCodecharacterCompany.CompanyCodeEntity Code
tiCostCentre_IDintegerCostCentre.CostCentre_IDRecord ID
tcCostCentreCodecharacterCostCentre.CostCentreCodeCost Center: A code that identifies the cost center.
tcCostCentreDescriptioncharacterCostCentre.CostCentreDescriptionDescription: a brief description of the cost center.
tcCreditorCodecharacterCreditor.CreditorCodeSupplier Code
tcCreditorTypeCodecharacterCreditorType.CreditorTypeCodeCode
tiCrossCompany_IDintegerPostingLine.CrossCompany_IDLink to Company
tiCrossCompanyPosting_IDintegerPostingLine.CrossCompanyPosting_IDPosting (Cross-Cy)
tcCurrencyCodecharacterCurrency2.CurrencyCodeCurrency Code
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.
tcJournalCodecharacterJournal2.JournalCodeA daybook code (maximum eight characters).
tiPosting_IDintegerPosting.Posting_IDRecord ID
tcPostingCurrencyCodecharacterCurrency1.CurrencyCodeCurrency Code
tcPostingJournalCodecharacterJournal1.JournalCodeA daybook code (maximum eight characters).
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.
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.
tcPostingLineTextcharacterPostingLine.PostingLineTextDescription
api annotation:Value for this field defaults to blank. Note: if a new record is created through the user interface, the default value is as same as the value of "PostingText" of tPosting.
tiPostingVoucherintegerPosting.PostingVoucherVoucher is a sequential number that uniquely identifies the journal entry (within the combination of an entity and a daybook code).
api annotation:In create mode,enter 0 in this field - the voucher number is generated by the system. In Modify/Delete, the correct voucher number must be entered because this identifies the record.
tiPostingYearintegerPosting.PostingYearThe GL calendar year for the posting.
tiProject_IDintegerProject.Project_IDRecord ID
tcProjectCodecharacterProject.ProjectCodeProject
tcProjectDescriptioncharacterProject.ProjectDescriptionDescription
tcPurchaseTypeCodecharacterPurchaseType.PurchaseTypeCodePurchase Type
tcUsrLogincharacterUsr.UsrLoginLogin


Internal usage


QadFinancials
method BCreditorReport.CInvoiceRegister