990: SELECT bcb.component_sequence_id
991: FROM bom_components_b bcb
992: WHERE bcb.CHANGE_NOTICE = cp_change_notice
993: AND exists
994: (select 'x' from bom_bill_of_materials
995: where bill_sequence_id = bcb.bill_sequence_id
996: and organization_id = x_organization_id )
997: AND (bcb.common_component_sequence_id IS NULL
998: OR bcb.common_component_sequence_id = bcb.component_sequence_id)
1157: OR bic.common_component_sequence_id = bic.component_sequence_id)
1158: -- This is to ensure that the destination bill's revised item
1159: -- reschedule doesnt affect its components effectivity date
1160: AND exists
1161: (select 'x' from bom_bill_of_materials
1162: where bill_sequence_id = bic.bill_sequence_id
1163: and organization_id = x_organization_id )
1164: AND bic.IMPLEMENTATION_DATE IS NULL;
1165:
1173: SET bic1.DISABLE_DATE = p_effectivity_date
1174: WHERE bic1.CHANGE_NOTICE = x_change_notice
1175: AND bic1.ACD_TYPE = 3 -- ACD Type: Disable
1176: AND exists
1177: (select 'x' from bom_bill_of_materials
1178: where bill_sequence_id = bic1.bill_sequence_id
1179: and organization_id = x_organization_id )
1180: AND bic1.IMPLEMENTATION_DATE IS NULL;
1181:
1401: SELECT bcb.component_sequence_id
1402: FROM bom_components_b bcb
1403: WHERE bcb.CHANGE_NOTICE = cp_change_notice
1404: AND exists
1405: (select 'x' from bom_bill_of_materials
1406: where bill_sequence_id = bcb.bill_sequence_id
1407: and organization_id = x_organization_id )
1408: AND (bcb.common_component_sequence_id IS NULL
1409: OR bcb.common_component_sequence_id = bcb.component_sequence_id)
1507: OR bic.common_component_sequence_id = bic.component_sequence_id)
1508: -- This is to ensure that the destination bill's revised item
1509: -- reschedule doesnt affect its components effectivity date
1510: AND exists
1511: (select 'x' from bom_bill_of_materials
1512: where bill_sequence_id = bic.bill_sequence_id
1513: and organization_id = x_organization_id )
1514: AND bic.IMPLEMENTATION_DATE IS NULL;
1515:
1523: SET bic1.DISABLE_DATE = p_effectivity_date
1524: WHERE bic1.CHANGE_NOTICE = x_change_notice
1525: AND bic1.ACD_TYPE = 3 -- ACD Type: Disable
1526: AND exists
1527: (select 'x' from bom_bill_of_materials
1528: where bill_sequence_id = bic1.bill_sequence_id
1529: and organization_id = x_organization_id )
1530: AND bic1.IMPLEMENTATION_DATE IS NULL;
1531:
2202:
2203: -- Delete the bom header if bill was created by this revised item and
2204: -- nothing else references this
2205:
2206: DELETE FROM BOM_BILL_OF_MATERIALS B
2207: WHERE B.BILL_SEQUENCE_ID in (SELECT BILL_SEQUENCE_ID
2208: FROM ENG_REVISED_ITEMS ERI
2209: WHERE ORGANIZATION_ID = org_id
2210: AND CHANGE_NOTICE = change_order
2217: AND (C.CHANGE_NOTICE IS NULL
2218: OR C.CHANGE_NOTICE <> change_order))
2219: AND ((B.ALTERNATE_BOM_DESIGNATOR IS NULL
2220: AND NOT EXISTS (SELECT NULL
2221: FROM BOM_BILL_OF_MATERIALS B2
2222: WHERE B2.ORGANIZATION_ID = B.ORGANIZATION_ID
2223: AND B2.ASSEMBLY_ITEM_ID = B.ASSEMBLY_ITEM_ID
2224: AND B2.ALTERNATE_BOM_DESIGNATOR IS NOT NULL))
2225: OR
2243: WHERE R.ORGANIZATION_ID = org_id
2244: AND R.CHANGE_NOTICE = change_order
2245: AND R.STATUS_TYPE = 5
2246: AND NOT EXISTS (SELECT 'NO SUCH BILL'
2247: FROM BOM_BILL_OF_MATERIALS BOM
2248: WHERE BOM.BILL_SEQUENCE_ID = R.BILL_SEQUENCE_ID);
2249: END IF;
2250:
2251: