220: and wt.operation_seq_num = p_operation_seq_num
221: and wt.resource_seq_num = p_resource_seq_num
222: and wt.resource_id = p_resource_id_old)
223: or exists (select 1
224: from wip_cost_txn_interface wcti, bom_resources br
225: where wcti.wip_entity_id = p_wip_entity_id
226: and wcti.organization_id = p_organization_id
227: and wcti.operation_seq_num = p_operation_seq_num
228: and wcti.resource_seq_num = p_resource_seq_num
308: and wt.operation_seq_num = p_operation_seq_num
309: and wt.resource_seq_num = p_resource_seq_num
310: and wt.resource_id = p_resource_id_old)
311: or exists (select 1
312: from wip_cost_txn_interface wcti, bom_resources br
313: where wcti.wip_entity_id = p_wip_entity_id
314: and wcti.organization_id = p_organization_id
315: and wcti.operation_seq_num = p_operation_seq_num
316: and wcti.resource_seq_num = p_resource_seq_num
845: -- Bug 12937792. Replacement Group can be Null.
846: --and wjdi.replacement_group_num is not null
847: )
848: and ( not exists(select 1
849: from bom_resources br
850: where br.resource_id = p_resource_id_new
851: and ( br.disable_date > sysdate
852: or br.disable_date is null)
853: and br.organization_id = p_organization_id)
860: l_error_exists boolean := false;
861: begin
862:
863: -- Validate when adding resources
864: -- resources to be added must exist in BOM_RESOURCES, not disabled
865: for l_inv_row in c_invalid_rows loop
866: l_error_exists := true;
867: fnd_message.set_name('WIP', 'WIP_INVALID_RESOURCE');
868: fnd_message.set_token('INTERFACE', to_char(l_inv_row.interface_id));
897: -- Bug 12937792. Replacement Group can be Null.
898: --and wjdi.replacement_group_num is not null
899: )
900: and ( not exists(select 1
901: from bom_resources br
902: where br.resource_id = p_resource_id_new
903: and ( br.disable_date > sysdate
904: or br.disable_date is null)
905: and br.organization_id = p_organization_id)
1049: l_hour_uom_class := wip_op_resources_utilities.get_uom_class(l_hour_uom);
1050:
1051: select uom.uom_class
1052: into l_uom_class
1053: from bom_resources br, mtl_units_of_measure_vl uom
1054: where br.resource_id = p_resource_id_new
1055: and br.unit_of_measure = uom.uom_code;
1056:
1057: if l_hour_uom_class = l_uom_class then
1061: end if;
1062:
1063: select autocharge_type
1064: into l_autocharge_type
1065: from bom_resources
1066: where resource_id = p_resource_id_new;
1067:
1068: if(l_autocharge_type is null) then
1069:
1182: and wjdi.substitution_type = wip_job_details.wip_add)
1183: or (wjdi.assigned_units is not null and wjdi.assigned_units <> 1
1184: and (wjdi.setup_id is not null or exists
1185: (select 1
1186: from bom_resources br
1187: where br.resource_id = nvl(wjdi.resource_id_new, wjdi.resource_id_old)
1188: and br.batchable = 1
1189: ))
1190: )
1273: and wjdi.substitution_type = wip_job_details.wip_add)
1274: or (wjdi.assigned_units is not null and wjdi.assigned_units <> 1
1275: and (wjdi.setup_id is not null or exists
1276: (select 1
1277: from bom_resources br
1278: where br.resource_id = nvl(wjdi.resource_id_new, wjdi.resource_id_old)
1279: ))
1280: )
1281: -- Bug 5172555