146: -- timecard which has history of transfer to BEE can be updated only, no delete
147: -- is allowed.
148:
149: PROCEDURE retro_restrict_edit (
150: p_tim_id IN hxt_det_hours_worked_f.tim_id%TYPE,
151: p_session_date IN DATE,
152: o_dt_update_mod OUT NOCOPY VARCHAR2,
153: o_error_message OUT NOCOPY VARCHAR2,
154: o_return_code OUT NOCOPY NUMBER,
151: p_session_date IN DATE,
152: o_dt_update_mod OUT NOCOPY VARCHAR2,
153: o_error_message OUT NOCOPY VARCHAR2,
154: o_return_code OUT NOCOPY NUMBER,
155: p_parent_id IN hxt_det_hours_worked_f.parent_id%TYPE,
156: p_do_intg_check IN VARCHAR2
157: )
158: IS
159:
162: -- instead of fnd_sessions table.
163:
164: /*
165: CURSOR csr_not_transferred (
166: v_tim_id hxt_det_hours_worked_f.tim_id%TYPE,
167: v_parent_id hxt_det_hours_worked_f.parent_id%TYPE
168: )
169: IS
170: SELECT 1
163:
164: /*
165: CURSOR csr_not_transferred (
166: v_tim_id hxt_det_hours_worked_f.tim_id%TYPE,
167: v_parent_id hxt_det_hours_worked_f.parent_id%TYPE
168: )
169: IS
170: SELECT 1
171: FROM hxt_det_hours_worked hdhw
172: WHERE hdhw.tim_id = v_tim_id
173: AND hdhw.pay_status = 'P' -- Bug 6067007
174: AND hdhw.pa_status = 'P' -- Bug 6067007
175: AND NOT EXISTS ( SELECT 1
176: FROM hxt_det_hours_worked_f hdhw2
177: WHERE hdhw.tim_id = hdhw2.tim_id
178: AND hdhw2.effective_start_date >
179: hdhw.effective_start_date);
180: */
178: AND hdhw2.effective_start_date >
179: hdhw.effective_start_date);
180: */
181: CURSOR csr_not_transferred (
182: v_tim_id hxt_det_hours_worked_f.tim_id%TYPE,
183: v_parent_id hxt_det_hours_worked_f.parent_id%TYPE,
184: v_session_date DATE
185: )
186: IS
179: hdhw.effective_start_date);
180: */
181: CURSOR csr_not_transferred (
182: v_tim_id hxt_det_hours_worked_f.tim_id%TYPE,
183: v_parent_id hxt_det_hours_worked_f.parent_id%TYPE,
184: v_session_date DATE
185: )
186: IS
187: SELECT 1
184: v_session_date DATE
185: )
186: IS
187: SELECT 1
188: FROM hxt_det_hours_worked_f hdhw
189: WHERE hdhw.tim_id = v_tim_id
190: AND v_session_date BETWEEN hdhw.effective_start_date
191: AND hdhw.effective_end_date
192: AND hdhw.pay_status = 'P' -- Bug 6067007
191: AND hdhw.effective_end_date
192: AND hdhw.pay_status = 'P' -- Bug 6067007
193: AND hdhw.pa_status = 'P' -- Bug 6067007
194: AND NOT EXISTS ( SELECT 1
195: FROM hxt_det_hours_worked_f hdhw2
196: WHERE hdhw.tim_id = hdhw2.tim_id
197: AND hdhw2.effective_start_date >
198: hdhw.effective_start_date);
199:
200:
201:
202: -- Bug 6067007
203: CURSOR csr_transferred_retro (
204: v_tim_id hxt_det_hours_worked_f.tim_id%TYPE,
205: v_parent_id hxt_det_hours_worked_f.parent_id%TYPE
206: )
207: IS
208: SELECT 1
201:
202: -- Bug 6067007
203: CURSOR csr_transferred_retro (
204: v_tim_id hxt_det_hours_worked_f.tim_id%TYPE,
205: v_parent_id hxt_det_hours_worked_f.parent_id%TYPE
206: )
207: IS
208: SELECT 1
209: FROM hxt_det_hours_worked_f hdhw
205: v_parent_id hxt_det_hours_worked_f.parent_id%TYPE
206: )
207: IS
208: SELECT 1
209: FROM hxt_det_hours_worked_f hdhw
210: WHERE hdhw.tim_id = v_tim_id
211: AND ( hdhw.pay_status = 'R'
212: OR hdhw.pa_status = 'R'
213: );
214: -- Bug 6067007
215:
216:
217: CURSOR csr_transferred (
218: v_tim_id hxt_det_hours_worked_f.tim_id%TYPE,
219: v_parent_id hxt_det_hours_worked_f.parent_id%TYPE
220: )
221: IS
222: SELECT 1
215:
216:
217: CURSOR csr_transferred (
218: v_tim_id hxt_det_hours_worked_f.tim_id%TYPE,
219: v_parent_id hxt_det_hours_worked_f.parent_id%TYPE
220: )
221: IS
222: SELECT 1
223: FROM hxt_det_hours_worked_f hdhw
219: v_parent_id hxt_det_hours_worked_f.parent_id%TYPE
220: )
221: IS
222: SELECT 1
223: FROM hxt_det_hours_worked_f hdhw
224: WHERE hdhw.tim_id = v_tim_id
225: AND ( hdhw.pay_status = 'C'
226: OR hdhw.pa_status = 'C'
227: );
226: OR hdhw.pa_status = 'C'
227: );
228:
229: CURSOR csr_changed_today (
230: v_tim_id hxt_det_hours_worked_f.tim_id%TYPE,
231: v_parent_id hxt_det_hours_worked_f.parent_id%TYPE,
232: v_session_dt DATE
233: )
234: IS
227: );
228:
229: CURSOR csr_changed_today (
230: v_tim_id hxt_det_hours_worked_f.tim_id%TYPE,
231: v_parent_id hxt_det_hours_worked_f.parent_id%TYPE,
232: v_session_dt DATE
233: )
234: IS
235: SELECT 1
232: v_session_dt DATE
233: )
234: IS
235: SELECT 1
236: FROM hxt_det_hours_worked_f hdhw
237: WHERE hdhw.tim_id = v_tim_id
238: AND trunc(hdhw.effective_start_date)
239: = trunc(v_session_dt);
240:
244: l_not_transferred csr_not_transferred%ROWTYPE := NULL;
245: l_changed_today csr_changed_today%ROWTYPE := NULL;
246: l_proc VARCHAR2 (30) ;
247:
248: FUNCTION details (p_tim_id IN hxt_det_hours_worked_f.tim_id%TYPE,
249: p_date IN DATE)
250: RETURN BOOLEAN
251: IS
252: -- Bug 7359347
253: -- Changed the below cursor to pick up session date from global variable
254: -- instead of fnd_sessions table.
255:
256: /*
257: CURSOR csr_debug (v_tim_id hxt_det_hours_worked_f.tim_id%TYPE)
258: IS
259: SELECT hdhw.id, hdhw.parent_id, hdhw.date_worked, hdhw.pay_status,
260: hdhw.effective_start_date
261: FROM hxt_det_hours_worked hdhw
261: FROM hxt_det_hours_worked hdhw
262: WHERE hdhw.tim_id = v_tim_id;
263: */
264:
265: CURSOR csr_debug (v_tim_id hxt_det_hours_worked_f.tim_id%TYPE,
266: v_sess_date DATE)
267: IS
268: SELECT hdhw.id, hdhw.parent_id, hdhw.date_worked, hdhw.pay_status,
269: hdhw.effective_start_date
266: v_sess_date DATE)
267: IS
268: SELECT hdhw.id, hdhw.parent_id, hdhw.date_worked, hdhw.pay_status,
269: hdhw.effective_start_date
270: FROM hxt_det_hours_worked_f hdhw
271: WHERE hdhw.tim_id = v_tim_id
272: AND v_sess_date BETWEEN hdhw.effective_start_date
273: AND hdhw.effective_end_date;
274:
475: END retro_restrict_edit;
476:
477:
478: PROCEDURE retro_restrict_edit (
479: p_tim_id IN hxt_det_hours_worked_f.tim_id%TYPE,
480: p_session_date IN DATE,
481: o_dt_update_mod OUT NOCOPY VARCHAR2,
482: o_error_message OUT NOCOPY VARCHAR2,
483: o_return_code OUT NOCOPY NUMBER,
480: p_session_date IN DATE,
481: o_dt_update_mod OUT NOCOPY VARCHAR2,
482: o_error_message OUT NOCOPY VARCHAR2,
483: o_return_code OUT NOCOPY NUMBER,
484: p_parent_id IN hxt_det_hours_worked_f.parent_id%TYPE
485: )
486: IS
487:
488: -- Bug 7359347
490: -- instead of fnd_sessions table.
491:
492: /*
493: CURSOR csr_not_transferred (
494: v_tim_id hxt_det_hours_worked_f.tim_id%TYPE,
495: v_parent_id hxt_det_hours_worked_f.parent_id%TYPE
496: )
497: IS
498: SELECT 1
491:
492: /*
493: CURSOR csr_not_transferred (
494: v_tim_id hxt_det_hours_worked_f.tim_id%TYPE,
495: v_parent_id hxt_det_hours_worked_f.parent_id%TYPE
496: )
497: IS
498: SELECT 1
499: FROM hxt_det_hours_worked hdhw
500: WHERE hdhw.tim_id = v_tim_id
501: AND hdhw.pay_status = 'P' -- Bug 6067007
502: AND hdhw.pa_status = 'P' -- Bug 6067007
503: AND NOT EXISTS ( SELECT 1
504: FROM hxt_det_hours_worked_f hdhw2
505: WHERE hdhw.tim_id = hdhw2.tim_id
506: AND hdhw2.effective_start_date >
507: hdhw.effective_start_date);
508: */
506: AND hdhw2.effective_start_date >
507: hdhw.effective_start_date);
508: */
509: CURSOR csr_not_transferred (
510: v_tim_id hxt_det_hours_worked_f.tim_id%TYPE,
511: v_parent_id hxt_det_hours_worked_f.parent_id%TYPE,
512: v_session_date DATE
513: )
514: IS
507: hdhw.effective_start_date);
508: */
509: CURSOR csr_not_transferred (
510: v_tim_id hxt_det_hours_worked_f.tim_id%TYPE,
511: v_parent_id hxt_det_hours_worked_f.parent_id%TYPE,
512: v_session_date DATE
513: )
514: IS
515: SELECT 1
512: v_session_date DATE
513: )
514: IS
515: SELECT 1
516: FROM hxt_det_hours_worked_f hdhw
517: WHERE hdhw.tim_id = v_tim_id
518: AND v_session_date BETWEEN hdhw.effective_start_date
519: AND hdhw.effective_end_date
520: AND hdhw.pay_status = 'P' -- Bug 6067007
519: AND hdhw.effective_end_date
520: AND hdhw.pay_status = 'P' -- Bug 6067007
521: AND hdhw.pa_status = 'P' -- Bug 6067007
522: AND NOT EXISTS ( SELECT 1
523: FROM hxt_det_hours_worked_f hdhw2
524: WHERE hdhw.tim_id = hdhw2.tim_id
525: AND hdhw2.effective_start_date >
526: hdhw.effective_start_date);
527:
528:
529:
530: -- Bug 6067007
531: CURSOR csr_transferred_retro (
532: v_tim_id hxt_det_hours_worked_f.tim_id%TYPE,
533: v_parent_id hxt_det_hours_worked_f.parent_id%TYPE
534: )
535: IS
536: SELECT 1
529:
530: -- Bug 6067007
531: CURSOR csr_transferred_retro (
532: v_tim_id hxt_det_hours_worked_f.tim_id%TYPE,
533: v_parent_id hxt_det_hours_worked_f.parent_id%TYPE
534: )
535: IS
536: SELECT 1
537: FROM hxt_det_hours_worked_f hdhw
533: v_parent_id hxt_det_hours_worked_f.parent_id%TYPE
534: )
535: IS
536: SELECT 1
537: FROM hxt_det_hours_worked_f hdhw
538: WHERE hdhw.tim_id = v_tim_id
539: AND ( hdhw.pay_status = 'R'
540: OR hdhw.pa_status = 'R'
541: );
542: -- Bug 6067007
543:
544:
545: CURSOR csr_transferred (
546: v_tim_id hxt_det_hours_worked_f.tim_id%TYPE,
547: v_parent_id hxt_det_hours_worked_f.parent_id%TYPE
548: )
549: IS
550: SELECT 1
543:
544:
545: CURSOR csr_transferred (
546: v_tim_id hxt_det_hours_worked_f.tim_id%TYPE,
547: v_parent_id hxt_det_hours_worked_f.parent_id%TYPE
548: )
549: IS
550: SELECT 1
551: FROM hxt_det_hours_worked_f hdhw
547: v_parent_id hxt_det_hours_worked_f.parent_id%TYPE
548: )
549: IS
550: SELECT 1
551: FROM hxt_det_hours_worked_f hdhw
552: WHERE hdhw.tim_id = v_tim_id
553: AND ( hdhw.pay_status = 'C'
554: OR hdhw.pa_status = 'C'
555: );
554: OR hdhw.pa_status = 'C'
555: );
556:
557: CURSOR csr_changed_today (
558: v_tim_id hxt_det_hours_worked_f.tim_id%TYPE,
559: v_parent_id hxt_det_hours_worked_f.parent_id%TYPE,
560: v_session_dt DATE
561: )
562: IS
555: );
556:
557: CURSOR csr_changed_today (
558: v_tim_id hxt_det_hours_worked_f.tim_id%TYPE,
559: v_parent_id hxt_det_hours_worked_f.parent_id%TYPE,
560: v_session_dt DATE
561: )
562: IS
563: SELECT 1
560: v_session_dt DATE
561: )
562: IS
563: SELECT 1
564: FROM hxt_det_hours_worked_f hdhw
565: WHERE hdhw.tim_id = v_tim_id
566: AND trunc(hdhw.effective_start_date)
567: = trunc(v_session_dt);
568:
572: l_not_transferred csr_not_transferred%ROWTYPE := NULL;
573: l_changed_today csr_changed_today%ROWTYPE := NULL;
574: l_proc VARCHAR2 (30) ;
575:
576: FUNCTION details (p_tim_id IN hxt_det_hours_worked_f.tim_id%TYPE,
577: p_date IN DATE)
578: RETURN BOOLEAN
579: IS
580: -- Bug 7359347
581: -- Changed the below cursor to pick up session date from global variable
582: -- instead of fnd_sessions table.
583:
584: /*
585: CURSOR csr_debug (v_tim_id hxt_det_hours_worked_f.tim_id%TYPE)
586: IS
587: SELECT hdhw.id, hdhw.parent_id, hdhw.date_worked, hdhw.pay_status,
588: hdhw.effective_start_date
589: FROM hxt_det_hours_worked hdhw
589: FROM hxt_det_hours_worked hdhw
590: WHERE hdhw.tim_id = v_tim_id;
591: */
592:
593: CURSOR csr_debug (v_tim_id hxt_det_hours_worked_f.tim_id%TYPE,
594: v_sess_date DATE)
595: IS
596: SELECT hdhw.id, hdhw.parent_id, hdhw.date_worked, hdhw.pay_status,
597: hdhw.effective_start_date
594: v_sess_date DATE)
595: IS
596: SELECT hdhw.id, hdhw.parent_id, hdhw.date_worked, hdhw.pay_status,
597: hdhw.effective_start_date
598: FROM hxt_det_hours_worked_f hdhw
599: WHERE hdhw.tim_id = v_tim_id
600: AND v_sess_date BETWEEN hdhw.effective_start_date
601: AND hdhw.effective_end_date;
602:
875:
876: CURSOR weekly_total(session_date DATE)
877: IS
878: SELECT NVL (SUM (hrw.hours), 0)
879: FROM hxt_det_hours_worked_f hrw,
880: hxt_timecards_f tim,
881: hxt_earn_groups erg,
882: hxt_earn_group_types egt,
883: hxt_earning_policies erp
911: p_tim_id IN NUMBER,
912: p_prev_id IN NUMBER)
913: IS
914: SELECT NVL (SUM (hrw.hours), 0)
915: FROM hxt_det_hours_worked_f hrw,
916: hxt_timecards_f tim,
917: hxt_earn_groups erg,
918: hxt_earn_group_types egt,
919: hxt_earning_policies erp
1087:
1088: CURSOR weekly_total(session_date DATE)
1089: IS
1090: SELECT NVL (SUM (hrw.hours), 0)
1091: FROM hxt_det_hours_worked_f hrw, --C421
1092: hxt_timecards_f tim,
1093: hxt_earn_groups erg,
1094: hxt_earn_group_types egt,
1095: hxt_earning_policies erp
1122: p_tim_id IN NUMBER,
1123: p_prev_id IN NUMBER)
1124: IS
1125: SELECT NVL (SUM (hrw.hours), 0)
1126: FROM hxt_det_hours_worked_f hrw,
1127: hxt_timecards_f tim,
1128: hxt_earn_groups erg,
1129: hxt_earn_group_types egt,
1130: hxt_earning_policies erp
1374: AND petv.element_type_id = c_element_type_id
1375: AND petv.effective_start_date <= p_effective_start_date
1376: AND petv.effective_end_date >= p_effective_end_date;
1377:
1378: v_amount hxt_det_hours_worked_f.amount%TYPE;
1379: BEGIN
1380:
1381: -- Determine if the element is a fixed amount and what the fixed amount is.
1382:
1714: )
1715: IS
1716: SELECT hrw.time_in, hrw.time_out, hrw.hours, hrw.element_type_id,
1717: hrw.date_worked, eltv.hxt_earning_category
1718: FROM hxt_det_hours_worked_f hrw,
1719: hxt_pay_element_types_f_ddf_v eltv,
1720: pay_element_types_f elt
1721: WHERE elt.element_type_id = hrw.element_type_id
1722: AND eltv.hxt_earning_category IN ('REG', 'OVT', 'ABS')