project QadFinancials > class BDDocument > business logic query DDocumentForBankImport

Description

This query gets Debtor Documents ready for payment.


Parameters


iiCompanyIdintegerCompany id
icReferencecharacter
iiOwnBankNumberIdinteger
idAmountTCdecimal
icIncassoSelectCodecharacter
iiDebtorIdinteger
icDebtorCodecharacter
iiDDocumentIdinteger
iiCurrencyIDinteger
icExcludeDDocStatusListcharacter


query condition


  each DDocument where
DDocument.Company_Id = iiCompanyId AND
DDocument.DDocumentReference = icReference AND
DDocument.DDocumentIncassoSelectCode = icIncassoSelectCode AND
DDocument.Debtor_ID = iiDebtorId AND
DDocument.DDocument_ID = iiDDocumentId AND
DDocument.Currency_ID = iiCurrencyID AND
DDocument.DDocumentOriginalDebitTC = idAmountTC AND
NOTDDocument.DDocumentStatus can-do icExcludeDDocStatusList

      first DCollection (inner-join) where
DCollection.Company_Id = iiCompanyId AND
DCollection.DCollection_ID = DDocument.DCollection_ID AND
DCollection.DCollectionBalanceTC <> 0

      first Debtor (inner-join) where
Debtor.SharedSet_Id = vi_DEBTOR_sharedset(iiCompanyId) AND
Debtor.Debtor_ID = DDocument.Debtor_ID AND
Debtor.DebtorCode = icDebtorCode

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

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

          each BankNumber (inner-join) where
BankNumber.ParentObject_ID = GL.GL_ID AND
BankNumber.BankNumber_ID = iiOwnBankNumberId


query resultset tqDDocumentForBankImport


field namedata typedb fielddescription
tiBankNumber_IDintegerBankNumber.BankNumber_IDRecord ID
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.
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.
tiDCollection_IDintegerDCollection.DCollection_IDRecord ID
tdDCollectionBalanceTCdecimalDCollection.DCollectionBalanceTCTC Balance
tcDCollectionNamecharacterDCollection.DCollectionNameName
tiDCollectionNumberintegerDCollection.DCollectionNumberNumber
tcDCollectionReferencecharacterDCollection.DCollectionReference1099 Box Reference
tiDDocument_IDintegerDDocument.DDocument_IDRecord ID
tcDDocumentIncassoSelectCodecharacterDDocument.DDocumentIncassoSelectCodeCustomer Payment Selection Code. This field displays the customer payment selection code.
This field is read-only.
tlDDocumentIsOpenlogicalDDocument.DDocumentIsOpenOpen. This field indicates if the payment is completely paid already.
tiDDocumentNumberintegerDDocument.DDocumentNumberDocument Number. This field hold a unified number for report use.
tcDDocumentReferencecharacterDDocument.DDocumentReferenceReference. Reference text for the payment.
tcDDocumentTypecharacterDDocument.DDocumentTypePayment Instrument. The system displays the payment instrument associated with the payment format linked to the customer bank.
tiDDocumentYearintegerDDocument.DDocumentYearYear/Number. This field displays the accounting year and payment sequence number, which is automatically generated by the accounting year.
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.


Internal usage


QadFinancials
method BBankImportLine.GetDDocumentByBankImpLine
dataset BBankImportLine.tDDocumentForBankImport