2058: end if;
2059:
2060: -- 5. operations do belong to the work order
2061: if l_wip_entity_id <> -9999 and l_org_id <> -9999 and l_operation_number <> -9999 then
2062: select count(*) into l_count from wip_operations where
2063: wip_entity_id = l_wip_entity_id and
2064: organization_id = l_org_id and
2065: operation_seq_num = l_operation_number;
2066: if l_count = 0 then
2081:
2082: -- 6. Check whether department and operation association is correct.
2083: if l_wip_entity_id <> -9999 and l_org_id <> -9999 and l_operation_number <> -9999
2084: and l_dept_id <> -9999 then
2085: select count(*) into l_count from wip_operations where
2086: wip_entity_id = l_wip_entity_id and
2087: operation_seq_num = l_operation_number and
2088: organization_id = l_org_id and
2089: department_id = l_dept_id;