1177: and pugu.process_type = g_process_type
1178: and pugu.id = g_geo_phase_id);
1179: fac_rec fac_cur%ROWTYPE;
1180:
1181: --Retrieve affected rows in the pay_balance_context_values table
1182: --using the latest_balance_id's from the pay_person_latest_balances
1183: --table.
1184: --Since we can join by the pk of the table we do not need any more logic
1185: --in the balance_contexts procedure.
1187: CURSOR pbcv_cur(geocode VARCHAR2, assign_id NUMBER, personid NUMBER) IS
1188: SELECT distinct pbcv.context_id, pbcv.value, pbcv.latest_balance_id,
1189: plb.assignment_action_id
1190: FROM pay_assignment_actions paa,
1191: pay_balance_context_values pbcv,
1192: pay_person_latest_balances plb,
1193: ff_contexts fcon
1194: WHERE paa.assignment_id = assign_id
1195: AND paa.assignment_action_id = plb.assignment_action_id
1201: AND NOT EXISTS (select 'Y' from PAY_US_GEO_UPDATE pugu
1202: where pugu.assignment_id = assign_id
1203: and pugu.table_value_id = plb.latest_balance_id
1204: and pugu.old_juri_code = geocode
1205: and pugu.table_name = 'PAY_BALANCE_CONTEXT_VALUES'
1206: and pugu.process_mode = g_mode
1207: and pugu.process_type = g_process_type
1208: and pugu.id = g_geo_phase_id);
1209:
1208: and pugu.id = g_geo_phase_id);
1209:
1210: pbcv_rec pbcv_cur%ROWTYPE;
1211:
1212: --Retrieve affected rows in the pay_balance_context_values table
1213: --using the latest_balance_id's from the pay_assignment_latest_balances
1214: --table.
1215: CURSOR pacv_cur(geocode VARCHAR2, assign_id NUMBER, personid NUMBER) IS
1216: SELECT distinct pbcv.context_id, pbcv.value, pbcv.latest_balance_id,
1215: CURSOR pacv_cur(geocode VARCHAR2, assign_id NUMBER, personid NUMBER) IS
1216: SELECT distinct pbcv.context_id, pbcv.value, pbcv.latest_balance_id,
1217: plb.assignment_action_id
1218: FROM ff_contexts fcon,
1219: pay_balance_context_values pbcv,
1220: pay_assignment_latest_balances plb
1221: WHERE plb.assignment_id = assign_id
1222: AND pbcv.latest_balance_id = plb.latest_balance_id
1223: AND pbcv.value = geocode
1226: AND NOT EXISTS (select 'Y' from PAY_US_GEO_UPDATE pugu
1227: where pugu.assignment_id = assign_id
1228: and pugu.table_value_id = plb.latest_balance_id
1229: and pugu.old_juri_code = geocode
1230: and pugu.table_name = 'PAY_BALANCE_CONTEXT_VALUES'
1231: and pugu.process_mode = g_mode
1232: and pugu.process_type = g_process_type
1233: and pugu.id = g_geo_phase_id);
1234:
1235:
1236: pacv_rec pacv_cur%ROWTYPE;
1237:
1238: -- Rosie Monge 10/17/2005 Bug 4602222
1239: --Retrieve affected rows in the pay_balance_context_values table
1240: --using the latest_balance_id's from the pay_latest_balances
1241: --table.
1242:
1243: CURSOR plbcv_cur(geocode VARCHAR2, assign_id NUMBER, personid NUMBER) IS
1243: CURSOR plbcv_cur(geocode VARCHAR2, assign_id NUMBER, personid NUMBER) IS
1244: SELECT distinct pbcv.context_id, pbcv.value, pbcv.latest_balance_id,
1245: plb.assignment_action_id
1246: FROM ff_contexts fcon,
1247: pay_balance_context_values pbcv,
1248: pay_latest_balances plb
1249: WHERE plb.assignment_id = assign_id
1250: AND pbcv.latest_balance_id = plb.latest_balance_id
1251: AND pbcv.value = geocode
1254: AND NOT EXISTS (select 'Y' from PAY_US_GEO_UPDATE pugu
1255: where pugu.assignment_id = assign_id
1256: and pugu.table_value_id = plb.latest_balance_id
1257: and pugu.old_juri_code = geocode
1258: and pugu.table_name = 'PAY_BALANCE_CONTEXT_VALUES'
1259: and pugu.process_mode = g_mode
1260: and pugu.process_type = g_process_type
1261: and pugu.id = g_geo_phase_id);
1262:
2221: hr_utility.trace('Before update of latest balances context for assignment_action_id: '||to_char(p_assign_act_id));
2222:
2223: IF G_MODE = 'UPGRADE' THEN
2224:
2225: UPDATE pay_balance_context_values
2226: SET value = p_new_juri_code
2227: WHERE value = p_old_juri_code
2228: AND context_id = p_context_id
2229: AND latest_balance_id = p_lat_bal_id;
2236: p_person_id => p_person_id,
2237: p_assign_id => p_assign_id,
2238: p_old_juri_code => p_old_juri_code,
2239: p_new_juri_code => p_new_juri_code,
2240: p_location => 'PAY_BALANCE_CONTEXT_VALUES',
2241: p_id => p_lat_bal_id);
2242:
2243: ELSE
2244:
2249: p_person_id => p_person_id,
2250: p_assign_id => p_assign_id,
2251: p_old_juri_code => p_old_juri_code,
2252: p_new_juri_code => p_new_juri_code,
2253: p_location => 'PAY_BALANCE_CONTEXT_VALUES',
2254: p_id => p_lat_bal_id);
2255:
2256: END IF;
2257: