29: fnd_msg_pub.add;
30: IF l_DEBUG in ('Y', 'C') THEN
31: cep_standard.debug(p_param_name|| ' is a required parameter.');
32: END IF;
33: RAISE fnd_api.g_exc_error;
34:
35: END IF;
36: END check_mandatory_param;
37:
58: and NVL(TRUNC(effective_end_date), SYSDATE+1);
59: l_country VARCHAR2(60);
60: BEGIN
61: -- initialize API return status to success.
62: x_return_status := fnd_api.g_ret_sts_success;
63:
64: OPEN c_country;
65: FETCH c_country INTO l_country;
66: IF c_country%NOTFOUND THEN
65: FETCH c_country INTO l_country;
66: IF c_country%NOTFOUND THEN
67: fnd_message.set_name('CE', 'CE_API_NO_BANK');
68: fnd_msg_pub.add;
69: x_return_status := fnd_api.g_ret_sts_error;
70: END IF;
71: CLOSE c_country;
72:
73: RETURN NVL(l_country, 'NULL');
128: and NVL(TRUNC(hz_bankorg.effective_end_date), SYSDATE+1)
129: AND hz_branch.party_id = p_branch_id;
130: BEGIN
131: -- initialize API return status to success.
132: x_return_status := fnd_api.g_ret_sts_success;
133:
134: OPEN c_bank;
135: FETCH c_bank INTO x_bank_id, x_country_code, x_bank_name, x_bank_number;
136: IF c_bank%NOTFOUND THEN
135: FETCH c_bank INTO x_bank_id, x_country_code, x_bank_name, x_bank_number;
136: IF c_bank%NOTFOUND THEN
137: fnd_message.set_name('CE', 'CE_API_NO_BANK');
138: fnd_msg_pub.add;
139: x_return_status := fnd_api.g_ret_sts_error;
140: END IF;
141: CLOSE c_bank;
142:
143: END find_bank_info;
154: | |
155: | ARGUMENTS |
156: | IN: |
157: | p_init_msg_list Initialize message stack if it is set to |
158: | FND_API.G_TRUE. Default is fnd_api.g_false
159: | p_country_code Country code of the bank. |
160: | p_bank_name Bank name. |
161: | p_bank_number Bank number. |
162: | p_alternate_bank_name Alternate bank name. |
167: | IN/OUT: |
168: | OUT: |
169: | x_bank_id Party ID for the bank. |
170: | x_return_status Return status after the call. The status can |
171: | be FND_API.G_RET_STS_SUCCESS (success), |
172: | fnd_api.g_ret_sts_error (error), |
173: | fnd_api.g_ret_sts_unexp_error (unexpected |
174: | error). |
175: | x_msg_count Number of messages in message stack. |
168: | OUT: |
169: | x_bank_id Party ID for the bank. |
170: | x_return_status Return status after the call. The status can |
171: | be FND_API.G_RET_STS_SUCCESS (success), |
172: | fnd_api.g_ret_sts_error (error), |
173: | fnd_api.g_ret_sts_unexp_error (unexpected |
174: | error). |
175: | x_msg_count Number of messages in message stack. |
176: | x_msg_data Message text if x_msg_count is 1. |
169: | x_bank_id Party ID for the bank. |
170: | x_return_status Return status after the call. The status can |
171: | be FND_API.G_RET_STS_SUCCESS (success), |
172: | fnd_api.g_ret_sts_error (error), |
173: | fnd_api.g_ret_sts_unexp_error (unexpected |
174: | error). |
175: | x_msg_count Number of messages in message stack. |
176: | x_msg_data Message text if x_msg_count is 1. |
177: | MODIFICATION HISTORY |
177: | MODIFICATION HISTORY |
178: | 25-AUG-2004 Xin Wang Created. |
179: +=======================================================================*/
180: PROCEDURE create_bank (
181: p_init_msg_list IN VARCHAR2:= fnd_api.g_false,
182: p_country_code IN VARCHAR2,
183: p_bank_name IN VARCHAR2,
184: p_bank_number IN VARCHAR2 DEFAULT NULL,
185: p_alternate_bank_name IN VARCHAR2 DEFAULT NULL,
232: cep_standard.debug('>>CE_EXT_BANK_ACCT_PUB.create_bank.');
233: END IF;
234:
235: -- initialize message list
236: IF fnd_api.to_boolean(p_init_msg_list) THEN
237: fnd_msg_pub.initialize;
238: END IF;
239:
240: -- initialize API return status to success.
237: fnd_msg_pub.initialize;
238: END IF;
239:
240: -- initialize API return status to success.
241: x_return_status := fnd_api.g_ret_sts_success;
242:
243: -- first check all required params
244: -- 12557352: Modified check by calling check_mandatory_param
245: check_mandatory_param('p_country_code',p_country_code);
251: p_bank_name,
252: p_alternate_bank_name,
253: p_tax_payer_id,
254: null, -- bank_id
255: FND_API.G_FALSE, -- do not re-initialize msg stack
256: x_msg_count,
257: x_msg_data,
258: l_bank_number, -- reformated bank number
259: x_return_status);
258: l_bank_number, -- reformated bank number
259: x_return_status);
260:
261: -- raise an exception if country specific validations fail
262: IF x_return_status <> fnd_api.g_ret_sts_success THEN
263: RAISE fnd_api.g_exc_error;
264: END IF;
265:
266: l_party_rec.attribute_category := p_attribute_category;
259: x_return_status);
260:
261: -- raise an exception if country specific validations fail
262: IF x_return_status <> fnd_api.g_ret_sts_success THEN
263: RAISE fnd_api.g_exc_error;
264: END IF;
265:
266: l_party_rec.attribute_category := p_attribute_category;
267: l_party_rec.attribute1 := p_attribute1;
307: if (l_gen_party_num = 'N') then
308: fnd_profile.put('HZ_GENERATE_PARTY_NUMBER', 'Y');
309: end if;
310:
311: hz_bank_pub.create_bank(fnd_api.g_false, l_bank_rec, x_bank_id, l_party_number,
312: l_profile_id, l_code_assignment_id,
313: x_return_status, x_msg_count, x_msg_data);
314:
315: if (l_gen_party_num = 'N') then
316: fnd_profile.put('HZ_GENERATE_PARTY_NUMBER', 'N');
317: end if;
318:
319: -- raise an exception if error creating bank
320: IF x_return_status <> fnd_api.g_ret_sts_success THEN
321: RAISE fnd_api.g_exc_error;
322: END IF;
323:
324: -- get message count and if count is 1, get message info.
317: end if;
318:
319: -- raise an exception if error creating bank
320: IF x_return_status <> fnd_api.g_ret_sts_success THEN
321: RAISE fnd_api.g_exc_error;
322: END IF;
323:
324: -- get message count and if count is 1, get message info.
325: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
321: RAISE fnd_api.g_exc_error;
322: END IF;
323:
324: -- get message count and if count is 1, get message info.
325: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
326: p_count => x_msg_count,
327: p_data => x_msg_data);
328:
329: IF l_DEBUG in ('Y', 'C') THEN
330: cep_standard.debug('<
332:
333: EXCEPTION
334: WHEN fnd_api.g_exc_error THEN
335: ROLLBACK TO create_bank;
336: x_return_status := fnd_api.g_ret_sts_error;
337: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
338: p_count => x_msg_count,
332:
333: EXCEPTION
334: WHEN fnd_api.g_exc_error THEN
335: ROLLBACK TO create_bank;
336: x_return_status := fnd_api.g_ret_sts_error;
337: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
338: p_count => x_msg_count,
339: p_data => x_msg_data);
340:
333: EXCEPTION
334: WHEN fnd_api.g_exc_error THEN
335: ROLLBACK TO create_bank;
336: x_return_status := fnd_api.g_ret_sts_error;
337: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
338: p_count => x_msg_count,
339: p_data => x_msg_data);
340:
341: IF l_DEBUG in ('Y', 'C') THEN
341: IF l_DEBUG in ('Y', 'C') THEN
342: cep_standard.debug_msg_stack(x_msg_count, x_msg_data);
343: END IF;
344:
345: WHEN fnd_api.g_exc_unexpected_error THEN
346: ROLLBACK TO create_bank;
347: x_return_status := fnd_api.g_ret_sts_unexp_error;
348: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
349: p_count => x_msg_count,
343: END IF;
344:
345: WHEN fnd_api.g_exc_unexpected_error THEN
346: ROLLBACK TO create_bank;
347: x_return_status := fnd_api.g_ret_sts_unexp_error;
348: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
349: p_count => x_msg_count,
350: p_data => x_msg_data);
351:
344:
345: WHEN fnd_api.g_exc_unexpected_error THEN
346: ROLLBACK TO create_bank;
347: x_return_status := fnd_api.g_ret_sts_unexp_error;
348: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
349: p_count => x_msg_count,
350: p_data => x_msg_data);
351:
352: IF l_DEBUG in ('Y', 'C') THEN
354: END IF;
355:
356: WHEN OTHERS THEN
357: ROLLBACK TO create_bank;
358: x_return_status := fnd_api.g_ret_sts_unexp_error;
359: fnd_message.set_name('CE', 'CE_API_OTHERS_EXCEP');
360: fnd_message.set_token('ERROR',SQLERRM);
361: fnd_msg_pub.add;
362: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
358: x_return_status := fnd_api.g_ret_sts_unexp_error;
359: fnd_message.set_name('CE', 'CE_API_OTHERS_EXCEP');
360: fnd_message.set_token('ERROR',SQLERRM);
361: fnd_msg_pub.add;
362: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
363: p_count => x_msg_count,
364: p_data => x_msg_data);
365:
366: IF l_DEBUG in ('Y', 'C') THEN
381: | |
382: | ARGUMENTS |
383: | IN: |
384: | p_init_msg_list Initialize message stack if it is set to |
385: | FND_API.G_TRUE. Default is fnd_api.g_false
386: | p_bank_id Party ID of the bank to be updated. |
387: | p_bank_name Bank name. |
388: | p_bank_number Bank number. |
389: | p_alternate_bank_name Alternate bank name. |
394: | IN/OUT: |
395: | p_object_version_number Current object version number for the bank|
396: | OUT: |
397: | x_return_status Return status after the call. The status can |
398: | be FND_API.G_RET_STS_SUCCESS (success), |
399: | fnd_api.g_ret_sts_error (error), |
400: | fnd_api.g_ret_sts_unexp_error (unexpected |
401: | error). |
402: | x_msg_count Number of messages in message stack. |
395: | p_object_version_number Current object version number for the bank|
396: | OUT: |
397: | x_return_status Return status after the call. The status can |
398: | be FND_API.G_RET_STS_SUCCESS (success), |
399: | fnd_api.g_ret_sts_error (error), |
400: | fnd_api.g_ret_sts_unexp_error (unexpected |
401: | error). |
402: | x_msg_count Number of messages in message stack. |
403: | x_msg_data Message text if x_msg_count is 1. |
396: | OUT: |
397: | x_return_status Return status after the call. The status can |
398: | be FND_API.G_RET_STS_SUCCESS (success), |
399: | fnd_api.g_ret_sts_error (error), |
400: | fnd_api.g_ret_sts_unexp_error (unexpected |
401: | error). |
402: | x_msg_count Number of messages in message stack. |
403: | x_msg_data Message text if x_msg_count is 1. |
404: | MODIFICATION HISTORY |
407: | to enable or disable the country specific |
408: | validation.(Bug #8286747) |
409: +=======================================================================*/
410: PROCEDURE update_bank (
411: p_init_msg_list IN VARCHAR2:= fnd_api.g_false,
412: p_bank_id IN NUMBER,
413: p_bank_name IN VARCHAR2,
414: p_bank_number IN VARCHAR2 DEFAULT NULL,
415: p_alternate_bank_name IN VARCHAR2 DEFAULT NULL,
462: cep_standard.debug('>>CE_EXT_BANK_ACCT_PUB.update_bank.');
463: END IF;
464:
465: -- initialize message list
466: IF fnd_api.to_boolean(p_init_msg_list) THEN
467: fnd_msg_pub.initialize;
468: END IF;
469:
470: -- initialize API return status to success.
467: fnd_msg_pub.initialize;
468: END IF;
469:
470: -- initialize API return status to success.
471: x_return_status := fnd_api.g_ret_sts_success;
472:
473: -- first check all required params
474: -- 12557352: Modified check by calling check_mandatory_param
475: check_mandatory_param('p_bank_id',p_bank_id);
477:
478: l_country_code := get_country(p_bank_id, x_return_status);
479:
480: -- raise an exception if bank is not found
481: IF x_return_status <> fnd_api.g_ret_sts_success THEN
482: RAISE fnd_api.g_exc_error;
483: END IF;
484:
485: -- country specific validation API call here
478: l_country_code := get_country(p_bank_id, x_return_status);
479:
480: -- raise an exception if bank is not found
481: IF x_return_status <> fnd_api.g_ret_sts_success THEN
482: RAISE fnd_api.g_exc_error;
483: END IF;
484:
485: -- country specific validation API call here
486: ce_validate_bankinfo.ce_validate_bank(l_country_code,
488: p_bank_name,
489: p_alternate_bank_name,
490: p_tax_payer_id,
491: p_bank_id, -- bank_id
492: FND_API.G_FALSE, -- do not re-initialize msg stack
493: x_msg_count,
494: x_msg_data,
495: l_bank_number, -- reformated bank number
496: x_return_status);
496: x_return_status);
497:
498: -- Bug #8286747 The country specific validation errors are reported only if p_country_validate is set to 'Y'
499: -- raise an exception if country specific validations fail
500: IF x_return_status <> fnd_api.g_ret_sts_success and upper(p_country_validate) ='Y' THEN
501: RAISE fnd_api.g_exc_error;
502: END IF;
503:
504: l_party_rec.party_id := p_bank_id;
497:
498: -- Bug #8286747 The country specific validation errors are reported only if p_country_validate is set to 'Y'
499: -- raise an exception if country specific validations fail
500: IF x_return_status <> fnd_api.g_ret_sts_success and upper(p_country_validate) ='Y' THEN
501: RAISE fnd_api.g_exc_error;
502: END IF;
503:
504: l_party_rec.party_id := p_bank_id;
505: l_party_rec.attribute_category := p_attribute_category;
549: AND owner_table_name = 'HZ_PARTIES'
550: AND owner_table_id = p_bank_id
551: AND status = 'A';
552:
553: hz_bank_pub.update_bank(fnd_api.g_false, l_bank_rec,
554: p_object_version_number, l_ca_object_version_number,
555: l_profile_id, x_return_status, x_msg_count, x_msg_data);
556:
557: -- raise an exception if error updating a bank
554: p_object_version_number, l_ca_object_version_number,
555: l_profile_id, x_return_status, x_msg_count, x_msg_data);
556:
557: -- raise an exception if error updating a bank
558: IF x_return_status <> fnd_api.g_ret_sts_success THEN
559: RAISE fnd_api.g_exc_error;
560: END IF;
561:
562: -- get message count and if count is 1, get message info.
555: l_profile_id, x_return_status, x_msg_count, x_msg_data);
556:
557: -- raise an exception if error updating a bank
558: IF x_return_status <> fnd_api.g_ret_sts_success THEN
559: RAISE fnd_api.g_exc_error;
560: END IF;
561:
562: -- get message count and if count is 1, get message info.
563: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
559: RAISE fnd_api.g_exc_error;
560: END IF;
561:
562: -- get message count and if count is 1, get message info.
563: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
564: p_count => x_msg_count,
565: p_data => x_msg_data);
566:
567: IF l_DEBUG in ('Y', 'C') THEN
568: cep_standard.debug('<
570:
571: EXCEPTION
572: WHEN fnd_api.g_exc_error THEN
573: ROLLBACK TO update_bank;
574: x_return_status := fnd_api.g_ret_sts_error;
575: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
576: p_count => x_msg_count,
570:
571: EXCEPTION
572: WHEN fnd_api.g_exc_error THEN
573: ROLLBACK TO update_bank;
574: x_return_status := fnd_api.g_ret_sts_error;
575: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
576: p_count => x_msg_count,
577: p_data => x_msg_data);
578:
571: EXCEPTION
572: WHEN fnd_api.g_exc_error THEN
573: ROLLBACK TO update_bank;
574: x_return_status := fnd_api.g_ret_sts_error;
575: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
576: p_count => x_msg_count,
577: p_data => x_msg_data);
578:
579: IF l_DEBUG in ('Y', 'C') THEN
579: IF l_DEBUG in ('Y', 'C') THEN
580: cep_standard.debug_msg_stack(x_msg_count, x_msg_data);
581: END IF;
582:
583: WHEN fnd_api.g_exc_unexpected_error THEN
584: ROLLBACK TO update_bank;
585: x_return_status := fnd_api.g_ret_sts_unexp_error;
586: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
587: p_count => x_msg_count,
581: END IF;
582:
583: WHEN fnd_api.g_exc_unexpected_error THEN
584: ROLLBACK TO update_bank;
585: x_return_status := fnd_api.g_ret_sts_unexp_error;
586: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
587: p_count => x_msg_count,
588: p_data => x_msg_data);
589:
582:
583: WHEN fnd_api.g_exc_unexpected_error THEN
584: ROLLBACK TO update_bank;
585: x_return_status := fnd_api.g_ret_sts_unexp_error;
586: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
587: p_count => x_msg_count,
588: p_data => x_msg_data);
589:
590: IF l_DEBUG in ('Y', 'C') THEN
592: END IF;
593:
594: WHEN OTHERS THEN
595: ROLLBACK TO update_bank;
596: x_return_status := fnd_api.g_ret_sts_unexp_error;
597: fnd_message.set_name('CE', 'CE_API_OTHERS_EXCEP');
598: fnd_message.set_token('ERROR',SQLERRM);
599: fnd_msg_pub.add;
600: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
596: x_return_status := fnd_api.g_ret_sts_unexp_error;
597: fnd_message.set_name('CE', 'CE_API_OTHERS_EXCEP');
598: fnd_message.set_token('ERROR',SQLERRM);
599: fnd_msg_pub.add;
600: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
601: p_count => x_msg_count,
602: p_data => x_msg_data);
603:
604: IF l_DEBUG in ('Y', 'C') THEN
619: | |
620: | ARGUMENTS |
621: | IN: |
622: | p_init_msg_list Initialize message stack if it is set to |
623: | FND_API.G_TRUE. Default is fnd_api.g_false
624: | p_bank_id Party ID of the bank to be updated. |
625: | p_end_date End date of the bank. |
626: | IN/OUT: |
627: | p_object_version_number Current object version number for the code|
627: | p_object_version_number Current object version number for the code|
628: | assignment for the bank institution type. |
629: | OUT: |
630: | x_return_status Return status after the call. The status can |
631: | be FND_API.G_RET_STS_SUCCESS (success), |
632: | fnd_api.g_ret_sts_error (error), |
633: | fnd_api.g_ret_sts_unexp_error (unexpected |
634: | error). |
635: | x_msg_count Number of messages in message stack. |
628: | assignment for the bank institution type. |
629: | OUT: |
630: | x_return_status Return status after the call. The status can |
631: | be FND_API.G_RET_STS_SUCCESS (success), |
632: | fnd_api.g_ret_sts_error (error), |
633: | fnd_api.g_ret_sts_unexp_error (unexpected |
634: | error). |
635: | x_msg_count Number of messages in message stack. |
636: | x_msg_data Message text if x_msg_count is 1. |
629: | OUT: |
630: | x_return_status Return status after the call. The status can |
631: | be FND_API.G_RET_STS_SUCCESS (success), |
632: | fnd_api.g_ret_sts_error (error), |
633: | fnd_api.g_ret_sts_unexp_error (unexpected |
634: | error). |
635: | x_msg_count Number of messages in message stack. |
636: | x_msg_data Message text if x_msg_count is 1. |
637: | MODIFICATION HISTORY |
637: | MODIFICATION HISTORY |
638: | 25-AUG-2004 Xin Wang Created. |
639: +=======================================================================*/
640: PROCEDURE set_bank_end_date (
641: p_init_msg_list IN VARCHAR2:= fnd_api.g_false,
642: p_bank_id IN NUMBER,
643: p_end_date IN DATE,
644: p_object_version_number IN OUT NOCOPY NUMBER,
645: x_return_status OUT NOCOPY VARCHAR2,
690: cep_standard.debug('>>CE_EXT_BANK_ACCT_PUB.set_bank_end_date.');
691: END IF;
692:
693: -- initialize message list
694: IF fnd_api.to_boolean(p_init_msg_list) THEN
695: fnd_msg_pub.initialize;
696: END IF;
697:
698: -- initialize API return status to success.
695: fnd_msg_pub.initialize;
696: END IF;
697:
698: -- initialize API return status to success.
699: x_return_status := fnd_api.g_ret_sts_success;
700:
701: -- first check all required params
702: -- 12557352: Modified check by calling check_mandatory_param
703: check_mandatory_param('p_bank_id',p_bank_id);
710: FETCH c_bank INTO l_bank_end;
711: IF c_bank%NOTFOUND THEN
712: fnd_message.set_name('CE', 'CE_API_NO_BANK');
713: fnd_msg_pub.add;
714: x_return_status := fnd_api.g_ret_sts_error;
715: CLOSE c_bank;
716: RAISE fnd_api.g_exc_error;
717: END IF;
718: CLOSE c_bank;
712: fnd_message.set_name('CE', 'CE_API_NO_BANK');
713: fnd_msg_pub.add;
714: x_return_status := fnd_api.g_ret_sts_error;
715: CLOSE c_bank;
716: RAISE fnd_api.g_exc_error;
717: END IF;
718: CLOSE c_bank;
719:
720: IF p_end_date IS NOT NULL AND p_end_date < NVL(l_bank_end, p_end_date+1) THEN
723: FETCH c_branch INTO l_branch_end, l_branch_ovn;
724: IF c_branch%NOTFOUND THEN
725: fnd_message.set_name('CE', 'CE_API_NO_BRANCH');
726: fnd_msg_pub.add;
727: x_return_status := fnd_api.g_ret_sts_error;
728: CLOSE c_branch;
729: RAISE fnd_api.g_exc_error;
730: END IF;
731: CLOSE c_branch;
725: fnd_message.set_name('CE', 'CE_API_NO_BRANCH');
726: fnd_msg_pub.add;
727: x_return_status := fnd_api.g_ret_sts_error;
728: CLOSE c_branch;
729: RAISE fnd_api.g_exc_error;
730: END IF;
731: CLOSE c_branch;
732:
733: IF p_end_date < NVL(l_branch_end, p_end_date+1) THEN
730: END IF;
731: CLOSE c_branch;
732:
733: IF p_end_date < NVL(l_branch_end, p_end_date+1) THEN
734: set_bank_branch_end_date (fnd_api.g_false,
735: branch_id_rec.subject_id,
736: p_end_date,
737: l_branch_ovn,
738: x_return_status,
737: l_branch_ovn,
738: x_return_status,
739: x_msg_count,
740: x_msg_data);
741: IF x_return_status <> fnd_api.g_ret_sts_success THEN
742: RAISE fnd_api.g_exc_error;
743: END IF;
744: END IF;
745: END LOOP;
738: x_return_status,
739: x_msg_count,
740: x_msg_data);
741: IF x_return_status <> fnd_api.g_ret_sts_success THEN
742: RAISE fnd_api.g_exc_error;
743: END IF;
744: END IF;
745: END LOOP;
746: END IF;
755: FETCH c_bank_ovn INTO l_bank_ovn;
756: IF c_bank_ovn%NOTFOUND THEN
757: fnd_message.set_name('CE', 'CE_API_NO_BANK');
758: fnd_msg_pub.add;
759: x_return_status := fnd_api.g_ret_sts_error;
760: CLOSE c_bank_ovn;
761: RAISE fnd_api.g_exc_error;
762: END IF;
763: CLOSE c_bank_ovn;
757: fnd_message.set_name('CE', 'CE_API_NO_BANK');
758: fnd_msg_pub.add;
759: x_return_status := fnd_api.g_ret_sts_error;
760: CLOSE c_bank_ovn;
761: RAISE fnd_api.g_exc_error;
762: END IF;
763: CLOSE c_bank_ovn;
764:
765: hz_bank_pub.update_bank(fnd_api.g_false, l_bank_rec,
761: RAISE fnd_api.g_exc_error;
762: END IF;
763: CLOSE c_bank_ovn;
764:
765: hz_bank_pub.update_bank(fnd_api.g_false, l_bank_rec,
766: l_bank_ovn, p_object_version_number,
767: l_profile_id, x_return_status, x_msg_count, x_msg_data);
768:
769: IF x_return_status <> fnd_api.g_ret_sts_success THEN
765: hz_bank_pub.update_bank(fnd_api.g_false, l_bank_rec,
766: l_bank_ovn, p_object_version_number,
767: l_profile_id, x_return_status, x_msg_count, x_msg_data);
768:
769: IF x_return_status <> fnd_api.g_ret_sts_success THEN
770: RAISE fnd_api.g_exc_error;
771: END IF;
772:
773: -- get message count and if count is 1, get message info.
766: l_bank_ovn, p_object_version_number,
767: l_profile_id, x_return_status, x_msg_count, x_msg_data);
768:
769: IF x_return_status <> fnd_api.g_ret_sts_success THEN
770: RAISE fnd_api.g_exc_error;
771: END IF;
772:
773: -- get message count and if count is 1, get message info.
774: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
770: RAISE fnd_api.g_exc_error;
771: END IF;
772:
773: -- get message count and if count is 1, get message info.
774: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
775: p_count => x_msg_count,
776: p_data => x_msg_data);
777:
778: IF l_DEBUG in ('Y', 'C') THEN
779: cep_standard.debug('<
781:
782: EXCEPTION
783: WHEN fnd_api.g_exc_error THEN
784: ROLLBACK TO set_bank_end_date;
785: x_return_status := fnd_api.g_ret_sts_error;
786: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
787: p_count => x_msg_count,
781:
782: EXCEPTION
783: WHEN fnd_api.g_exc_error THEN
784: ROLLBACK TO set_bank_end_date;
785: x_return_status := fnd_api.g_ret_sts_error;
786: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
787: p_count => x_msg_count,
788: p_data => x_msg_data);
789:
782: EXCEPTION
783: WHEN fnd_api.g_exc_error THEN
784: ROLLBACK TO set_bank_end_date;
785: x_return_status := fnd_api.g_ret_sts_error;
786: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
787: p_count => x_msg_count,
788: p_data => x_msg_data);
789:
790: IF l_DEBUG in ('Y', 'C') THEN
790: IF l_DEBUG in ('Y', 'C') THEN
791: cep_standard.debug_msg_stack(x_msg_count, x_msg_data);
792: END IF;
793:
794: WHEN fnd_api.g_exc_unexpected_error THEN
795: ROLLBACK TO set_bank_end_date;
796: x_return_status := fnd_api.g_ret_sts_unexp_error;
797: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
798: p_count => x_msg_count,
792: END IF;
793:
794: WHEN fnd_api.g_exc_unexpected_error THEN
795: ROLLBACK TO set_bank_end_date;
796: x_return_status := fnd_api.g_ret_sts_unexp_error;
797: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
798: p_count => x_msg_count,
799: p_data => x_msg_data);
800:
793:
794: WHEN fnd_api.g_exc_unexpected_error THEN
795: ROLLBACK TO set_bank_end_date;
796: x_return_status := fnd_api.g_ret_sts_unexp_error;
797: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
798: p_count => x_msg_count,
799: p_data => x_msg_data);
800:
801: IF l_DEBUG in ('Y', 'C') THEN
803: END IF;
804:
805: WHEN OTHERS THEN
806: ROLLBACK TO set_bank_end_date;
807: x_return_status := fnd_api.g_ret_sts_unexp_error;
808: fnd_message.set_name('CE', 'CE_API_OTHERS_EXCEP');
809: fnd_message.set_token('ERROR',SQLERRM);
810: fnd_msg_pub.add;
811: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
807: x_return_status := fnd_api.g_ret_sts_unexp_error;
808: fnd_message.set_name('CE', 'CE_API_OTHERS_EXCEP');
809: fnd_message.set_token('ERROR',SQLERRM);
810: fnd_msg_pub.add;
811: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
812: p_count => x_msg_count,
813: p_data => x_msg_data);
814:
815: IF l_DEBUG in ('Y', 'C') THEN
931: | |
932: | ARGUMENTS |
933: | IN: |
934: | p_init_msg_list Initialize message stack if it is set to |
935: | FND_API.G_TRUE. Default is fnd_api.g_false
936: | p_bank_id Party ID of the bank that the branch |
937: | belongs. |
938: | p_branch_name Bank branch name. |
939: | p_branch_number Bank branch number. |
946: | IN/OUT: |
947: | OUT: |
948: | x_branch_id Party ID for the bank branch. |
949: | x_return_status Return status after the call. The status can |
950: | be FND_API.G_RET_STS_SUCCESS (success), |
951: | fnd_api.g_ret_sts_error (error), |
952: | fnd_api.g_ret_sts_unexp_error (unexpected |
953: | error). |
954: | x_msg_count Number of messages in message stack. |
947: | OUT: |
948: | x_branch_id Party ID for the bank branch. |
949: | x_return_status Return status after the call. The status can |
950: | be FND_API.G_RET_STS_SUCCESS (success), |
951: | fnd_api.g_ret_sts_error (error), |
952: | fnd_api.g_ret_sts_unexp_error (unexpected |
953: | error). |
954: | x_msg_count Number of messages in message stack. |
955: | x_msg_data Message text if x_msg_count is 1. |
948: | x_branch_id Party ID for the bank branch. |
949: | x_return_status Return status after the call. The status can |
950: | be FND_API.G_RET_STS_SUCCESS (success), |
951: | fnd_api.g_ret_sts_error (error), |
952: | fnd_api.g_ret_sts_unexp_error (unexpected |
953: | error). |
954: | x_msg_count Number of messages in message stack. |
955: | x_msg_data Message text if x_msg_count is 1. |
956: | MODIFICATION HISTORY |
956: | MODIFICATION HISTORY |
957: | 25-AUG-2004 Xin Wang Created. |
958: +=======================================================================*/
959: PROCEDURE create_bank_branch (
960: p_init_msg_list IN VARCHAR2:= fnd_api.g_false,
961: p_bank_id IN NUMBER,
962: p_branch_name IN VARCHAR2,
963: p_branch_number IN VARCHAR2 DEFAULT NULL,
964: p_branch_type IN VARCHAR2 DEFAULT NULL,
1032: cep_standard.debug('>>CE_EXT_BANK_ACCT_PUB.create_bank_branch.');
1033: END IF;
1034:
1035: -- initialize message list
1036: IF fnd_api.to_boolean(p_init_msg_list) THEN
1037: fnd_msg_pub.initialize;
1038: END IF;
1039:
1040: -- initialize API return status to success.
1037: fnd_msg_pub.initialize;
1038: END IF;
1039:
1040: -- initialize API return status to success.
1041: x_return_status := fnd_api.g_ret_sts_success;
1042:
1043: -- first check all required params
1044: -- 12557352: Modified check by calling check_mandatory_param
1045: check_mandatory_param('p_bank_id',p_bank_id);
1047:
1048: l_country := get_country(p_bank_id, x_return_status);
1049:
1050: -- raise an exception if bank is not found
1051: IF x_return_status <> fnd_api.g_ret_sts_success THEN
1052: RAISE fnd_api.g_exc_error;
1053: END IF;
1054:
1055: OPEN c_bank;
1048: l_country := get_country(p_bank_id, x_return_status);
1049:
1050: -- raise an exception if bank is not found
1051: IF x_return_status <> fnd_api.g_ret_sts_success THEN
1052: RAISE fnd_api.g_exc_error;
1053: END IF;
1054:
1055: OPEN c_bank;
1056: FETCH c_bank INTO l_bank_name, l_bank_number;
1056: FETCH c_bank INTO l_bank_name, l_bank_number;
1057: IF c_bank%NOTFOUND THEN
1058: fnd_message.set_name('CE', 'CE_API_NO_BANK');
1059: fnd_msg_pub.add;
1060: x_return_status := fnd_api.g_ret_sts_error;
1061: RAISE fnd_api.g_exc_error;
1062: END IF;
1063: CLOSE c_bank;
1064:
1057: IF c_bank%NOTFOUND THEN
1058: fnd_message.set_name('CE', 'CE_API_NO_BANK');
1059: fnd_msg_pub.add;
1060: x_return_status := fnd_api.g_ret_sts_error;
1061: RAISE fnd_api.g_exc_error;
1062: END IF;
1063: CLOSE c_bank;
1064:
1065: -- start bug 9918477
1080: x_return_status
1081: );
1082:
1083: -- raise an exception if BIC validations fail
1084: IF x_return_status <> fnd_api.g_ret_sts_success THEN
1085: RAISE fnd_api.g_exc_error;
1086: END IF;
1087: END IF;
1088: -- end bug 9918477
1081: );
1082:
1083: -- raise an exception if BIC validations fail
1084: IF x_return_status <> fnd_api.g_ret_sts_success THEN
1085: RAISE fnd_api.g_exc_error;
1086: END IF;
1087: END IF;
1088: -- end bug 9918477
1089:
1096: X_BRANCH_NAME => p_branch_name,
1097: X_BRANCH_NAME_ALT => p_alternate_branch_name,
1098: X_BANK_ID => p_bank_id,
1099: X_BRANCH_ID => null, -- branch_id
1100: P_INIT_MSG_LIST => FND_API.G_FALSE, -- do not re-initialize msg stack
1101: X_MSG_COUNT => x_msg_count,
1102: X_MSG_DATA => x_msg_data,
1103: X_VALUE_OUT => l_branch_number, -- reformatted branch number
1104: X_RETURN_STATUS => x_return_status,
1106: X_BRANCH_TYPE => p_branch_type); -- 9218190 added
1107:
1108:
1109: -- raise an exception if country specific validations fail
1110: IF x_return_status <> fnd_api.g_ret_sts_success THEN
1111: RAISE fnd_api.g_exc_error;
1112: END IF;
1113:
1114: l_party_rec.attribute_category := p_attribute_category;
1107:
1108:
1109: -- raise an exception if country specific validations fail
1110: IF x_return_status <> fnd_api.g_ret_sts_success THEN
1111: RAISE fnd_api.g_exc_error;
1112: END IF;
1113:
1114: l_party_rec.attribute_category := p_attribute_category;
1115: l_party_rec.attribute1 := p_attribute1;
1154: if (l_gen_party_num = 'N') then
1155: fnd_profile.put('HZ_GENERATE_PARTY_NUMBER', 'Y');
1156: end if;
1157:
1158: hz_bank_pub.create_bank_branch(fnd_api.g_false, l_branch_rec, p_bank_id,
1159: x_branch_id, l_party_number,
1160: l_profile_id, l_rel_id,
1161: l_rel_party_id, l_rel_party_number,
1162: l_bch_code_assignment_id, l_typ_code_assignment_id,
1167: fnd_profile.put('HZ_GENERATE_PARTY_NUMBER', 'N');
1168: end if;
1169:
1170: -- raise an exception if the branch creation is unsuccessful
1171: IF x_return_status <> fnd_api.g_ret_sts_success THEN
1172: RAISE fnd_api.g_exc_error;
1173: END IF;
1174:
1175: IF p_bic IS NOT NULL OR p_eft_number IS NOT NULL THEN
1168: end if;
1169:
1170: -- raise an exception if the branch creation is unsuccessful
1171: IF x_return_status <> fnd_api.g_ret_sts_success THEN
1172: RAISE fnd_api.g_exc_error;
1173: END IF;
1174:
1175: IF p_bic IS NOT NULL OR p_eft_number IS NOT NULL THEN
1176: l_contact_point_rec.contact_point_type := 'EFT';
1181: l_eft_rec.eft_swift_code := p_bic;
1182: l_eft_rec.eft_user_number := p_eft_number;
1183:
1184: hz_contact_point_v2pub.create_eft_contact_point
1185: (fnd_api.g_false, l_contact_point_rec, l_eft_rec,
1186: l_contact_point_id,
1187: x_return_status, x_msg_count, x_msg_data);
1188:
1189: -- raise an exception if the branch creation is unsuccessful
1186: l_contact_point_id,
1187: x_return_status, x_msg_count, x_msg_data);
1188:
1189: -- raise an exception if the branch creation is unsuccessful
1190: IF x_return_status <> fnd_api.g_ret_sts_success THEN
1191: RAISE fnd_api.g_exc_error;
1192: END IF;
1193: END IF;
1194:
1187: x_return_status, x_msg_count, x_msg_data);
1188:
1189: -- raise an exception if the branch creation is unsuccessful
1190: IF x_return_status <> fnd_api.g_ret_sts_success THEN
1191: RAISE fnd_api.g_exc_error;
1192: END IF;
1193: END IF;
1194:
1195: -- get message count and if count is 1, get message info.
1192: END IF;
1193: END IF;
1194:
1195: -- get message count and if count is 1, get message info.
1196: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
1197: p_count => x_msg_count,
1198: p_data => x_msg_data);
1199:
1200: IF l_DEBUG in ('Y', 'C') THEN
1201: cep_standard.debug('<
1203:
1204: EXCEPTION
1205: WHEN fnd_api.g_exc_error THEN
1206: ROLLBACK TO create_bank_branch;
1207: x_return_status := fnd_api.g_ret_sts_error;
1208: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
1209: p_count => x_msg_count,
1203:
1204: EXCEPTION
1205: WHEN fnd_api.g_exc_error THEN
1206: ROLLBACK TO create_bank_branch;
1207: x_return_status := fnd_api.g_ret_sts_error;
1208: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
1209: p_count => x_msg_count,
1210: p_data => x_msg_data);
1211:
1204: EXCEPTION
1205: WHEN fnd_api.g_exc_error THEN
1206: ROLLBACK TO create_bank_branch;
1207: x_return_status := fnd_api.g_ret_sts_error;
1208: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
1209: p_count => x_msg_count,
1210: p_data => x_msg_data);
1211:
1212: IF l_DEBUG in ('Y', 'C') THEN
1212: IF l_DEBUG in ('Y', 'C') THEN
1213: cep_standard.debug_msg_stack(x_msg_count, x_msg_data);
1214: END IF;
1215:
1216: WHEN fnd_api.g_exc_unexpected_error THEN
1217: ROLLBACK TO create_bank_branch;
1218: x_return_status := fnd_api.g_ret_sts_unexp_error;
1219: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
1220: p_count => x_msg_count,
1214: END IF;
1215:
1216: WHEN fnd_api.g_exc_unexpected_error THEN
1217: ROLLBACK TO create_bank_branch;
1218: x_return_status := fnd_api.g_ret_sts_unexp_error;
1219: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
1220: p_count => x_msg_count,
1221: p_data => x_msg_data);
1222:
1215:
1216: WHEN fnd_api.g_exc_unexpected_error THEN
1217: ROLLBACK TO create_bank_branch;
1218: x_return_status := fnd_api.g_ret_sts_unexp_error;
1219: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
1220: p_count => x_msg_count,
1221: p_data => x_msg_data);
1222:
1223: IF l_DEBUG in ('Y', 'C') THEN
1225: END IF;
1226:
1227: WHEN OTHERS THEN
1228: ROLLBACK TO create_bank_branch;
1229: x_return_status := fnd_api.g_ret_sts_unexp_error;
1230: fnd_message.set_name('CE', 'CE_API_OTHERS_EXCEP');
1231: fnd_message.set_token('ERROR',SQLERRM);
1232: fnd_msg_pub.add;
1233: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
1229: x_return_status := fnd_api.g_ret_sts_unexp_error;
1230: fnd_message.set_name('CE', 'CE_API_OTHERS_EXCEP');
1231: fnd_message.set_token('ERROR',SQLERRM);
1232: fnd_msg_pub.add;
1233: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
1234: p_count => x_msg_count,
1235: p_data => x_msg_data);
1236:
1237: IF l_DEBUG in ('Y', 'C') THEN
1252: | |
1253: | ARGUMENTS |
1254: | IN: |
1255: | p_init_msg_list Initialize message stack if it is set to |
1256: | FND_API.G_TRUE. Default is fnd_api.g_false
1257: | p_branch_id Party ID of the branch to be updated. |
1258: | p_branch_name Bank branch name. |
1259: | p_branch_number Bank branch number. |
1260: | p_branch_type Bank branch type. |
1271: | p_rfc_object_version_number Current object version number for |
1272: | RFC code assignment. |
1273: | OUT: |
1274: | x_return_status Return status after the call. The status can |
1275: | be FND_API.G_RET_STS_SUCCESS (success), |
1276: | fnd_api.g_ret_sts_error (error), |
1277: | fnd_api.g_ret_sts_unexp_error (unexpected |
1278: | error). |
1279: | x_msg_count Number of messages in message stack. |
1272: | RFC code assignment. |
1273: | OUT: |
1274: | x_return_status Return status after the call. The status can |
1275: | be FND_API.G_RET_STS_SUCCESS (success), |
1276: | fnd_api.g_ret_sts_error (error), |
1277: | fnd_api.g_ret_sts_unexp_error (unexpected |
1278: | error). |
1279: | x_msg_count Number of messages in message stack. |
1280: | x_msg_data Message text if x_msg_count is 1. |
1273: | OUT: |
1274: | x_return_status Return status after the call. The status can |
1275: | be FND_API.G_RET_STS_SUCCESS (success), |
1276: | fnd_api.g_ret_sts_error (error), |
1277: | fnd_api.g_ret_sts_unexp_error (unexpected |
1278: | error). |
1279: | x_msg_count Number of messages in message stack. |
1280: | x_msg_data Message text if x_msg_count is 1. |
1281: | MODIFICATION HISTORY |
1284: | to enable or disable the country specific |
1285: | validation. (Bug # 8286747) |
1286: +=======================================================================*/
1287: PROCEDURE update_bank_branch (
1288: p_init_msg_list IN VARCHAR2:= fnd_api.g_false,
1289: p_branch_id IN NUMBER,
1290: p_branch_name IN VARCHAR2,
1291: p_branch_number IN VARCHAR2 DEFAULT NULL,
1292: p_branch_type IN VARCHAR2,
1359: cep_standard.debug('>>CE_EXT_BANK_ACCT_PUB.update_bank_branch.');
1360: END IF;
1361:
1362: -- initialize message list
1363: IF fnd_api.to_boolean(p_init_msg_list) THEN
1364: fnd_msg_pub.initialize;
1365: END IF;
1366:
1367: -- initialize API return status to success.
1364: fnd_msg_pub.initialize;
1365: END IF;
1366:
1367: -- initialize API return status to success.
1368: x_return_status := fnd_api.g_ret_sts_success;
1369:
1370: -- first check all required params
1371: -- 12557352: Modified check by calling check_mandatory_param
1372: check_mandatory_param('p_branch_id',p_branch_id);
1374:
1375: find_bank_info(p_branch_id, x_return_status, l_bank_id, l_country, l_bank_name, l_bank_number);
1376:
1377: -- raise an exception if bank is not found
1378: IF x_return_status <> fnd_api.g_ret_sts_success THEN
1379: RAISE fnd_api.g_exc_error;
1380: END IF;
1381:
1382: -- start bug 9918477
1375: find_bank_info(p_branch_id, x_return_status, l_bank_id, l_country, l_bank_name, l_bank_number);
1376:
1377: -- raise an exception if bank is not found
1378: IF x_return_status <> fnd_api.g_ret_sts_success THEN
1379: RAISE fnd_api.g_exc_error;
1380: END IF;
1381:
1382: -- start bug 9918477
1383: /*
1397: x_return_status
1398: );
1399:
1400: -- raise an exception if BIC validations fail
1401: IF x_return_status <> fnd_api.g_ret_sts_success THEN
1402: RAISE fnd_api.g_exc_error;
1403: END IF;
1404: END IF;
1405: -- end bug 9918477
1398: );
1399:
1400: -- raise an exception if BIC validations fail
1401: IF x_return_status <> fnd_api.g_ret_sts_success THEN
1402: RAISE fnd_api.g_exc_error;
1403: END IF;
1404: END IF;
1405: -- end bug 9918477
1406:
1413: X_BRANCH_NAME => p_branch_name,
1414: X_BRANCH_NAME_ALT => p_alternate_branch_name,
1415: X_BANK_ID => l_bank_id,
1416: X_BRANCH_ID => p_branch_id,
1417: P_INIT_MSG_LIST => FND_API.G_FALSE, -- do not re-initialize msg stack
1418: X_MSG_COUNT => x_msg_count,
1419: X_MSG_DATA => x_msg_data,
1420: X_VALUE_OUT => l_branch_number, -- reformatted branch number
1421: X_RETURN_STATUS => x_return_status,
1423: X_BRANCH_TYPE => p_branch_type); -- 9218190 added
1424:
1425: -- Bug #8286747 The country specific validation errors are reported only if p_country_validate is set to 'Y'
1426: -- raise an exception if country specific validations fail
1427: IF x_return_status <> fnd_api.g_ret_sts_success and upper(p_country_validate) ='Y' THEN
1428: RAISE fnd_api.g_exc_error;
1429: END IF;
1430:
1431: l_party_rec.party_id := p_branch_id;
1424:
1425: -- Bug #8286747 The country specific validation errors are reported only if p_country_validate is set to 'Y'
1426: -- raise an exception if country specific validations fail
1427: IF x_return_status <> fnd_api.g_ret_sts_success and upper(p_country_validate) ='Y' THEN
1428: RAISE fnd_api.g_exc_error;
1429: END IF;
1430:
1431: l_party_rec.party_id := p_branch_id;
1432: l_party_rec.attribute_category := p_attribute_category;
1466: l_branch_rec.branch_type := p_branch_type;
1467: l_branch_rec.rfc_code := p_rfc_identifier;
1468: l_branch_rec.organization_rec := l_org_rec;
1469:
1470: hz_bank_pub.update_bank_branch(fnd_api.g_false, l_branch_rec, null,
1471: l_rel_id,
1472: p_bch_object_version_number, p_typ_object_version_number,
1473: p_rfc_object_version_number,
1474: l_profile_id, l_rel_party_id, l_rel_party_number,
1474: l_profile_id, l_rel_party_id, l_rel_party_number,
1475: x_return_status, x_msg_count, x_msg_data);
1476:
1477: -- raise an exception if the branch creation is unsuccessful
1478: IF x_return_status <> fnd_api.g_ret_sts_success THEN
1479: RAISE fnd_api.g_exc_error;
1480: END IF;
1481:
1482: -- see whether this branch already have eft contact points
1475: x_return_status, x_msg_count, x_msg_data);
1476:
1477: -- raise an exception if the branch creation is unsuccessful
1478: IF x_return_status <> fnd_api.g_ret_sts_success THEN
1479: RAISE fnd_api.g_exc_error;
1480: END IF;
1481:
1482: -- see whether this branch already have eft contact points
1483: OPEN c_eft;
1493: l_eft_rec.eft_swift_code := p_bic;
1494: l_eft_rec.eft_user_number := p_eft_number;
1495:
1496: hz_contact_point_v2pub.create_eft_contact_point
1497: (fnd_api.g_false, l_contact_point_rec, l_eft_rec,
1498: l_contact_point_id,
1499: x_return_status, x_msg_count, x_msg_data);
1500: END IF;
1501: ELSE -- already have, update
1504: l_eft_rec.eft_swift_code := p_bic;
1505: l_eft_rec.eft_user_number := p_eft_number;
1506:
1507: hz_contact_point_v2pub.update_eft_contact_point
1508: (fnd_api.g_false, l_contact_point_rec, l_eft_rec,
1509: p_eft_object_version_number,
1510: x_return_status, x_msg_count, x_msg_data);
1511: END IF;
1512:
1510: x_return_status, x_msg_count, x_msg_data);
1511: END IF;
1512:
1513: -- raise an exception if the eft contact point creation/update is unsuccessful
1514: IF x_return_status <> fnd_api.g_ret_sts_success THEN
1515: RAISE fnd_api.g_exc_error;
1516: END IF;
1517:
1518: -- get message count and if count is 1, get message info.
1511: END IF;
1512:
1513: -- raise an exception if the eft contact point creation/update is unsuccessful
1514: IF x_return_status <> fnd_api.g_ret_sts_success THEN
1515: RAISE fnd_api.g_exc_error;
1516: END IF;
1517:
1518: -- get message count and if count is 1, get message info.
1519: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
1515: RAISE fnd_api.g_exc_error;
1516: END IF;
1517:
1518: -- get message count and if count is 1, get message info.
1519: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
1520: p_count => x_msg_count,
1521: p_data => x_msg_data);
1522:
1523: IF l_DEBUG in ('Y', 'C') THEN
1524: cep_standard.debug('<
1526:
1527: EXCEPTION
1528: WHEN fnd_api.g_exc_error THEN
1529: ROLLBACK TO update_bank_branch;
1530: x_return_status := fnd_api.g_ret_sts_error;
1531: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
1532: p_count => x_msg_count,
1526:
1527: EXCEPTION
1528: WHEN fnd_api.g_exc_error THEN
1529: ROLLBACK TO update_bank_branch;
1530: x_return_status := fnd_api.g_ret_sts_error;
1531: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
1532: p_count => x_msg_count,
1533: p_data => x_msg_data);
1534:
1527: EXCEPTION
1528: WHEN fnd_api.g_exc_error THEN
1529: ROLLBACK TO update_bank_branch;
1530: x_return_status := fnd_api.g_ret_sts_error;
1531: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
1532: p_count => x_msg_count,
1533: p_data => x_msg_data);
1534:
1535: IF l_DEBUG in ('Y', 'C') THEN
1535: IF l_DEBUG in ('Y', 'C') THEN
1536: cep_standard.debug_msg_stack(x_msg_count, x_msg_data);
1537: END IF;
1538:
1539: WHEN fnd_api.g_exc_unexpected_error THEN
1540: ROLLBACK TO update_bank_branch;
1541: x_return_status := fnd_api.g_ret_sts_unexp_error;
1542: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
1543: p_count => x_msg_count,
1537: END IF;
1538:
1539: WHEN fnd_api.g_exc_unexpected_error THEN
1540: ROLLBACK TO update_bank_branch;
1541: x_return_status := fnd_api.g_ret_sts_unexp_error;
1542: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
1543: p_count => x_msg_count,
1544: p_data => x_msg_data);
1545:
1538:
1539: WHEN fnd_api.g_exc_unexpected_error THEN
1540: ROLLBACK TO update_bank_branch;
1541: x_return_status := fnd_api.g_ret_sts_unexp_error;
1542: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
1543: p_count => x_msg_count,
1544: p_data => x_msg_data);
1545:
1546: IF l_DEBUG in ('Y', 'C') THEN
1548: END IF;
1549:
1550: WHEN OTHERS THEN
1551: ROLLBACK TO update_bank_branch;
1552: x_return_status := fnd_api.g_ret_sts_unexp_error;
1553: fnd_message.set_name('CE', 'CE_API_OTHERS_EXCEP');
1554: fnd_message.set_token('ERROR',SQLERRM);
1555: fnd_msg_pub.add;
1556: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
1552: x_return_status := fnd_api.g_ret_sts_unexp_error;
1553: fnd_message.set_name('CE', 'CE_API_OTHERS_EXCEP');
1554: fnd_message.set_token('ERROR',SQLERRM);
1555: fnd_msg_pub.add;
1556: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
1557: p_count => x_msg_count,
1558: p_data => x_msg_data);
1559:
1560: IF l_DEBUG in ('Y', 'C') THEN
1575: | |
1576: | ARGUMENTS |
1577: | IN: |
1578: | p_init_msg_list Initialize message stack if it is set to |
1579: | FND_API.G_TRUE. Default is fnd_api.g_false
1580: | p_branch_id Party ID of the branch to be inactivated.|
1581: | p_end_date Inactive date of the bank branch. |
1582: | IN/OUT: |
1583: | p_object_version_number Current object version number for the |
1584: | code assignment of the bank institution|
1585: | type for the bank branch. |
1586: | OUT: |
1587: | x_return_status Return status after the call. The status can |
1588: | be FND_API.G_RET_STS_SUCCESS (success), |
1589: | fnd_api.g_ret_sts_error (error), |
1590: | fnd_api.g_ret_sts_unexp_error (unexpected |
1591: | error). |
1592: | x_msg_count Number of messages in message stack. |
1585: | type for the bank branch. |
1586: | OUT: |
1587: | x_return_status Return status after the call. The status can |
1588: | be FND_API.G_RET_STS_SUCCESS (success), |
1589: | fnd_api.g_ret_sts_error (error), |
1590: | fnd_api.g_ret_sts_unexp_error (unexpected |
1591: | error). |
1592: | x_msg_count Number of messages in message stack. |
1593: | x_msg_data Message text if x_msg_count is 1. |
1586: | OUT: |
1587: | x_return_status Return status after the call. The status can |
1588: | be FND_API.G_RET_STS_SUCCESS (success), |
1589: | fnd_api.g_ret_sts_error (error), |
1590: | fnd_api.g_ret_sts_unexp_error (unexpected |
1591: | error). |
1592: | x_msg_count Number of messages in message stack. |
1593: | x_msg_data Message text if x_msg_count is 1. |
1594: | MODIFICATION HISTORY |
1596: | 20-May-2011 vnetan 12557352: Bug fix for end-dating |
1597: | internal and external bank accounts |
1598: +=======================================================================*/
1599: PROCEDURE set_bank_branch_end_date (
1600: p_init_msg_list IN VARCHAR2:= fnd_api.g_false,
1601: p_branch_id IN NUMBER,
1602: p_end_date IN DATE,
1603: p_object_version_number IN OUT NOCOPY NUMBER,
1604: x_return_status OUT NOCOPY VARCHAR2,
1680: cep_standard.debug('>>CE_EXT_BANK_ACCT_PUB.set_bank_branch_end_date.');
1681: END IF;
1682:
1683: -- initialize message list
1684: IF fnd_api.to_boolean(p_init_msg_list) THEN
1685: fnd_msg_pub.initialize;
1686: END IF;
1687:
1688: -- initialize API return status to success.
1685: fnd_msg_pub.initialize;
1686: END IF;
1687:
1688: -- initialize API return status to success.
1689: x_return_status := fnd_api.g_ret_sts_success;
1690:
1691: -- first check all required params
1692: -- 12557352: Modified check by calling check_mandatory_param
1693: check_mandatory_param('p_branch_id',p_branch_id);
1703: FETCH c_branch_end INTO l_branch_end;
1704: IF c_branch_end%NOTFOUND THEN
1705: fnd_message.set_name('CE', 'CE_API_NO_BRANCH');
1706: fnd_msg_pub.add;
1707: x_return_status := fnd_api.g_ret_sts_error;
1708: RAISE fnd_api.g_exc_error;
1709: END IF;
1710: CLOSE c_branch_end;
1711:
1704: IF c_branch_end%NOTFOUND THEN
1705: fnd_message.set_name('CE', 'CE_API_NO_BRANCH');
1706: fnd_msg_pub.add;
1707: x_return_status := fnd_api.g_ret_sts_error;
1708: RAISE fnd_api.g_exc_error;
1709: END IF;
1710: CLOSE c_branch_end;
1711:
1712: -- find bank_id of this branch's bank
1714: FETCH c_bank_id INTO l_bank_id;
1715: IF c_bank_id%NOTFOUND THEN
1716: fnd_message.set_name('CE', 'CE_API_NO_BRANCH');
1717: fnd_msg_pub.add;
1718: x_return_status := fnd_api.g_ret_sts_error;
1719: RAISE fnd_api.g_exc_error;
1720: END IF;
1721: CLOSE c_bank_id;
1722:
1715: IF c_bank_id%NOTFOUND THEN
1716: fnd_message.set_name('CE', 'CE_API_NO_BRANCH');
1717: fnd_msg_pub.add;
1718: x_return_status := fnd_api.g_ret_sts_error;
1719: RAISE fnd_api.g_exc_error;
1720: END IF;
1721: CLOSE c_bank_id;
1722:
1723: -- bank's end date
1725: FETCH c_bank INTO l_bank_end, l_bank_ovn;
1726: IF c_bank%NOTFOUND THEN
1727: fnd_message.set_name('CE', 'CE_API_NO_BANK');
1728: fnd_msg_pub.add;
1729: x_return_status := fnd_api.g_ret_sts_error;
1730: RAISE fnd_api.g_exc_error;
1731: END IF;
1732: CLOSE c_bank;
1733:
1726: IF c_bank%NOTFOUND THEN
1727: fnd_message.set_name('CE', 'CE_API_NO_BANK');
1728: fnd_msg_pub.add;
1729: x_return_status := fnd_api.g_ret_sts_error;
1730: RAISE fnd_api.g_exc_error;
1731: END IF;
1732: CLOSE c_bank;
1733:
1734: IF (p_end_date IS NOT NULL AND p_end_date > NVL(l_bank_end, p_end_date))
1734: IF (p_end_date IS NOT NULL AND p_end_date > NVL(l_bank_end, p_end_date))
1735: OR (p_end_date IS NULL AND l_bank_end IS NOT NULL)
1736: THEN
1737: set_bank_end_date (
1738: p_init_msg_list => fnd_api.g_false,
1739: p_bank_id => l_bank_id,
1740: p_end_date => p_end_date,
1741: p_object_version_number => l_bank_ovn,
1742: x_return_status => x_return_status,
1742: x_return_status => x_return_status,
1743: x_msg_count => x_msg_count,
1744: x_msg_data => x_msg_data);
1745:
1746: IF x_return_status <> fnd_api.g_ret_sts_success THEN
1747: RAISE fnd_api.g_exc_error;
1748: END IF;
1749: END IF;
1750:
1743: x_msg_count => x_msg_count,
1744: x_msg_data => x_msg_data);
1745:
1746: IF x_return_status <> fnd_api.g_ret_sts_success THEN
1747: RAISE fnd_api.g_exc_error;
1748: END IF;
1749: END IF;
1750:
1751: -- if the new end date is earlier than the old branch end date
1760: l_ext_account_ovn := ext_acct_rec.object_version_number;
1761:
1762: iby_ext_bankacct_pub.set_ext_bank_acct_dates (
1763: p_api_version => 1.0,
1764: p_init_msg_list => fnd_api.g_false,
1765: p_acct_id => ext_acct_rec.ext_bank_account_id,
1766: p_start_date => ext_acct_rec.start_date,
1767: p_end_date => p_end_date,
1768: p_object_version_number => l_ext_account_ovn,
1770: x_msg_count => x_msg_count,
1771: x_msg_data => x_msg_data,
1772: x_response => l_response);
1773:
1774: IF x_return_status <> fnd_api.g_ret_sts_success THEN
1775: RAISE fnd_api.g_exc_error;
1776: END IF;
1777:
1778: l_ext_account_ovn := NULL;
1771: x_msg_data => x_msg_data,
1772: x_response => l_response);
1773:
1774: IF x_return_status <> fnd_api.g_ret_sts_success THEN
1775: RAISE fnd_api.g_exc_error;
1776: END IF;
1777:
1778: l_ext_account_ovn := NULL;
1779:
1787: THEN
1788: l_int_account_ovn := int_acct_rec.object_version_number;
1789:
1790: set_bank_acct_end_date (
1791: p_init_msg_list => fnd_api.g_false,
1792: p_bank_acct_id => int_acct_rec.bank_account_id,
1793: p_end_date => p_end_date,
1794: p_object_version_number => l_int_account_ovn,
1795: x_return_status => x_return_status,
1795: x_return_status => x_return_status,
1796: x_msg_count => x_msg_count,
1797: x_msg_data => x_msg_data);
1798:
1799: IF x_return_status <> fnd_api.g_ret_sts_success THEN
1800: RAISE fnd_api.g_exc_error;
1801: END IF;
1802:
1803: l_int_account_ovn := NULL;
1796: x_msg_count => x_msg_count,
1797: x_msg_data => x_msg_data);
1798:
1799: IF x_return_status <> fnd_api.g_ret_sts_success THEN
1800: RAISE fnd_api.g_exc_error;
1801: END IF;
1802:
1803: l_int_account_ovn := NULL;
1804:
1815: FETCH c_branch_party_ovn INTO l_branch_party_ovn;
1816: IF c_branch_party_ovn%NOTFOUND THEN
1817: fnd_message.set_name('CE', 'CE_API_NO_BRANCH');
1818: fnd_msg_pub.add;
1819: x_return_status := fnd_api.g_ret_sts_error;
1820: CLOSE c_branch_party_ovn;
1821: RAISE fnd_api.g_exc_error;
1822: END IF;
1823: CLOSE c_branch_party_ovn;
1817: fnd_message.set_name('CE', 'CE_API_NO_BRANCH');
1818: fnd_msg_pub.add;
1819: x_return_status := fnd_api.g_ret_sts_error;
1820: CLOSE c_branch_party_ovn;
1821: RAISE fnd_api.g_exc_error;
1822: END IF;
1823: CLOSE c_branch_party_ovn;
1824:
1825: OPEN c_rfc_ovn;
1829: END IF;
1830: CLOSE c_rfc_ovn;
1831:
1832: HZ_BANK_PUB.update_bank_branch(
1833: p_init_msg_list => fnd_api.g_false,
1834: p_bank_rec => l_branch_rec,
1835: p_bank_party_id => NULL,
1836: p_relationship_id => l_rel_id,
1837: p_pobject_version_number => l_branch_party_ovn,
1843: x_return_status => x_return_status,
1844: x_msg_count => x_msg_count,
1845: x_msg_data => x_msg_data);
1846:
1847: IF x_return_status <> fnd_api.g_ret_sts_success THEN
1848: RAISE fnd_api.g_exc_error;
1849: END IF;
1850:
1851: -- get message count and if count is 1, get message info.
1844: x_msg_count => x_msg_count,
1845: x_msg_data => x_msg_data);
1846:
1847: IF x_return_status <> fnd_api.g_ret_sts_success THEN
1848: RAISE fnd_api.g_exc_error;
1849: END IF;
1850:
1851: -- get message count and if count is 1, get message info.
1852: fnd_msg_pub.count_and_get(
1849: END IF;
1850:
1851: -- get message count and if count is 1, get message info.
1852: fnd_msg_pub.count_and_get(
1853: p_encoded => fnd_api.g_false,
1854: p_count => x_msg_count,
1855: p_data => x_msg_data);
1856:
1857: IF l_DEBUG in ('Y', 'C') THEN
1858: cep_standard.debug('<
1860:
1861: EXCEPTION
1862: WHEN fnd_api.g_exc_error THEN
1863: ROLLBACK TO set_bank_branch_end_date;
1864: x_return_status := fnd_api.g_ret_sts_error;
1865: fnd_msg_pub.count_and_get(
1866: p_encoded => fnd_api.g_false,
1860:
1861: EXCEPTION
1862: WHEN fnd_api.g_exc_error THEN
1863: ROLLBACK TO set_bank_branch_end_date;
1864: x_return_status := fnd_api.g_ret_sts_error;
1865: fnd_msg_pub.count_and_get(
1866: p_encoded => fnd_api.g_false,
1867: p_count => x_msg_count,
1868: p_data => x_msg_data);
1862: WHEN fnd_api.g_exc_error THEN
1863: ROLLBACK TO set_bank_branch_end_date;
1864: x_return_status := fnd_api.g_ret_sts_error;
1865: fnd_msg_pub.count_and_get(
1866: p_encoded => fnd_api.g_false,
1867: p_count => x_msg_count,
1868: p_data => x_msg_data);
1869:
1870: IF l_DEBUG in ('Y', 'C') THEN
1870: IF l_DEBUG in ('Y', 'C') THEN
1871: cep_standard.debug_msg_stack(x_msg_count, x_msg_data);
1872: END IF;
1873:
1874: WHEN fnd_api.g_exc_unexpected_error THEN
1875: ROLLBACK TO set_bank_branch_end_date;
1876: x_return_status := fnd_api.g_ret_sts_unexp_error;
1877: fnd_msg_pub.count_and_get(
1878: p_encoded => fnd_api.g_false,
1872: END IF;
1873:
1874: WHEN fnd_api.g_exc_unexpected_error THEN
1875: ROLLBACK TO set_bank_branch_end_date;
1876: x_return_status := fnd_api.g_ret_sts_unexp_error;
1877: fnd_msg_pub.count_and_get(
1878: p_encoded => fnd_api.g_false,
1879: p_count => x_msg_count,
1880: p_data => x_msg_data);
1874: WHEN fnd_api.g_exc_unexpected_error THEN
1875: ROLLBACK TO set_bank_branch_end_date;
1876: x_return_status := fnd_api.g_ret_sts_unexp_error;
1877: fnd_msg_pub.count_and_get(
1878: p_encoded => fnd_api.g_false,
1879: p_count => x_msg_count,
1880: p_data => x_msg_data);
1881:
1882: IF l_DEBUG in ('Y', 'C') THEN
1884: END IF;
1885:
1886: WHEN OTHERS THEN
1887: ROLLBACK TO set_bank_branch_end_date;
1888: x_return_status := fnd_api.g_ret_sts_unexp_error;
1889: fnd_message.set_name('CE', 'CE_API_OTHERS_EXCEP');
1890: fnd_message.set_token('ERROR',SQLERRM);
1891: fnd_msg_pub.add;
1892: fnd_msg_pub.count_and_get(
1889: fnd_message.set_name('CE', 'CE_API_OTHERS_EXCEP');
1890: fnd_message.set_token('ERROR',SQLERRM);
1891: fnd_msg_pub.add;
1892: fnd_msg_pub.count_and_get(
1893: p_encoded => fnd_api.g_false,
1894: p_count => x_msg_count,
1895: p_data => x_msg_data);
1896:
1897: IF l_DEBUG in ('Y', 'C') THEN
2021: | |
2022: | ARGUMENTS |
2023: | IN: |
2024: | p_init_msg_list Initialize message stack if it is set to |
2025: | FND_API.G_TRUE. Default is fnd_api.g_false |
2026: | p_acct_rec Bank account record. |
2027: | IN/OUT: |
2028: | OUT: |
2029: | x_acct_id Bank account ID. |
2027: | IN/OUT: |
2028: | OUT: |
2029: | x_acct_id Bank account ID. |
2030: | x_return_status Return status after the call. The status can |
2031: | be FND_API.G_RET_STS_SUCCESS (success), |
2032: | fnd_api.g_ret_sts_error (error), |
2033: | fnd_api.g_ret_sts_unexp_error (unexpected |
2034: | error). |
2035: | x_msg_count Number of messages in message stack. |
2028: | OUT: |
2029: | x_acct_id Bank account ID. |
2030: | x_return_status Return status after the call. The status can |
2031: | be FND_API.G_RET_STS_SUCCESS (success), |
2032: | fnd_api.g_ret_sts_error (error), |
2033: | fnd_api.g_ret_sts_unexp_error (unexpected |
2034: | error). |
2035: | x_msg_count Number of messages in message stack. |
2036: | x_msg_data Message text if x_msg_count is 1. |
2029: | x_acct_id Bank account ID. |
2030: | x_return_status Return status after the call. The status can |
2031: | be FND_API.G_RET_STS_SUCCESS (success), |
2032: | fnd_api.g_ret_sts_error (error), |
2033: | fnd_api.g_ret_sts_unexp_error (unexpected |
2034: | error). |
2035: | x_msg_count Number of messages in message stack. |
2036: | x_msg_data Message text if x_msg_count is 1. |
2037: | MODIFICATION HISTORY |
2037: | MODIFICATION HISTORY |
2038: | 25-AUG-2004 Xin Wang Created. |
2039: +=======================================================================*/
2040: PROCEDURE create_bank_acct (
2041: p_init_msg_list IN VARCHAR2:= fnd_api.g_false,
2042: p_acct_rec IN BankAcct_rec_type,
2043: x_acct_id OUT NOCOPY NUMBER,
2044: x_return_status OUT NOCOPY VARCHAR2,
2045: x_msg_count OUT NOCOPY NUMBER,
2096: cep_standard.debug('>>CE_BANK_PUB.create_bank_acct.');
2097: END IF;
2098:
2099: -- initialize message list
2100: IF fnd_api.to_boolean(p_init_msg_list) THEN
2101: fnd_msg_pub.initialize;
2102: END IF;
2103:
2104: -- initialize API return status to success.
2101: fnd_msg_pub.initialize;
2102: END IF;
2103:
2104: -- initialize API return status to success.
2105: x_return_status := fnd_api.g_ret_sts_success;
2106:
2107: -- first check all required params
2108: -- 12557352: Modified check by calling check_mandatory_param
2109: check_mandatory_param('p_acct_rec.branch_id',p_acct_rec.branch_id);
2116: IF p_acct_rec.currency IS NOT NULL THEN
2117: CE_BANK_AND_ACCOUNT_VALIDATION.validate_currency(p_acct_rec.currency, x_return_status);
2118:
2119: -- raise an exception if the validation is unsuccessful
2120: IF x_return_status <> fnd_api.g_ret_sts_success THEN
2121: RAISE fnd_api.g_exc_error;
2122: END IF;
2123: END IF;
2124:
2117: CE_BANK_AND_ACCOUNT_VALIDATION.validate_currency(p_acct_rec.currency, x_return_status);
2118:
2119: -- raise an exception if the validation is unsuccessful
2120: IF x_return_status <> fnd_api.g_ret_sts_success THEN
2121: RAISE fnd_api.g_exc_error;
2122: END IF;
2123: END IF;
2124:
2125: -- Bug 10183698
2127: /* CE_BANK_AND_ACCOUNT_VALIDATION.validate_account_name(p_acct_rec.branch_id, p_acct_rec.bank_account_name,
2128: null, x_return_status);
2129:
2130: -- raise an exception if the validation is unsuccessful
2131: IF x_return_status <> fnd_api.g_ret_sts_success THEN
2132: RAISE fnd_api.g_exc_error;
2133: END IF; */
2134:
2135:
2128: null, x_return_status);
2129:
2130: -- raise an exception if the validation is unsuccessful
2131: IF x_return_status <> fnd_api.g_ret_sts_success THEN
2132: RAISE fnd_api.g_exc_error;
2133: END IF; */
2134:
2135:
2136: -- validate iban
2137: IF p_acct_rec.iban IS NOT NULL THEN
2138: CE_BANK_AND_ACCOUNT_VALIDATION.validate_IBAN(p_acct_rec.iban, l_iban, x_return_status);
2139:
2140: -- raise an exception if the validation is unsuccessful
2141: IF x_return_status <> fnd_api.g_ret_sts_success THEN
2142: RAISE fnd_api.g_exc_error;
2143: END IF;
2144: END IF;
2145:
2138: CE_BANK_AND_ACCOUNT_VALIDATION.validate_IBAN(p_acct_rec.iban, l_iban, x_return_status);
2139:
2140: -- raise an exception if the validation is unsuccessful
2141: IF x_return_status <> fnd_api.g_ret_sts_success THEN
2142: RAISE fnd_api.g_exc_error;
2143: END IF;
2144: END IF;
2145:
2146: -- validate agency_location_code
2145:
2146: -- validate agency_location_code
2147: IF p_acct_rec.agency_location_code IS NOT NULL THEN
2148: CE_BANK_AND_ACCOUNT_VALIDATION.validate_alc(p_acct_rec.agency_location_code,
2149: FND_API.G_FALSE,
2150: x_msg_count,
2151: x_msg_data,
2152: l_alc,
2153: x_return_status);
2152: l_alc,
2153: x_return_status);
2154:
2155: -- raise an exception if the validation is unsuccessful
2156: IF x_return_status <> fnd_api.g_ret_sts_success THEN
2157: RAISE fnd_api.g_exc_error;
2158: END IF;
2159: END IF;
2160:
2153: x_return_status);
2154:
2155: -- raise an exception if the validation is unsuccessful
2156: IF x_return_status <> fnd_api.g_ret_sts_success THEN
2157: RAISE fnd_api.g_exc_error;
2158: END IF;
2159: END IF;
2160:
2161: -- find bank info
2162: IF p_acct_rec.branch_id IS NOT NULL THEN
2163: find_bank_info(p_acct_rec.branch_id, x_return_status, l_bank_id, l_country, l_bank_name, l_bank_number);
2164:
2165: -- raise an exception if bank is not found
2166: IF x_return_status <> fnd_api.g_ret_sts_success THEN
2167: RAISE fnd_api.g_exc_error;
2168: END IF;
2169:
2170: -- find branch number
2163: find_bank_info(p_acct_rec.branch_id, x_return_status, l_bank_id, l_country, l_bank_name, l_bank_number);
2164:
2165: -- raise an exception if bank is not found
2166: IF x_return_status <> fnd_api.g_ret_sts_success THEN
2167: RAISE fnd_api.g_exc_error;
2168: END IF;
2169:
2170: -- find branch number
2171: OPEN c_branch;
2172: FETCH c_branch INTO l_branch_number;
2173: IF c_branch%NOTFOUND THEN
2174: fnd_message.set_name('CE', 'CE_API_NO_BRANCH');
2175: fnd_msg_pub.add;
2176: x_return_status := fnd_api.g_ret_sts_error;
2177: RAISE fnd_api.g_exc_error;
2178: END IF;
2179: CLOSE c_branch;
2180: END IF;
2173: IF c_branch%NOTFOUND THEN
2174: fnd_message.set_name('CE', 'CE_API_NO_BRANCH');
2175: fnd_msg_pub.add;
2176: x_return_status := fnd_api.g_ret_sts_error;
2177: RAISE fnd_api.g_exc_error;
2178: END IF;
2179: CLOSE c_branch;
2180: END IF;
2181:
2186: p_acct_rec.check_digits,
2187: l_bank_number,
2188: l_branch_number,
2189: p_acct_rec.bank_account_num,
2190: FND_API.G_FALSE,
2191: x_msg_count,
2192: x_msg_data,
2193: x_return_status,
2194: 'INTERNAL');
2204: p_acct_rec.acct_type,
2205: p_acct_rec.acct_suffix,
2206: p_acct_rec.secondary_account_reference,
2207: p_acct_rec.bank_account_name,
2208: FND_API.G_FALSE,
2209: x_msg_count,
2210: x_msg_data,
2211: l_account_number,
2212: x_return_status,
2215: X_ELECTRONIC_ACCT_NUM
2216: );
2217:
2218: -- raise an exception if the validation fails
2219: IF x_return_status <> fnd_api.g_ret_sts_success THEN
2220: RAISE fnd_api.g_exc_error;
2221: END IF;
2222: ELSE -- set the account number for subsidiary accounts
2223: l_account_number := p_acct_rec.bank_account_num;
2216: );
2217:
2218: -- raise an exception if the validation fails
2219: IF x_return_status <> fnd_api.g_ret_sts_success THEN
2220: RAISE fnd_api.g_exc_error;
2221: END IF;
2222: ELSE -- set the account number for subsidiary accounts
2223: l_account_number := p_acct_rec.bank_account_num;
2224: END IF; -- subsidiary accounts
2487: x_xtr_api_msg_data, -- x_msg_data OUT
2488: l_iban
2489: );
2490: cep_standard.debug('Call to XTR API XTR_REPLICATE_BANK_ACCOUNTS_P.REPLICATE_BANK_ACCOUNTS Sucessfully Completed...');
2491: if x_xtr_api_return_status<>FND_API.G_RET_STS_SUCCESS then
2492: cep_standard.debug('Call to XTR API XTR_REPLICATE_BANK_ACCOUNTS_P.REPLICATE_BANK_ACCOUNTS has failed...');
2493: RAISE fnd_api.g_exc_error;
2494: end if;
2495: end if;
2489: );
2490: cep_standard.debug('Call to XTR API XTR_REPLICATE_BANK_ACCOUNTS_P.REPLICATE_BANK_ACCOUNTS Sucessfully Completed...');
2491: if x_xtr_api_return_status<>FND_API.G_RET_STS_SUCCESS then
2492: cep_standard.debug('Call to XTR API XTR_REPLICATE_BANK_ACCOUNTS_P.REPLICATE_BANK_ACCOUNTS has failed...');
2493: RAISE fnd_api.g_exc_error;
2494: end if;
2495: end if;
2496: -- Bug 14350260 End
2497:
2495: end if;
2496: -- Bug 14350260 End
2497:
2498: -- get message count and if count is 1, get message info.
2499: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
2500: p_count => x_msg_count,
2501: p_data => x_msg_data);
2502:
2503: IF l_DEBUG in ('Y', 'C') THEN
2504: cep_standard.debug('<
2506:
2507: EXCEPTION
2508: WHEN fnd_api.g_exc_error THEN
2509: ROLLBACK TO create_bank_acct;
2510: x_return_status := fnd_api.g_ret_sts_error;
2511: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
2512: p_count => x_msg_count,
2506:
2507: EXCEPTION
2508: WHEN fnd_api.g_exc_error THEN
2509: ROLLBACK TO create_bank_acct;
2510: x_return_status := fnd_api.g_ret_sts_error;
2511: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
2512: p_count => x_msg_count,
2513: p_data => x_msg_data);
2514:
2507: EXCEPTION
2508: WHEN fnd_api.g_exc_error THEN
2509: ROLLBACK TO create_bank_acct;
2510: x_return_status := fnd_api.g_ret_sts_error;
2511: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
2512: p_count => x_msg_count,
2513: p_data => x_msg_data);
2514:
2515: IF l_DEBUG in ('Y', 'C') THEN
2515: IF l_DEBUG in ('Y', 'C') THEN
2516: cep_standard.debug_msg_stack(x_msg_count, x_msg_data);
2517: END IF;
2518:
2519: WHEN fnd_api.g_exc_unexpected_error THEN
2520: ROLLBACK TO create_bank_acct;
2521: x_return_status := fnd_api.g_ret_sts_unexp_error;
2522: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
2523: p_count => x_msg_count,
2517: END IF;
2518:
2519: WHEN fnd_api.g_exc_unexpected_error THEN
2520: ROLLBACK TO create_bank_acct;
2521: x_return_status := fnd_api.g_ret_sts_unexp_error;
2522: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
2523: p_count => x_msg_count,
2524: p_data => x_msg_data);
2525:
2518:
2519: WHEN fnd_api.g_exc_unexpected_error THEN
2520: ROLLBACK TO create_bank_acct;
2521: x_return_status := fnd_api.g_ret_sts_unexp_error;
2522: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
2523: p_count => x_msg_count,
2524: p_data => x_msg_data);
2525:
2526: IF l_DEBUG in ('Y', 'C') THEN
2528: END IF;
2529:
2530: WHEN OTHERS THEN
2531: ROLLBACK TO create_bank_acct;
2532: x_return_status := fnd_api.g_ret_sts_unexp_error;
2533: fnd_message.set_name('CE', 'CE_API_OTHERS_EXCEP');
2534: fnd_message.set_token('ERROR',SQLERRM);
2535: fnd_msg_pub.add;
2536: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
2532: x_return_status := fnd_api.g_ret_sts_unexp_error;
2533: fnd_message.set_name('CE', 'CE_API_OTHERS_EXCEP');
2534: fnd_message.set_token('ERROR',SQLERRM);
2535: fnd_msg_pub.add;
2536: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
2537: p_count => x_msg_count,
2538: p_data => x_msg_data);
2539:
2540: IF l_DEBUG in ('Y', 'C') THEN
2594: | |
2595: | ARGUMENTS |
2596: | IN: |
2597: | p_init_msg_list Initialize message stack if it is set to |
2598: | FND_API.G_TRUE. Default is fnd_api.g_false
2599: | p_acct_rec External bank account record. |
2600: | IN/OUT: |
2601: | p_object_version_number Current object version number for the |
2602: | bank account. |
2601: | p_object_version_number Current object version number for the |
2602: | bank account. |
2603: | OUT: |
2604: | x_return_status Return status after the call. The status can |
2605: | be FND_API.G_RET_STS_SUCCESS (success), |
2606: | fnd_api.g_ret_sts_error (error), |
2607: | fnd_api.g_ret_sts_unexp_error (unexpected |
2608: | error). |
2609: | x_msg_count Number of messages in message stack. |
2602: | bank account. |
2603: | OUT: |
2604: | x_return_status Return status after the call. The status can |
2605: | be FND_API.G_RET_STS_SUCCESS (success), |
2606: | fnd_api.g_ret_sts_error (error), |
2607: | fnd_api.g_ret_sts_unexp_error (unexpected |
2608: | error). |
2609: | x_msg_count Number of messages in message stack. |
2610: | x_msg_data Message text if x_msg_count is 1. |
2603: | OUT: |
2604: | x_return_status Return status after the call. The status can |
2605: | be FND_API.G_RET_STS_SUCCESS (success), |
2606: | fnd_api.g_ret_sts_error (error), |
2607: | fnd_api.g_ret_sts_unexp_error (unexpected |
2608: | error). |
2609: | x_msg_count Number of messages in message stack. |
2610: | x_msg_data Message text if x_msg_count is 1. |
2611: | MODIFICATION HISTORY |
2614: | #8407297 |
2615: | |
2616: +=======================================================================*/
2617: PROCEDURE update_bank_acct (
2618: p_init_msg_list IN VARCHAR2:= fnd_api.g_false,
2619: p_acct_rec IN BankAcct_rec_type,
2620: p_object_version_number IN OUT NOCOPY NUMBER,
2621: x_return_status OUT NOCOPY VARCHAR2,
2622: x_msg_count OUT NOCOPY NUMBER,
2672: cep_standard.debug('>>CE_BANK_PUB.update_bank_acct.');
2673: END IF;
2674:
2675: -- initialize message list
2676: IF fnd_api.to_boolean(p_init_msg_list) THEN
2677: fnd_msg_pub.initialize;
2678: END IF;
2679:
2680: -- initialize API return status to success.
2677: fnd_msg_pub.initialize;
2678: END IF;
2679:
2680: -- initialize API return status to success.
2681: x_return_status := fnd_api.g_ret_sts_success;
2682:
2683: -- first check all required params
2684: -- 12557352: Modified check by calling check_mandatory_param
2685: check_mandatory_param('p_acct_rec.bank_account_id',p_acct_rec.bank_account_id);
2693: FETCH c_bank_account INTO l_bank_acct_rec_master;
2694: IF c_bank_account%NOTFOUND THEN
2695: fnd_message.set_name('CE', 'CE_API_NO_ACCOUNT');
2696: fnd_msg_pub.add;
2697: x_return_status := fnd_api.g_ret_sts_error;
2698: CLOSE c_bank_account;
2699: RAISE fnd_api.g_exc_error;
2700: END IF;
2701: CLOSE c_bank_account;
2695: fnd_message.set_name('CE', 'CE_API_NO_ACCOUNT');
2696: fnd_msg_pub.add;
2697: x_return_status := fnd_api.g_ret_sts_error;
2698: CLOSE c_bank_account;
2699: RAISE fnd_api.g_exc_error;
2700: END IF;
2701: CLOSE c_bank_account;
2702:
2703:
2750: -- Validate Multi-Currency Allowed or not bug 8407297
2751: if l_currency_code <> l_bank_acct_rec_master.currency_code then
2752: fnd_message.set_name('CE', 'CE_BANK_MULTICURRENCY');
2753: fnd_msg_pub.add;
2754: x_return_status := fnd_api.g_ret_sts_error;
2755: RAISE fnd_api.g_exc_error;
2756: end if;
2757: end if;
2758:
2751: if l_currency_code <> l_bank_acct_rec_master.currency_code then
2752: fnd_message.set_name('CE', 'CE_BANK_MULTICURRENCY');
2753: fnd_msg_pub.add;
2754: x_return_status := fnd_api.g_ret_sts_error;
2755: RAISE fnd_api.g_exc_error;
2756: end if;
2757: end if;
2758:
2759:
2763: IF p_acct_rec.currency IS NOT NULL THEN
2764: CE_BANK_AND_ACCOUNT_VALIDATION.validate_currency(p_acct_rec.currency, x_return_status);
2765:
2766: -- raise an exception if the validation is unsuccessful
2767: IF x_return_status <> fnd_api.g_ret_sts_success THEN
2768: RAISE fnd_api.g_exc_error;
2769: END IF;
2770: END IF;
2771: */
2764: CE_BANK_AND_ACCOUNT_VALIDATION.validate_currency(p_acct_rec.currency, x_return_status);
2765:
2766: -- raise an exception if the validation is unsuccessful
2767: IF x_return_status <> fnd_api.g_ret_sts_success THEN
2768: RAISE fnd_api.g_exc_error;
2769: END IF;
2770: END IF;
2771: */
2772: -- validate account name
2774: FETCH c_branch_id INTO l_branch_id;
2775: IF c_branch_id%NOTFOUND THEN
2776: fnd_message.set_name('CE', 'CE_API_NO_ACCOUNT');
2777: fnd_msg_pub.add;
2778: x_return_status := fnd_api.g_ret_sts_error;
2779: CLOSE c_branch_id;
2780: RAISE fnd_api.g_exc_error;
2781: END IF;
2782: CLOSE c_branch_id;
2776: fnd_message.set_name('CE', 'CE_API_NO_ACCOUNT');
2777: fnd_msg_pub.add;
2778: x_return_status := fnd_api.g_ret_sts_error;
2779: CLOSE c_branch_id;
2780: RAISE fnd_api.g_exc_error;
2781: END IF;
2782: CLOSE c_branch_id;
2783: -- Bug 10261393
2784: /* CE_BANK_AND_ACCOUNT_VALIDATION.validate_account_name(l_branch_id, p_acct_rec.bank_account_name,
2784: /* CE_BANK_AND_ACCOUNT_VALIDATION.validate_account_name(l_branch_id, p_acct_rec.bank_account_name,
2785: p_acct_rec.bank_account_id, x_return_status);
2786:
2787: -- raise an exception if the validation is unsuccessful
2788: IF x_return_status <> fnd_api.g_ret_sts_success THEN
2789: RAISE fnd_api.g_exc_error;
2790: END IF; */
2791:
2792: -- validate iban
2785: p_acct_rec.bank_account_id, x_return_status);
2786:
2787: -- raise an exception if the validation is unsuccessful
2788: IF x_return_status <> fnd_api.g_ret_sts_success THEN
2789: RAISE fnd_api.g_exc_error;
2790: END IF; */
2791:
2792: -- validate iban
2793: IF p_acct_rec.iban IS NOT NULL THEN
2793: IF p_acct_rec.iban IS NOT NULL THEN
2794: CE_BANK_AND_ACCOUNT_VALIDATION.validate_IBAN(p_acct_rec.iban, l_iban, x_return_status);
2795:
2796: -- raise an exception if the validation is unsuccessful
2797: IF x_return_status <> fnd_api.g_ret_sts_success THEN
2798: RAISE fnd_api.g_exc_error;
2799: END IF;
2800: END IF;
2801:
2794: CE_BANK_AND_ACCOUNT_VALIDATION.validate_IBAN(p_acct_rec.iban, l_iban, x_return_status);
2795:
2796: -- raise an exception if the validation is unsuccessful
2797: IF x_return_status <> fnd_api.g_ret_sts_success THEN
2798: RAISE fnd_api.g_exc_error;
2799: END IF;
2800: END IF;
2801:
2802: -- validate agency_location_code
2801:
2802: -- validate agency_location_code
2803: IF p_acct_rec.agency_location_code IS NOT NULL THEN
2804: CE_BANK_AND_ACCOUNT_VALIDATION.validate_alc(p_acct_rec.agency_location_code,
2805: FND_API.G_FALSE,
2806: x_msg_count,
2807: x_msg_data,
2808: l_alc,
2809: x_return_status);
2808: l_alc,
2809: x_return_status);
2810:
2811: -- raise an exception if the validation is unsuccessful
2812: IF x_return_status <> fnd_api.g_ret_sts_success THEN
2813: RAISE fnd_api.g_exc_error;
2814: END IF;
2815: END IF;
2816:
2809: x_return_status);
2810:
2811: -- raise an exception if the validation is unsuccessful
2812: IF x_return_status <> fnd_api.g_ret_sts_success THEN
2813: RAISE fnd_api.g_exc_error;
2814: END IF;
2815: END IF;
2816:
2817: -- find bank info
2817: -- find bank info
2818: IF l_branch_id IS NOT NULL THEN
2819: find_bank_info(l_branch_id, x_return_status, l_bank_id, l_country, l_bank_name, l_bank_number);
2820: -- raise an exception if bank is not found
2821: IF x_return_status <> fnd_api.g_ret_sts_success THEN
2822: RAISE fnd_api.g_exc_error;
2823: END IF;
2824:
2825: -- find branch number
2818: IF l_branch_id IS NOT NULL THEN
2819: find_bank_info(l_branch_id, x_return_status, l_bank_id, l_country, l_bank_name, l_bank_number);
2820: -- raise an exception if bank is not found
2821: IF x_return_status <> fnd_api.g_ret_sts_success THEN
2822: RAISE fnd_api.g_exc_error;
2823: END IF;
2824:
2825: -- find branch number
2826: OPEN c_branch_num(l_branch_id);
2827: FETCH c_branch_num INTO l_branch_number;
2828: IF c_branch_num%NOTFOUND THEN
2829: fnd_message.set_name('CE', 'CE_API_NO_BRANCH');
2830: fnd_msg_pub.add;
2831: x_return_status := fnd_api.g_ret_sts_error;
2832: CLOSE c_branch_num;
2833: RAISE fnd_api.g_exc_error;
2834: END IF;
2835: CLOSE c_branch_num;
2829: fnd_message.set_name('CE', 'CE_API_NO_BRANCH');
2830: fnd_msg_pub.add;
2831: x_return_status := fnd_api.g_ret_sts_error;
2832: CLOSE c_branch_num;
2833: RAISE fnd_api.g_exc_error;
2834: END IF;
2835: CLOSE c_branch_num;
2836: END IF;
2837:
2842: p_acct_rec.check_digits,
2843: l_bank_number,
2844: l_branch_number,
2845: p_acct_rec.bank_account_num,
2846: FND_API.G_FALSE,
2847: x_msg_count,
2848: x_msg_data,
2849: x_return_status,
2850: 'INTERNAL');
2860: p_acct_rec.acct_type,
2861: p_acct_rec.acct_suffix,
2862: p_acct_rec.secondary_account_reference,
2863: p_acct_rec.bank_account_name,
2864: FND_API.G_FALSE,
2865: x_msg_count,
2866: x_msg_data,
2867: l_account_number,
2868: x_return_status,
2870: p_acct_rec.check_digits,
2871: X_ELECTRONIC_ACCT_NUM);
2872:
2873: -- raise an exception if the validation fails
2874: IF x_return_status <> fnd_api.g_ret_sts_success THEN
2875: RAISE fnd_api.g_exc_error;
2876: END IF;
2877: ELSE -- set the account number for subsidiary accounts
2878: l_account_number := p_acct_rec.bank_account_num;
2871: X_ELECTRONIC_ACCT_NUM);
2872:
2873: -- raise an exception if the validation fails
2874: IF x_return_status <> fnd_api.g_ret_sts_success THEN
2875: RAISE fnd_api.g_exc_error;
2876: END IF;
2877: ELSE -- set the account number for subsidiary accounts
2878: l_account_number := p_acct_rec.bank_account_num;
2879: END IF; -- subsidiary account
2883: FETCH c_ovn INTO l_old_ovn;
2884: IF c_ovn%NOTFOUND THEN
2885: fnd_message.set_name('CE', 'CE_API_NO_ACCOUNT');
2886: fnd_msg_pub.add;
2887: x_return_status := fnd_api.g_ret_sts_error;
2888: CLOSE c_ovn;
2889: RAISE fnd_api.g_exc_error;
2890: END IF;
2891: CLOSE c_ovn;
2885: fnd_message.set_name('CE', 'CE_API_NO_ACCOUNT');
2886: fnd_msg_pub.add;
2887: x_return_status := fnd_api.g_ret_sts_error;
2888: CLOSE c_ovn;
2889: RAISE fnd_api.g_exc_error;
2890: END IF;
2891: CLOSE c_ovn;
2892:
2893: IF l_old_ovn > p_object_version_number THEN
2893: IF l_old_ovn > p_object_version_number THEN
2894: fnd_message.set_name('CE', 'CE_API_RECORD_CHANGED');
2895: fnd_message.set_token('TABLE', 'CE_BANK_ACCOUNTS');
2896: fnd_msg_pub.add;
2897: x_return_status := fnd_api.g_ret_sts_error;
2898: RAISE fnd_api.g_exc_error;
2899: END IF;
2900:
2901: -- Bug 8407297 Get the Masked value of the Bank Account Number
2894: fnd_message.set_name('CE', 'CE_API_RECORD_CHANGED');
2895: fnd_message.set_token('TABLE', 'CE_BANK_ACCOUNTS');
2896: fnd_msg_pub.add;
2897: x_return_status := fnd_api.g_ret_sts_error;
2898: RAISE fnd_api.g_exc_error;
2899: END IF;
2900:
2901: -- Bug 8407297 Get the Masked value of the Bank Account Number
2902: if p_acct_rec.masked_account_num is null then
2988: WHERE bank_account_id = p_acct_rec.bank_account_id;
2989: IF (SQL%NOTFOUND) THEN
2990: fnd_message.set_name('CE', 'CE_API_NO_ACCOUNT');
2991: fnd_msg_pub.add;
2992: x_return_status := fnd_api.g_ret_sts_error;
2993: RAISE fnd_api.g_exc_error;
2994: END IF;
2995: p_object_version_number := l_old_ovn + 1;
2996:
2989: IF (SQL%NOTFOUND) THEN
2990: fnd_message.set_name('CE', 'CE_API_NO_ACCOUNT');
2991: fnd_msg_pub.add;
2992: x_return_status := fnd_api.g_ret_sts_error;
2993: RAISE fnd_api.g_exc_error;
2994: END IF;
2995: p_object_version_number := l_old_ovn + 1;
2996:
2997: -- get message count and if count is 1, get message info.
2994: END IF;
2995: p_object_version_number := l_old_ovn + 1;
2996:
2997: -- get message count and if count is 1, get message info.
2998: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
2999: p_count => x_msg_count,
3000: p_data => x_msg_data);
3001:
3002: IF l_DEBUG in ('Y', 'C') THEN
3003: cep_standard.debug('<
3005:
3006: EXCEPTION
3007: WHEN fnd_api.g_exc_error THEN
3008: ROLLBACK TO update_bank_acct;
3009: x_return_status := fnd_api.g_ret_sts_error;
3010: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
3011: p_count => x_msg_count,
3005:
3006: EXCEPTION
3007: WHEN fnd_api.g_exc_error THEN
3008: ROLLBACK TO update_bank_acct;
3009: x_return_status := fnd_api.g_ret_sts_error;
3010: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
3011: p_count => x_msg_count,
3012: p_data => x_msg_data);
3013:
3006: EXCEPTION
3007: WHEN fnd_api.g_exc_error THEN
3008: ROLLBACK TO update_bank_acct;
3009: x_return_status := fnd_api.g_ret_sts_error;
3010: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
3011: p_count => x_msg_count,
3012: p_data => x_msg_data);
3013:
3014: IF l_DEBUG in ('Y', 'C') THEN
3014: IF l_DEBUG in ('Y', 'C') THEN
3015: cep_standard.debug_msg_stack(x_msg_count, x_msg_data);
3016: END IF;
3017:
3018: WHEN fnd_api.g_exc_unexpected_error THEN
3019: ROLLBACK TO update_bank_acct;
3020: x_return_status := fnd_api.g_ret_sts_unexp_error;
3021: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
3022: p_count => x_msg_count,
3016: END IF;
3017:
3018: WHEN fnd_api.g_exc_unexpected_error THEN
3019: ROLLBACK TO update_bank_acct;
3020: x_return_status := fnd_api.g_ret_sts_unexp_error;
3021: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
3022: p_count => x_msg_count,
3023: p_data => x_msg_data);
3024:
3017:
3018: WHEN fnd_api.g_exc_unexpected_error THEN
3019: ROLLBACK TO update_bank_acct;
3020: x_return_status := fnd_api.g_ret_sts_unexp_error;
3021: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
3022: p_count => x_msg_count,
3023: p_data => x_msg_data);
3024:
3025: IF l_DEBUG in ('Y', 'C') THEN
3027: END IF;
3028:
3029: WHEN OTHERS THEN
3030: ROLLBACK TO udpate_bank_acct;
3031: x_return_status := fnd_api.g_ret_sts_unexp_error;
3032: fnd_message.set_name('CE', 'CE_API_OTHERS_EXCEP');
3033: fnd_message.set_token('ERROR',SQLERRM);
3034: fnd_msg_pub.add;
3035: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
3031: x_return_status := fnd_api.g_ret_sts_unexp_error;
3032: fnd_message.set_name('CE', 'CE_API_OTHERS_EXCEP');
3033: fnd_message.set_token('ERROR',SQLERRM);
3034: fnd_msg_pub.add;
3035: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
3036: p_count => x_msg_count,
3037: p_data => x_msg_data);
3038:
3039: IF l_DEBUG in ('Y', 'C') THEN
3043: END update_bank_acct;
3044:
3045:
3046: PROCEDURE create_bank_acct_use (
3047: p_init_msg_list IN VARCHAR2:= fnd_api.g_false,
3048: p_acct_use_rec IN BankAcct_use_rec_type,
3049: x_acct_use_id OUT NOCOPY NUMBER,
3050: x_return_status OUT NOCOPY VARCHAR2,
3051: x_msg_count OUT NOCOPY NUMBER,
3073: cep_standard.debug('>>CE_BANK_PUB.create_bank_acct_use.');
3074: END IF;
3075:
3076: -- initialize message list
3077: IF fnd_api.to_boolean(p_init_msg_list) THEN
3078: fnd_msg_pub.initialize;
3079: END IF;
3080:
3081: -- initialize API return status to success.
3078: fnd_msg_pub.initialize;
3079: END IF;
3080:
3081: -- initialize API return status to success.
3082: x_return_status := fnd_api.g_ret_sts_success;
3083:
3084: -- first check all required params
3085: -- 12557352: Modified check by calling check_mandatory_param
3086: check_mandatory_param('p_acct_use_rec.bank_account_id',p_acct_use_rec.bank_account_id);
3096: p_acct_use_rec.ar_use_enable_flag = 'Y') and
3097: p_acct_use_rec.asset_code_combination_id is null) THEN -- bug 7671686
3098: fnd_message.set_name('CE', 'CE_API_CASH_CCID_REQUIRED');
3099: fnd_msg_pub.add;
3100: x_return_status := fnd_api.g_ret_sts_error;
3101: RAISE fnd_api.g_exc_error;
3102: END IF;
3103:
3104: -- validate account use
3097: p_acct_use_rec.asset_code_combination_id is null) THEN -- bug 7671686
3098: fnd_message.set_name('CE', 'CE_API_CASH_CCID_REQUIRED');
3099: fnd_msg_pub.add;
3100: x_return_status := fnd_api.g_ret_sts_error;
3101: RAISE fnd_api.g_exc_error;
3102: END IF;
3103:
3104: -- validate account use
3105: CE_BANK_AND_ACCOUNT_VALIDATION.validate_account_use
3109: p_acct_use_rec.xtr_use_enable_flag,
3110: x_return_status);
3111:
3112: -- raise an exception if the validation is unsuccessful
3113: IF x_return_status <> fnd_api.g_ret_sts_success THEN
3114: RAISE fnd_api.g_exc_error;
3115: END IF;
3116:
3117: -- validate the combination of bank_account_id and org_id/legal_entity_id is unique
3110: x_return_status);
3111:
3112: -- raise an exception if the validation is unsuccessful
3113: IF x_return_status <> fnd_api.g_ret_sts_success THEN
3114: RAISE fnd_api.g_exc_error;
3115: END IF;
3116:
3117: -- validate the combination of bank_account_id and org_id/legal_entity_id is unique
3118: IF p_acct_use_rec.org_type = 'LE' THEN
3126: p_acct_use_rec.bank_account_id,
3127: null,
3128: x_return_status);
3129: -- raise an exception if the validation is unsuccessful
3130: IF x_return_status <> fnd_api.g_ret_sts_success THEN
3131: RAISE fnd_api.g_exc_error;
3132: END IF;
3133:
3134: -- validate the org type matches with the account use
3127: null,
3128: x_return_status);
3129: -- raise an exception if the validation is unsuccessful
3130: IF x_return_status <> fnd_api.g_ret_sts_success THEN
3131: RAISE fnd_api.g_exc_error;
3132: END IF;
3133:
3134: -- validate the org type matches with the account use
3135: CE_BANK_AND_ACCOUNT_VALIDATION.validate_account_access_org
3140: p_acct_use_rec.org_type,
3141: l_org_le_id,
3142: x_return_status);
3143: -- raise an exception if the validation is unsuccessful
3144: IF x_return_status <> fnd_api.g_ret_sts_success THEN
3145: RAISE fnd_api.g_exc_error;
3146: END IF;
3147:
3148: -- validate default settlement
3141: l_org_le_id,
3142: x_return_status);
3143: -- raise an exception if the validation is unsuccessful
3144: IF x_return_status <> fnd_api.g_ret_sts_success THEN
3145: RAISE fnd_api.g_exc_error;
3146: END IF;
3147:
3148: -- validate default settlement
3149: CE_BANK_AND_ACCOUNT_VALIDATION.validate_def_settlement
3151: null,
3152: l_org_le_id,
3153: p_acct_use_rec.xtr_default_settlement_flag,
3154: p_acct_use_rec.ap_default_settlement_flag,
3155: FND_API.G_FALSE,
3156: x_msg_count,
3157: x_msg_data,
3158: x_return_status);
3159: -- raise an exception if the validation is unsuccessful
3156: x_msg_count,
3157: x_msg_data,
3158: x_return_status);
3159: -- raise an exception if the validation is unsuccessful
3160: IF x_return_status <> fnd_api.g_ret_sts_success THEN
3161: RAISE fnd_api.g_exc_error;
3162: END IF;
3163:
3164: -- insert data into ce_bank_accounts table
3157: x_msg_data,
3158: x_return_status);
3159: -- raise an exception if the validation is unsuccessful
3160: IF x_return_status <> fnd_api.g_ret_sts_success THEN
3161: RAISE fnd_api.g_exc_error;
3162: END IF;
3163:
3164: -- insert data into ce_bank_accounts table
3165: OPEN c_acct_use_id;
3340: End If;
3341: CLOSE c_gl_ccid_rowid;
3342:
3343: -- get message count and if count is 1, get message info.
3344: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
3345: p_count => x_msg_count,
3346: p_data => x_msg_data);
3347:
3348: IF l_DEBUG in ('Y', 'C') THEN
3349: cep_standard.debug('<
3351:
3352: EXCEPTION
3353: WHEN fnd_api.g_exc_error THEN
3354: ROLLBACK TO create_bank_acct_use;
3355: x_return_status := fnd_api.g_ret_sts_error;
3356: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
3357: p_count => x_msg_count,
3351:
3352: EXCEPTION
3353: WHEN fnd_api.g_exc_error THEN
3354: ROLLBACK TO create_bank_acct_use;
3355: x_return_status := fnd_api.g_ret_sts_error;
3356: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
3357: p_count => x_msg_count,
3358: p_data => x_msg_data);
3359:
3352: EXCEPTION
3353: WHEN fnd_api.g_exc_error THEN
3354: ROLLBACK TO create_bank_acct_use;
3355: x_return_status := fnd_api.g_ret_sts_error;
3356: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
3357: p_count => x_msg_count,
3358: p_data => x_msg_data);
3359:
3360: IF l_DEBUG in ('Y', 'C') THEN
3360: IF l_DEBUG in ('Y', 'C') THEN
3361: cep_standard.debug_msg_stack(x_msg_count, x_msg_data);
3362: END IF;
3363:
3364: WHEN fnd_api.g_exc_unexpected_error THEN
3365: ROLLBACK TO create_bank_acct_use;
3366: x_return_status := fnd_api.g_ret_sts_unexp_error;
3367: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
3368: p_count => x_msg_count,
3362: END IF;
3363:
3364: WHEN fnd_api.g_exc_unexpected_error THEN
3365: ROLLBACK TO create_bank_acct_use;
3366: x_return_status := fnd_api.g_ret_sts_unexp_error;
3367: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
3368: p_count => x_msg_count,
3369: p_data => x_msg_data);
3370:
3363:
3364: WHEN fnd_api.g_exc_unexpected_error THEN
3365: ROLLBACK TO create_bank_acct_use;
3366: x_return_status := fnd_api.g_ret_sts_unexp_error;
3367: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
3368: p_count => x_msg_count,
3369: p_data => x_msg_data);
3370:
3371: IF l_DEBUG in ('Y', 'C') THEN
3373: END IF;
3374:
3375: WHEN OTHERS THEN
3376: ROLLBACK TO create_bank_acct_use;
3377: x_return_status := fnd_api.g_ret_sts_unexp_error;
3378: fnd_message.set_name('CE', 'CE_API_OTHERS_EXCEP');
3379: fnd_message.set_token('ERROR',SQLERRM);
3380: fnd_msg_pub.add;
3381: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
3377: x_return_status := fnd_api.g_ret_sts_unexp_error;
3378: fnd_message.set_name('CE', 'CE_API_OTHERS_EXCEP');
3379: fnd_message.set_token('ERROR',SQLERRM);
3380: fnd_msg_pub.add;
3381: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
3382: p_count => x_msg_count,
3383: p_data => x_msg_data);
3384:
3385: IF l_DEBUG in ('Y', 'C') THEN
3390: END create_bank_acct_use;
3391:
3392:
3393: PROCEDURE update_bank_acct_use (
3394: p_init_msg_list IN VARCHAR2:= fnd_api.g_false,
3395: p_acct_use_rec IN BankAcct_use_rec_type,
3396: p_use_ovn IN OUT NOCOPY NUMBER,
3397: p_ccid_ovn IN OUT NOCOPY NUMBER,
3398: x_return_status OUT NOCOPY VARCHAR2,
3430: cep_standard.debug('>>CE_BANK_PUB.update_bank_acct_use.');
3431: END IF;
3432:
3433: -- initialize message list
3434: IF fnd_api.to_boolean(p_init_msg_list) THEN
3435: fnd_msg_pub.initialize;
3436: END IF;
3437:
3438: -- initialize API return status to success.
3435: fnd_msg_pub.initialize;
3436: END IF;
3437:
3438: -- initialize API return status to success.
3439: x_return_status := fnd_api.g_ret_sts_success;
3440:
3441: -- bank_account_id and org_id/legal_entity_id cannot be updated
3442: -- find them using the bank_acct_use_id
3443: OPEN c_acct_org;
3444: FETCH c_acct_org INTO l_acct_id, l_org_id, l_le_id;
3445: IF c_acct_org%NOTFOUND THEN
3446: fnd_message.set_name('CE', 'CE_API_NO_ACCOUNT_USE');
3447: fnd_msg_pub.add;
3448: x_return_status := fnd_api.g_ret_sts_error;
3449: CLOSE c_acct_org;
3450: RAISE fnd_api.g_exc_error;
3451: END IF;
3452: CLOSE c_acct_org;
3446: fnd_message.set_name('CE', 'CE_API_NO_ACCOUNT_USE');
3447: fnd_msg_pub.add;
3448: x_return_status := fnd_api.g_ret_sts_error;
3449: CLOSE c_acct_org;
3450: RAISE fnd_api.g_exc_error;
3451: END IF;
3452: CLOSE c_acct_org;
3453:
3454: IF l_org_id is not null AND l_org_id <> -1 THEN -- Bug 9150022
3470: p_acct_use_rec.ar_use_enable_flag = 'Y') and
3471: p_acct_use_rec.asset_code_combination_id is null) THEN -- bug 7671686
3472: fnd_message.set_name('CE', 'CE_API_CASH_CCID_REQUIRED');
3473: fnd_msg_pub.add;
3474: x_return_status := fnd_api.g_ret_sts_error;
3475: RAISE fnd_api.g_exc_error;
3476: END IF;
3477:
3478: -- validate account use
3471: p_acct_use_rec.asset_code_combination_id is null) THEN -- bug 7671686
3472: fnd_message.set_name('CE', 'CE_API_CASH_CCID_REQUIRED');
3473: fnd_msg_pub.add;
3474: x_return_status := fnd_api.g_ret_sts_error;
3475: RAISE fnd_api.g_exc_error;
3476: END IF;
3477:
3478: -- validate account use
3479: CE_BANK_AND_ACCOUNT_VALIDATION.validate_account_use
3483: p_acct_use_rec.xtr_use_enable_flag,
3484: x_return_status);
3485:
3486: -- raise an exception if the validation is unsuccessful
3487: IF x_return_status <> fnd_api.g_ret_sts_success THEN
3488: RAISE fnd_api.g_exc_error;
3489: END IF;
3490:
3491: -- validate the org type matches with the account use
3484: x_return_status);
3485:
3486: -- raise an exception if the validation is unsuccessful
3487: IF x_return_status <> fnd_api.g_ret_sts_success THEN
3488: RAISE fnd_api.g_exc_error;
3489: END IF;
3490:
3491: -- validate the org type matches with the account use
3492: CE_BANK_AND_ACCOUNT_VALIDATION.validate_account_access_org
3497: l_org_type,
3498: l_org_le_id,
3499: x_return_status);
3500: -- raise an exception if the validation is unsuccessful
3501: IF x_return_status <> fnd_api.g_ret_sts_success THEN
3502: RAISE fnd_api.g_exc_error;
3503: END IF;
3504:
3505: -- validate default settlement
3498: l_org_le_id,
3499: x_return_status);
3500: -- raise an exception if the validation is unsuccessful
3501: IF x_return_status <> fnd_api.g_ret_sts_success THEN
3502: RAISE fnd_api.g_exc_error;
3503: END IF;
3504:
3505: -- validate default settlement
3506: CE_BANK_AND_ACCOUNT_VALIDATION.validate_def_settlement
3508: p_acct_use_rec.bank_acct_use_id,
3509: l_org_le_id,
3510: p_acct_use_rec.xtr_default_settlement_flag,
3511: p_acct_use_rec.ap_default_settlement_flag,
3512: FND_API.G_FALSE,
3513: x_msg_count,
3514: x_msg_data,
3515: x_return_status);
3516: -- raise an exception if the validation is unsuccessful
3513: x_msg_count,
3514: x_msg_data,
3515: x_return_status);
3516: -- raise an exception if the validation is unsuccessful
3517: IF x_return_status <> fnd_api.g_ret_sts_success THEN
3518: RAISE fnd_api.g_exc_error;
3519: END IF;
3520:
3521: -- check object version number to make sure the record has not been updated
3514: x_msg_data,
3515: x_return_status);
3516: -- raise an exception if the validation is unsuccessful
3517: IF x_return_status <> fnd_api.g_ret_sts_success THEN
3518: RAISE fnd_api.g_exc_error;
3519: END IF;
3520:
3521: -- check object version number to make sure the record has not been updated
3522: OPEN c_use_ovn;
3523: FETCH c_use_ovn INTO l_old_use_ovn;
3524: IF c_use_ovn%NOTFOUND THEN
3525: fnd_message.set_name('CE', 'CE_API_NO_ACCOUNT_USE');
3526: fnd_msg_pub.add;
3527: x_return_status := fnd_api.g_ret_sts_error;
3528: CLOSE c_use_ovn;
3529: RAISE fnd_api.g_exc_error;
3530: END IF;
3531: CLOSE c_use_ovn;
3525: fnd_message.set_name('CE', 'CE_API_NO_ACCOUNT_USE');
3526: fnd_msg_pub.add;
3527: x_return_status := fnd_api.g_ret_sts_error;
3528: CLOSE c_use_ovn;
3529: RAISE fnd_api.g_exc_error;
3530: END IF;
3531: CLOSE c_use_ovn;
3532:
3533: IF l_old_use_ovn > p_use_ovn THEN
3533: IF l_old_use_ovn > p_use_ovn THEN
3534: fnd_message.set_name('CE', 'CE_API_RECORD_CHANGED');
3535: fnd_message.set_token('TABLE', 'CE_BANK_ACCT_USES_ALL');
3536: fnd_msg_pub.add;
3537: x_return_status := fnd_api.g_ret_sts_error;
3538: RAISE fnd_api.g_exc_error;
3539: END IF;
3540:
3541: -- check object version number to make sure the record has not been updated
3534: fnd_message.set_name('CE', 'CE_API_RECORD_CHANGED');
3535: fnd_message.set_token('TABLE', 'CE_BANK_ACCT_USES_ALL');
3536: fnd_msg_pub.add;
3537: x_return_status := fnd_api.g_ret_sts_error;
3538: RAISE fnd_api.g_exc_error;
3539: END IF;
3540:
3541: -- check object version number to make sure the record has not been updated
3542: OPEN c_ccid_ovn;
3546: IF l_old_ccid_ovn is not null AND l_old_ccid_ovn > p_ccid_ovn THEN
3547: fnd_message.set_name('CE', 'CE_API_RECORD_CHANGED');
3548: fnd_message.set_token('TABLE', 'CE_GL_ACCOUNTS_CCID');
3549: fnd_msg_pub.add;
3550: x_return_status := fnd_api.g_ret_sts_error;
3551: RAISE fnd_api.g_exc_error;
3552: END IF;
3553:
3554: -- update
3547: fnd_message.set_name('CE', 'CE_API_RECORD_CHANGED');
3548: fnd_message.set_token('TABLE', 'CE_GL_ACCOUNTS_CCID');
3549: fnd_msg_pub.add;
3550: x_return_status := fnd_api.g_ret_sts_error;
3551: RAISE fnd_api.g_exc_error;
3552: END IF;
3553:
3554: -- update
3555: update ce_bank_acct_uses_all
3595: WHERE bank_acct_use_id = p_acct_use_rec.bank_acct_use_id;
3596: IF (SQL%NOTFOUND) THEN
3597: fnd_message.set_name('CE', 'CE_API_NO_ACCOUNT_USE');
3598: fnd_msg_pub.add;
3599: x_return_status := fnd_api.g_ret_sts_error;
3600: RAISE fnd_api.g_exc_error;
3601: END IF;
3602: p_use_ovn := l_old_use_ovn + 1;
3603:
3596: IF (SQL%NOTFOUND) THEN
3597: fnd_message.set_name('CE', 'CE_API_NO_ACCOUNT_USE');
3598: fnd_msg_pub.add;
3599: x_return_status := fnd_api.g_ret_sts_error;
3600: RAISE fnd_api.g_exc_error;
3601: END IF;
3602: p_use_ovn := l_old_use_ovn + 1;
3603:
3604: -- update ccid table
3635: p_ccid_ovn := l_old_ccid_ovn + 1;
3636: END IF;
3637:
3638: -- get message count and if count is 1, get message info.
3639: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
3640: p_count => x_msg_count,
3641: p_data => x_msg_data);
3642:
3643: IF l_DEBUG in ('Y', 'C') THEN
3644: cep_standard.debug('<
3646:
3647: EXCEPTION
3648: WHEN fnd_api.g_exc_error THEN
3649: ROLLBACK TO update_bank_acct_use;
3650: x_return_status := fnd_api.g_ret_sts_error;
3651: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
3652: p_count => x_msg_count,
3646:
3647: EXCEPTION
3648: WHEN fnd_api.g_exc_error THEN
3649: ROLLBACK TO update_bank_acct_use;
3650: x_return_status := fnd_api.g_ret_sts_error;
3651: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
3652: p_count => x_msg_count,
3653: p_data => x_msg_data);
3654:
3647: EXCEPTION
3648: WHEN fnd_api.g_exc_error THEN
3649: ROLLBACK TO update_bank_acct_use;
3650: x_return_status := fnd_api.g_ret_sts_error;
3651: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
3652: p_count => x_msg_count,
3653: p_data => x_msg_data);
3654:
3655: IF l_DEBUG in ('Y', 'C') THEN
3655: IF l_DEBUG in ('Y', 'C') THEN
3656: cep_standard.debug_msg_stack(x_msg_count, x_msg_data);
3657: END IF;
3658:
3659: WHEN fnd_api.g_exc_unexpected_error THEN
3660: ROLLBACK TO update_bank_acct_use;
3661: x_return_status := fnd_api.g_ret_sts_unexp_error;
3662: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
3663: p_count => x_msg_count,
3657: END IF;
3658:
3659: WHEN fnd_api.g_exc_unexpected_error THEN
3660: ROLLBACK TO update_bank_acct_use;
3661: x_return_status := fnd_api.g_ret_sts_unexp_error;
3662: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
3663: p_count => x_msg_count,
3664: p_data => x_msg_data);
3665:
3658:
3659: WHEN fnd_api.g_exc_unexpected_error THEN
3660: ROLLBACK TO update_bank_acct_use;
3661: x_return_status := fnd_api.g_ret_sts_unexp_error;
3662: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
3663: p_count => x_msg_count,
3664: p_data => x_msg_data);
3665:
3666: IF l_DEBUG in ('Y', 'C') THEN
3668: END IF;
3669:
3670: WHEN OTHERS THEN
3671: ROLLBACK TO udpate_bank_acct_use;
3672: x_return_status := fnd_api.g_ret_sts_unexp_error;
3673: fnd_message.set_name('CE', 'CE_API_OTHERS_EXCEP');
3674: fnd_message.set_token('ERROR',SQLERRM);
3675: fnd_msg_pub.add;
3676: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
3672: x_return_status := fnd_api.g_ret_sts_unexp_error;
3673: fnd_message.set_name('CE', 'CE_API_OTHERS_EXCEP');
3674: fnd_message.set_token('ERROR',SQLERRM);
3675: fnd_msg_pub.add;
3676: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
3677: p_count => x_msg_count,
3678: p_data => x_msg_data);
3679:
3680: IF l_DEBUG in ('Y', 'C') THEN
3694: | |
3695: | ARGUMENTS |
3696: | IN: |
3697: | p_init_msg_list Initialize message stack if it is set to |
3698: | FND_API.G_TRUE. Default is fnd_api.g_false|
3699: | p_bank_acct_id ID of the Internal Bank account to be |
3700: | inactivated. |
3701: | p_end_date Inactive date of the bank account |
3702: | |
3705: | p_object_version_number Current object version number for the |
3706: | bank account. |
3707: | OUT: |
3708: | x_return_status Return status after the call. The status can |
3709: | be FND_API.G_RET_STS_SUCCESS (success), |
3710: | fnd_api.g_ret_sts_error (error), |
3711: | fnd_api.g_ret_sts_unexp_error (unexpected |
3712: | error). |
3713: | x_msg_count Number of messages in message stack. |
3706: | bank account. |
3707: | OUT: |
3708: | x_return_status Return status after the call. The status can |
3709: | be FND_API.G_RET_STS_SUCCESS (success), |
3710: | fnd_api.g_ret_sts_error (error), |
3711: | fnd_api.g_ret_sts_unexp_error (unexpected |
3712: | error). |
3713: | x_msg_count Number of messages in message stack. |
3714: | x_msg_data Message text if x_msg_count is 1. |
3707: | OUT: |
3708: | x_return_status Return status after the call. The status can |
3709: | be FND_API.G_RET_STS_SUCCESS (success), |
3710: | fnd_api.g_ret_sts_error (error), |
3711: | fnd_api.g_ret_sts_unexp_error (unexpected |
3712: | error). |
3713: | x_msg_count Number of messages in message stack. |
3714: | x_msg_data Message text if x_msg_count is 1. |
3715: | MODIFICATION HISTORY |
3715: | MODIFICATION HISTORY |
3716: | 18-MAY-2011 vnetan Created. |
3717: +=======================================================================*/
3718: PROCEDURE set_bank_acct_end_date (
3719: p_init_msg_list IN VARCHAR2 := fnd_api.g_false,
3720: p_bank_acct_id IN NUMBER,
3721: p_end_date IN DATE,
3722: p_object_version_number IN OUT NOCOPY NUMBER,
3723: x_return_status OUT NOCOPY VARCHAR2,
3732: cep_standard.debug('>>CE_EXT_BANK_ACCT_PUB.set_bank_acct_end_date.');
3733: END IF;
3734:
3735: -- initialize message list
3736: IF fnd_api.to_boolean(p_init_msg_list) THEN
3737: fnd_msg_pub.initialize;
3738: END IF;
3739:
3740: -- initialize API return status to success.
3737: fnd_msg_pub.initialize;
3738: END IF;
3739:
3740: -- initialize API return status to success.
3741: x_return_status := fnd_api.g_ret_sts_success;
3742:
3743: -- check mandatory parameters
3744: check_mandatory_param('p_bank_acct_id',p_bank_acct_id);
3745: check_mandatory_param('p_object_version_number',p_object_version_number);
3753: EXCEPTION
3754: WHEN NO_DATA_FOUND THEN
3755: fnd_message.set_name('CE', 'CE_API_NO_ACCOUNT');
3756: fnd_msg_pub.add;
3757: x_return_status := fnd_api.g_ret_sts_error;
3758: RAISE fnd_api.g_exc_error;
3759: END;
3760:
3761: IF l_old_ovn > p_object_version_number THEN
3754: WHEN NO_DATA_FOUND THEN
3755: fnd_message.set_name('CE', 'CE_API_NO_ACCOUNT');
3756: fnd_msg_pub.add;
3757: x_return_status := fnd_api.g_ret_sts_error;
3758: RAISE fnd_api.g_exc_error;
3759: END;
3760:
3761: IF l_old_ovn > p_object_version_number THEN
3762: fnd_message.set_name('CE', 'CE_API_RECORD_CHANGED');
3761: IF l_old_ovn > p_object_version_number THEN
3762: fnd_message.set_name('CE', 'CE_API_RECORD_CHANGED');
3763: fnd_message.set_token('TABLE', 'CE_BANK_ACCOUNTS');
3764: fnd_msg_pub.add;
3765: x_return_status := fnd_api.g_ret_sts_error;
3766: RAISE fnd_api.g_exc_error;
3767: END IF;
3768:
3769: -- set the end date of the account
3762: fnd_message.set_name('CE', 'CE_API_RECORD_CHANGED');
3763: fnd_message.set_token('TABLE', 'CE_BANK_ACCOUNTS');
3764: fnd_msg_pub.add;
3765: x_return_status := fnd_api.g_ret_sts_error;
3766: RAISE fnd_api.g_exc_error;
3767: END IF;
3768:
3769: -- set the end date of the account
3770: UPDATE ce_bank_accounts
3775: -- check to see row udpated
3776: IF (SQL%NOTFOUND) THEN
3777: fnd_message.set_name('CE', 'CE_API_NO_ACCOUNT');
3778: fnd_msg_pub.add;
3779: x_return_status := fnd_api.g_ret_sts_error;
3780: RAISE fnd_api.g_exc_error;
3781: END IF;
3782:
3783: p_object_version_number := l_old_ovn + 1;
3776: IF (SQL%NOTFOUND) THEN
3777: fnd_message.set_name('CE', 'CE_API_NO_ACCOUNT');
3778: fnd_msg_pub.add;
3779: x_return_status := fnd_api.g_ret_sts_error;
3780: RAISE fnd_api.g_exc_error;
3781: END IF;
3782:
3783: p_object_version_number := l_old_ovn + 1;
3784: -- get message count and if count is 1, get message info.
3782:
3783: p_object_version_number := l_old_ovn + 1;
3784: -- get message count and if count is 1, get message info.
3785: fnd_msg_pub.count_and_get(
3786: p_encoded => fnd_api.g_false,
3787: p_count => x_msg_count,
3788: p_data => x_msg_data);
3789:
3790: IF l_DEBUG in ('Y', 'C') THEN
3791: cep_standard.debug('<
3793:
3794: EXCEPTION
3795: WHEN fnd_api.g_exc_error THEN
3796: ROLLBACK TO set_bank_acct_end_date;
3797: x_return_status := fnd_api.g_ret_sts_error;
3798: fnd_msg_pub.count_and_get(
3799: p_encoded => fnd_api.g_false,
3793:
3794: EXCEPTION
3795: WHEN fnd_api.g_exc_error THEN
3796: ROLLBACK TO set_bank_acct_end_date;
3797: x_return_status := fnd_api.g_ret_sts_error;
3798: fnd_msg_pub.count_and_get(
3799: p_encoded => fnd_api.g_false,
3800: p_count => x_msg_count,
3801: p_data => x_msg_data);
3795: WHEN fnd_api.g_exc_error THEN
3796: ROLLBACK TO set_bank_acct_end_date;
3797: x_return_status := fnd_api.g_ret_sts_error;
3798: fnd_msg_pub.count_and_get(
3799: p_encoded => fnd_api.g_false,
3800: p_count => x_msg_count,
3801: p_data => x_msg_data);
3802:
3803: IF l_DEBUG in ('Y', 'C') THEN
3803: IF l_DEBUG in ('Y', 'C') THEN
3804: cep_standard.debug_msg_stack(x_msg_count, x_msg_data);
3805: END IF;
3806:
3807: WHEN fnd_api.g_exc_unexpected_error THEN
3808: ROLLBACK TO set_bank_acct_end_date;
3809: x_return_status := fnd_api.g_ret_sts_unexp_error;
3810: fnd_msg_pub.count_and_get(
3811: p_encoded => fnd_api.g_false,
3805: END IF;
3806:
3807: WHEN fnd_api.g_exc_unexpected_error THEN
3808: ROLLBACK TO set_bank_acct_end_date;
3809: x_return_status := fnd_api.g_ret_sts_unexp_error;
3810: fnd_msg_pub.count_and_get(
3811: p_encoded => fnd_api.g_false,
3812: p_count => x_msg_count,
3813: p_data => x_msg_data);
3807: WHEN fnd_api.g_exc_unexpected_error THEN
3808: ROLLBACK TO set_bank_acct_end_date;
3809: x_return_status := fnd_api.g_ret_sts_unexp_error;
3810: fnd_msg_pub.count_and_get(
3811: p_encoded => fnd_api.g_false,
3812: p_count => x_msg_count,
3813: p_data => x_msg_data);
3814:
3815: IF l_DEBUG in ('Y', 'C') THEN
3817: END IF;
3818:
3819: WHEN OTHERS THEN
3820: ROLLBACK TO set_bank_acct_end_date;
3821: x_return_status := fnd_api.g_ret_sts_unexp_error;
3822: fnd_message.set_name('CE', 'CE_API_OTHERS_EXCEP');
3823: fnd_message.set_token('ERROR',SQLERRM);
3824: fnd_msg_pub.add;
3825: fnd_msg_pub.count_and_get(
3822: fnd_message.set_name('CE', 'CE_API_OTHERS_EXCEP');
3823: fnd_message.set_token('ERROR',SQLERRM);
3824: fnd_msg_pub.add;
3825: fnd_msg_pub.count_and_get(
3826: p_encoded => fnd_api.g_false,
3827: p_count => x_msg_count,
3828: p_data => x_msg_data);
3829:
3830: IF l_DEBUG in ('Y', 'C') THEN