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


iiCompanyIdintegerCompany id
icDebtorCodecharacter
iiDebtorIDinteger


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 namedata typedb fielddescription
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.
tlDebtorIsActivelogicalDebtor.DebtorIsActiveIndicate if this is an active record.
api annotation:Value for this field defaults to false.
tiInvControlGLProfile_IDintegerDebtor.InvControlGLProfile_IDControl GL Profile (Invoice)
tiCnControlGLProfile_IDintegerDebtor.CnControlGLProfile_IDControl GL Profile (Credit Note)
tiPrePayControlGLProfile_IDintegerDebtor.PrePayControlGLProfile_IDControl GL Profile (Pre-payment)
tcInvoiceControlGLCodecharacterGL1.GLCodeA code identifying the GL account.
tcCreditNoteControlGLCodecharacterGL2.GLCodeA code identifying the GL account.
tcPrepaymentControlGLCodecharacterGL3.GLCodeA code identifying the GL account.


Internal usage


QadFinancials
method BOpenItemAdjustment.OIAdjNewOpenItem