52:
53: /* find out the day that is on */
54: select min(bsd.shift_date)
55: into l_cur_date
56: from bom_shift_dates bsd
57: where bsd.calendar_code = p_cal_code and
58: bsd.shift_date >= trunc( p_date )and
59: bsd.seq_num is not null;
60:
60:
61: /* find out prior and next day in calendar */
62: select max(bsd.shift_date)
63: into l_prior_date
64: from bom_shift_dates bsd
65: where bsd.calendar_code = p_cal_code and
66: bsd.shift_date < l_cur_date and
67: bsd.seq_num is not null;
68:
67: bsd.seq_num is not null;
68:
69: select min(bsd.shift_date)
70: into l_next_date
71: from bom_shift_dates bsd
72: where bsd.calendar_code = p_cal_code and
73: bsd.shift_date > l_cur_date and
74: bsd.seq_num is not null;
75:
90: bsd.shift_num,
91: bsd.seq_num,
92: st.from_time,
93: st.to_time
94: from bom_shift_dates bsd,
95: ( select bst.shift_num,
96: min(bst.from_time) from_time,
97: max (bst.to_time + decode(sign(bst.to_time - bst.from_time), -1, (24*60*60), 0) ) to_time
98: from bom_shift_times bst
137:
138: /* find out the day that is on */
139: select min(bsd.shift_date)
140: into l_cur_date
141: from bom_shift_dates bsd, bom_resource_shifts brs
142: where bsd.calendar_code = p_cal_code and
143: bsd.shift_date >= trunc( p_date )and
144: brs.department_id = p_dept_id and
145: brs.resource_id = nvl( p_resource_id, brs.resource_id) and
149:
150: /* find out prior and next day in calendar */
151: select max(bsd.shift_date)
152: into l_prior_date
153: from bom_shift_dates bsd, bom_resource_shifts brs
154: where bsd.calendar_code = p_cal_code and
155: bsd.shift_date < l_cur_date and
156: brs.department_id = p_dept_id and
157: brs.resource_id = nvl( p_resource_id, brs.resource_id) and
160: bsd.seq_num is not null;
161:
162: select min(bsd.shift_date)
163: into l_next_date
164: from bom_shift_dates bsd, bom_resource_shifts brs
165: where bsd.calendar_code = p_cal_code and
166: bsd.shift_date > l_cur_date and
167: brs.department_id = p_dept_id and
168: brs.resource_id = nvl( p_resource_id, brs.resource_id) and
187: bsd.shift_num,
188: bsd.seq_num,
189: st.from_time,
190: st.to_time
191: from bom_shift_dates bsd,
192: ( select bst.shift_num,
193: min(bst.from_time) from_time,
194: max (bst.to_time + decode(sign(bst.to_time - bst.from_time), -1, (24*60*60), 0) ) to_time
195: from bom_shift_times bst
1598: from mtl_parameters mp
1599: where mp.organization_id = p_org_id;
1600:
1601: if( p_shift_num is not null) then
1602: /* use bom_shift_dates*/
1603: l_date := sysdate;
1604:
1605: select shift_date
1606: into l_shift_date
1603: l_date := sysdate;
1604:
1605: select shift_date
1606: into l_shift_date
1607: from bom_shift_dates bsd
1608: where bsd.calendar_code = l_cal_code and
1609: bsd.exception_set_id = l_cal_exception_id and
1610: bsd.seq_num = p_shift_seq and
1611: bsd.shift_num = p_shift_num;
1794: Begin
1795: Begin
1796: select bsd.seq_num
1797: into l_shift_seq
1798: from bom_shift_dates bsd, mtl_parameters mp, bom_resource_shifts brs
1799: where mp.organization_id = p_org_id and
1800: mp.calendar_code = bsd.calendar_code and
1801: brs.department_id = p_department_id and
1802: brs.resource_id = p_resource_id and