[Home] [Help]
1266: crl.requirement_line_id,
1267: crh.destination_organization_id,
1268: crh.destination_subinventory,
1269: crh.ship_to_location_id
1270: from csp_available_parts_temp capt,
1271: org_organization_definitions ood,
1272: csp_requirement_lines crl,
1273: csp_requirement_headers crh,
1274: mtl_system_items_b msib
1638:
1639:
1640: if x_options(1).transfer_cost <= p_options.transfer_cost and
1641: x_options(1).start_time <= p_options.start_time+1/144 then
1642: -- Loop csp_available_parts_temp
1643: for cap in c_available_parts(p_task_id) loop
1644: l_ship_to_location_id := cap.ship_to_location_id;
1645:
1646: log('choose_option','l_destination_org_id:'||l_destination_org_id);
3617: select organization_id,
3618: subinventory_code,
3619: shipping_date,
3620: sum(supplied_quantity)
3621: from csp_available_parts_temp capt
3622: where capt.required_item_id = p_inventory_item_id
3623: and capt.supplied_quantity >= p_quantity
3624: and capt.arrival_date <= p_interval.latest_time
3625: group by organization_id, subinventory_code, shipping_date, shipping_cost
3744: x_final_unavailable_list(x_final_unavailable_list.count).revision := p_unavailable_list(i).revision;
3745: x_final_unavailable_list(x_final_unavailable_list.count).item_type := p_unavailable_list(i).item_type;
3746: x_final_unavailable_list(x_final_unavailable_list.count).line_id := p_unavailable_list(i).line_id;
3747: end if;
3748: delete from csp_available_parts_temp;
3749: delete from csp_required_parts_temp;
3750: end loop;
3751: end;
3752:
3799: shipping_method,
3800: source_type_code,
3801: supplied_item_id,
3802: distance
3803: from csp_available_parts_temp
3804: where required_item_id = p_inventory_item_id
3805: and nvl(open_or_closed,'-1') <> 'USED'
3806: order by shipping_cost,distance,organization_id,subinventory_code;
3807:
3879: else
3880: l_alternates := FALSE;
3881: end if;
3882: if l_ship_to_location_id is not null and p_warehouse then
3883: delete from csp_available_parts_temp;
3884: delete from csp_required_parts_temp;
3885: if p_warehouse then
3886: p_search_params.search_method := l_search_method;
3887: p_search_params.my_inventory := false;
3942: if l_org_id = l_sr_org_id then
3943: exit;
3944: end if;
3945: end loop;
3946: delete from csp_available_parts_temp;
3947: delete from csp_required_parts_temp;
3948: p_search_params.search_method := l_search_method;
3949: p_search_params.my_inventory := false;
3950: p_search_params.unmanned_warehouses := false;
3970: end if;
3971:
3972: if p_trunk then
3973: begin
3974: delete from csp_available_parts_temp
3975: where source_type_code in ('MYSELF','DEDICATED');
3976: exception when others then null;
3977: end;
3978: --dbms_output.put_line('ResourceTYPE:'||p_resources(i).resource_type);
4075: l_start_time := greatest(l_start_time,ca.arrival_date);
4076: log('spares_check2','l_start_time:'||to_char(l_start_time,'dd-mon-yyyy hh24:mi'));
4077: if l_choose_option then
4078: log('spares_check2','update supplied quantity of capt');
4079: update csp_available_parts_temp
4080: set supplied_quantity = least(supplied_quantity,l_missing_parts),
4081: open_or_closed = 'USED'
4082: where organization_id = ca.organization_id
4083: and nvl(subinventory_code,'-1') = nvl(ca.subinventory_code,'-1')
4089: end if;
4090: l_missing_parts := greatest(l_missing_parts - ca.supplied_quantity,0);
4091: log('spares_check2','l_missing_parts:'||l_missing_parts);
4092: elsif l_missing_parts = 0 and l_choose_option then
4093: delete from csp_available_parts_temp
4094: where organization_id = ca.organization_id
4095: and nvl(subinventory_code,'-1') = nvl(ca.subinventory_code,'-1')
4096: and supplied_item_id = ca.supplied_item_id
4097: and required_item_id = cp.inventory_item_id