406: pl_org_id NUMBER)
407: IS
408: SELECT DISTINCT t1.site_use_id
409: FROM
410: hz_cust_site_uses_all t1,
411: hz_cust_acct_sites_all t2
412: WHERE t1.cust_acct_site_id = t2.cust_acct_site_id
413: AND t2.cust_account_id = pl_sold_to_org_id
414: AND t1.org_id = pl_org_id
470: BEGIN
471:
472: SELECT t1.site_use_id
473: INTO l_pri_bill_to_site_id
474: FROM hz_cust_site_uses_all t1,
475: hz_cust_acct_sites_all t2
476: WHERE t1.site_use_code = 'BILL_TO'
477: AND t1.primary_flag = 'Y'
478: AND t1.status = 'A'
743: l_county,
744: l_city,
745: l_postal_code
746: FROM
747: hz_cust_site_uses_all p,
748: hz_cust_acct_sites_all a,
749: hz_cust_accounts b,
750: hz_parties c,
751: hz_party_sites d,
1119: p_county,
1120: p_city,
1121: p_postal_code
1122: FROM
1123: hz_cust_site_uses_all p,
1124: hz_cust_acct_sites_all a,
1125: hz_cust_accounts b,
1126: hz_parties c,
1127: hz_party_sites d,
1181: pl_org_id NUMBER)
1182: IS
1183: SELECT DISTINCT t1.site_use_id
1184: FROM
1185: hz_cust_site_uses_all t1,
1186: hz_cust_acct_sites_all t2
1187: WHERE t1.cust_acct_site_id = t2.cust_acct_site_id
1188: AND t2.cust_account_id = pl_sold_to_org_id
1189: AND t1.org_id = pl_org_id
1279: BEGIN
1280:
1281: SELECT t1.site_use_id
1282: INTO l_pri_bill_to_site_id
1283: FROM hz_cust_site_uses_all t1,
1284: hz_cust_acct_sites_all t2
1285: WHERE t1.site_use_code = 'BILL_TO'
1286: AND t1.primary_flag = 'Y'
1287: AND t1.status = 'A'