650: -- cursor to fetch the default operation sequence number
651:
652: CURSOR default_operation(p_wip_entity_id IN NUMBER) IS
653: SELECT operation_seq_num
654: FROM wip_operations
655: WHERE wip_entity_id = p_wip_entity_id AND
656: previous_operation_seq_num IS NULL ;
657:
658: -- special case ( when CSD: Default Repair Item as Material on Job profile is set to yes)
911: where inventory_item_id = p_item_id and serial_number = p_serial_number and current_organization_id = p_org_id;
912:
913:
914: Cursor c_get_min_operation_seq(p_wip_entity_id number) is
915: select min(operation_seq_num) from wip_operations_v where wip_entity_id = p_wip_entity_id;
916:
917: l_inventory_item_id NUMBER;
918: l_unit_of_measure VARCHAR2(3);
919: l_quantity NUMBER;
1767: THEN
1768: BEGIN
1769: SELECT operation_seq_num
1770: INTO l_operation_seq_num
1771: FROM wip_operations
1772: WHERE previous_operation_seq_num IS NULL
1773: AND wip_entity_id = i.wip_entity_id;
1774: EXCEPTION
1775: WHEN NO_DATA_FOUND THEN