67: INTO l_plan_element;
68:
69: IF c_plan_element_csr%NOTFOUND
70: THEN
71: fnd_message.set_name ('CN', 'CN_INVALID_UPDATE_REC');
72: fnd_msg_pub.ADD;
73:
74: CLOSE c_plan_element_csr;
75:
114: WHEN NO_DATA_FOUND
115: THEN
116: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
117: THEN
118: fnd_message.set_name ('FND', 'MO_ORG_INVALID');
119: fnd_msg_pub.ADD;
120: END IF;
121:
122: RETURN FALSE;
165: x_msg_count := fnd_api.g_null_num;
166:
167: IF (p_operation <> 'update') THEN
168: IF (p_operation = 'create') THEN
169: fnd_message.set_name('CN','CNR12_NOTE_PE_NAME_CREATE');
170: fnd_message.set_token('PE_NAME', p_plan_element_new.NAME);
171: l_plan_element_id := p_plan_element_new.quota_id;
172: l_temp_new := 'CN_QUOTAS';
173: END IF;
166:
167: IF (p_operation <> 'update') THEN
168: IF (p_operation = 'create') THEN
169: fnd_message.set_name('CN','CNR12_NOTE_PE_NAME_CREATE');
170: fnd_message.set_token('PE_NAME', p_plan_element_new.NAME);
171: l_plan_element_id := p_plan_element_new.quota_id;
172: l_temp_new := 'CN_QUOTAS';
173: END IF;
174: IF (p_operation = 'delete') THEN
171: l_plan_element_id := p_plan_element_new.quota_id;
172: l_temp_new := 'CN_QUOTAS';
173: END IF;
174: IF (p_operation = 'delete') THEN
175: fnd_message.set_name ('CN', 'CNR12_NOTE_PE_NAME_DELETE');
176: fnd_message.set_token('PE_NAME', p_plan_element_old.NAME);
177: l_plan_element_id := p_plan_element_old.org_id;
178: l_temp_new := 'CN_DELETED_OBJECTS';
179: END IF;
172: l_temp_new := 'CN_QUOTAS';
173: END IF;
174: IF (p_operation = 'delete') THEN
175: fnd_message.set_name ('CN', 'CNR12_NOTE_PE_NAME_DELETE');
176: fnd_message.set_token('PE_NAME', p_plan_element_old.NAME);
177: l_plan_element_id := p_plan_element_old.org_id;
178: l_temp_new := 'CN_DELETED_OBJECTS';
179: END IF;
180: l_note_msg := fnd_message.get;
176: fnd_message.set_token('PE_NAME', p_plan_element_old.NAME);
177: l_plan_element_id := p_plan_element_old.org_id;
178: l_temp_new := 'CN_DELETED_OBJECTS';
179: END IF;
180: l_note_msg := fnd_message.get;
181: jtf_notes_pub.create_note
182: (p_api_version => 1.0,
183: x_return_status => x_return_status,
184: x_msg_count => x_msg_count,
193: ELSIF (p_operation = 'update') THEN
194: l_consolidated_note := '';
195: -- CHECK IF PE NAME WAS UPDATED
196: IF (p_plan_element_old.NAME <> p_plan_element_new.NAME) THEN
197: fnd_message.set_name ('CN', 'CNR12_NOTE_PE_NAME_UPDATE');
198: fnd_message.set_token('PE_NAME_OLD', p_plan_element_old.NAME);
199: fnd_message.set_token('PE_NAME_NEW', p_plan_element_new.NAME);
200: l_plan_element_id := p_plan_element_new.quota_id;
201: l_note_msg := fnd_message.get;
194: l_consolidated_note := '';
195: -- CHECK IF PE NAME WAS UPDATED
196: IF (p_plan_element_old.NAME <> p_plan_element_new.NAME) THEN
197: fnd_message.set_name ('CN', 'CNR12_NOTE_PE_NAME_UPDATE');
198: fnd_message.set_token('PE_NAME_OLD', p_plan_element_old.NAME);
199: fnd_message.set_token('PE_NAME_NEW', p_plan_element_new.NAME);
200: l_plan_element_id := p_plan_element_new.quota_id;
201: l_note_msg := fnd_message.get;
202: l_consolidated_note := l_note_msg || fnd_global.local_chr(10);
195: -- CHECK IF PE NAME WAS UPDATED
196: IF (p_plan_element_old.NAME <> p_plan_element_new.NAME) THEN
197: fnd_message.set_name ('CN', 'CNR12_NOTE_PE_NAME_UPDATE');
198: fnd_message.set_token('PE_NAME_OLD', p_plan_element_old.NAME);
199: fnd_message.set_token('PE_NAME_NEW', p_plan_element_new.NAME);
200: l_plan_element_id := p_plan_element_new.quota_id;
201: l_note_msg := fnd_message.get;
202: l_consolidated_note := l_note_msg || fnd_global.local_chr(10);
203: /* jtf_notes_pub.create_note
197: fnd_message.set_name ('CN', 'CNR12_NOTE_PE_NAME_UPDATE');
198: fnd_message.set_token('PE_NAME_OLD', p_plan_element_old.NAME);
199: fnd_message.set_token('PE_NAME_NEW', p_plan_element_new.NAME);
200: l_plan_element_id := p_plan_element_new.quota_id;
201: l_note_msg := fnd_message.get;
202: l_consolidated_note := l_note_msg || fnd_global.local_chr(10);
203: /* jtf_notes_pub.create_note
204: (p_api_version => 1.0,
205: x_return_status => x_return_status,
214: );*/
215: END IF;
216: -- CHECK IF START DATE WAS UPDATED
217: IF (p_plan_element_old.start_date <> p_plan_element_new.start_date) THEN
218: fnd_message.set_name ('CN', 'CNR12_NOTE_PE_STDATE_UPDATE');
219: fnd_message.set_token('PE_START_OLD', p_plan_element_old.start_date);
220: fnd_message.set_token('PE_START_NEW', p_plan_element_new.start_date);
221: l_plan_element_id := p_plan_element_new.quota_id;
222: l_note_msg := fnd_message.get;
215: END IF;
216: -- CHECK IF START DATE WAS UPDATED
217: IF (p_plan_element_old.start_date <> p_plan_element_new.start_date) THEN
218: fnd_message.set_name ('CN', 'CNR12_NOTE_PE_STDATE_UPDATE');
219: fnd_message.set_token('PE_START_OLD', p_plan_element_old.start_date);
220: fnd_message.set_token('PE_START_NEW', p_plan_element_new.start_date);
221: l_plan_element_id := p_plan_element_new.quota_id;
222: l_note_msg := fnd_message.get;
223: l_consolidated_note := l_consolidated_note || l_note_msg || fnd_global.local_chr(10);
216: -- CHECK IF START DATE WAS UPDATED
217: IF (p_plan_element_old.start_date <> p_plan_element_new.start_date) THEN
218: fnd_message.set_name ('CN', 'CNR12_NOTE_PE_STDATE_UPDATE');
219: fnd_message.set_token('PE_START_OLD', p_plan_element_old.start_date);
220: fnd_message.set_token('PE_START_NEW', p_plan_element_new.start_date);
221: l_plan_element_id := p_plan_element_new.quota_id;
222: l_note_msg := fnd_message.get;
223: l_consolidated_note := l_consolidated_note || l_note_msg || fnd_global.local_chr(10);
224: /* jtf_notes_pub.create_note
218: fnd_message.set_name ('CN', 'CNR12_NOTE_PE_STDATE_UPDATE');
219: fnd_message.set_token('PE_START_OLD', p_plan_element_old.start_date);
220: fnd_message.set_token('PE_START_NEW', p_plan_element_new.start_date);
221: l_plan_element_id := p_plan_element_new.quota_id;
222: l_note_msg := fnd_message.get;
223: l_consolidated_note := l_consolidated_note || l_note_msg || fnd_global.local_chr(10);
224: /* jtf_notes_pub.create_note
225: (p_api_version => 1.0,
226: x_return_status => x_return_status,
236: END IF;
237: -- CHECK IF END DATE WAS UPDATED
238: IF (NVL(p_plan_element_old.end_date, fnd_api.g_miss_date)
239: <> NVL(p_plan_element_new.end_date, fnd_api.g_miss_date)) THEN
240: fnd_message.set_name ('CN', 'CNR12_NOTE_PE_ENDATE_UPDATE');
241: IF (p_plan_element_old.end_date IS NULL) THEN
242: fnd_message.set_token('PE_END_OLD', 'NULL');
243: ELSE
244: fnd_message.set_token('PE_END_OLD', p_plan_element_old.end_date);
238: IF (NVL(p_plan_element_old.end_date, fnd_api.g_miss_date)
239: <> NVL(p_plan_element_new.end_date, fnd_api.g_miss_date)) THEN
240: fnd_message.set_name ('CN', 'CNR12_NOTE_PE_ENDATE_UPDATE');
241: IF (p_plan_element_old.end_date IS NULL) THEN
242: fnd_message.set_token('PE_END_OLD', 'NULL');
243: ELSE
244: fnd_message.set_token('PE_END_OLD', p_plan_element_old.end_date);
245: END IF;
246: IF (p_plan_element_new.end_date IS NULL) THEN
240: fnd_message.set_name ('CN', 'CNR12_NOTE_PE_ENDATE_UPDATE');
241: IF (p_plan_element_old.end_date IS NULL) THEN
242: fnd_message.set_token('PE_END_OLD', 'NULL');
243: ELSE
244: fnd_message.set_token('PE_END_OLD', p_plan_element_old.end_date);
245: END IF;
246: IF (p_plan_element_new.end_date IS NULL) THEN
247: fnd_message.set_token('PE_END_NEW', 'NULL');
248: ELSE
243: ELSE
244: fnd_message.set_token('PE_END_OLD', p_plan_element_old.end_date);
245: END IF;
246: IF (p_plan_element_new.end_date IS NULL) THEN
247: fnd_message.set_token('PE_END_NEW', 'NULL');
248: ELSE
249: fnd_message.set_token('PE_END_NEW', p_plan_element_new.end_date);
250: END IF;
251: l_plan_element_id := p_plan_element_new.quota_id;
245: END IF;
246: IF (p_plan_element_new.end_date IS NULL) THEN
247: fnd_message.set_token('PE_END_NEW', 'NULL');
248: ELSE
249: fnd_message.set_token('PE_END_NEW', p_plan_element_new.end_date);
250: END IF;
251: l_plan_element_id := p_plan_element_new.quota_id;
252: l_note_msg := fnd_message.get;
253: l_consolidated_note := l_consolidated_note || l_note_msg || fnd_global.local_chr(10);
248: ELSE
249: fnd_message.set_token('PE_END_NEW', p_plan_element_new.end_date);
250: END IF;
251: l_plan_element_id := p_plan_element_new.quota_id;
252: l_note_msg := fnd_message.get;
253: l_consolidated_note := l_consolidated_note || l_note_msg || fnd_global.local_chr(10);
254: /* jtf_notes_pub.create_note
255: (p_api_version => 1.0,
256: x_return_status => x_return_status,
265: );*/
266: END IF;
267: -- CHECK IF DESCRIPTION WAS UPDATED
268: IF (p_plan_element_old.description <> p_plan_element_new.description) THEN
269: fnd_message.set_name ('CN','CNR12_NOTE_PE_DESC_UPDATE');
270: l_plan_element_id := p_plan_element_new.quota_id;
271: l_note_msg := fnd_message.get;
272: l_consolidated_note := l_consolidated_note || l_note_msg || fnd_global.local_chr(10);
273: /* jtf_notes_pub.create_note
267: -- CHECK IF DESCRIPTION WAS UPDATED
268: IF (p_plan_element_old.description <> p_plan_element_new.description) THEN
269: fnd_message.set_name ('CN','CNR12_NOTE_PE_DESC_UPDATE');
270: l_plan_element_id := p_plan_element_new.quota_id;
271: l_note_msg := fnd_message.get;
272: l_consolidated_note := l_consolidated_note || l_note_msg || fnd_global.local_chr(10);
273: /* jtf_notes_pub.create_note
274: (p_api_version => 1.0,
275: x_return_status => x_return_status,
285: END IF;
286:
287: -- CHECK IF INTERVAL TYPE WAS UPDATED
288: IF (p_plan_element_old.interval_type_id <> p_plan_element_new.interval_type_id) THEN
289: fnd_message.set_name ('CN', 'CNR12_NOTE_PE_INTTYPE_UPDATE');
290: l_plan_element_id := p_plan_element_new.quota_id;
291: select NAME into l_temp_old from CN_INTERVAL_TYPES
292: where interval_type_id = p_plan_element_old.interval_type_id
293: and org_id = p_plan_element_old.org_id;
293: and org_id = p_plan_element_old.org_id;
294: select NAME into l_temp_new from CN_INTERVAL_TYPES
295: where interval_type_id = p_plan_element_new.interval_type_id
296: and org_id = p_plan_element_new.org_id;
297: fnd_message.set_token('PE_OLD_INTERVAL', l_temp_old);
298: fnd_message.set_token('PE_NEW_INTERVAL', l_temp_new);
299: l_note_msg := fnd_message.get;
300: l_consolidated_note := l_consolidated_note || l_note_msg || fnd_global.local_chr(10);
301: /* jtf_notes_pub.create_note
294: select NAME into l_temp_new from CN_INTERVAL_TYPES
295: where interval_type_id = p_plan_element_new.interval_type_id
296: and org_id = p_plan_element_new.org_id;
297: fnd_message.set_token('PE_OLD_INTERVAL', l_temp_old);
298: fnd_message.set_token('PE_NEW_INTERVAL', l_temp_new);
299: l_note_msg := fnd_message.get;
300: l_consolidated_note := l_consolidated_note || l_note_msg || fnd_global.local_chr(10);
301: /* jtf_notes_pub.create_note
302: (p_api_version => 1.0,
295: where interval_type_id = p_plan_element_new.interval_type_id
296: and org_id = p_plan_element_new.org_id;
297: fnd_message.set_token('PE_OLD_INTERVAL', l_temp_old);
298: fnd_message.set_token('PE_NEW_INTERVAL', l_temp_new);
299: l_note_msg := fnd_message.get;
300: l_consolidated_note := l_consolidated_note || l_note_msg || fnd_global.local_chr(10);
301: /* jtf_notes_pub.create_note
302: (p_api_version => 1.0,
303: x_return_status => x_return_status,
313: END IF;
314:
315: -- CHECK IF FORMULA TYPE WAS UPDATED
316: IF (p_plan_element_old.quota_type_code <> p_plan_element_new.quota_type_code) THEN
317: fnd_message.set_name ('CN', 'CNR12_NOTE_PE_FORTYPE_UPDATE');
318: l_plan_element_id := p_plan_element_new.quota_id;
319: l_temp_1 := cn_api.get_lkup_meaning(p_plan_element_old.quota_type_code, 'QUOTA_TYPE');
320: l_temp_2 := cn_api.get_lkup_meaning(p_plan_element_new.quota_type_code, 'QUOTA_TYPE');
321: fnd_message.set_token('PE_OLD_FOR', l_temp_1);
317: fnd_message.set_name ('CN', 'CNR12_NOTE_PE_FORTYPE_UPDATE');
318: l_plan_element_id := p_plan_element_new.quota_id;
319: l_temp_1 := cn_api.get_lkup_meaning(p_plan_element_old.quota_type_code, 'QUOTA_TYPE');
320: l_temp_2 := cn_api.get_lkup_meaning(p_plan_element_new.quota_type_code, 'QUOTA_TYPE');
321: fnd_message.set_token('PE_OLD_FOR', l_temp_1);
322: fnd_message.set_token('PE_NEW_FOR', l_temp_2);
323: l_note_msg := fnd_message.get;
324: l_consolidated_note := l_consolidated_note || l_note_msg || fnd_global.local_chr(10);
325: /* jtf_notes_pub.create_note
318: l_plan_element_id := p_plan_element_new.quota_id;
319: l_temp_1 := cn_api.get_lkup_meaning(p_plan_element_old.quota_type_code, 'QUOTA_TYPE');
320: l_temp_2 := cn_api.get_lkup_meaning(p_plan_element_new.quota_type_code, 'QUOTA_TYPE');
321: fnd_message.set_token('PE_OLD_FOR', l_temp_1);
322: fnd_message.set_token('PE_NEW_FOR', l_temp_2);
323: l_note_msg := fnd_message.get;
324: l_consolidated_note := l_consolidated_note || l_note_msg || fnd_global.local_chr(10);
325: /* jtf_notes_pub.create_note
326: (p_api_version => 1.0,
319: l_temp_1 := cn_api.get_lkup_meaning(p_plan_element_old.quota_type_code, 'QUOTA_TYPE');
320: l_temp_2 := cn_api.get_lkup_meaning(p_plan_element_new.quota_type_code, 'QUOTA_TYPE');
321: fnd_message.set_token('PE_OLD_FOR', l_temp_1);
322: fnd_message.set_token('PE_NEW_FOR', l_temp_2);
323: l_note_msg := fnd_message.get;
324: l_consolidated_note := l_consolidated_note || l_note_msg || fnd_global.local_chr(10);
325: /* jtf_notes_pub.create_note
326: (p_api_version => 1.0,
327: x_return_status => x_return_status,
339: -- CHECK IF FORMULA TYPE/NAME WAS UPDATED
340: IF (p_plan_element_old.quota_type_code <> p_plan_element_new.quota_type_code
341: OR p_plan_element_old.calc_formula_id <> p_plan_element_new.calc_formula_id
342: OR p_plan_element_old.package_name <> p_plan_element_new.package_name) THEN
343: fnd_message.set_name ('CN', 'CNR12_NOTE_PE_FOR_TYPE_UPDATE');
344: l_plan_element_id := p_plan_element_new.quota_id;
345: IF (p_plan_element_old.quota_type_code = 'FORMULA') THEN
346: IF (p_plan_element_old.calc_formula_id IS NULL) THEN
347: l_temp_old := '';
359: l_temp_new := p_plan_element_new.package_name;
360: END IF;
361: l_temp_1 := cn_api.get_lkup_meaning(p_plan_element_old.quota_type_code, 'QUOTA_TYPE');
362: l_temp_2 := cn_api.get_lkup_meaning(p_plan_element_new.quota_type_code, 'QUOTA_TYPE');
363: fnd_message.set_token('FORMULA_TYPE_OLD', l_temp_1);
364: fnd_message.set_token('FORMULA_NAME_OLD', l_temp_old);
365: fnd_message.set_token('FORMULA_TYPE_NEW', l_temp_2);
366: fnd_message.set_token('FORMULA_NAME_NEW', l_temp_new);
367: l_note_msg := fnd_message.get;
360: END IF;
361: l_temp_1 := cn_api.get_lkup_meaning(p_plan_element_old.quota_type_code, 'QUOTA_TYPE');
362: l_temp_2 := cn_api.get_lkup_meaning(p_plan_element_new.quota_type_code, 'QUOTA_TYPE');
363: fnd_message.set_token('FORMULA_TYPE_OLD', l_temp_1);
364: fnd_message.set_token('FORMULA_NAME_OLD', l_temp_old);
365: fnd_message.set_token('FORMULA_TYPE_NEW', l_temp_2);
366: fnd_message.set_token('FORMULA_NAME_NEW', l_temp_new);
367: l_note_msg := fnd_message.get;
368: l_consolidated_note := l_consolidated_note || l_note_msg || fnd_global.local_chr(10);
361: l_temp_1 := cn_api.get_lkup_meaning(p_plan_element_old.quota_type_code, 'QUOTA_TYPE');
362: l_temp_2 := cn_api.get_lkup_meaning(p_plan_element_new.quota_type_code, 'QUOTA_TYPE');
363: fnd_message.set_token('FORMULA_TYPE_OLD', l_temp_1);
364: fnd_message.set_token('FORMULA_NAME_OLD', l_temp_old);
365: fnd_message.set_token('FORMULA_TYPE_NEW', l_temp_2);
366: fnd_message.set_token('FORMULA_NAME_NEW', l_temp_new);
367: l_note_msg := fnd_message.get;
368: l_consolidated_note := l_consolidated_note || l_note_msg || fnd_global.local_chr(10);
369: /* jtf_notes_pub.create_note
362: l_temp_2 := cn_api.get_lkup_meaning(p_plan_element_new.quota_type_code, 'QUOTA_TYPE');
363: fnd_message.set_token('FORMULA_TYPE_OLD', l_temp_1);
364: fnd_message.set_token('FORMULA_NAME_OLD', l_temp_old);
365: fnd_message.set_token('FORMULA_TYPE_NEW', l_temp_2);
366: fnd_message.set_token('FORMULA_NAME_NEW', l_temp_new);
367: l_note_msg := fnd_message.get;
368: l_consolidated_note := l_consolidated_note || l_note_msg || fnd_global.local_chr(10);
369: /* jtf_notes_pub.create_note
370: (p_api_version => 1.0,
363: fnd_message.set_token('FORMULA_TYPE_OLD', l_temp_1);
364: fnd_message.set_token('FORMULA_NAME_OLD', l_temp_old);
365: fnd_message.set_token('FORMULA_TYPE_NEW', l_temp_2);
366: fnd_message.set_token('FORMULA_NAME_NEW', l_temp_new);
367: l_note_msg := fnd_message.get;
368: l_consolidated_note := l_consolidated_note || l_note_msg || fnd_global.local_chr(10);
369: /* jtf_notes_pub.create_note
370: (p_api_version => 1.0,
371: x_return_status => x_return_status,
381: END IF;
382:
383: -- CHECK IF PAYMENT GROUP WAS UPDATED
384: IF (p_plan_element_old.payment_group_code <> p_plan_element_new.payment_group_code) THEN
385: fnd_message.set_name ('CN', 'CNR12_NOTE_PE_PAYGRP_UPDATE');
386: fnd_message.set_token('PAYGRP_OLD', p_plan_element_old.payment_group_code);
387: fnd_message.set_token('PAYGRP_NEW', p_plan_element_new.payment_group_code);
388: l_plan_element_id := p_plan_element_new.quota_id;
389: l_note_msg := fnd_message.get;
382:
383: -- CHECK IF PAYMENT GROUP WAS UPDATED
384: IF (p_plan_element_old.payment_group_code <> p_plan_element_new.payment_group_code) THEN
385: fnd_message.set_name ('CN', 'CNR12_NOTE_PE_PAYGRP_UPDATE');
386: fnd_message.set_token('PAYGRP_OLD', p_plan_element_old.payment_group_code);
387: fnd_message.set_token('PAYGRP_NEW', p_plan_element_new.payment_group_code);
388: l_plan_element_id := p_plan_element_new.quota_id;
389: l_note_msg := fnd_message.get;
390: l_consolidated_note := l_consolidated_note || l_note_msg || fnd_global.local_chr(10);
383: -- CHECK IF PAYMENT GROUP WAS UPDATED
384: IF (p_plan_element_old.payment_group_code <> p_plan_element_new.payment_group_code) THEN
385: fnd_message.set_name ('CN', 'CNR12_NOTE_PE_PAYGRP_UPDATE');
386: fnd_message.set_token('PAYGRP_OLD', p_plan_element_old.payment_group_code);
387: fnd_message.set_token('PAYGRP_NEW', p_plan_element_new.payment_group_code);
388: l_plan_element_id := p_plan_element_new.quota_id;
389: l_note_msg := fnd_message.get;
390: l_consolidated_note := l_consolidated_note || l_note_msg || fnd_global.local_chr(10);
391: /* jtf_notes_pub.create_note
385: fnd_message.set_name ('CN', 'CNR12_NOTE_PE_PAYGRP_UPDATE');
386: fnd_message.set_token('PAYGRP_OLD', p_plan_element_old.payment_group_code);
387: fnd_message.set_token('PAYGRP_NEW', p_plan_element_new.payment_group_code);
388: l_plan_element_id := p_plan_element_new.quota_id;
389: l_note_msg := fnd_message.get;
390: l_consolidated_note := l_consolidated_note || l_note_msg || fnd_global.local_chr(10);
391: /* jtf_notes_pub.create_note
392: (p_api_version => 1.0,
393: x_return_status => x_return_status,
403: END IF;
404:
405: -- CHECK IF CREDIT TYPE WAS UPDATED
406: IF (p_plan_element_old.credit_type_id <> p_plan_element_new.credit_type_id) THEN
407: fnd_message.set_name ('CN', 'CNR12_NOTE_PE_CRTYPE_UPDATE');
408: select name into l_temp_old from cn_credit_types_vl
409: where credit_type_id = p_plan_element_old.credit_type_id
410: and org_id = p_plan_element_old.org_id;
411: select name into l_temp_new from cn_credit_types_vl
410: and org_id = p_plan_element_old.org_id;
411: select name into l_temp_new from cn_credit_types_vl
412: where credit_type_id = p_plan_element_new.credit_type_id
413: and org_id = p_plan_element_new.org_id;
414: fnd_message.set_token('PE_OLD_CREDIT', l_temp_old);
415: fnd_message.set_token('PE_NEW_CREDIT', l_temp_new);
416: l_plan_element_id := p_plan_element_new.quota_id;
417: l_note_msg := fnd_message.get;
418: l_consolidated_note := l_consolidated_note || l_note_msg || fnd_global.local_chr(10);
411: select name into l_temp_new from cn_credit_types_vl
412: where credit_type_id = p_plan_element_new.credit_type_id
413: and org_id = p_plan_element_new.org_id;
414: fnd_message.set_token('PE_OLD_CREDIT', l_temp_old);
415: fnd_message.set_token('PE_NEW_CREDIT', l_temp_new);
416: l_plan_element_id := p_plan_element_new.quota_id;
417: l_note_msg := fnd_message.get;
418: l_consolidated_note := l_consolidated_note || l_note_msg || fnd_global.local_chr(10);
419: /* jtf_notes_pub.create_note
413: and org_id = p_plan_element_new.org_id;
414: fnd_message.set_token('PE_OLD_CREDIT', l_temp_old);
415: fnd_message.set_token('PE_NEW_CREDIT', l_temp_new);
416: l_plan_element_id := p_plan_element_new.quota_id;
417: l_note_msg := fnd_message.get;
418: l_consolidated_note := l_consolidated_note || l_note_msg || fnd_global.local_chr(10);
419: /* jtf_notes_pub.create_note
420: (p_api_version => 1.0,
421: x_return_status => x_return_status,
431: END IF;
432:
433: -- CHECK IF PAID THRU PARTY WAS UPDATED
434: IF (p_plan_element_old.payee_assign_flag <> p_plan_element_new.payee_assign_flag) THEN
435: fnd_message.set_name ('CN', 'CNR12_NOTE_PE_THIRDPARY_UPDATE');
436: select meaning into l_temp_old from cn_lookups
437: where lookup_code = NVL(p_plan_element_old.payee_assign_flag, 'N')
438: and lookup_type = 'YES_NO';
439: select meaning into l_temp_new from cn_lookups
438: and lookup_type = 'YES_NO';
439: select meaning into l_temp_new from cn_lookups
440: where lookup_code = NVL(p_plan_element_new.payee_assign_flag, 'N')
441: and lookup_type = 'YES_NO';
442: fnd_message.set_token('PE_OLD_PAYEE', l_temp_old);
443: fnd_message.set_token('PE_NEW_PAYEE', l_temp_new);
444: l_plan_element_id := p_plan_element_new.quota_id;
445: l_note_msg := fnd_message.get;
446: l_consolidated_note := l_consolidated_note || l_note_msg || fnd_global.local_chr(10);
439: select meaning into l_temp_new from cn_lookups
440: where lookup_code = NVL(p_plan_element_new.payee_assign_flag, 'N')
441: and lookup_type = 'YES_NO';
442: fnd_message.set_token('PE_OLD_PAYEE', l_temp_old);
443: fnd_message.set_token('PE_NEW_PAYEE', l_temp_new);
444: l_plan_element_id := p_plan_element_new.quota_id;
445: l_note_msg := fnd_message.get;
446: l_consolidated_note := l_consolidated_note || l_note_msg || fnd_global.local_chr(10);
447: /* jtf_notes_pub.create_note
441: and lookup_type = 'YES_NO';
442: fnd_message.set_token('PE_OLD_PAYEE', l_temp_old);
443: fnd_message.set_token('PE_NEW_PAYEE', l_temp_new);
444: l_plan_element_id := p_plan_element_new.quota_id;
445: l_note_msg := fnd_message.get;
446: l_consolidated_note := l_consolidated_note || l_note_msg || fnd_global.local_chr(10);
447: /* jtf_notes_pub.create_note
448: (p_api_version => 1.0,
449: x_return_status => x_return_status,
459: END IF;
460:
461: -- CHECK IF LIABILITY A/C WAS UPDATED
462: IF (p_plan_element_old.liability_account_id <> p_plan_element_new.liability_account_id) THEN
463: fnd_message.set_name ('CN', 'CNR12_NOTE_PE_LIA_UPDATE');
464: SELECT
465: DECODE(LA.CODE_COMBINATION_ID,NULL,NULL, LA.SEGMENT1||'-'||LA.SEGMENT2||'-'||LA.SEGMENT3||'-'||LA.SEGMENT4 ||'-'||LA.SEGMENT5)
466: INTO l_temp_old FROM GL_CODE_COMBINATIONS LA
467: WHERE LA.CODE_COMBINATION_ID = p_plan_element_old.liability_account_id;
468: SELECT
469: DECODE(LA.CODE_COMBINATION_ID,NULL,NULL, LA.SEGMENT1||'-'||LA.SEGMENT2||'-'||LA.SEGMENT3||'-'||LA.SEGMENT4 ||'-'||LA.SEGMENT5)
470: INTO l_temp_new FROM GL_CODE_COMBINATIONS LA
471: WHERE LA.CODE_COMBINATION_ID = p_plan_element_new.liability_account_id;
472: fnd_message.set_token('PE_OLD_LIA', l_temp_old);
473: fnd_message.set_token('PE_NEW_LIA', l_temp_new);
474: l_plan_element_id := p_plan_element_new.quota_id;
475: l_note_msg := fnd_message.get;
476: l_consolidated_note := l_consolidated_note || l_note_msg || fnd_global.local_chr(10);
469: DECODE(LA.CODE_COMBINATION_ID,NULL,NULL, LA.SEGMENT1||'-'||LA.SEGMENT2||'-'||LA.SEGMENT3||'-'||LA.SEGMENT4 ||'-'||LA.SEGMENT5)
470: INTO l_temp_new FROM GL_CODE_COMBINATIONS LA
471: WHERE LA.CODE_COMBINATION_ID = p_plan_element_new.liability_account_id;
472: fnd_message.set_token('PE_OLD_LIA', l_temp_old);
473: fnd_message.set_token('PE_NEW_LIA', l_temp_new);
474: l_plan_element_id := p_plan_element_new.quota_id;
475: l_note_msg := fnd_message.get;
476: l_consolidated_note := l_consolidated_note || l_note_msg || fnd_global.local_chr(10);
477: /* jtf_notes_pub.create_note
471: WHERE LA.CODE_COMBINATION_ID = p_plan_element_new.liability_account_id;
472: fnd_message.set_token('PE_OLD_LIA', l_temp_old);
473: fnd_message.set_token('PE_NEW_LIA', l_temp_new);
474: l_plan_element_id := p_plan_element_new.quota_id;
475: l_note_msg := fnd_message.get;
476: l_consolidated_note := l_consolidated_note || l_note_msg || fnd_global.local_chr(10);
477: /* jtf_notes_pub.create_note
478: (p_api_version => 1.0,
479: x_return_status => x_return_status,
489: END IF;
490:
491: -- CHECK IF EXPENSE A/C WAS UPDATED
492: IF (p_plan_element_old.expense_account_id <> p_plan_element_new.expense_account_id) THEN
493: fnd_message.set_name ('CN', 'CNR12_NOTE_PE_EXP_UPDATE');
494: SELECT
495: DECODE(LA.CODE_COMBINATION_ID,NULL,NULL, LA.SEGMENT1||'-'||LA.SEGMENT2||'-'||LA.SEGMENT3||'-'||LA.SEGMENT4 ||'-'||LA.SEGMENT5)
496: INTO l_temp_old FROM GL_CODE_COMBINATIONS LA
497: WHERE LA.CODE_COMBINATION_ID = p_plan_element_old.expense_account_id;
498: SELECT
499: DECODE(LA.CODE_COMBINATION_ID,NULL,NULL, LA.SEGMENT1||'-'||LA.SEGMENT2||'-'||LA.SEGMENT3||'-'||LA.SEGMENT4 ||'-'||LA.SEGMENT5)
500: INTO l_temp_new FROM GL_CODE_COMBINATIONS LA
501: WHERE LA.CODE_COMBINATION_ID = p_plan_element_new.expense_account_id;
502: fnd_message.set_token('PE_EXP_OLD', l_temp_old);
503: fnd_message.set_token('PE_EXP_NEW', l_temp_new);
504: l_plan_element_id := p_plan_element_new.quota_id;
505: l_note_msg := fnd_message.get;
506: l_consolidated_note := l_consolidated_note || l_note_msg || fnd_global.local_chr(10);
499: DECODE(LA.CODE_COMBINATION_ID,NULL,NULL, LA.SEGMENT1||'-'||LA.SEGMENT2||'-'||LA.SEGMENT3||'-'||LA.SEGMENT4 ||'-'||LA.SEGMENT5)
500: INTO l_temp_new FROM GL_CODE_COMBINATIONS LA
501: WHERE LA.CODE_COMBINATION_ID = p_plan_element_new.expense_account_id;
502: fnd_message.set_token('PE_EXP_OLD', l_temp_old);
503: fnd_message.set_token('PE_EXP_NEW', l_temp_new);
504: l_plan_element_id := p_plan_element_new.quota_id;
505: l_note_msg := fnd_message.get;
506: l_consolidated_note := l_consolidated_note || l_note_msg || fnd_global.local_chr(10);
507: /* jtf_notes_pub.create_note
501: WHERE LA.CODE_COMBINATION_ID = p_plan_element_new.expense_account_id;
502: fnd_message.set_token('PE_EXP_OLD', l_temp_old);
503: fnd_message.set_token('PE_EXP_NEW', l_temp_new);
504: l_plan_element_id := p_plan_element_new.quota_id;
505: l_note_msg := fnd_message.get;
506: l_consolidated_note := l_consolidated_note || l_note_msg || fnd_global.local_chr(10);
507: /* jtf_notes_pub.create_note
508: (p_api_version => 1.0,
509: x_return_status => x_return_status,
519: END IF;
520:
521: -- CHECK IF CREDIT ROLLUP WAS UPDATED
522: IF (p_plan_element_old.indirect_credit_code <> p_plan_element_new.indirect_credit_code) THEN
523: fnd_message.set_name ('CN', 'CNR12_NOTE_PE_CRROLL_UPDATE');
524: l_temp_old := cn_api.get_lkup_meaning(p_plan_element_old.indirect_credit_code, 'INDIRECT_CREDIT_TYPE');
525: l_temp_new := cn_api.get_lkup_meaning(p_plan_element_new.indirect_credit_code, 'INDIRECT_CREDIT_TYPE');
526: fnd_message.set_token('PE_CR_ROLL_OLD', l_temp_old);
527: fnd_message.set_token('PE_CR_ROLL_NEW', l_temp_new);
522: IF (p_plan_element_old.indirect_credit_code <> p_plan_element_new.indirect_credit_code) THEN
523: fnd_message.set_name ('CN', 'CNR12_NOTE_PE_CRROLL_UPDATE');
524: l_temp_old := cn_api.get_lkup_meaning(p_plan_element_old.indirect_credit_code, 'INDIRECT_CREDIT_TYPE');
525: l_temp_new := cn_api.get_lkup_meaning(p_plan_element_new.indirect_credit_code, 'INDIRECT_CREDIT_TYPE');
526: fnd_message.set_token('PE_CR_ROLL_OLD', l_temp_old);
527: fnd_message.set_token('PE_CR_ROLL_NEW', l_temp_new);
528: l_plan_element_id := p_plan_element_new.quota_id;
529: l_note_msg := fnd_message.get;
530: l_consolidated_note := l_consolidated_note || l_note_msg || fnd_global.local_chr(10);
523: fnd_message.set_name ('CN', 'CNR12_NOTE_PE_CRROLL_UPDATE');
524: l_temp_old := cn_api.get_lkup_meaning(p_plan_element_old.indirect_credit_code, 'INDIRECT_CREDIT_TYPE');
525: l_temp_new := cn_api.get_lkup_meaning(p_plan_element_new.indirect_credit_code, 'INDIRECT_CREDIT_TYPE');
526: fnd_message.set_token('PE_CR_ROLL_OLD', l_temp_old);
527: fnd_message.set_token('PE_CR_ROLL_NEW', l_temp_new);
528: l_plan_element_id := p_plan_element_new.quota_id;
529: l_note_msg := fnd_message.get;
530: l_consolidated_note := l_consolidated_note || l_note_msg || fnd_global.local_chr(10);
531: /* jtf_notes_pub.create_note
525: l_temp_new := cn_api.get_lkup_meaning(p_plan_element_new.indirect_credit_code, 'INDIRECT_CREDIT_TYPE');
526: fnd_message.set_token('PE_CR_ROLL_OLD', l_temp_old);
527: fnd_message.set_token('PE_CR_ROLL_NEW', l_temp_new);
528: l_plan_element_id := p_plan_element_new.quota_id;
529: l_note_msg := fnd_message.get;
530: l_consolidated_note := l_consolidated_note || l_note_msg || fnd_global.local_chr(10);
531: /* jtf_notes_pub.create_note
532: (p_api_version => 1.0,
533: x_return_status => x_return_status,
542: );*/
543: END IF;
544: -- CHECK IF VARIABLE 1- TARGET IS CHANGED
545: IF (p_plan_element_old.target <> p_plan_element_new.target) THEN
546: fnd_message.set_name ('CN', 'CNR12_NOTE_PE_VAR1_UPD');
547: fnd_message.set_token('OLD_VAL', p_plan_element_old.target);
548: fnd_message.set_token('NEW_VAL', p_plan_element_new.target);
549: l_plan_element_id := p_plan_element_new.quota_id;
550: l_note_msg := fnd_message.get;
543: END IF;
544: -- CHECK IF VARIABLE 1- TARGET IS CHANGED
545: IF (p_plan_element_old.target <> p_plan_element_new.target) THEN
546: fnd_message.set_name ('CN', 'CNR12_NOTE_PE_VAR1_UPD');
547: fnd_message.set_token('OLD_VAL', p_plan_element_old.target);
548: fnd_message.set_token('NEW_VAL', p_plan_element_new.target);
549: l_plan_element_id := p_plan_element_new.quota_id;
550: l_note_msg := fnd_message.get;
551: l_consolidated_note := l_consolidated_note || l_note_msg || fnd_global.local_chr(10);
544: -- CHECK IF VARIABLE 1- TARGET IS CHANGED
545: IF (p_plan_element_old.target <> p_plan_element_new.target) THEN
546: fnd_message.set_name ('CN', 'CNR12_NOTE_PE_VAR1_UPD');
547: fnd_message.set_token('OLD_VAL', p_plan_element_old.target);
548: fnd_message.set_token('NEW_VAL', p_plan_element_new.target);
549: l_plan_element_id := p_plan_element_new.quota_id;
550: l_note_msg := fnd_message.get;
551: l_consolidated_note := l_consolidated_note || l_note_msg || fnd_global.local_chr(10);
552: /* jtf_notes_pub.create_note
546: fnd_message.set_name ('CN', 'CNR12_NOTE_PE_VAR1_UPD');
547: fnd_message.set_token('OLD_VAL', p_plan_element_old.target);
548: fnd_message.set_token('NEW_VAL', p_plan_element_new.target);
549: l_plan_element_id := p_plan_element_new.quota_id;
550: l_note_msg := fnd_message.get;
551: l_consolidated_note := l_consolidated_note || l_note_msg || fnd_global.local_chr(10);
552: /* jtf_notes_pub.create_note
553: (p_api_version => 1.0,
554: x_return_status => x_return_status,
563: );*/
564: END IF;
565: -- CHECK IF VARIABLE 2- PAYMENT AMOUNT IS CHANGED
566: IF (p_plan_element_old.payment_amount <> p_plan_element_new.payment_amount) THEN
567: fnd_message.set_name ('CN', 'CNR12_NOTE_PE_VAR2_UPD');
568: fnd_message.set_token('OLD_VAL', p_plan_element_old.payment_amount);
569: fnd_message.set_token('NEW_VAL', p_plan_element_new.payment_amount);
570: l_plan_element_id := p_plan_element_new.quota_id;
571: l_note_msg := fnd_message.get;
564: END IF;
565: -- CHECK IF VARIABLE 2- PAYMENT AMOUNT IS CHANGED
566: IF (p_plan_element_old.payment_amount <> p_plan_element_new.payment_amount) THEN
567: fnd_message.set_name ('CN', 'CNR12_NOTE_PE_VAR2_UPD');
568: fnd_message.set_token('OLD_VAL', p_plan_element_old.payment_amount);
569: fnd_message.set_token('NEW_VAL', p_plan_element_new.payment_amount);
570: l_plan_element_id := p_plan_element_new.quota_id;
571: l_note_msg := fnd_message.get;
572: l_consolidated_note := l_consolidated_note || l_note_msg || fnd_global.local_chr(10);
565: -- CHECK IF VARIABLE 2- PAYMENT AMOUNT IS CHANGED
566: IF (p_plan_element_old.payment_amount <> p_plan_element_new.payment_amount) THEN
567: fnd_message.set_name ('CN', 'CNR12_NOTE_PE_VAR2_UPD');
568: fnd_message.set_token('OLD_VAL', p_plan_element_old.payment_amount);
569: fnd_message.set_token('NEW_VAL', p_plan_element_new.payment_amount);
570: l_plan_element_id := p_plan_element_new.quota_id;
571: l_note_msg := fnd_message.get;
572: l_consolidated_note := l_consolidated_note || l_note_msg || fnd_global.local_chr(10);
573: /* jtf_notes_pub.create_note
567: fnd_message.set_name ('CN', 'CNR12_NOTE_PE_VAR2_UPD');
568: fnd_message.set_token('OLD_VAL', p_plan_element_old.payment_amount);
569: fnd_message.set_token('NEW_VAL', p_plan_element_new.payment_amount);
570: l_plan_element_id := p_plan_element_new.quota_id;
571: l_note_msg := fnd_message.get;
572: l_consolidated_note := l_consolidated_note || l_note_msg || fnd_global.local_chr(10);
573: /* jtf_notes_pub.create_note
574: (p_api_version => 1.0,
575: x_return_status => x_return_status,
584: );*/
585: END IF;
586: -- CHECK IF VARIABLE 3- PERFORMANCE GOAL IS CHANGED
587: IF (p_plan_element_old.performance_goal <> p_plan_element_new.performance_goal) THEN
588: fnd_message.set_name ('CN', 'CNR12_NOTE_PE_VAR3_UPD');
589: fnd_message.set_token('OLD_VAL', p_plan_element_old.performance_goal);
590: fnd_message.set_token('NEW_VAL', p_plan_element_new.performance_goal);
591: l_plan_element_id := p_plan_element_new.quota_id;
592: l_note_msg := fnd_message.get;
585: END IF;
586: -- CHECK IF VARIABLE 3- PERFORMANCE GOAL IS CHANGED
587: IF (p_plan_element_old.performance_goal <> p_plan_element_new.performance_goal) THEN
588: fnd_message.set_name ('CN', 'CNR12_NOTE_PE_VAR3_UPD');
589: fnd_message.set_token('OLD_VAL', p_plan_element_old.performance_goal);
590: fnd_message.set_token('NEW_VAL', p_plan_element_new.performance_goal);
591: l_plan_element_id := p_plan_element_new.quota_id;
592: l_note_msg := fnd_message.get;
593: l_consolidated_note := l_consolidated_note || l_note_msg || fnd_global.local_chr(10);
586: -- CHECK IF VARIABLE 3- PERFORMANCE GOAL IS CHANGED
587: IF (p_plan_element_old.performance_goal <> p_plan_element_new.performance_goal) THEN
588: fnd_message.set_name ('CN', 'CNR12_NOTE_PE_VAR3_UPD');
589: fnd_message.set_token('OLD_VAL', p_plan_element_old.performance_goal);
590: fnd_message.set_token('NEW_VAL', p_plan_element_new.performance_goal);
591: l_plan_element_id := p_plan_element_new.quota_id;
592: l_note_msg := fnd_message.get;
593: l_consolidated_note := l_consolidated_note || l_note_msg || fnd_global.local_chr(10);
594: /* jtf_notes_pub.create_note
588: fnd_message.set_name ('CN', 'CNR12_NOTE_PE_VAR3_UPD');
589: fnd_message.set_token('OLD_VAL', p_plan_element_old.performance_goal);
590: fnd_message.set_token('NEW_VAL', p_plan_element_new.performance_goal);
591: l_plan_element_id := p_plan_element_new.quota_id;
592: l_note_msg := fnd_message.get;
593: l_consolidated_note := l_consolidated_note || l_note_msg || fnd_global.local_chr(10);
594: /* jtf_notes_pub.create_note
595: (p_api_version => 1.0,
596: x_return_status => x_return_status,
770: -- if table count is > 0 but the quota type code is NONE
771: -- then raise an error
772: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
773: THEN
774: fnd_message.set_name ('CN', 'CN_QUOTA_CANNOT_HAVE_RATES');
775: fnd_message.set_token ('PLAN_NAME', p_quota_name);
776: fnd_msg_pub.ADD;
777: END IF;
778:
771: -- then raise an error
772: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
773: THEN
774: fnd_message.set_name ('CN', 'CN_QUOTA_CANNOT_HAVE_RATES');
775: fnd_message.set_token ('PLAN_NAME', p_quota_name);
776: fnd_msg_pub.ADD;
777: END IF;
778:
779: x_loading_status := 'QUOTA_CANNOT_HAVE_RATES';
895: IF p_plan_element.quota_type_code NOT IN ('EXTERNAL', 'FORMULA')
896: THEN
897: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
898: THEN
899: fnd_message.set_name ('CN', 'CN_INVALID_DATA');
900: fnd_message.set_token ('OBJ_NAME', cn_chk_plan_element_pkg.g_element_type);
901: fnd_msg_pub.ADD;
902: END IF;
903:
896: THEN
897: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
898: THEN
899: fnd_message.set_name ('CN', 'CN_INVALID_DATA');
900: fnd_message.set_token ('OBJ_NAME', cn_chk_plan_element_pkg.g_element_type);
901: fnd_msg_pub.ADD;
902: END IF;
903:
904: RAISE fnd_api.g_exc_error;
915: IF (l_tmp_exist = 0)
916: THEN
917: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
918: THEN
919: fnd_message.set_name ('CN', 'CN_INVALID_DATA');
920: fnd_message.set_token ('OBJ_NAME', cn_chk_plan_element_pkg.g_incentive_type_code);
921: fnd_msg_pub.ADD;
922: END IF;
923:
916: THEN
917: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
918: THEN
919: fnd_message.set_name ('CN', 'CN_INVALID_DATA');
920: fnd_message.set_token ('OBJ_NAME', cn_chk_plan_element_pkg.g_incentive_type_code);
921: fnd_msg_pub.ADD;
922: END IF;
923:
924: RAISE fnd_api.g_exc_error;
934: IF (l_tmp_exist = 0)
935: THEN
936: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
937: THEN
938: fnd_message.set_name ('CN', 'CN_INVALID_DATA');
939: fnd_message.set_token ('OBJ_NAME', cn_api.get_lkup_meaning ('PAYMENT_GROUP', 'PE_OBJECT_TYPE'));
940: fnd_msg_pub.ADD;
941: END IF;
942:
935: THEN
936: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
937: THEN
938: fnd_message.set_name ('CN', 'CN_INVALID_DATA');
939: fnd_message.set_token ('OBJ_NAME', cn_api.get_lkup_meaning ('PAYMENT_GROUP', 'PE_OBJECT_TYPE'));
940: fnd_msg_pub.ADD;
941: END IF;
942:
943: RAISE fnd_api.g_exc_error;
952: WHEN NO_DATA_FOUND
953: THEN
954: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
955: THEN
956: fnd_message.set_name ('CN', 'CN_INVALID_DATA');
957: fnd_message.set_token ('OBJ_NAME', cn_api.get_lkup_meaning ('QUOTA_GROUP', 'PE_OBJECT_TYPE'));
958: fnd_msg_pub.ADD;
959: END IF;
960:
953: THEN
954: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
955: THEN
956: fnd_message.set_name ('CN', 'CN_INVALID_DATA');
957: fnd_message.set_token ('OBJ_NAME', cn_api.get_lkup_meaning ('QUOTA_GROUP', 'PE_OBJECT_TYPE'));
958: fnd_msg_pub.ADD;
959: END IF;
960:
961: RAISE fnd_api.g_exc_error;
973: WHEN NO_DATA_FOUND
974: THEN
975: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
976: THEN
977: fnd_message.set_name ('CN', 'CN_INVALID_DATA');
978: fnd_message.set_token ('OBJ_NAME', cn_api.get_lkup_meaning ('STATUS', 'PE_OBJECT_TYPE'));
979: fnd_msg_pub.ADD;
980: END IF;
981:
974: THEN
975: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
976: THEN
977: fnd_message.set_name ('CN', 'CN_INVALID_DATA');
978: fnd_message.set_token ('OBJ_NAME', cn_api.get_lkup_meaning ('STATUS', 'PE_OBJECT_TYPE'));
979: fnd_msg_pub.ADD;
980: END IF;
981:
982: RAISE fnd_api.g_exc_error;
996: IF (l_tmp_exist = 0)
997: THEN
998: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
999: THEN
1000: fnd_message.set_name ('CN', 'CN_INVALID_DATA');
1001: fnd_message.set_token ('OBJ_NAME', cn_api.get_lkup_meaning ('INDIRECT_CREDIT_TYPE', 'PE_OBJECT_TYPE'));
1002: fnd_msg_pub.ADD;
1003: END IF;
1004:
997: THEN
998: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
999: THEN
1000: fnd_message.set_name ('CN', 'CN_INVALID_DATA');
1001: fnd_message.set_token ('OBJ_NAME', cn_api.get_lkup_meaning ('INDIRECT_CREDIT_TYPE', 'PE_OBJECT_TYPE'));
1002: fnd_msg_pub.ADD;
1003: END IF;
1004:
1005: RAISE fnd_api.g_exc_error;
1044: IF (l_tmp_exist = 0)
1045: THEN
1046: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
1047: THEN
1048: fnd_message.set_name ('CN', 'CN_INVALID_DATA');
1049: fnd_message.set_token ('OBJ_NAME', cn_api.get_lkup_meaning ('CREDIT_TYPE', 'PE_OBJECT_TYPE'));
1050: fnd_msg_pub.ADD;
1051: END IF;
1052:
1045: THEN
1046: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
1047: THEN
1048: fnd_message.set_name ('CN', 'CN_INVALID_DATA');
1049: fnd_message.set_token ('OBJ_NAME', cn_api.get_lkup_meaning ('CREDIT_TYPE', 'PE_OBJECT_TYPE'));
1050: fnd_msg_pub.ADD;
1051: END IF;
1052:
1053: RAISE fnd_api.g_exc_error;
1065: IF (l_tmp_exist = 0)
1066: THEN
1067: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
1068: THEN
1069: fnd_message.set_name ('CN', 'CN_INVALID_DATA');
1070: fnd_message.set_token ('OBJ_NAME', cn_api.get_lkup_meaning ('PERIOD_TYPE', 'PE_OBJECT_TYPE'));
1071: fnd_msg_pub.ADD;
1072: END IF;
1073:
1066: THEN
1067: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
1068: THEN
1069: fnd_message.set_name ('CN', 'CN_INVALID_DATA');
1070: fnd_message.set_token ('OBJ_NAME', cn_api.get_lkup_meaning ('PERIOD_TYPE', 'PE_OBJECT_TYPE'));
1071: fnd_msg_pub.ADD;
1072: END IF;
1073:
1074: RAISE fnd_api.g_exc_error;
1084: IF (p_plan_element.credit_type_id IS NULL)
1085: THEN
1086: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
1087: THEN
1088: fnd_message.set_name ('CN', 'CN_INVALID_DATA');
1089: fnd_message.set_token ('OBJ_NAME', cn_api.get_lkup_meaning ('CREDIT_TYPE', 'PE_OBJECT_TYPE'));
1090: fnd_msg_pub.ADD;
1091: END IF;
1092:
1085: THEN
1086: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
1087: THEN
1088: fnd_message.set_name ('CN', 'CN_INVALID_DATA');
1089: fnd_message.set_token ('OBJ_NAME', cn_api.get_lkup_meaning ('CREDIT_TYPE', 'PE_OBJECT_TYPE'));
1090: fnd_msg_pub.ADD;
1091: END IF;
1092:
1093: RAISE fnd_api.g_exc_error;
1097: IF (p_plan_element.interval_type_id IS NULL)
1098: THEN
1099: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
1100: THEN
1101: fnd_message.set_name ('CN', 'CN_INVALID_DATA');
1102: fnd_message.set_token ('OBJ_NAME', cn_api.get_lkup_meaning ('PERIOD_TYPE', 'PE_OBJECT_TYPE'));
1103: fnd_msg_pub.ADD;
1104: END IF;
1105:
1098: THEN
1099: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
1100: THEN
1101: fnd_message.set_name ('CN', 'CN_INVALID_DATA');
1102: fnd_message.set_token ('OBJ_NAME', cn_api.get_lkup_meaning ('PERIOD_TYPE', 'PE_OBJECT_TYPE'));
1103: fnd_msg_pub.ADD;
1104: END IF;
1105:
1106: RAISE fnd_api.g_exc_error;
1109: IF (p_plan_element.calc_formula_id IS NULL AND p_plan_element.quota_type_code = 'FORMULA')
1110: THEN
1111: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
1112: THEN
1113: fnd_message.set_name ('CN', 'CN_INVALID_DATA');
1114: fnd_message.set_token ('OBJ_NAME', cn_api.get_lkup_meaning ('FORMULA', 'QUOTA_TYPE'));
1115: fnd_msg_pub.ADD;
1116: END IF;
1117:
1110: THEN
1111: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
1112: THEN
1113: fnd_message.set_name ('CN', 'CN_INVALID_DATA');
1114: fnd_message.set_token ('OBJ_NAME', cn_api.get_lkup_meaning ('FORMULA', 'QUOTA_TYPE'));
1115: fnd_msg_pub.ADD;
1116: END IF;
1117:
1118: RAISE fnd_api.g_exc_error;
1208: THEN
1209: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
1210: THEN
1211: -- Need to define message 'CN_E_CANNOT_REF_ITSEF' in SEED115
1212: fnd_message.set_name ('CN', 'CN_INV_ACC_NO');
1213: fnd_msg_pub.ADD;
1214: END IF;
1215:
1216: RAISE fnd_api.g_exc_error;
1220: THEN
1221: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
1222: THEN
1223: -- Need to define message 'CN_E_CANNOT_REF_ITSEF' in SEED115
1224: fnd_message.set_name ('CN', 'CN_INV_ACC_NO');
1225: fnd_msg_pub.ADD;
1226: END IF;
1227:
1228: RAISE fnd_api.g_exc_error;
1300: WHEN NO_DATA_FOUND
1301: THEN
1302: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
1303: THEN
1304: fnd_message.set_name ('CN', 'CN_IMP_INVLD_LIABLTY_CODE');
1305: fnd_msg_pub.ADD;
1306: END IF;
1307:
1308: RAISE fnd_api.g_exc_error;
1328: WHEN NO_DATA_FOUND
1329: THEN
1330: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
1331: THEN
1332: fnd_message.set_name ('CN', 'CN_IMP_INVLD_EXPENS_CODE');
1333: fnd_msg_pub.ADD;
1334: END IF;
1335:
1336: RAISE fnd_api.g_exc_error;
2185: IF l_temp_count = 0
2186: THEN
2187: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
2188: THEN
2189: fnd_message.set_name ('CN', 'CN_INVALID_DEL_REC');
2190: fnd_msg_pub.ADD;
2191: END IF;
2192:
2193: RAISE fnd_api.g_exc_error;
2205: WHEN NO_DATA_FOUND
2206: THEN
2207: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
2208: THEN
2209: fnd_message.set_name ('CN', 'PLN_QUOTA_DELETE_NA');
2210: fnd_msg_pub.ADD;
2211: END IF;
2212: RAISE fnd_api.g_exc_error;
2213: END;
2225: IF p_old_plan_element.object_version_number <> p_plan_element.object_version_number
2226: THEN
2227: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
2228: THEN
2229: fnd_message.set_name ('CN', 'CN_RECORD_CHANGED');
2230: fnd_msg_pub.ADD;
2231: END IF;
2232:
2233: RAISE fnd_api.g_exc_error;
2242: IF l_temp_count <> 0
2243: THEN
2244: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
2245: THEN
2246: fnd_message.set_name ('CN', 'CN_INPUT_MUST_UNIQUE');
2247: fnd_message.set_token ('INPUT_NAME', cn_api.get_lkup_meaning ('PE_NAME', 'INPUT_TOKEN'));
2248: fnd_msg_pub.ADD;
2249: END IF;
2250:
2243: THEN
2244: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
2245: THEN
2246: fnd_message.set_name ('CN', 'CN_INPUT_MUST_UNIQUE');
2247: fnd_message.set_token ('INPUT_NAME', cn_api.get_lkup_meaning ('PE_NAME', 'INPUT_TOKEN'));
2248: fnd_msg_pub.ADD;
2249: END IF;
2250:
2251: RAISE fnd_api.g_exc_error;
2264: IF l_uplift_dt_range > 0
2265: THEN
2266: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
2267: THEN
2268: fnd_message.set_name ('CN', 'CN_UPLIFT_DT_NOT_WIN_QUOTA');
2269: fnd_msg_pub.ADD;
2270: END IF;
2271: RAISE fnd_api.g_exc_error;
2272: END IF;
2288: IF l_temp_count <> 0
2289: THEN
2290: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
2291: THEN
2292: fnd_message.set_name ('CN', 'CN_INPUT_MUST_UNIQUE');
2293: fnd_message.set_token ('INPUT_NAME', cn_api.get_lkup_meaning ('PE_NAME', 'INPUT_TOKEN'));
2294: fnd_msg_pub.ADD;
2295: END IF;
2296:
2289: THEN
2290: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
2291: THEN
2292: fnd_message.set_name ('CN', 'CN_INPUT_MUST_UNIQUE');
2293: fnd_message.set_token ('INPUT_NAME', cn_api.get_lkup_meaning ('PE_NAME', 'INPUT_TOKEN'));
2294: fnd_msg_pub.ADD;
2295: END IF;
2296:
2297: RAISE fnd_api.g_exc_error;
2306: IF (p_plan_element.NAME IS NULL) OR (p_plan_element.NAME = fnd_api.g_miss_char)
2307: THEN
2308: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
2309: THEN
2310: fnd_message.set_name ('CN', 'CN_INPUT_CANT_NULL');
2311: fnd_message.set_token ('INPUT_NAME', cn_api.get_lkup_meaning ('PE_NAME', 'INPUT_TOKEN'));
2312: fnd_msg_pub.ADD;
2313: END IF;
2314:
2307: THEN
2308: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
2309: THEN
2310: fnd_message.set_name ('CN', 'CN_INPUT_CANT_NULL');
2311: fnd_message.set_token ('INPUT_NAME', cn_api.get_lkup_meaning ('PE_NAME', 'INPUT_TOKEN'));
2312: fnd_msg_pub.ADD;
2313: END IF;
2314:
2315: RAISE fnd_api.g_exc_error;
2319: IF (p_plan_element.start_date IS NULL) OR (p_plan_element.start_date = fnd_api.g_miss_date)
2320: THEN
2321: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
2322: THEN
2323: fnd_message.set_name ('CN', 'CN_INPUT_CANT_NULL');
2324: fnd_message.set_token ('INPUT_NAME', cn_api.get_lkup_meaning ('SD', 'INPUT_TOKEN'));
2325: fnd_msg_pub.ADD;
2326: END IF;
2327:
2320: THEN
2321: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
2322: THEN
2323: fnd_message.set_name ('CN', 'CN_INPUT_CANT_NULL');
2324: fnd_message.set_token ('INPUT_NAME', cn_api.get_lkup_meaning ('SD', 'INPUT_TOKEN'));
2325: fnd_msg_pub.ADD;
2326: END IF;
2327:
2328: RAISE fnd_api.g_exc_error;
2332: IF (p_plan_element.end_date IS NOT NULL) AND (p_plan_element.start_date > p_plan_element.end_date)
2333: THEN
2334: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
2335: THEN
2336: fnd_message.set_name ('CN', 'CN_DATE_RANGE_ERROR');
2337: fnd_msg_pub.ADD;
2338: END IF;
2339:
2340: RAISE fnd_api.g_exc_error;
2352: IF (p_plan_element.target IS NULL)
2353: THEN
2354: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
2355: THEN
2356: fnd_message.set_name ('CN', 'CN_INPUT_CANT_NULL');
2357: fnd_message.set_token ('INPUT_NAME', cn_api.get_lkup_meaning ('VARIABLE(S)', 'PE_OBJECT_TYPE'));
2358: fnd_msg_pub.ADD;
2359: END IF;
2360:
2353: THEN
2354: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
2355: THEN
2356: fnd_message.set_name ('CN', 'CN_INPUT_CANT_NULL');
2357: fnd_message.set_token ('INPUT_NAME', cn_api.get_lkup_meaning ('VARIABLE(S)', 'PE_OBJECT_TYPE'));
2358: fnd_msg_pub.ADD;
2359: END IF;
2360:
2361: RAISE fnd_api.g_exc_error;
2364: IF (p_plan_element.payment_amount IS NULL)
2365: THEN
2366: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
2367: THEN
2368: fnd_message.set_name ('CN', 'CN_INPUT_CANT_NULL');
2369: fnd_message.set_token ('INPUT_NAME', cn_api.get_lkup_meaning ('VARIABLE(S)', 'PE_OBJECT_TYPE'));
2370: fnd_msg_pub.ADD;
2371: END IF;
2372:
2365: THEN
2366: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
2367: THEN
2368: fnd_message.set_name ('CN', 'CN_INPUT_CANT_NULL');
2369: fnd_message.set_token ('INPUT_NAME', cn_api.get_lkup_meaning ('VARIABLE(S)', 'PE_OBJECT_TYPE'));
2370: fnd_msg_pub.ADD;
2371: END IF;
2372:
2373: RAISE fnd_api.g_exc_error;
2376: IF (p_plan_element.performance_goal IS NULL)
2377: THEN
2378: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
2379: THEN
2380: fnd_message.set_name ('CN', 'CN_INPUT_CANT_NULL');
2381: fnd_message.set_token ('INPUT_NAME', cn_api.get_lkup_meaning ('VARIABLE(S)', 'PE_OBJECT_TYPE'));
2382: fnd_msg_pub.ADD;
2383: END IF;
2384:
2377: THEN
2378: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
2379: THEN
2380: fnd_message.set_name ('CN', 'CN_INPUT_CANT_NULL');
2381: fnd_message.set_token ('INPUT_NAME', cn_api.get_lkup_meaning ('VARIABLE(S)', 'PE_OBJECT_TYPE'));
2382: fnd_msg_pub.ADD;
2383: END IF;
2384:
2385: RAISE fnd_api.g_exc_error;
2388: IF (p_plan_element.payee_assign_flag NOT IN ('Y', 'N'))
2389: THEN
2390: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
2391: THEN
2392: fnd_message.set_name ('CN', 'CN_INVALID_DATA');
2393: fnd_message.set_token ('OBJ_NAME', cn_api.get_lkup_meaning ('PAYEE_ASSIGN', 'PE_OBJECT_TYPE'));
2394: fnd_msg_pub.ADD;
2395: END IF;
2396:
2389: THEN
2390: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
2391: THEN
2392: fnd_message.set_name ('CN', 'CN_INVALID_DATA');
2393: fnd_message.set_token ('OBJ_NAME', cn_api.get_lkup_meaning ('PAYEE_ASSIGN', 'PE_OBJECT_TYPE'));
2394: fnd_msg_pub.ADD;
2395: END IF;
2396:
2397: RAISE fnd_api.g_exc_error;
2400: IF p_plan_element.addup_from_rev_class_flag NOT IN ('Y', 'N')
2401: THEN
2402: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
2403: THEN
2404: fnd_message.set_name ('CN', 'CN_INVALID_DATA');
2405: fnd_message.set_token ('OBJ_NAME', cn_api.get_lkup_meaning ('ADD_FROM_REVCLASS', 'PE_OBJECT_TYPE'));
2406: fnd_msg_pub.ADD;
2407: END IF;
2408:
2401: THEN
2402: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
2403: THEN
2404: fnd_message.set_name ('CN', 'CN_INVALID_DATA');
2405: fnd_message.set_token ('OBJ_NAME', cn_api.get_lkup_meaning ('ADD_FROM_REVCLASS', 'PE_OBJECT_TYPE'));
2406: fnd_msg_pub.ADD;
2407: END IF;
2408:
2409: RAISE fnd_api.g_exc_error;
2424: WHERE csr.salesrep_id = cspa.salesrep_id AND csr.role_id = 54));
2425:
2426: IF (l_payeechk > 0)
2427: THEN
2428: fnd_message.set_name ('CN', 'CN_PAYEE_ASGN_FLAG_CHECK');
2429: fnd_msg_pub.ADD;
2430: RAISE fnd_api.g_exc_error;
2431: END IF;
2432: END IF;