878: /* for Internal Orders */
879: /* Internal Orders only support standard item */
880: IF p_source_document_type_id = 10 THEN
881: --perf bug 5121218, replace org_organization_definitions with
882: --hr_all_organization_units
883:
884: /* SELECT null
885: INTO l_dummy
886: FROM mtl_system_items msi,
895:
896: SELECT null
897: INTO l_dummy
898: FROM mtl_system_items msi,
899: hr_all_organization_units org
900: WHERE msi.inventory_item_id = p_inventory_item_id
901: AND org.organization_id= msi.organization_id
902: AND msi.internal_order_enabled_flag = 'Y'
903: AND sysdate <= nvl( org.date_to, sysdate)
912: (p_item_type_code = OE_GLOBALS.G_ITEM_KIT AND
913: nvl(p_top_model_line_id, -1) <> p_line_id)
914: THEN
915: --perf bug 5121218, replace org_organization_definitions with
916: --hr_all_organization_units
917:
918: /* SELECT null
919: INTO l_dummy
920: FROM mtl_system_items msi,
928:
929: SELECT null
930: INTO l_dummy
931: FROM mtl_system_items msi,
932: hr_all_organization_units org
933: WHERE msi.inventory_item_id = p_inventory_item_id
934: AND org.organization_id= msi.organization_id
935: AND sysdate <= nvl( org.date_to, sysdate)
936: AND org.organization_id= p_ship_from_org_id
937: AND rownum=1;
938:
939: ELSE /* item type is MODEL,STANDARD,SERVICE,KIT in top most level*/
940: --perf bug 5121218, replace org_organization_definitions with
941: --hr_all_organization_units
942:
943: /* SELECT null
944: INTO l_dummy
945: FROM mtl_system_items msi,
954:
955: SELECT null
956: INTO l_dummy
957: FROM mtl_system_items msi,
958: hr_all_organization_units org
959: WHERE msi.inventory_item_id = p_inventory_item_id
960: AND org.organization_id= msi.organization_id
961: AND msi.customer_order_enabled_flag = 'Y'
962: AND sysdate <= nvl( org.date_to, sysdate)