965: CLOSE Cur_check_subinventory;
966:
967: --Validate the existing inventory org for the warehouse
968: IF (l_rec.disable_warehouse_ind ='Y') THEN
969: UPDATE hr_organization_units
970: SET date_to = SYSDATE
971: WHERE organization_id = l_rec.mtl_organization_id;
972: END IF;
973:
1102: SELECT HOU.BUSINESS_GROUP_ID,
1103: DECODE(HOI2.ORG_INFORMATION_CONTEXT, 'Accounting Information', TO_NUMBER(HOI2.ORG_INFORMATION1), TO_NUMBER(NULL)) SET_OF_BOOKS_ID,
1104: DECODE(HOI2.ORG_INFORMATION_CONTEXT, 'Accounting Information', TO_NUMBER(HOI2.ORG_INFORMATION3), TO_NUMBER(NULL)) OPERATING_UNIT,
1105: DECODE(HOI2.ORG_INFORMATION_CONTEXT, 'Accounting Information', TO_NUMBER(HOI2.ORG_INFORMATION2), null) LEGAL_ENTITY
1106: FROM HR_ORGANIZATION_UNITS HOU, HR_ORGANIZATION_INFORMATION HOI2
1107: WHERE HOU.organization_id = V_orgn_id
1108: AND HOU.ORGANIZATION_ID = HOI2.ORGANIZATION_ID
1109: AND ( HOI2.ORG_INFORMATION_CONTEXT || '') ='Accounting Information';
1110:
1108: AND HOU.ORGANIZATION_ID = HOI2.ORGANIZATION_ID
1109: AND ( HOI2.ORG_INFORMATION_CONTEXT || '') ='Accounting Information';
1110:
1111: CURSOR Cur_get_unit IS
1112: SELECT hr_organization_units_s.nextval
1113: FROM dual;
1114:
1115: CURSOR Cur_org_code (v_org_code VARCHAR2, v_start_ch NUMBER) IS
1116: (SELECT substrb(v_org_code,1,v_start_ch)|| substrb(ltrim(to_char(to_number(rownum)-1,'099')), v_start_ch+1)
1225: p_business_group_id => NVL(l_orgn_def.business_group_id, l_def_business_group),
1226: p_location_id => l_location_id,
1227: p_object_version_number => l_dummy);
1228: END IF;
1229: --Create a row for the organization in hr_organization_units table.
1230: OPEN Cur_get_unit;
1231: FETCH Cur_get_unit INTO X_organization_id;
1232: CLOSE Cur_get_unit;
1233:
1233:
1234: IF (p_migrate_as_ind = 3 OR (p_migrate_as_ind IS NULL AND p_delete_mark = 1)) THEN
1235: l_date_to := SYSDATE;
1236: END IF;
1237: hr_organization_units_pkg.insert_row(
1238: X_rowid =>l_rowid,
1239: X_organization_id =>X_organization_id,
1240: X_business_group_id =>NVL(l_orgn_def.business_group_id, l_def_business_group),
1241: X_cost_allocation_keyflex_id =>NULL,