project QadFinancials > class BDebtor > business logic query DebtorForProfiles
Description
Query that returns the 3 control-gl-codes based upon the key of a debtor
Parameters
| iiCompanyId | integer | Company id |
| icDebtorCode | character | |
| iiDebtorID | integer | |
query condition
each Debtor where
Debtor.SharedSet_Id = vi_DEBTOR_sharedset(iiCompanyId) AND
Debtor.Debtor_ID = iiDebtorID AND
Debtor.DebtorCode = icDebtorCode
first Profile1 (inner-join) where
Profile1.Profile_ID = Debtor.InvControlGLProfile_ID AND
each ProfileLink1 (inner-join) where
ProfileLink1.Profile_ID = Profile1.Profile_ID AND
first GL1 (inner-join) where
GL1.SharedSet_Id = vi_GL_sharedset(iiCompanyId) AND
GL1.GL_ID = ProfileLink1.ProfileLinkObject_ID AND
first Profile2 (inner-join) where
Profile2.Profile_ID = Debtor.CnControlGLProfile_ID AND
each ProfileLink2 (inner-join) where
ProfileLink2.Profile_ID = Profile2.Profile_ID AND
first GL2 (inner-join) where
GL2.SharedSet_Id = vi_GL_sharedset(iiCompanyId) AND
GL2.GL_ID = ProfileLink2.ProfileLinkObject_ID AND
first Profile3 (inner-join) where
Profile3.Profile_ID = Debtor.PrePayControlGLProfile_ID AND
each ProfileLink3 (inner-join) where
ProfileLink3.Profile_ID = Profile3.Profile_ID AND
first GL3 (inner-join) where
GL3.SharedSet_Id = vi_GL_sharedset(iiCompanyId) AND
GL3.GL_ID = ProfileLink3.ProfileLinkObject_ID AND
query resultset tqDebtorForProfiles
| field name | data type | db field | description |
| tiDebtor_ID | integer | Debtor.Debtor_ID | Record ID |
| tcDebtorCode | character | Debtor.DebtorCode | A 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. |
| tlDebtorIsActive | logical | Debtor.DebtorIsActive | Indicate if this is an active record. |
| api annotation: | | Value for this field defaults to false. |
| tiInvControlGLProfile_ID | integer | Debtor.InvControlGLProfile_ID | Control GL Profile (Invoice) |
| tiCnControlGLProfile_ID | integer | Debtor.CnControlGLProfile_ID | Control GL Profile (Credit Note) |
| tiPrePayControlGLProfile_ID | integer | Debtor.PrePayControlGLProfile_ID | Control GL Profile (Pre-payment) |
| tcInvoiceControlGLCode | character | GL1.GLCode | A code identifying the GL account. |
| tcCreditNoteControlGLCode | character | GL2.GLCode | A code identifying the GL account. |
| tcPrepaymentControlGLCode | character | GL3.GLCode | A code identifying the GL account. |
Internal usage
QadFinancials