[Home] [Help]
157: ) IS
158: --
159: CURSOR c_wp_bg_check IS
160: SELECT DISTINCT(pet.business_group_id) bg
161: FROM hxt_work_shifts wsh
162: , pay_element_types_f pet
163: WHERE wsh.tws_id = p_wp_id
164: AND wsh.shift_diff_ovrrd_id = pet.element_type_id
165: AND pet.business_group_id is not null
164: AND wsh.shift_diff_ovrrd_id = pet.element_type_id
165: AND pet.business_group_id is not null
166: UNION
167: SELECT DISTINCT(pet.business_group_id) bg
168: FROM hxt_work_shifts ws
169: , pay_element_types_f pet
170: WHERE ws.tws_id = p_wp_id
171: AND ws.off_shift_prem_id = pet.element_type_id
172: AND pet.business_group_id is not null
209: CURSOR c_rp_bg_check is
210: select distinct(pet.business_group_id) bg
211: from hxt_rotation_schedules rts
212: , hxt_weekly_work_schedules wws
213: , hxt_work_shifts wsh
214: , pay_element_types_f pet
215: where wws.id = rts.tws_id
216: and rts.rtp_id = p_rp_id
217: and wsh.tws_id = wws.id
220: union
221: select distinct(pet.business_group_id) bg
222: from hxt_rotation_schedules rts
223: , hxt_weekly_work_schedules wws
224: , hxt_work_shifts wsh
225: , pay_element_types_f pet
226: where wws.id = rts.tws_id
227: and rts.rtp_id = p_rp_id
228: and wsh.tws_id = wws.id
944: select distinct
945: wsh.tws_id id
946: , pet.business_group_id bg
947: from hxt_weekly_work_schedules wws
948: , hxt_work_shifts wsh
949: , pay_element_types_f pet
950: where wws.business_group_id is null
951: and wws.id = wsh.tws_id
952: and ((wsh.off_shift_prem_id = pet.element_type_id
977: where wws.business_group_id is null
978: and wws.id = ass_sub.wp_id (+)
979: and wws.id = rp_sub.wp_id (+)
980: and not exists(select 'X'
981: from hxt_work_shifts wsh
982: , pay_element_types_f pet
983: where wws.id = wsh.tws_id
984: and ((wsh.off_shift_prem_id = pet.element_type_id
985: and pet.business_group_id is not null)
989: CURSOR c_get_rp_bg(p_wp_id number) is
990: select distinct(pet.business_group_id) rp_bg
991: from hxt_rotation_schedules rts
992: , hxt_weekly_work_schedules wws
993: , hxt_work_shifts wsh
994: , pay_element_types_f pet
995: where rts.tws_id = wws.id
996: and wws.id = wsh.tws_id
997: and ((wsh.off_shift_prem_id = pet.element_type_id
1123: , early_start
1124: , late_stop
1125: , off_shift_prem_id
1126: , shift_diff_ovrrd_id
1127: from hxt_work_shifts
1128: where tws_id = p_wp_id;
1129: --
1130: Begin
1131: --
1170: , busg.id
1171: );
1172: --
1173: For shifts in c_workshift_rec loop
1174: Insert into hxt_work_shifts
1175: ( sht_id
1176: , tws_id
1177: , week_day
1178: , seq_no
1206: end loop;
1207: --
1208: end loop;
1209: --
1210: delete from hxt_work_shifts
1211: where tws_id = p_wp_id;
1212: --
1213: delete from hxt_weekly_work_schedules
1214: where id = p_wp_id;
1262: , early_start
1263: , late_stop
1264: , off_shift_prem_id
1265: , shift_diff_ovrrd_id
1266: from hxt_work_shifts
1267: where tws_id = p_wp_id;
1268: --
1269: CURSOR c_rotplan_rec is
1270: select distinct
1369: , busg.id
1370: );
1371: --
1372: For shifts in c_workshift_rec(r_workplan_rec.id) loop
1373: Insert into hxt_work_shifts
1374: ( sht_id
1375: , tws_id
1376: , week_day
1377: , seq_no
1452: delete from hxt_rotation_plans
1453: where id = l_delete_rp(i);
1454: end loop;
1455: --
1456: delete from hxt_work_shifts
1457: where tws_id = p_wp_id;
1458: --
1459: delete from hxt_weekly_work_schedules
1460: where id = p_wp_id;