1074: phone.phone_country_code phone_country_code,
1075: phone.phone_area_code phone_area_code,
1076: phone.phone_number phone_number,
1077: phone.phone_extension phone_extension,
1078: (SELECT COUNT(1) FROM iex_bankruptcies bkr
1079: WHERE bkr.party_id = party.party_id and NVL(BKR.DISPOSITION_CODE,'GRANTED') in ('GRANTED','NEGOTIATION')) number_of_bankruptcies, -- Changed for bug#7693986
1080:
1081: (SELECT COUNT(1) FROM iex_promise_details PRO, IEX_DELINQUENCIES_ALL DEL
1082: WHERE PRO.CUST_ACCOUNT_ID = TRX_SUMM.CUST_ACCOUNT_ID and del.customer_site_use_id = TRX_SUMM.site_use_ID AND
1506:
1507: cursor c_billto_bankruptcies is
1508: select summ.party_id,
1509: COUNT(1) number_of_bankruptcies
1510: FROM iex_bankruptcies bkr,
1511: iex_dln_uwq_summary summ
1512: where bkr.customer_site_use_id=summ.site_use_id
1513: and NVL(BKR.DISPOSITION_CODE,'GRANTED') in ('GRANTED','NEGOTIATION')
1514: group by summ.party_id;
1694: phone.phone_country_code phone_country_code,
1695: phone.phone_area_code phone_area_code,
1696: phone.phone_number phone_number,
1697: phone.phone_extension phone_extension,
1698: (SELECT COUNT(1) FROM iex_bankruptcies bkr WHERE bkr.party_id = party.party_id and NVL(BKR.DISPOSITION_CODE,'GRANTED') in ('GRANTED','NEGOTIATION')) number_of_bankruptcies, -- Changed for bug#7693986
1699:
1700: (SELECT COUNT(1) FROM iex_promise_details PRO, IEX_DELINQUENCIES_ALL DEL
1701: WHERE PRO.CUST_ACCOUNT_ID = TRX_SUMM.CUST_ACCOUNT_ID and del.customer_site_use_id = TRX_SUMM.site_use_ID AND
1702: PRO.STATUS IN ('COLLECTABLE', 'PENDING') AND PRO.STATE = 'BROKEN_PROMISE' AND PRO.AMOUNT_DUE_REMAINING > 0 AND
2167:
2168: cursor c_billto_bankruptcies_dt is
2169: select summ.party_id,
2170: COUNT(1) number_of_bankruptcies
2171: FROM iex_bankruptcies bkr,
2172: iex_dln_uwq_summary summ
2173: where bkr.customer_site_use_id=summ.site_use_id
2174: and NVL(BKR.DISPOSITION_CODE,'GRANTED') in ('GRANTED','NEGOTIATION')
2175: --AND trunc(summ.last_update_date)>=trunc(sysdate-1) --changed for bug 13322580
2350: phone.phone_country_code phone_country_code,
2351: phone.phone_area_code phone_area_code,
2352: phone.phone_number phone_number,
2353: phone.phone_extension phone_extension,
2354: (SELECT COUNT(1) FROM iex_bankruptcies bkr WHERE bkr.party_id = party.party_id and NVL(BKR.DISPOSITION_CODE,'GRANTED') in ('GRANTED','NEGOTIATION')) number_of_bankruptcies, -- Changed for bug#7693986
2355:
2356: (SELECT COUNT(1) FROM iex_promise_details PRO, IEX_DELINQUENCIES_all DEL
2357: WHERE PRO.CUST_ACCOUNT_ID = TRX_SUMM.CUST_ACCOUNT_ID AND
2358: PRO.STATUS IN ('COLLECTABLE', 'PENDING') AND PRO.STATE = 'BROKEN_PROMISE' AND PRO.AMOUNT_DUE_REMAINING > 0 AND
2752:
2753: cursor c_acc_bankruptcies is
2754: select summ.party_id,summ.org_id,
2755: COUNT(1) number_of_bankruptcies
2756: FROM iex_bankruptcies bkr,
2757: iex_dln_uwq_summary summ
2758: where bkr.cust_account_id=summ.cust_account_id
2759: and NVL(BKR.DISPOSITION_CODE,'GRANTED') in ('GRANTED','NEGOTIATION')
2760: group by summ.party_id,summ.org_id;
2932: phone.phone_country_code phone_country_code,
2933: phone.phone_area_code phone_area_code,
2934: phone.phone_number phone_number,
2935: phone.phone_extension phone_extension,
2936: (SELECT COUNT(1) FROM iex_bankruptcies bkr WHERE bkr.party_id = party.party_id and NVL(BKR.DISPOSITION_CODE,'GRANTED') in ('GRANTED','NEGOTIATION')) number_of_bankruptcies, -- Changed for bug#7693986
2937:
2938: (SELECT COUNT(1) FROM iex_promise_details PRO, IEX_DELINQUENCIES_all DEL
2939: WHERE PRO.CUST_ACCOUNT_ID = TRX_SUMM.CUST_ACCOUNT_ID AND
2940: PRO.STATUS IN ('COLLECTABLE', 'PENDING') AND PRO.STATE = 'BROKEN_PROMISE' AND PRO.AMOUNT_DUE_REMAINING > 0 AND
3379:
3380: cursor c_acc_bankruptcies_dt is
3381: select summ.party_id,summ.org_id,
3382: COUNT(1) number_of_bankruptcies
3383: FROM iex_bankruptcies bkr,
3384: iex_dln_uwq_summary summ
3385: where bkr.cust_account_id=summ.cust_account_id
3386: and NVL(BKR.DISPOSITION_CODE,'GRANTED') in ('GRANTED','NEGOTIATION')
3387: --AND trunc(summ.LAST_UPDATE_DATE) >= trunc(sysdate-1) --changed for bug 13322580
3562: phone.phone_country_code phone_country_code,
3563: phone.phone_area_code phone_area_code,
3564: phone.phone_number phone_number,
3565: phone.phone_extension phone_extension,
3566: (SELECT COUNT(1) FROM iex_bankruptcies bkr WHERE bkr.party_id = party.party_id and NVL(BKR.DISPOSITION_CODE,'GRANTED') in ('GRANTED','NEGOTIATION')) number_of_bankruptcies, -- Changed for bug#7693986
3567:
3568: iex_uwq_view_pkg.get_pro_count(party.party_id, NULL, NULL, NULL, trx_summ.org_id) number_of_promises,
3569: iex_uwq_view_pkg.get_broken_prm_amt(party.party_id, NULL, NULL, trx_summ.org_id) broken_promise_amount,
3570: iex_uwq_view_pkg.get_prm_amt(party.party_id, NULL, NULL, trx_summ.org_id) promise_amount,
3957:
3958: cursor c_cu_bankruptcies is
3959: select summ.party_id,summ.org_id,
3960: COUNT(1) number_of_bankruptcies
3961: FROM iex_bankruptcies bkr,
3962: iex_dln_uwq_summary summ
3963: where bkr.party_id=summ.party_id
3964: and NVL(BKR.DISPOSITION_CODE,'GRANTED') in ('GRANTED','NEGOTIATION')
3965: and summ.site_use_id is null and summ.cust_account_id is null
4140: phone.phone_country_code phone_country_code,
4141: phone.phone_area_code phone_area_code,
4142: phone.phone_number phone_number,
4143: phone.phone_extension phone_extension,
4144: (SELECT COUNT(1) FROM iex_bankruptcies bkr WHERE bkr.party_id = party.party_id and NVL(BKR.DISPOSITION_CODE,'GRANTED') in ('GRANTED','NEGOTIATION')) number_of_bankruptcies, -- Changed for bug#7693986
4145:
4146: iex_uwq_view_pkg.get_pro_count(party.party_id, NULL, NULL, NULL, trx_summ.org_id) number_of_promises,
4147: iex_uwq_view_pkg.get_broken_prm_amt(party.party_id, NULL, NULL, trx_summ.org_id) broken_promise_amount,
4148: iex_uwq_view_pkg.get_prm_amt(party.party_id, NULL, NULL, trx_summ.org_id) promise_amount,
4581:
4582: cursor c_cu_bankruptcies_dt is
4583: select summ.party_id,summ.org_id,
4584: COUNT(1) number_of_bankruptcies
4585: FROM iex_bankruptcies bkr,
4586: iex_dln_uwq_summary summ
4587: where bkr.party_id=summ.party_id
4588: and NVL(BKR.DISPOSITION_CODE,'GRANTED') in ('GRANTED','NEGOTIATION')
4589: and summ.site_use_id is null and summ.cust_account_id is null
9947:
9948: cursor c_bankruptcies is
9949: select sua.site_use_id,
9950: COUNT(1) number_of_bankruptcies
9951: FROM iex_bankruptcies bkr,hz_cust_accounts ca,
9952: hz_cust_acct_sites_all cas,--Modified for Bug 9487600 23-Mar-2010 barathsr
9953: hz_cust_site_uses_all sua
9954: where sua.site_use_id in (select object_id from iex_pop_uwq_summ_gt)
9955: and bkr.party_id=ca.party_id
11273:
11274: cursor c_bankruptcies is
11275: select ca.cust_account_id,
11276: COUNT(1) number_of_bankruptcies
11277: FROM iex_bankruptcies bkr,hz_cust_accounts ca
11278: where ca.cust_account_id in (select object_id from iex_pop_uwq_summ_gt)
11279: and bkr.party_id=ca.party_id
11280: and NVL(BKR.DISPOSITION_CODE,'GRANTED') in ('GRANTED','NEGOTIATION') -- Changed for bug#7693986
11281: group by ca.cust_account_id;
12586:
12587: cursor c_bankruptcies is
12588: select bkr.party_id,
12589: COUNT(1) number_of_bankruptcies
12590: FROM iex_bankruptcies bkr
12591: where bkr.party_id in (select object_id from iex_pop_uwq_summ_gt)
12592: and NVL(BKR.DISPOSITION_CODE,'GRANTED') in ('GRANTED','NEGOTIATION') -- Changed for bug#7693986
12593: group by bkr.party_id;
12594: