project QadFinancials > class BDDocumentReport > business logic query HeadOfficeForDebtor


Parameters


iiCompanyIdintegerCompany id
iiDebtorIDinteger
icRelationCodecharacter


query condition


  each Debtor where
Debtor.SharedSet_Id = vi_DEBTOR_sharedset(iiCompanyId) AND
Debtor.Debtor_ID = iiDebtorID

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

          each Address (inner-join) where
Address.BusinessRelation_ID = BusinessRelation.BusinessRelation_ID AND

              first AddressType (inner-join) where
AddressType.AddressType_ID = Address.AddressType_ID AND
AddressType.AddressTypeCode = icRelationCode

              first Country (inner-join) where
Country.Country_ID = Address.Country_ID AND

              first County (outer-join) where
County.County_ID = Address.County_ID AND


query resultset tqHeadOfficeForDebtor


field namedata typedb fielddescription
tcAddressCitycharacterAddress.AddressCityCity. The city for this address. This field can be used to decide the tax zone of the address.
tiAddressFormatintegerAddress.AddressFormatFormat. This field determines where postal codes display on printed addresses.
api annotation:PartialUpdate = yes - defaults to the value for the same field defined for the country.
tcAddressStreet1characterAddress.AddressStreet1Address: Line one of address details.
This field can be blank.
tcAddressStreet2characterAddress.AddressStreet2Address.Line two of address details.
This field can be blank.
tcAddressStreet3characterAddress.AddressStreet3Address.Line three of address details.
This field can be blank.
tcAddressTypeCodecharacterAddressType.AddressTypeCodeAddress Type
tcAddressZipcharacterAddress.AddressZipZip. The postal code or US zip code associated with this address.
This field is used to decide the tax zone for the address.
This field can be blank.
tiBusinessRelation_IDintegerDebtor.BusinessRelation_IDBusiness Relation
tiBusinessRelation_ID2integerBusinessRelation.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.
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.
tcBusinessRelationName2characterBusinessRelation.BusinessRelationName2Second Name. An extended name when the Name field is not large enough to contain all information.
This fielsd can be blank.
tiCountry_IDintegerAddress.Country_IDCountry Format
tiCountry_ID2integerCountry.Country_IDRecord ID
tcCountryCodecharacterCountry.CountryCodeCountry Code
tcCountryDescriptioncharacterCountry.CountryDescriptionDescription
tiCounty_IDintegerAddress.County_IDDescription
tiCounty_ID2integerCounty.County_IDRecord ID
tcCountyCodecharacterCounty.CountyCodeCounty Code
tcCountyDescriptioncharacterCounty.CountyDescriptionDescription
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.
ti_sequenceintegercalculatedprimary index
tc_rowidcharactercalculated = rowid(Debtor),rowid(BusinessRelation),rowid(Address),rowid(AddressType),rowid(Country),rowid(County)


Internal usage


QadFinancials
method BDDocumentReport.DDocumentReportAll