50: ((decode(least(shifts.to_time,shifts.from_time),
51: shifts.to_time,shifts.to_time + 24*3600,
52: shifts.to_time) - shifts.from_time)/3600))),0))
53: FROM bom_calendar_dates cal,
54: bom_department_resources bdr,
55: bom_resource_shifts brs,
56: bom_shift_times shifts,
57: mtl_parameters mp,
58: mrp_form_query mfq
321: -- --------------------------------------------
322: /* Fix for bug 2000775*/
323: select capacity_units
324: into temp_cap_units
325: from bom_department_resources
326: where department_id = l_dept_id
327: and resource_id = l_res_id;
328:
329: qty_cells_tab(capacity_rec2.bucket_number) := capacity_rec2.bucket_qty *