DBA Data[Home] [Help]

APPS.CN_FORMULA_COMMON_PKG dependencies on CN_QUOTAS

Line 141: cn_quotas_all pe

137: null, --cl.attribute15
138: cl.org_id,
139: 0
140: FROM cn_commission_lines_all cl,
141: cn_quotas_all pe
142: WHERE cl.commission_line_id = p_commission_line_id
143: AND cl.quota_id = pe.quota_id
144: AND cl.srp_payee_assign_id IS NULL)
145: UNION --this is added for assign payees for fixing bug#2495614

Line 199: cn_quotas_all pe

195: cl.org_id,
196: 0
197: FROM cn_commission_lines_all cl,
198: cn_srp_payee_assigns_all payee,
199: cn_quotas_all pe
200: WHERE cl.commission_line_id = p_commission_line_id
201: AND cl.quota_id = pe.quota_id
202: AND cl.srp_payee_assign_id IS NOT NULL
203: AND payee.srp_payee_assign_id = cl.srp_payee_assign_id);

Line 574: IF (instr(l_sql_from, 'CN_QUOTAS', 1, 1) > 0) THEN

570: IF (instr(l_sql_from, 'CN_PERIOD_QUOTAS', 1, 1) > 0) THEN
571: l_where_clause := l_where_clause || ' and CPQ.quota_id = :p_quota_id and CPQ.period_id = :p_period_id';
572: END IF;
573:
574: IF (instr(l_sql_from, 'CN_QUOTAS', 1, 1) > 0) THEN
575: l_where_clause := l_where_clause || ' and CQ.quota_id = :p_quota_id';
576: END IF;
577:
578: l_where_clause := ' where ' || l_where_clause;

Line 605: IF (instr(l_sql_from, 'CN_QUOTAS', 1, 1) > 0) THEN

601: IF (instr(l_sql_from, 'CN_PERIOD_QUOTAS', 1, 1) > 0) THEN
602: l_where_clause := l_where_clause || ' and CPQ.quota_id = :p_quota_id and CPQ.period_id = :p_period_id';
603: END IF;
604:
605: IF (instr(l_sql_from, 'CN_QUOTAS', 1, 1) > 0) THEN
606: l_where_clause := l_where_clause || ' and CQ.quota_id = :p_quota_id';
607: END IF;
608:
609: l_where_clause := ' where ' || l_where_clause;

Line 871: l_incremental_flag cn_quotas.incremental_type%TYPE;

867: x_perf_achieved_ptd OUT NOCOPY NUMBER ,
868: x_perf_achieved_itd OUT NOCOPY NUMBER ,
869: x_select_status_flag OUT NOCOPY VARCHAR2 )
870: IS
871: l_incremental_flag cn_quotas.incremental_type%TYPE;
872: l_input_achieved NUMBER ;
873: l_output_achieved NUMBER ;
874: l_perf_achieved NUMBER ;
875: l_commission_achieved NUMBER;

Line 899: FROM cn_quotas_all q,

895: l_input_achieved_itd_tbl cn_formula_common_pkg.num_table_type;
896:
897: CURSOR l_quota_csr (l_quota_id NUMBER ) IS
898: SELECT q.incremental_type, cr.name, q.interval_type_id, q.org_id
899: FROM cn_quotas_all q,
900: cn_credit_types cr
901: WHERE q.quota_id = l_quota_id
902: AND cr.credit_type_id = q.credit_type_id
903: AND cr.org_id = q.org_id;

Line 1401: cn_quotas_all q

1397: FROM cn_cal_per_int_types_all p2
1398: WHERE (p2.interval_type_id, p2.org_id, p2.interval_number) IN
1399: (SELECT p1.interval_type_id, p1.org_id, p1.interval_number
1400: FROM cn_cal_per_int_types_all p1,
1401: cn_quotas_all q
1402: WHERE p1.cal_period_id = p_period_id
1403: AND q.quota_id = p_quota_id
1404: AND p1.org_id = q.org_id
1405: AND p1.interval_type_id = q.interval_type_id);

Line 1424: cn_quotas_all q

1420: FROM cn_cal_per_int_types_all p2
1421: WHERE (p2.interval_type_id, p2.org_id, p2.interval_number) IN
1422: (SELECT p1.interval_type_id, p1.org_id, p1.interval_number
1423: FROM cn_cal_per_int_types_all p1,
1424: cn_quotas_all q
1425: WHERE p1.cal_period_id = p_period_id
1426: AND q.quota_id = p_quota_id
1427: AND p1.org_id = q.org_id
1428: AND p1.interval_type_id = q.interval_type_id);

Line 1451: from cn_quotas_all

1447: INTO l_start_period_id
1448: from cn_cal_per_int_types_all a,
1449: cn_period_statuses_all b
1450: where (a.interval_type_id, a.org_id) = (select interval_type_id, org_id
1451: from cn_quotas_all
1452: where quota_id = p_quota_id)
1453: and a.interval_number = (select interval_number
1454: from cn_cal_per_int_types_all
1455: where cal_period_id = p_period_id

Line 1457: from cn_quotas_all

1453: and a.interval_number = (select interval_number
1454: from cn_cal_per_int_types_all
1455: where cal_period_id = p_period_id
1456: and (interval_type_id, org_id) = (select interval_type_id, org_id
1457: from cn_quotas_all
1458: where quota_id = p_quota_id))
1459: and a.cal_period_id = b.period_id
1460: and b.quarter_num = (select quarter_num
1461: from cn_period_statuses_all

Line 1463: and org_id = (select org_id from cn_quotas_all where quota_id = p_quota_id));

1459: and a.cal_period_id = b.period_id
1460: and b.quarter_num = (select quarter_num
1461: from cn_period_statuses_all
1462: where period_id = p_period_id
1463: and org_id = (select org_id from cn_quotas_all where quota_id = p_quota_id));
1464:
1465: RETURN l_start_period_id;
1466: END get_quarter_start_period_id;
1467:

Line 1476: from cn_quotas_all

1472: INTO l_end_period_id
1473: from cn_cal_per_int_types_all a,
1474: cn_period_statuses_all b
1475: where (a.interval_type_id, a.org_id) = (select interval_type_id, org_id
1476: from cn_quotas_all
1477: where quota_id = p_quota_id)
1478: and a.interval_number = (select interval_number from cn_cal_per_int_types_all
1479: where cal_period_id = p_period_id
1480: and (interval_type_id, org_id) = (select interval_type_id, org_id

Line 1481: from cn_quotas_all

1477: where quota_id = p_quota_id)
1478: and a.interval_number = (select interval_number from cn_cal_per_int_types_all
1479: where cal_period_id = p_period_id
1480: and (interval_type_id, org_id) = (select interval_type_id, org_id
1481: from cn_quotas_all
1482: where quota_id = p_quota_id))
1483: and a.cal_period_id = b.period_id
1484: and b.quarter_num = (select quarter_num
1485: from cn_period_statuses_all

Line 1487: and org_id = (select org_id from cn_quotas_all where quota_id = p_quota_id));

1483: and a.cal_period_id = b.period_id
1484: and b.quarter_num = (select quarter_num
1485: from cn_period_statuses_all
1486: where period_id = p_period_id
1487: and org_id = (select org_id from cn_quotas_all where quota_id = p_quota_id));
1488:
1489: RETURN l_end_period_id;
1490: END get_quarter_end_period_id;
1491:

Line 1610: FROM cn_quotas_all q,

1606: l_formula_name,
1607: l_formula_type,
1608: l_org_id,
1609: l_pe_name
1610: FROM cn_quotas_all q,
1611: cn_calc_formulas_all f
1612: WHERE q.quota_id = p_quota_id
1613: AND q.calc_formula_id = f.calc_formula_id(+)
1614: AND q.org_id = f.org_id(+);

Line 1745: cn_quotas_all q

1741: SELECT spq.quota_id,
1742: qa.quota_sequence
1743: FROM cn_srp_period_quotas_all spq,
1744: cn_quota_assigns_all qa,
1745: cn_quotas_all q
1746: WHERE spq.srp_plan_assign_id = l_srp_plan_assign_id
1747: AND spq.salesrep_id = l_salesrep_id
1748: AND spq.period_id = l_period_id
1749: and qa.comp_plan_id = (select comp_plan_id

Line 1789: cn_quotas_all pe,

1785: SELECT spa.srp_plan_assign_id srp_plan_assign_id, batch.salesrep_id salesrep_id, qa.quota_sequence quota_sequence,
1786: batch.end_period_id end_period_id, batch.end_date end_date, pe.quota_id quota_id, pe.interval_type_id interval_type_id
1787: FROM cn_srp_plan_assigns_all spa,
1788: cn_quota_assigns_all qa,
1789: cn_quotas_all pe,
1790: cn_process_batches_all batch
1791: WHERE batch.physical_batch_id = p_physical_batch_id
1792: AND batch.salesrep_id = spa.salesrep_id
1793: AND spa.org_id = batch.org_id

Line 1817: cn_quotas_all pe,

1813: SELECT spa.srp_plan_assign_id srp_plan_assign_id, batch.salesrep_id salesrep_id, qa.quota_sequence quota_sequence,
1814: batch.end_period_id end_period_id, batch.end_date end_date, pe.quota_id quota_id, pe.interval_type_id interval_type_id
1815: FROM cn_srp_plan_assigns_all spa,
1816: cn_quota_assigns_all qa,
1817: cn_quotas_all pe,
1818: cn_process_batches_all batch
1819: WHERE batch.physical_batch_id = p_physical_batch_id
1820: AND batch.salesrep_id = spa.salesrep_id
1821: AND spa.org_id = batch.org_id

Line 1907: line.credit_type_id = (select credit_type_id from cn_quotas_all where quota_id = line.quota_id),

1903: cn_commission_lines_all amtline
1904: where amthead.commission_header_id = amtline.commission_header_id
1905: and amtline.commission_line_id = line.commission_line_id
1906: ),
1907: line.credit_type_id = (select credit_type_id from cn_quotas_all where quota_id = line.quota_id),
1908: last_update_date = sysdate,
1909: last_updated_by = g_last_updated_by,
1910: last_update_login = g_last_update_login
1911: WHERE line.commission_line_id in

Line 3319: and (exists (select 1 from cn_quotas_all

3315: and cl.processed_date between batch.start_date and batch.end_date
3316: and cl.status = 'CALC'
3317: and cl.posting_status = 'POSTED'
3318: and cl.trx_type = 'BONUS'
3319: and (exists (select 1 from cn_quotas_all
3320: where quota_id = cl.quota_id
3321: and (l_interval_type_id = interval_type_id or l_interval_type_id = -1003)))
3322: and (l_calc_sub_batch_id = -1000 or
3323: cl.quota_id in (select quota_id from cn_calc_sub_quotas_all

Line 3358: and (exists (select 1 from cn_quotas_all

3354: and cl.org_id = l_org_id
3355: --and cl.processed_period_id between batch.period_id and batch.end_period_id
3356: and cl.processed_date between batch.start_date and batch.end_date
3357: and cl.trx_type = 'BONUS'
3358: and (exists (select 1 from cn_quotas_all
3359: where quota_id = cl.quota_id
3360: and (l_interval_type_id = interval_type_id or l_interval_type_id = -1003)))
3361: and (l_calc_sub_batch_id = -1000 or
3362: cl.quota_id in (select quota_id from cn_calc_sub_quotas_all

Line 3377: and (exists (select 1 from cn_quotas_all

3373: and cl.org_id =l_org_id
3374: --and cl.processed_period_id between batch.period_id and batch.end_period_id
3375: and cl.processed_date between batch.start_date and batch.end_date
3376: and cl.trx_type = 'BONUS'
3377: and (exists (select 1 from cn_quotas_all
3378: where quota_id = cl.quota_id
3379: and (l_interval_type_id = interval_type_id or l_interval_type_id = -1003)))
3380: and (l_calc_sub_batch_id = -1000 or
3381: cl.quota_id in (select quota_id from cn_calc_sub_quotas_all