project QadFinancials > class BDInvoice > business logic query DinvoiceByIDForBusinessRel


Parameters


iiCompanyIdintegerCompany id
iiDinvoiceIDinteger


query condition


  each DInvoice where
DInvoice.Company_Id = iiCompanyId AND
DInvoice.DInvoice_ID = iiDinvoiceID

      first CostCentre (outer-join) where
CostCentre.SharedSet_Id = vi_COSTCENTRE_sharedset(iiCompanyId) AND
CostCentre.CostCentre_ID = DInvoice.CostCentre_ID AND

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

      first Debtor (inner-join) where
Debtor.SharedSet_Id = vi_DEBTOR_sharedset(iiCompanyId) AND
Debtor.Debtor_ID = DInvoice.Debtor_ID AND

          first BusinessRelation (inner-join) where
BusinessRelation.BusinessRelation_ID = Debtor.BusinessRelation_ID AND

      first Division (outer-join) where
Division.SharedSet_Id = vi_DIVISION_sharedset(iiCompanyId) AND
Division.Division_ID = DInvoice.Division_ID AND

      first Project (outer-join) where
Project.SharedSet_Id = vi_PROJECT_sharedset(iiCompanyId) AND
Project.Project_ID = DInvoice.Project_ID AND


query resultset tqDinvoiceByIDForBusinessRel


field namedata typedb fielddescription
tiBusinessRelation_IDintegerBusinessRelation.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.
tcBusinessRelationICCodecharacterBusinessRelation.BusinessRelationICCodeIntercompany Code. When Intercompany is true, this field is mandatory.
The code entered here must match the intercompany code entered for GL accounts in order to generate intercompany reports.
The intercompany code must be unique for this business relation.
tcCostCentreCodecharacterCostCentre.CostCentreCodeCost Center: A code that identifies the cost center.
tcCurrencyCodecharacterCurrency.CurrencyCodeCurrency Code
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.
tiDInvoice_IDintegerDInvoice.DInvoice_IDRecord ID
tdDInvoiceCCRatedecimalDInvoice.DInvoiceCCRateSC Rate. The statutory exchange rate used by the invoice.
The SC Invoice Amount is calculated based on the SC rate.
tdDInvoiceCCScaledecimalDInvoice.DInvoiceCCScaleScale Factor. This field indicates the scale factor applying to the SC rate in use for foreign currency payments.
tiDInvoiceCurrency_IDintegerDInvoice.DInvoiceCurrency_IDCurrency Code
tcDInvoiceDITextcharacterDInvoice.DInvoiceDITextCIDescription. A brief description for the SI posting.
api annotation:This field defaults from the DInvoiceDescription.
tdDInvoiceExchangeRatedecimalDInvoice.DInvoiceExchangeRateExchange Rate. The accounting exchange rate used by the invoice.
The BC Invoice Amount is calculated based on the exchange rate.
If user modify the TC Invoice Amount, the BC invoice amount is automatically adjusted.
tdDInvoiceRateScaledecimalDInvoice.DInvoiceRateScaleScale Factor.This field indicates the scale factor applying to the exchange rate in use for foreign currency payments.
The exchange rate is multiplied by the scale factor to determine the actual exchange rate.
api annotation:The value for the scale factor defaults from the exchange rate definition, but it can be modified.
tiDivision_IDintegerDInvoice.Division_IDSub-Account
tcDivisionCodecharacterDivision.DivisionCodeSub-Account
tcProjectCodecharacterProject.ProjectCodeProject


Internal usage


QadFinancials
method BDInvoice.AdditionalUpdatesAllCreateDA
method BDInvoice.AdditionalUpdatesAllCreateDALinkedDI