292: l_return_status VARCHAR2(1);
293:
294: cursor c_attrval_seq is
295: select PSB_ATTRIBUTE_VALUES_S.NEXTVAL seq
296: from dual;
297:
298: cursor c_attrval is
299: select *
300: from PSB_ATTRIBUTE_VALUES a
607: where position_set_group_id = possetgrpid;
608:
609: cursor c_elem_seq is
610: select psb_pay_elements_s.nextval seq
611: from dual;
612:
613: cursor c_elemoptions_seq is
614: select psb_pay_element_options_s.nextval seq
615: from dual;
611: from dual;
612:
613: cursor c_elemoptions_seq is
614: select psb_pay_element_options_s.nextval seq
615: from dual;
616:
617: cursor c_posset_seq is
618: select PSB_ACCOUNT_POSITION_SETS_S.NEXTVAL seq
619: from dual;
615: from dual;
616:
617: cursor c_posset_seq is
618: select PSB_ACCOUNT_POSITION_SETS_S.NEXTVAL seq
619: from dual;
620:
621: cursor c_possetline_seq is
622: select PSB_ACCT_POSITION_SET_LINES_S.NEXTVAL seq
623: from dual;
619: from dual;
620:
621: cursor c_possetline_seq is
622: select PSB_ACCT_POSITION_SET_LINES_S.NEXTVAL seq
623: from dual;
624:
625: cursor c_possetlineval_seq is
626: select PSB_POSITION_SET_LINE_VALUES_S.NEXTVAL seq
627: from dual;
623: from dual;
624:
625: cursor c_possetlineval_seq is
626: select PSB_POSITION_SET_LINE_VALUES_S.NEXTVAL seq
627: from dual;
628:
629: cursor c_setrel_seq is
630: select PSB_SET_RELATIONS_S.NEXTVAL seq
631: from dual;
627: from dual;
628:
629: cursor c_setrel_seq is
630: select PSB_SET_RELATIONS_S.NEXTVAL seq
631: from dual;
632:
633: cursor c_elempossetgrp_seq is
634: select PSB_ELEMENT_POS_SET_GROUPS_S.NEXTVAL seq
635: from dual;
631: from dual;
632:
633: cursor c_elempossetgrp_seq is
634: select PSB_ELEMENT_POS_SET_GROUPS_S.NEXTVAL seq
635: from dual;
636:
637: cursor c_elemdist_seq is
638: select PSB_PAY_ELEMENT_DISTRIBUTION_S.NEXTVAL seq
639: from dual;
635: from dual;
636:
637: cursor c_elemdist_seq is
638: select PSB_PAY_ELEMENT_DISTRIBUTION_S.NEXTVAL seq
639: from dual;
640:
641: BEGIN
642:
643: /* Bug No 2579818 Start
1618: and b.worksheet_id = p_worksheet_id)));
1619:
1620: cursor c_elem_seq is
1621: select psb_pay_elements_s.nextval seq
1622: from dual;
1623:
1624: cursor c_elemoptions_seq is
1625: select psb_pay_element_options_s.nextval seq
1626: from dual;
1622: from dual;
1623:
1624: cursor c_elemoptions_seq is
1625: select psb_pay_element_options_s.nextval seq
1626: from dual;
1627:
1628: BEGIN
1629:
1630: for c_elem_rec in c_elem loop
2450: IF rec_start_date(i) < l_year_start_date THEN
2451:
2452: SELECT PSB_POSITION_PAY_DISTR_S.NEXTVAL
2453: INTO l_distribution_id
2454: FROM dual;
2455:
2456: l_count_ins_rec := l_count_ins_rec + 1;
2457: ins_distribution_id(l_count_ins_rec) := l_distribution_id;
2458: ins_position_id(l_count_ins_rec) := p_position_id;
2482: END IF;
2483:
2484: /*SELECT PSB_POSITION_PAY_DISTR_S.NEXTVAL
2485: INTO l_distribution_id
2486: FROM dual;
2487:
2488: l_count_ins_rec := l_count_ins_rec + 1;
2489: ins_distribution_id(l_count_ins_rec) := l_distribution_id;
2490: ins_position_id(l_count_ins_rec) := p_position_id;
2517: IF rec_start_date(i) < l_year_start_date THEN
2518:
2519: SELECT PSB_POSITION_PAY_DISTR_S.NEXTVAL
2520: INTO l_distribution_id
2521: FROM dual;
2522:
2523: l_count_ins_rec := l_count_ins_rec + 1;
2524: ins_distribution_id(l_count_ins_rec) := l_distribution_id;
2525: ins_position_id(l_count_ins_rec) := p_position_id;
2550: IF rec_end_date(i) > l_year_end_date THEN
2551:
2552: SELECT PSB_POSITION_PAY_DISTR_S.NEXTVAL
2553: INTO l_distribution_id
2554: FROM dual;
2555:
2556: l_count_ins_rec := l_count_ins_rec + 1;
2557: ins_distribution_id(l_count_ins_rec) := l_distribution_id;
2558: ins_position_id(l_count_ins_rec) := p_position_id;
2588: IF rec_end_date(i) > l_year_end_Date THEN
2589:
2590: SELECT PSB_POSITION_PAY_DISTR_S.NEXTVAL
2591: INTO l_distribution_id
2592: FROM dual;
2593:
2594: l_count_ins_rec := l_count_ins_rec + 1;
2595: ins_distribution_id(l_count_ins_rec) := l_distribution_id;
2596: ins_position_id(l_count_ins_rec) := p_position_id;
2766: p_position_exists = FALSE
2767: THEN
2768: SELECT PSB_POSITION_PAY_DISTR_S.NEXTVAL
2769: INTO l_distribution_id
2770: FROM dual;
2771:
2772: l_count_ins_rec := l_count_ins_rec + 1;
2773: ins_distribution_id(l_count_ins_rec) := l_distribution_id;
2774: ins_start_date(l_count_ins_rec) := l_distr_start_date;
2837: IF(l_budget_year_end_date <= l_distr_end_date) THEN
2838:
2839: SELECT PSB_POSITION_PAY_DISTR_S.NEXTVAL
2840: INTO l_distribution_id
2841: FROM dual;
2842: l_count_ins_rec := l_count_ins_rec + 1;
2843: ins_distribution_id(l_count_ins_rec) := l_distribution_id;
2844: ins_start_date(l_count_ins_rec) := l_budget_year_start_date;
2845: ins_end_date(l_count_ins_rec) := l_budget_year_end_date;
2855: -- Insert the end dated distribution
2856: ELSE
2857: SELECT PSB_POSITION_PAY_DISTR_S.NEXTVAL
2858: INTO l_distribution_id
2859: FROM dual;
2860:
2861: l_count_ins_rec := l_count_ins_rec + 1;
2862: ins_distribution_id(l_count_ins_rec) := l_distribution_id;
2863: ins_start_date(l_count_ins_rec) := l_date_val;
2915: END IF;
2916:
2917: SELECT PSB_POSITION_PAY_DISTR_S.NEXTVAL
2918: INTO l_distribution_id
2919: FROM dual;
2920: l_count_ins_rec := l_count_ins_rec + 1;
2921: ins_distribution_id(l_count_ins_rec) := l_distribution_id;
2922: ins_start_date(l_count_ins_rec) := l_date_val;
2923: ins_end_date(l_count_ins_rec) := l_budget_year_end_date;
2935: /*-- Populate the PL/SQL table with a non end dated record
2936: -- for the open ws record.
2937: SELECT PSB_POSITION_PAY_DISTR_S.NEXTVAL
2938: INTO l_distribution_id
2939: FROM dual;
2940:
2941: l_count_ins_rec := l_count_ins_rec + 1;
2942: ins_distribution_id(l_count_ins_rec) := l_distribution_id;
2943: ins_start_date(l_count_ins_rec) := l_year_end_date + 1;
3215: and c.worksheet_id = p_worksheet_id)));
3216:
3217: cursor c_pos_seq is
3218: select PSB_POSITIONS_S.NEXTVAL seq
3219: from dual;
3220:
3221: cursor c_posassign_seq is
3222: select PSB_POSITION_ASSIGNMENTS_S.NEXTVAL seq
3223: from dual;
3219: from dual;
3220:
3221: cursor c_posassign_seq is
3222: select PSB_POSITION_ASSIGNMENTS_S.NEXTVAL seq
3223: from dual;
3224:
3225: cursor c_posdistr_seq is
3226: select PSB_POSITION_PAY_DISTR_S.NEXTVAL seq
3227: from dual;
3223: from dual;
3224:
3225: cursor c_posdistr_seq is
3226: select PSB_POSITION_PAY_DISTR_S.NEXTVAL seq
3227: from dual;
3228:
3229: BEGIN
3230:
3231: -- Loop for all positions in the source data extract
5393: l_position_exists BOOLEAN := FALSE;
5394:
5395: cursor c_position_exists_bp is
5396: select 'Exists'
5397: from dual
5398: where exists
5399: (select 'Exists'
5400: from psb_ws_position_lines wpl, psb_ws_lines_positions wlp
5401: where wpl.position_id = p_position_id
5403: and wlp.worksheet_id = p_source_id);
5404:
5405: cursor c_position_exists_br is
5406: select 'Exists'
5407: from dual
5408: where exists
5409: (select 'Exists'
5410: from psb_budget_revision_positions brp, psb_budget_revision_pos_lines brpl
5411: where brp.position_id = p_position_id
5449: l_dist_exists BOOLEAN := FALSE;
5450:
5451: cursor c_dist_exists_bp is
5452: select 'Exists'
5453: from dual
5454: where exists
5455: (select 'Exists'
5456: from psb_ws_position_lines wpl, psb_ws_lines_positions wlp, psb_ws_account_lines wal
5457: where wpl.position_id = p_position_id
5460: and wal.position_line_id = wpl.position_line_id);
5461:
5462: cursor c_dist_exists_br is
5463: select 'Exists'
5464: from dual
5465: where exists
5466: (select 'Exists'
5467: from psb_position_accounts
5468: where budget_revision_id = p_source_id
6091: g_wks_new_hr_budget := FALSE;
6092:
6093: IF p_hr_budget_id IS NOT NULL THEN
6094: FOR li_csr IN ( SELECT 1 new_bud
6095: FROM dual
6096: WHERE EXISTS (SELECT 1
6097: FROM psb_position_events_all
6098: WHERE event_type = 'BP'
6099: AND hr_budget_id = p_hr_budget_id)) LOOP
8172: and b.name = a.name;
8173:
8174: cursor c_element_exists_bp is
8175: select 'Exists'
8176: from dual
8177: where exists
8178: (select 'Exists'
8179: from psb_ws_lines_positions wlp, psb_ws_position_lines wpl, psb_position_assignments ppa
8180: where wlp.worksheet_id = p_source_id
8187: );
8188:
8189: cursor c_element_exists_br is
8190: select 'Exists'
8191: from dual
8192: where exists
8193: (select 'Exists'
8194: from psb_budget_revision_pos_lines brpl, psb_budget_revision_positions brp, psb_position_assignments ppa
8195: where brpl.budget_revision_id = p_source_id
12231: l_return_status VARCHAR2(1);
12232: --
12233: cursor c_elempossetgrp_seq is
12234: select PSB_ELEMENT_POS_SET_GROUPS_S.NEXTVAL seq
12235: from dual;
12236:
12237: cursor c_possetgrp (elemid NUMBER) is
12238: select * from PSB_ELEMENT_POS_SET_GROUPS
12239: where pay_element_id = elemid;
12361: and name = possetname;
12362:
12363: cursor c_posset_seq is
12364: select PSB_ACCOUNT_POSITION_SETS_S.NEXTVAL seq
12365: from dual;
12366:
12367: cursor c_setrel_seq is
12368: select PSB_SET_RELATIONS_S.NEXTVAL seq
12369: from dual;
12365: from dual;
12366:
12367: cursor c_setrel_seq is
12368: select PSB_SET_RELATIONS_S.NEXTVAL seq
12369: from dual;
12370:
12371:
12372: --
12373: BEGIN
12572: and b.line_sequence_id = lineseqid);
12573:
12574: cursor c_possetline_seq is
12575: select PSB_ACCT_POSITION_SET_LINES_S.NEXTVAL seq
12576: from dual;
12577:
12578: cursor c_possetlineval_seq is
12579: select PSB_POSITION_SET_LINE_VALUES_S.NEXTVAL seq
12580: from dual;
12576: from dual;
12577:
12578: cursor c_possetlineval_seq is
12579: select PSB_POSITION_SET_LINE_VALUES_S.NEXTVAL seq
12580: from dual;
12581: --
12582: BEGIN
12583: --
12584: for c_possetline_rec in c_possetline (p_old_posset_id) loop
12770: where position_set_group_id = possetgrpid;
12771:
12772: cursor c_elemdist_seq is
12773: select PSB_PAY_ELEMENT_DISTRIBUTION_S.NEXTVAL seq
12774: from dual;
12775:
12776: cursor c_elemdist_exists (psg_id NUMBER, cc_id NUMBER, con_segments VARCHAR2) is
12777: select distribution_id, distribution_percent
12778: from PSB_PAY_ELEMENT_DISTRIBUTIONS