DBA Data[Home] [Help]

APPS.CN_FORMULA_COMMON_PKG dependencies on CN_PROCESS_BATCHES_ALL

Line 1691: FROM cn_process_batches_all batch

1687: UPDATE cn_srp_periods_all
1688: SET consistency_flag = 'Y'
1689: WHERE (salesrep_id, period_id, org_id) IN
1690: ( SELECT batch.salesrep_id, batch.period_id, batch.org_id
1691: FROM cn_process_batches_all batch
1692: WHERE batch.physical_batch_id = x_calc_batch_id);
1693: END update_consistency_flag;
1694:
1695:

Line 1726: FROM cn_process_batches_all batch,

1722: spa.srp_plan_assign_id,
1723: prd.period_id,
1724: prd.process_all_flag,
1725: decode(prd.period_id, batch.period_id, batch.start_date, prd.start_date) start_date
1726: FROM cn_process_batches_all batch,
1727: cn_srp_plan_assigns_all spa,
1728: cn_srp_intel_periods_all prd
1729: WHERE batch.physical_batch_id = p_physical_batch_id
1730: AND prd.salesrep_id = batch.salesrep_id

Line 1791: cn_process_batches_all batch

1787: batch.end_period_id end_period_id, batch.end_date end_date, pe.quota_id quota_id, pe.interval_type_id interval_type_id
1788: FROM cn_srp_plan_assigns_all spa,
1789: cn_quota_assigns_all qa,
1790: cn_quotas_all pe,
1791: cn_process_batches_all batch
1792: WHERE batch.physical_batch_id = p_physical_batch_id
1793: AND batch.salesrep_id = spa.salesrep_id
1794: AND spa.org_id = batch.org_id
1795: -- find comp plans active on batch.end_date

Line 1819: cn_process_batches_all batch

1815: batch.end_period_id end_period_id, batch.end_date end_date, pe.quota_id quota_id, pe.interval_type_id interval_type_id
1816: FROM cn_srp_plan_assigns_all spa,
1817: cn_quota_assigns_all qa,
1818: cn_quotas_all pe,
1819: cn_process_batches_all batch
1820: WHERE batch.physical_batch_id = p_physical_batch_id
1821: AND batch.salesrep_id = spa.salesrep_id
1822: AND spa.org_id = batch.org_id
1823: -- find comp plans active between batch start and end date

Line 1853: from cn_process_batches_all

1849: 'Beginning of calculate_batch ...');
1850: end if;
1851:
1852: select org_id into l_org_id
1853: from cn_process_batches_all
1854: where physical_batch_id = p_physical_batch_id and rownum = 1;
1855:
1856: -- for maintaining cn_repositories.latest_processed_date
1857: SELECT nvl(latest_processed_date, to_date('01/01/1900', 'DD/MM/YYYY'))

Line 1885: FROM cn_process_batches_all batch,

1881: last_updated_by = g_last_updated_by,
1882: last_update_login = g_last_update_login
1883: WHERE line.commission_line_id in
1884: (SELECT line2.commission_line_id
1885: FROM cn_process_batches_all batch,
1886: cn_commission_lines_all line2,
1887: cn_commission_headers_all ch
1888: WHERE batch.physical_batch_id = p_physical_batch_id
1889: AND line2.commission_header_id = ch.commission_header_id

Line 1914: FROM cn_process_batches_all batch,

1910: last_updated_by = g_last_updated_by,
1911: last_update_login = g_last_update_login
1912: WHERE line.commission_line_id in
1913: (SELECT line2.commission_line_id
1914: FROM cn_process_batches_all batch,
1915: cn_commission_lines_all line2,
1916: cn_commission_headers_all ch
1917: WHERE batch.physical_batch_id = p_physical_batch_id
1918: AND line2.commission_header_id = ch.commission_header_id

Line 2086: FROM cn_process_batches_all batch,

2082: last_updated_by = g_last_updated_by,
2083: last_update_login = g_last_update_login
2084: WHERE line.commission_line_id IN
2085: (SELECT line2.commission_line_id
2086: FROM cn_process_batches_all batch,
2087: cn_commission_lines_all line2
2088: WHERE batch.physical_batch_id = p_physical_batch_id
2089: AND line2.org_id = batch.org_id
2090: AND line2.credited_salesrep_id = batch.salesrep_id

Line 2105: cn_process_batches_all batch

2101: SET Log.status = 'COMPLETE'
2102: WHERE Log.notify_log_id IN
2103: (SELECT log2.notify_log_id
2104: FROM cn_notify_log_all log2,
2105: cn_process_batches_all batch
2106: WHERE batch.physical_batch_id = p_physical_batch_id
2107: AND log2.org_id = batch.org_id
2108: AND log2.salesrep_id = batch.salesrep_id
2109: AND log2.period_id BETWEEN batch.period_id AND batch.end_period_id

Line 2115: USING cn_process_batches_all batch

2111: AND log2.start_date >= batch.start_date);
2112: */
2113: --fix for the Bug 10011406
2114: MERGE INTO cn_notify_log_all log
2115: USING cn_process_batches_all batch
2116: ON ( batch.physical_batch_id = p_physical_batch_id
2117: AND batch.org_id = log.org_id
2118: AND batch.salesrep_id = log.salesrep_id
2119: AND log.period_id BETWEEN batch.period_id AND batch.end_period_id

Line 2140: FROM cn_notify_log_all event, cn_process_batches_all batch

2136: AND event.action IN ('SOURCE_CLS', 'XROLL', 'ROLL_PULL', 'DELETE_ROLL_PULL')
2137: AND event.status = 'INCOMPLETE'
2138: UNION
2139: SELECT event.notify_log_id
2140: FROM cn_notify_log_all event, cn_process_batches_all batch
2141: WHERE batch.physical_batch_id = p_physical_batch_id
2142: AND batch.salesrep_id = event.salesrep_id
2143: AND event.org_id = batch.org_id
2144: AND event.period_id between batch.period_id and batch.end_period_id

Line 2153: and a.salesrep_id in (select salesrep_id from cn_process_batches_all

2149: -- reset process_all_flag = 'N' since calculation completed sucessfully
2150: update cn_srp_intel_periods_all a
2151: set a.process_all_flag = 'N'
2152: where a.org_id = l_org_id
2153: and a.salesrep_id in (select salesrep_id from cn_process_batches_all
2154: where physical_batch_id = p_physical_batch_id)
2155: and a.period_id >= (select min(period_id) from cn_process_batches_all
2156: where physical_batch_id = p_physical_batch_id
2157: and salesrep_id = a.salesrep_id)

Line 2155: and a.period_id >= (select min(period_id) from cn_process_batches_all

2151: set a.process_all_flag = 'N'
2152: where a.org_id = l_org_id
2153: and a.salesrep_id in (select salesrep_id from cn_process_batches_all
2154: where physical_batch_id = p_physical_batch_id)
2155: and a.period_id >= (select min(period_id) from cn_process_batches_all
2156: where physical_batch_id = p_physical_batch_id
2157: and salesrep_id = a.salesrep_id)
2158: and a.period_id <= (select max(end_period_id) from cn_process_batches_all
2159: where physical_batch_id = p_physical_batch_id

Line 2158: and a.period_id <= (select max(end_period_id) from cn_process_batches_all

2154: where physical_batch_id = p_physical_batch_id)
2155: and a.period_id >= (select min(period_id) from cn_process_batches_all
2156: where physical_batch_id = p_physical_batch_id
2157: and salesrep_id = a.salesrep_id)
2158: and a.period_id <= (select max(end_period_id) from cn_process_batches_all
2159: where physical_batch_id = p_physical_batch_id
2160: and salesrep_id = a.salesrep_id);
2161: commit;
2162: END IF;

Line 2490: FROM cn_process_batches_all batch,

2486: Log.start_date, Log.end_date,
2487: Log.revert_state, Log.comp_group_id,
2488: Log.base_salesrep_id, Log.base_comp_group_id,
2489: Log.role_id, Log.action
2490: FROM cn_process_batches_all batch,
2491: cn_notify_log_all Log
2492: WHERE batch.physical_batch_id = p_physical_batch_id
2493: AND log.org_id = batch.org_id
2494: AND Log.period_id BETWEEN batch.period_id AND batch.end_period_id

Line 2507: FROM cn_process_batches_all batch,

2503: Log.start_date, Log.end_date,
2504: Log.revert_state, Log.comp_group_id,
2505: Log.base_salesrep_id, Log.base_comp_group_id,
2506: Log.quota_id
2507: FROM cn_process_batches_all batch,
2508: cn_notify_log_all Log
2509: WHERE batch.physical_batch_id = p_physical_batch_id
2510: AND log.org_id = batch.org_id
2511: AND Log.period_id BETWEEN batch.period_id AND batch.end_period_id

Line 2704: from cn_process_batches_all

2700: BEGIN
2701: cn_message_pkg.debug('Reversing transactions in physical batch (ID=' || p_physical_batch_id||')');
2702:
2703: select org_id into l_org_id
2704: from cn_process_batches_all
2705: where physical_batch_id = p_physical_batch_id
2706: and rownum = 1;
2707:
2708: -- mark proces_all_flag = 'Y', means that need to recalculate every transaction

Line 2719: FROM cn_process_batches_all batch,

2715: SET process_all_flag = 'Y'
2716: WHERE org_id = l_org_id
2717: AND ( salesrep_id, period_id ) IN
2718: ( SELECT DISTINCT batch.salesrep_id, Log.period_id
2719: FROM cn_process_batches_all batch,
2720: cn_notify_log_all Log
2721: WHERE batch.physical_batch_id = p_physical_batch_id
2722: AND log.org_id = batch.org_id
2723: AND Log.period_id BETWEEN batch.period_id AND batch.end_period_id

Line 3129: cn_process_batches_all batch

3125: p_calc_type cn_calc_submission_batches.calc_type%TYPE) IS
3126: CURSOR l_post_lines_csr IS
3127: SELECT line.commission_line_id
3128: FROM cn_commission_lines_all line,
3129: cn_process_batches_all batch
3130: WHERE batch.physical_batch_id = p_batch_id
3131: AND line.org_id = batch.org_id
3132: AND line.credited_salesrep_id = batch.salesrep_id
3133: AND line.status = 'CALC'

Line 3142: FROM cn_process_batches_all

3138: OR (p_calc_type ='FORECAST' AND line.trx_type = 'FORECAST') );
3139:
3140: CURSOR check_unique_tuple IS
3141: SELECT DISTINCT period_id, end_period_id, start_date, end_date
3142: FROM cn_process_batches_all
3143: WHERE physical_batch_id = p_batch_id;
3144:
3145: l_period_id NUMBER;
3146: l_end_period_id NUMBER;

Line 3164: from cn_process_batches_all

3160: BEGIN
3161: cn_message_pkg.debug('Reversing transactions in physical batch (ID='||p_batch_id||')');
3162:
3163: select org_id into l_org_id
3164: from cn_process_batches_all
3165: where physical_batch_id = p_batch_id
3166: and rownum = 1;
3167:
3168: -- mark process_all_flag = 'Y'

Line 3172: and a.salesrep_id in (select salesrep_id from cn_process_batches_all

3168: -- mark process_all_flag = 'Y'
3169: update cn_srp_intel_periods_all a
3170: set a.process_all_flag = 'Y'
3171: where a.org_id = l_org_id
3172: and a.salesrep_id in (select salesrep_id from cn_process_batches_all
3173: where physical_batch_id = p_batch_id)
3174: and a.period_id >= (select min(period_id) from cn_process_batches_all
3175: where physical_batch_id = p_batch_id
3176: and salesrep_id = a.salesrep_id)

Line 3174: and a.period_id >= (select min(period_id) from cn_process_batches_all

3170: set a.process_all_flag = 'Y'
3171: where a.org_id = l_org_id
3172: and a.salesrep_id in (select salesrep_id from cn_process_batches_all
3173: where physical_batch_id = p_batch_id)
3174: and a.period_id >= (select min(period_id) from cn_process_batches_all
3175: where physical_batch_id = p_batch_id
3176: and salesrep_id = a.salesrep_id)
3177: and a.period_id <= (select max(end_period_id) from cn_process_batches_all
3178: where physical_batch_id = p_batch_id

Line 3177: and a.period_id <= (select max(end_period_id) from cn_process_batches_all

3173: where physical_batch_id = p_batch_id)
3174: and a.period_id >= (select min(period_id) from cn_process_batches_all
3175: where physical_batch_id = p_batch_id
3176: and salesrep_id = a.salesrep_id)
3177: and a.period_id <= (select max(end_period_id) from cn_process_batches_all
3178: where physical_batch_id = p_batch_id
3179: and salesrep_id = a.salesrep_id);
3180:
3181: -- create reversal of posting line

Line 3202: FROM cn_process_batches_all

3198:
3199: loop
3200: DELETE /*+ index(line cn_commission_lines_n7) */ cn_commission_lines_all line
3201: WHERE line.credited_salesrep_id IN (SELECT salesrep_id
3202: FROM cn_process_batches_all
3203: WHERE physical_batch_id = p_batch_id)
3204: AND line.processed_period_id BETWEEN l_period_id AND l_end_period_id
3205: AND line.processed_date BETWEEN l_start_date AND l_end_date
3206: AND line.status <> 'OBSOLETE'

Line 3222: cn_process_batches_all batch

3218: DELETE cn_commission_lines_all del_line
3219: WHERE del_line.commission_line_id IN
3220: (SELECT line.commission_line_id
3221: FROM cn_commission_lines_all line,
3222: cn_process_batches_all batch
3223: WHERE batch.physical_batch_id = p_batch_id
3224: AND line.org_id = batch.org_id
3225: AND line.credited_salesrep_id = batch.salesrep_id
3226: AND line.processed_period_id BETWEEN batch.period_id AND batch.end_period_id

Line 3246: from cn_process_batches_all

3242: -- bonus trx are all non accumulative, so 'ITD', 'GRP' doesn't apply.
3243: IF (l_unique_flag = 'Y') THEN
3244: delete cn_commission_headers_all ch
3245: where ch.direct_salesrep_id in (select salesrep_id
3246: from cn_process_batches_all
3247: where physical_batch_id = p_batch_id)
3248: and ch.processed_date between l_start_date and l_end_date
3249: AND (ch.trx_type IN ('GRP', 'ITD') OR ch.parent_header_id = -1)
3250: and ch.org_id = l_org_id;

Line 3256: cn_process_batches_all batch

3252: DELETE cn_commission_headers_all head
3253: WHERE head.commission_header_id IN
3254: ( SELECT dh.commission_header_id
3255: FROM cn_commission_headers_all dh,
3256: cn_process_batches_all batch
3257: WHERE batch.physical_batch_id = p_batch_id
3258: AND dh.org_id = batch.org_id
3259: AND batch.salesrep_id = dh.direct_salesrep_id
3260: AND dh.processed_date BETWEEN batch.start_date AND batch.end_date

Line 3276: cn_process_batches_all batch

3272: last_update_login = g_last_update_login
3273: WHERE up_header.commission_header_id IN
3274: ( SELECT header.commission_header_id
3275: FROM cn_commission_headers_all header,
3276: cn_process_batches_all batch
3277: WHERE batch.physical_batch_id = p_batch_id
3278: AND batch.salesrep_id = header.direct_salesrep_id
3279: AND header.org_id = batch.org_id
3280: AND header.status <> 'OBSOLETE'

Line 3294: FROM cn_process_batches_all

3290: last_updated_by = g_last_updated_by,
3291: last_update_login = g_last_update_login
3292: WHERE org_id = l_org_id
3293: AND direct_salesrep_id IN (SELECT salesrep_id
3294: FROM cn_process_batches_all
3295: WHERE physical_batch_id = p_batch_id)
3296: AND processed_date BETWEEN l_start_date AND l_end_date
3297: AND status <> 'OBSOLETE'
3298: AND ((p_calc_type ='FORECAST' AND trx_type = 'FORECAST')

Line 3314: FROM cn_process_batches_all

3310: CURSOR l_sub_batch_csr IS
3311: SELECT calc_sub_batch_id, interval_type_id, org_id
3312: FROM cn_calc_submission_batches_all
3313: WHERE logical_batch_id IN (SELECT logical_batch_id
3314: FROM cn_process_batches_all
3315: WHERE physical_batch_id = p_batch_id
3316: AND rownum = 1);
3317:
3318: CURSOR l_quota_count_csr IS

Line 3326: cn_process_batches_all batch

3322:
3323: CURSOR l_post_lines IS
3324: select cl.commission_line_id
3325: FROM cn_commission_lines_all cl,
3326: cn_process_batches_all batch
3327: WHERE batch.physical_batch_id = p_batch_id
3328: AND batch.salesrep_id = cl.credited_salesrep_id
3329: and cl.org_id = l_org_id
3330: --and cl.processed_period_id between batch.period_id and batch.end_period_id

Line 3367: cn_process_batches_all batch

3363: delete from cn_commission_headers_all
3364: where commission_header_id in (
3365: select cl.commission_header_id
3366: from cn_commission_lines_all cl,
3367: cn_process_batches_all batch
3368: where batch.physical_batch_id = p_batch_id
3369: and batch.salesrep_id = cl.credited_salesrep_id
3370: and cl.org_id = l_org_id
3371: --and cl.processed_period_id between batch.period_id and batch.end_period_id

Line 3386: cn_process_batches_all batch

3382: delete from cn_commission_lines_all
3383: where commission_line_id in (
3384: select cl.commission_line_id
3385: from cn_commission_lines_all cl,
3386: cn_process_batches_all batch
3387: where batch.physical_batch_id = p_batch_id
3388: and batch.salesrep_id = cl.credited_salesrep_id
3389: and cl.org_id =l_org_id
3390: --and cl.processed_period_id between batch.period_id and batch.end_period_id

Line 3740: FROM cn_process_batches_all

3736: end_period_id,
3737: start_date,
3738: end_date,
3739: org_id
3740: FROM cn_process_batches_all
3741: WHERE physical_batch_id = p_physical_batch_id;
3742:
3743: l_calc_type VARCHAR2(30);
3744: BEGIN