[Home] [Help]
1736: begin
1737:
1738: select 1, max (direct_item_sequence_id), sum(nvl(required_quantity,0))
1739: into l_status , l_direct_item_id, l_required_quantity
1740: from wip_eam_direct_items
1741: where wip_entity_id = l_wip_entity_id
1742: and organization_id = l_organization_id
1743: and operation_seq_num = l_operation_seq_num
1744: and description = l_item_description;
1744: and description = l_item_description;
1745:
1746: select uom
1747: into l_uom
1748: from wip_eam_direct_items
1749: where wip_entity_id = l_wip_entity_id
1750: and organization_id = l_organization_id
1751: and operation_seq_num = l_operation_seq_num
1752: and description = l_item_description
1781:
1782:
1783: if (l_quantity_received > l_required_quantity ) then
1784:
1785: update wip_eam_direct_items
1786: set required_quantity = l_quantity_received
1787: where wip_entity_id = l_wip_entity_id
1788: and organization_id = l_organization_id
1789: and operation_seq_num = l_operation_seq_num
1791:
1792: end if;
1793:
1794: if ( l_order_type_lookup_code = 'AMOUNT') then
1795: update wip_eam_direct_items
1796: set required_quantity = nvl(l_quantity_received,0),
1797: amount = amount + p_unit_price
1798: where wip_entity_id = l_wip_entity_id
1799: and organization_id = l_organization_id
1807: WHEN NO_DATA_FOUND then
1808:
1809:
1810:
1811: insert into WIP_EAM_DIRECT_ITEMS
1812: (DESCRIPTION,
1813: PURCHASING_CATEGORY_ID,
1814: DIRECT_ITEM_SEQUENCE_ID,
1815: OPERATION_SEQ_NUM,
1853: FND_GLOBAL.USER_ID,
1854: l_order_type_lookup_code,
1855: l_unit_price );
1856:
1857: end; -- end of insertion into WIP_EAM_DIRECT_ITEMS table
1858:
1859: end if; -- end of l_resource_seq_num
1860:
1861: end if; -- end of l_item_id, l_operation_seq_num, l_organization_id not null