Customer Detail Information
Customer Detail Information
cust_account_id customer_id ,
----------------------------------------------------------
-- Party Information
----------------------------------------------------------
haou.name org_name,
hp.party_number oracle_party_no,
hp.attribute1 Cust_legacy_no,
hp.party_name "Party Name",
hp.party_type "Party Type",
hp.tax_reference VAT_NUMBER,
hp.jgzz_fiscal_code TIN_NO,
/* DECODE(hp.status,
'A', 'Active',
'I', 'Inactive',
hp.status) "Party Status",
*/ ----------------------------------------------------------
-- Account Information
----------------------------------------------------------
hca.account_number "Account Number",
DECODE(hca.status,
'A', 'Active',
'I', 'Inactive',
hca.status) "Account Status",
hca.account_name "Account Description",
hca.customer_class_code "Classification",
DECODE(hca.customer_type,
'R', 'External',
'I', 'Internal',
hca.customer_type) "Account Type",
----------------------------------------------------------
-- Site Information
----------------------------------------------------------
/*hps.party_site_number "Customer Site Number",
DECODE(hcas.status,
'A', 'Active',
'Inactive') "Site Status",
DECODE(hcas.bill_to_flag,
'P', 'Primary',
'Y', 'Yes',
hcas.bill_to_flag) "Bill To Flag",
DECODE(hcas.ship_to_flag,
'P', 'Primary',
'Y', 'Yes',
hcas.ship_to_flag) "Ship To Flag",
hcas.cust_acct_site_id "Customer Acct Site ID",*/
----------------------------------------------------------
-- Address Information
----------------------------------------------------------
hl.address1 Billing_address,
hl.address2 Address,
hl.city "City",
hl.state "Province/State",
hl.postal_code "postal Code",
hl.country country,
-- ter.name "sales_Territory",
----------------------------------------------------------
-- Account Profile Information
---------------------------------------------------------
(select hcpc.name from HZ_CUST_PROFILE_CLASSES hcpc where
hcpc.profile_class_id = hcp.profile_class_id) Profile_class,
--hcp.credit_checking "Credit Check Flag",
--hcp.credit_hold "Credit Hold Flag",
--hcpa.auto_rec_min_receipt_amount "Min Receipt Amount",
hcpa.overall_credit_limit PROFILE_AMOUNT,
hp_per.title designation_of_contact_person,
hp_per.person_name name_of_contact_person,
hp_per.person_phone phone_no_of_contact_person
WHERE
1=1
AND hp.party_id = hca.party_id
AND hca.cust_account_id = hcas.cust_account_id(+)
AND hps.party_site_id(+) = hcas.party_site_id
AND hp.party_id = hcp.party_id
AND hca.cust_account_id = hcp.cust_account_id
AND hps.location_id = hl.location_id(+)
--AND col.collector_id = hcp.collector_id
-- AND hcas.territory_id = ter.territory_id(+)
AND hcp.cust_account_profile_id = hcpa.cust_account_profile_id(+)
and haou.organization_id = hcas.org_id
and hcas.cust_account_id = hp_per.cust_account_id(+)
----
-- AND hp.party_type = 'ORGANIZATION' -- only ORGANIZATION Party
types
-- AND hp.status = 'A' -- only Active
Parties/Customers
----
-- following conditions are for testing purpose only
-- comment/uncomment as needed
----
-- AND hp.party_number = 1146
--and hp.party_name ='Pranto Traders'
-- AND hca.account_number = 32253 --32396 --31753 --32253 --31038
ORDER BY TO_NUMBER(hp.party_number), hp.party_name, hca.account_number