177: i_primary_quantity := i_transaction_quantity;
178:
179: -- prepare the rest data
180: if(s_transaction_type = 1) then -- Complete Transaction
181: i_transaction_action_id := WIP_CONSTANTS.CPLASSY_ACTION;
182: i_transaction_type_id := WIP_CONSTANTS.CPLASSY_TYPE;
183: elsif(s_transaction_type = 2) then -- Uncomplete Transaction
184: i_transaction_quantity := - i_transaction_quantity;
185: i_primary_quantity := - i_primary_quantity;
178:
179: -- prepare the rest data
180: if(s_transaction_type = 1) then -- Complete Transaction
181: i_transaction_action_id := WIP_CONSTANTS.CPLASSY_ACTION;
182: i_transaction_type_id := WIP_CONSTANTS.CPLASSY_TYPE;
183: elsif(s_transaction_type = 2) then -- Uncomplete Transaction
184: i_transaction_quantity := - i_transaction_quantity;
185: i_primary_quantity := - i_primary_quantity;
186: i_transaction_action_id := WIP_CONSTANTS.RETASSY_ACTION;
182: i_transaction_type_id := WIP_CONSTANTS.CPLASSY_TYPE;
183: elsif(s_transaction_type = 2) then -- Uncomplete Transaction
184: i_transaction_quantity := - i_transaction_quantity;
185: i_primary_quantity := - i_primary_quantity;
186: i_transaction_action_id := WIP_CONSTANTS.RETASSY_ACTION;
187: i_transaction_type_id := WIP_CONSTANTS.RETASSY_TYPE;
188: else
189: fnd_message.set_name('EAM','EAM_INVALID_TRANSACTION_TYPE');
190: errCode := 1;
183: elsif(s_transaction_type = 2) then -- Uncomplete Transaction
184: i_transaction_quantity := - i_transaction_quantity;
185: i_primary_quantity := - i_primary_quantity;
186: i_transaction_action_id := WIP_CONSTANTS.RETASSY_ACTION;
187: i_transaction_type_id := WIP_CONSTANTS.RETASSY_TYPE;
188: else
189: fnd_message.set_name('EAM','EAM_INVALID_TRANSACTION_TYPE');
190: errCode := 1;
191: errMsg := fnd_message.get;
233: end if;
234:
235: -- Check whether the item is under lot or serial control or not
236: -- If it is, insert the data to coresponding tables
237: if(item.lotControlCode = WIP_CONSTANTS.LOT) then
238:
239: -- the item is under lot control
240:
241: -- call inventory API to insert data to mtl_transaction_lots_temp
257: null;
258: end if; -- end lot control check
259:
260: -- Check if the item is under serial control or not
261: if(item.serialNumberControlCode in (WIP_CONSTANTS.FULL_SN,
262: WIP_CONSTANTS.DYN_RCV_SN)) then
263: -- item is under serial control
264:
265: -- Check if the item is under lot control or not
258: end if; -- end lot control check
259:
260: -- Check if the item is under serial control or not
261: if(item.serialNumberControlCode in (WIP_CONSTANTS.FULL_SN,
262: WIP_CONSTANTS.DYN_RCV_SN)) then
263: -- item is under serial control
264:
265: -- Check if the item is under lot control or not
266: if(item.lotControlCode = WIP_CONSTANTS.LOT) then
262: WIP_CONSTANTS.DYN_RCV_SN)) then
263: -- item is under serial control
264:
265: -- Check if the item is under lot control or not
266: if(item.lotControlCode = WIP_CONSTANTS.LOT) then
267:
268: -- under lot control
269: i_transaction_temp_id_s := i_serial_transaction_temp_id;
270: else
1113: WHERE parent_relationship_type =1
1114: START WITH parent_object_id = x_wip_entity_id AND parent_relationship_type = 1
1115: CONNECT BY parent_object_id = prior child_object_id AND parent_relationship_type = 1
1116: )
1117: AND status_type NOT IN (WIP_CONSTANTS.COMP_CHRG,
1118: WIP_CONSTANTS.COMP_NOCHRG,WIP_CONSTANTS.CLOSED,WIP_CONSTANTS.CANCELLED, WIP_CONSTANTS.PEND_CLOSE)
1119:
1120: );
1121:
1114: START WITH parent_object_id = x_wip_entity_id AND parent_relationship_type = 1
1115: CONNECT BY parent_object_id = prior child_object_id AND parent_relationship_type = 1
1116: )
1117: AND status_type NOT IN (WIP_CONSTANTS.COMP_CHRG,
1118: WIP_CONSTANTS.COMP_NOCHRG,WIP_CONSTANTS.CLOSED,WIP_CONSTANTS.CANCELLED, WIP_CONSTANTS.PEND_CLOSE)
1119:
1120: );
1121:
1122: if (network_child_job_var = '1') then --In the network Work Order has Uncompleted Child Work Orders
1131: FROM eam_wo_relationships
1132: WHERE parent_relationship_type =1
1133: START WITH parent_object_id = x_wip_entity_id AND parent_relationship_type = 1
1134: CONNECT BY parent_object_id = prior child_object_id AND parent_relationship_type = 1)
1135: AND status_type NOT IN (WIP_CONSTANTS.COMP_CHRG,
1136: WIP_CONSTANTS.COMP_NOCHRG,WIP_CONSTANTS.CLOSED,WIP_CONSTANTS.CANCELLED, WIP_CONSTANTS.PEND_CLOSE)
1137: AND ROWNUM =1
1138: );
1139: fnd_message.set_name('EAM','EAM_NETWRK_CHILD_JOB_NOT_COMP');
1132: WHERE parent_relationship_type =1
1133: START WITH parent_object_id = x_wip_entity_id AND parent_relationship_type = 1
1134: CONNECT BY parent_object_id = prior child_object_id AND parent_relationship_type = 1)
1135: AND status_type NOT IN (WIP_CONSTANTS.COMP_CHRG,
1136: WIP_CONSTANTS.COMP_NOCHRG,WIP_CONSTANTS.CLOSED,WIP_CONSTANTS.CANCELLED, WIP_CONSTANTS.PEND_CLOSE)
1137: AND ROWNUM =1
1138: );
1139: fnd_message.set_name('EAM','EAM_NETWRK_CHILD_JOB_NOT_COMP');
1140: fnd_message.set_token('WIP_ENTITY_NAME',network_child_name);
1166: FROM eam_wo_relationships
1167: WHERE parent_relationship_type =2 and
1168: child_object_id = x_wip_entity_id
1169: )
1170: AND status_type NOT IN (WIP_CONSTANTS.COMP_CHRG,
1171: WIP_CONSTANTS.COMP_NOCHRG,WIP_CONSTANTS.CLOSED)
1172:
1173: );
1174:
1167: WHERE parent_relationship_type =2 and
1168: child_object_id = x_wip_entity_id
1169: )
1170: AND status_type NOT IN (WIP_CONSTANTS.COMP_CHRG,
1171: WIP_CONSTANTS.COMP_NOCHRG,WIP_CONSTANTS.CLOSED)
1172:
1173: );
1174:
1175: if (sibling_parent_job_var = '1') then
1184: FROM eam_wo_relationships
1185: WHERE parent_relationship_type =2 and
1186: child_object_id = x_wip_entity_id
1187: )
1188: AND status_type NOT IN (WIP_CONSTANTS.COMP_CHRG,
1189: WIP_CONSTANTS.COMP_NOCHRG,WIP_CONSTANTS.CLOSED)
1190: AND ROWNUM =1
1191: );
1192: ROLLBACK TO job_comp;
1185: WHERE parent_relationship_type =2 and
1186: child_object_id = x_wip_entity_id
1187: )
1188: AND status_type NOT IN (WIP_CONSTANTS.COMP_CHRG,
1189: WIP_CONSTANTS.COMP_NOCHRG,WIP_CONSTANTS.CLOSED)
1190: AND ROWNUM =1
1191: );
1192: ROLLBACK TO job_comp;
1193: fnd_message.set_name('EAM','EAM_NETWRK_SIB_JOB_NOT_COM');
1385: FROM wip_discrete_jobs wdj, wip_entities we
1386: WHERE wdj.wip_entity_id = we.wip_entity_id
1387: AND wdj.parent_wip_entity_id = x_wip_entity_id
1388: AND wdj.manual_rebuild_flag = 'Y'
1389: AND wdj.status_type NOT IN (WIP_CONSTANTS.COMP_CHRG,
1390: WIP_CONSTANTS.COMP_NOCHRG,WIP_CONSTANTS.CLOSED,
1391: WIP_CONSTANTS.CANCELLED));
1392: if (child_job_var = '1') then
1393: ROLLBACK TO job_comp;
1386: WHERE wdj.wip_entity_id = we.wip_entity_id
1387: AND wdj.parent_wip_entity_id = x_wip_entity_id
1388: AND wdj.manual_rebuild_flag = 'Y'
1389: AND wdj.status_type NOT IN (WIP_CONSTANTS.COMP_CHRG,
1390: WIP_CONSTANTS.COMP_NOCHRG,WIP_CONSTANTS.CLOSED,
1391: WIP_CONSTANTS.CANCELLED));
1392: if (child_job_var = '1') then
1393: ROLLBACK TO job_comp;
1394: fnd_message.set_name('EAM','EAM_CHILD_JOB_NOT_COMPLETE');
1387: AND wdj.parent_wip_entity_id = x_wip_entity_id
1388: AND wdj.manual_rebuild_flag = 'Y'
1389: AND wdj.status_type NOT IN (WIP_CONSTANTS.COMP_CHRG,
1390: WIP_CONSTANTS.COMP_NOCHRG,WIP_CONSTANTS.CLOSED,
1391: WIP_CONSTANTS.CANCELLED));
1392: if (child_job_var = '1') then
1393: ROLLBACK TO job_comp;
1394: fnd_message.set_name('EAM','EAM_CHILD_JOB_NOT_COMPLETE');
1395: FND_MSG_PUB.Add;
1436:
1437:
1438:
1439: -- initial the rest important variable
1440: i_status_type := WIP_CONSTANTS.COMP_CHRG;
1441: i_completion_date := x_actual_end_date;
1442: i_work_request_status := 6; -- Work request complete
1443:
1444: elsif (x_transaction_type = 2) then -- Uncomplete Transaction
1484: null;
1485: end;
1486:
1487: -- Check whether parent job already completed or not
1488: if(i_parent_status_type = WIP_CONSTANTS.COMP_CHRG) then
1489: ROLLBACK TO job_comp;
1490: fnd_message.set_name('EAM','EAM_PARENT_JOB_COMPLETED');
1491: FND_MSG_PUB.Add;
1492: errCode := 1;
1530: eam_pm_utils.update_pm_when_uncomplete(i_org_id, x_wip_entity_id);
1531: end if; -- end of source entity check
1532:
1533: -- initial the rest important variable
1534: i_status_type := WIP_CONSTANTS.RELEASED;
1535: i_completion_date := null;
1536: i_work_request_status := 4; -- Work request in process
1537:
1538: else -- Other Transactions