DBA Data[Home] [Help]

APPS.FUN_NET_CANCEL_PKG dependencies on FND_API

Line 29: x_return_status := FND_API.G_TRUE;

25: p_batch_id IN fun_net_batches_all.batch_id%TYPE,
26: x_return_status OUT NOCOPY VARCHAR2)
27: IS
28: BEGIN
29: x_return_status := FND_API.G_TRUE;
30:
31: SELECT batch_status_code
32: INTO g_batch_status
33: FROM

Line 40: x_return_status := FND_API.G_FALSE;

36: batch_id = p_batch_id;
37: EXCEPTION
38:
39: WHEN OTHERS THEN
40: x_return_status := FND_API.G_FALSE;
41: END get_batch_status;
42:
43: /* Validates Batch Status :
44: If mode = Cancel , then the batch should be in the following statuses

Line 55: x_return_status := FND_API.G_TRUE;

51: x_return_status OUT NOCOPY VARCHAR2)
52: IS
53: l_return_status VARCHAR2(1);
54: BEGIN
55: x_return_status := FND_API.G_TRUE;
56: IF p_mode IS NULL or p_batch_id IS NULL THEN
57: x_return_status := FND_API.G_FALSE;
58: RETURN;
59: END IF;

Line 57: x_return_status := FND_API.G_FALSE;

53: l_return_status VARCHAR2(1);
54: BEGIN
55: x_return_status := FND_API.G_TRUE;
56: IF p_mode IS NULL or p_batch_id IS NULL THEN
57: x_return_status := FND_API.G_FALSE;
58: RETURN;
59: END IF;
60:
61: get_batch_status(

Line 65: IF l_return_status = FND_API.G_TRUE THEN

61: get_batch_status(
62: p_batch_id => p_batch_id,
63: x_return_status => l_return_status);
64:
65: IF l_return_status = FND_API.G_TRUE THEN
66: IF p_mode = 'CANCEL' THEN
67: IF g_batch_status NOT IN ('SELECTED','SUSPENDED',
68: 'CANCELLED','REJECTED','ERROR') THEN
69: x_return_status := FND_API.G_FALSE;

Line 69: x_return_status := FND_API.G_FALSE;

65: IF l_return_status = FND_API.G_TRUE THEN
66: IF p_mode = 'CANCEL' THEN
67: IF g_batch_status NOT IN ('SELECTED','SUSPENDED',
68: 'CANCELLED','REJECTED','ERROR') THEN
69: x_return_status := FND_API.G_FALSE;
70: RETURN;
71: END IF;
72: ELSIF p_mode = 'REVERSE' THEN
73: IF g_batch_status <> 'COMPLETE' THEN

Line 74: x_return_status := FND_API.G_FALSE;

70: RETURN;
71: END IF;
72: ELSIF p_mode = 'REVERSE' THEN
73: IF g_batch_status <> 'COMPLETE' THEN
74: x_return_status := FND_API.G_FALSE;
75: RETURN;
76: END IF;
77: END IF;
78:

Line 80: x_return_status := FND_API.G_FALSE;

76: END IF;
77: END IF;
78:
79: ELSE
80: x_return_status := FND_API.G_FALSE;
81: END IF;
82: EXCEPTION
83: WHEN OTHERS THEN
84: x_return_status := FND_API.G_FALSE;

Line 84: x_return_status := FND_API.G_FALSE;

80: x_return_status := FND_API.G_FALSE;
81: END IF;
82: EXCEPTION
83: WHEN OTHERS THEN
84: x_return_status := FND_API.G_FALSE;
85: END Validate_Batch_Status;
86:
87: /* Unlocks AP Payment Schedule lines for the given batch if the batch status is
88: 'SELECTED' and deletes Netting AP Invoices in FUN_NET_AP_INVS given a Batch Id */

Line 98: x_return_status := FND_API.G_TRUE;

94: TYPE l_inv_tab_type IS TABLE OF fun_net_ap_invs.invoice_id%TYPE;
95: l_inv_tab l_inv_tab_type;
96:
97: BEGIN
98: x_return_status := FND_API.G_TRUE;
99:
100: /* Unlock AP Transactions if the Batch Status = SELECTED
101: AR Transactions are not locked at this point */
102:

Line 109: IF x_return_status = FND_API.G_FALSE THEN

105: p_batch_id => p_batch_id,
106: x_return_status => x_return_status);
107: END IF;
108:
109: IF x_return_status = FND_API.G_FALSE THEN
110: RETURN;
111: END IF;
112:
113: SELECT invoice_id

Line 131: x_return_status := FND_API.G_FALSE;

127: END IF;
128:
129: EXCEPTION
130: WHEN OTHERS THEN
131: x_return_status := FND_API.G_FALSE;
132: END delete_ap_invs;
133:
134: /* Deletes Netting AR transactions for the given batch */
135:

Line 144: x_return_status := FND_API.G_TRUE;

140: TYPE l_txn_tab_type IS TABLE OF fun_net_ar_txns.customer_trx_id%TYPE;
141: l_txn_tab l_txn_tab_type;
142:
143: BEGIN
144: x_return_status := FND_API.G_TRUE;
145: SELECT customer_trx_id
146: BULK COLLECT INTO l_txn_tab
147: FROM fun_net_ar_txns
148: WHERE batch_id = x_batch_id;

Line 162: x_return_status := FND_API.G_FALSE;

158: END IF;
159:
160: EXCEPTION
161: WHEN OTHERS THEN
162: x_return_status := FND_API.G_FALSE;
163: END delete_ar_txns;
164:
165: /* Gets the Agreement id for a given batch */
166:

Line 173: x_return_status := FND_API.G_TRUE;

169: x_agreement_id OUT NOCOPY fun_net_agreements.agreement_id%TYPE,
170: x_return_status OUT NOCOPY VARCHAR2)
171: IS
172: BEGIN
173: x_return_status := FND_API.G_TRUE;
174: SELECT agreement_id
175: INTO x_agreement_id
176: FROM fun_net_batches
177: WHERE batch_id = p_batch_id;

Line 180: x_return_status := FND_API.G_FALSE;

176: FROM fun_net_batches
177: WHERE batch_id = p_batch_id;
178: EXCEPTION
179: WHEN OTHERS THEN
180: x_return_status := FND_API.G_FALSE;
181: END get_agreement;
182:
183:
184: /* Deletes a Batch and all the transactions in a batch

Line 190: p_init_msg_list IN VARCHAR2 := FND_API.G_TRUE,

186: if the Batch Status is 'SELECTED' */
187:
188: PROCEDURE cancel_net_batch(
189: -- ***** Standard API Parameters *****
190: p_init_msg_list IN VARCHAR2 := FND_API.G_TRUE,
191: p_commit IN VARCHAR2 := FND_API.G_FALSE,
192: x_return_status OUT NOCOPY VARCHAR2,
193: x_msg_count OUT NOCOPY NUMBER,
194: x_msg_data OUT NOCOPY VARCHAR2,

Line 191: p_commit IN VARCHAR2 := FND_API.G_FALSE,

187:
188: PROCEDURE cancel_net_batch(
189: -- ***** Standard API Parameters *****
190: p_init_msg_list IN VARCHAR2 := FND_API.G_TRUE,
191: p_commit IN VARCHAR2 := FND_API.G_FALSE,
192: x_return_status OUT NOCOPY VARCHAR2,
193: x_msg_count OUT NOCOPY NUMBER,
194: x_msg_data OUT NOCOPY VARCHAR2,
195: -- ***** Netting batch input parameters *****

Line 216: IF FND_API.to_Boolean( p_init_msg_list ) THEN

212: -- **** Standard start of API savepoint ****
213: SAVEPOINT cancel_net_batch_SP;
214:
215: -- **** Initialize message list if p_init_msg_list is set to TRUE. ****
216: IF FND_API.to_Boolean( p_init_msg_list ) THEN
217: FND_MSG_PUB.initialize;
218: END IF;
219:
220: -- **** Initialize return status to SUCCESS *****

Line 221: x_return_status := FND_API.G_RET_STS_SUCCESS;

217: FND_MSG_PUB.initialize;
218: END IF;
219:
220: -- **** Initialize return status to SUCCESS *****
221: x_return_status := FND_API.G_RET_STS_SUCCESS;
222:
223: /*-----------------------------------------------+
224: | ======== START OF API BODY ============ |
225: +-----------------------------------------------*/

Line 230: RAISE FND_API.G_EXC_ERROR;

226:
227: /* Check for mandatory parameters */
228:
229: IF p_batch_id IS NULL THEN
230: RAISE FND_API.G_EXC_ERROR;
231: END IF;
232:
233: IF l_return_status = FND_API.G_FALSE THEN
234: RAISE FND_API.G_EXC_ERROR;

Line 233: IF l_return_status = FND_API.G_FALSE THEN

229: IF p_batch_id IS NULL THEN
230: RAISE FND_API.G_EXC_ERROR;
231: END IF;
232:
233: IF l_return_status = FND_API.G_FALSE THEN
234: RAISE FND_API.G_EXC_ERROR;
235: END IF;
236:
237: /* Check the batch status before deleting */

Line 234: RAISE FND_API.G_EXC_ERROR;

230: RAISE FND_API.G_EXC_ERROR;
231: END IF;
232:
233: IF l_return_status = FND_API.G_FALSE THEN
234: RAISE FND_API.G_EXC_ERROR;
235: END IF;
236:
237: /* Check the batch status before deleting */
238:

Line 244: IF l_return_status = FND_API.G_FALSE THEN

240: p_mode => 'CANCEL',
241: p_batch_id => p_batch_id,
242: x_return_status => l_return_status);
243:
244: IF l_return_status = FND_API.G_FALSE THEN
245: RAISE FND_API.G_EXC_ERROR;
246: END IF;
247: /* Get Agreement Id of the Batch */
248:

Line 245: RAISE FND_API.G_EXC_ERROR;

241: p_batch_id => p_batch_id,
242: x_return_status => l_return_status);
243:
244: IF l_return_status = FND_API.G_FALSE THEN
245: RAISE FND_API.G_EXC_ERROR;
246: END IF;
247: /* Get Agreement Id of the Batch */
248:
249: get_agreement(

Line 254: IF l_return_status = FND_API.G_FALSE THEN

250: p_batch_id => p_batch_id,
251: x_agreement_id => l_agreement_id,
252: x_return_status => x_return_status);
253:
254: IF l_return_status = FND_API.G_FALSE THEN
255: RAISE FND_API.G_EXC_ERROR;
256: END IF;
257:
258: /* Check Agreement Status and unset the in process flag so that

Line 255: RAISE FND_API.G_EXC_ERROR;

251: x_agreement_id => l_agreement_id,
252: x_return_status => x_return_status);
253:
254: IF l_return_status = FND_API.G_FALSE THEN
255: RAISE FND_API.G_EXC_ERROR;
256: END IF;
257:
258: /* Check Agreement Status and unset the in process flag so that
259: agreement can be used again */

Line 267: IF l_return_status = FND_API.G_FALSE THEN

263: x_agreement_id => l_agreement_id,
264: x_mode => 'UNSET',
265: x_return_status => l_return_status);
266:
267: IF l_return_status = FND_API.G_FALSE THEN
268: RAISE FND_API.G_EXC_ERROR;
269: END IF;
270:
271:

Line 268: RAISE FND_API.G_EXC_ERROR;

264: x_mode => 'UNSET',
265: x_return_status => l_return_status);
266:
267: IF l_return_status = FND_API.G_FALSE THEN
268: RAISE FND_API.G_EXC_ERROR;
269: END IF;
270:
271:
272: /* Delete AP Invoices belonging to the Batch */

Line 279: IF l_return_status = FND_API.G_FALSE THEN

275: p_batch_id => p_batch_id,
276: x_return_status => l_return_status);
277:
278:
279: IF l_return_status = FND_API.G_FALSE THEN
280: RAISE FND_API.G_EXC_ERROR;
281: END IF;
282:
283: /* Delete AR Transactions belonging to the Batch */

Line 280: RAISE FND_API.G_EXC_ERROR;

276: x_return_status => l_return_status);
277:
278:
279: IF l_return_status = FND_API.G_FALSE THEN
280: RAISE FND_API.G_EXC_ERROR;
281: END IF;
282:
283: /* Delete AR Transactions belonging to the Batch */
284: delete_ar_txns(

Line 288: IF l_return_status = FND_API.G_FALSE THEN

284: delete_ar_txns(
285: x_batch_id => p_batch_id,
286: x_return_status => l_return_status);
287:
288: IF l_return_status = FND_API.G_FALSE THEN
289: RAISE FND_API.G_EXC_ERROR;
290: END IF;
291:
292: /* Delete the Batch */

Line 289: RAISE FND_API.G_EXC_ERROR;

285: x_batch_id => p_batch_id,
286: x_return_status => l_return_status);
287:
288: IF l_return_status = FND_API.G_FALSE THEN
289: RAISE FND_API.G_EXC_ERROR;
290: END IF;
291:
292: /* Delete the Batch */
293:

Line 298: IF FND_API.To_Boolean( p_commit ) THEN

294: FUN_NET_BATCHES_PKG.Delete_Row(
295: x_batch_id => p_batch_id);
296:
297: -- Standard check of p_commit.
298: IF FND_API.To_Boolean( p_commit ) THEN
299: COMMIT WORK;
300: END IF;
301:
302: EXCEPTION

Line 303: WHEN FND_API.G_EXC_ERROR THEN

299: COMMIT WORK;
300: END IF;
301:
302: EXCEPTION
303: WHEN FND_API.G_EXC_ERROR THEN
304: ROLLBACK TO cancel_net_batch_SP;
305: x_return_status := FND_API.G_RET_STS_ERROR;
306: FND_MSG_PUB.Count_And_Get (
307: p_count => x_msg_count,

Line 305: x_return_status := FND_API.G_RET_STS_ERROR;

301:
302: EXCEPTION
303: WHEN FND_API.G_EXC_ERROR THEN
304: ROLLBACK TO cancel_net_batch_SP;
305: x_return_status := FND_API.G_RET_STS_ERROR;
306: FND_MSG_PUB.Count_And_Get (
307: p_count => x_msg_count,
308: p_data => x_msg_data);
309:

Line 310: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN

306: FND_MSG_PUB.Count_And_Get (
307: p_count => x_msg_count,
308: p_data => x_msg_data);
309:
310: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
311: ROLLBACK TO cancel_net_batch_SP;
312: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
313: FND_MSG_PUB.Count_And_Get (
314: p_count => x_msg_count,

Line 312: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;

308: p_data => x_msg_data);
309:
310: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
311: ROLLBACK TO cancel_net_batch_SP;
312: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
313: FND_MSG_PUB.Count_And_Get (
314: p_count => x_msg_count,
315: p_data => x_msg_data );
316:

Line 319: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;

315: p_data => x_msg_data );
316:
317: WHEN OTHERS THEN
318: ROLLBACK TO Cancel_Net_Batch_SP;
319: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
320: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
321: FND_MSG_PUB.Add_Exc_Msg( 'FUN_ARAP_NET_PKG', 'cancel_net_batch');
322: END IF;
323: FND_MSG_PUB.Count_And_Get (

Line 360: x_return_status := FND_API.G_TRUE;

356: BEGIN
357: l_path := g_path || 'Validate_Settlement_period';
358:
359: /* Check if GL Period is open*/
360: x_return_status := FND_API.G_TRUE;
361: OPEN c_get_batch_details;
362: FETCH c_get_batch_details INTO l_org_id,l_gl_date,l_settlement_date;
363: CLOSE c_get_batch_details;
364:

Line 389: x_return_status := FND_API.G_FALSE;

385: x_period_type);
386: fun_net_util.Log_String(g_state_level,l_path,'After getting period status');
387: IF (x_period_name IS NULL and x_closing_status IS NULL) OR
388: x_closing_status not in ('O','F') THEN
389: x_return_status := FND_API.G_FALSE;
390: fun_net_util.Log_String(g_state_level,l_path,'Period not open');
391: END IF;
392: EXCEPTION
393: WHEN OTHERS THEN

Line 394: x_return_status := FND_API.G_FALSE;

390: fun_net_util.Log_String(g_state_level,l_path,'Period not open');
391: END IF;
392: EXCEPTION
393: WHEN OTHERS THEN
394: x_return_status := FND_API.G_FALSE;
395: END Validate_Settlement_Period;
396:
397: /* Validates the GL Period before reversing AP Checks created for the batch.
398: Calls AP Reverse API to reverse a check */

Line 420: x_return_status := FND_API.G_TRUE;

416: l_msg_data VARCHAR2(1000);
417: l_path VARCHAR2(100);
418: BEGIN
419: l_path := g_path || 'reverse_ap_checks';
420: x_return_status := FND_API.G_TRUE;
421:
422: /* Validate GL Period */
423: fun_net_util.Log_String(g_state_level,l_path,'Validating settlement period');
424: Validate_Settlement_Period(

Line 431: IF l_return_status = FND_API.G_FALSE THEN

427: x_period_name => l_period_name,
428: x_return_status => l_return_status,
429: x_return_msg => l_return_msg);
430:
431: IF l_return_status = FND_API.G_FALSE THEN
432: x_return_status := FND_API.G_FALSE;
433: RETURN;
434: END IF;
435:

Line 432: x_return_status := FND_API.G_FALSE;

428: x_return_status => l_return_status,
429: x_return_msg => l_return_msg);
430:
431: IF l_return_status = FND_API.G_FALSE THEN
432: x_return_status := FND_API.G_FALSE;
433: RETURN;
434: END IF;
435:
436: FOR ap_reverse_rec IN ap_reverse_cur(p_batch_id)

Line 463: IF l_return_status = FND_API.G_FALSE THEN

459: X_msg_count => l_msg_count,
460: X_msg_data => l_msg_data);
461:
462:
463: IF l_return_status = FND_API.G_FALSE THEN
464: x_return_status := FND_API.G_FALSE;
465: RETURN;
466: END IF;
467:

Line 464: x_return_status := FND_API.G_FALSE;

460: X_msg_data => l_msg_data);
461:
462:
463: IF l_return_status = FND_API.G_FALSE THEN
464: x_return_status := FND_API.G_FALSE;
465: RETURN;
466: END IF;
467:
468: END LOOP;

Line 472: x_return_status := FND_API.G_FALSE;

468: END LOOP;
469: fun_net_util.Log_String(g_state_level,l_path,'Successfully reversed AP invoices');
470: EXCEPTION
471: WHEN OTHERS THEN
472: x_return_status := FND_API.G_FALSE;
473: END reverse_ap_checks;
474:
475: /* Validates the GL Period for the Reversal Date. If the Period is not 'Open'
476: or 'Future' then raises an error.

Line 511: x_return_status := FND_API.G_TRUE;

507: l_reversal_date DATE;
508: l_path VARCHAR2(100);
509: BEGIN
510: l_path := g_path || 'reverse_ar_receipts';
511: x_return_status := FND_API.G_TRUE;
512: fun_net_util.Log_String(g_state_level,l_path,'Validating AR period');
513: Validate_Settlement_Period(
514: x_appln_id => 222,
515: p_batch_id => p_batch_id,

Line 520: IF x_return_status = FND_API.G_FALSE THEN

516: x_period_name => l_period_name,
517: x_return_status => x_return_status,
518: x_return_msg => l_msg_data);
519:
520: IF x_return_status = FND_API.G_FALSE THEN
521: RETURN;
522: END IF;
523:
524: FOR ar_txn_rec IN ar_txn_cur(p_batch_id)

Line 543: p_init_msg_list => FND_API.G_TRUE,

539:
540: AR_RECEIPT_API_PUB.Reverse(
541: -- Standard API parameters.
542: p_api_version => 1.0,
543: p_init_msg_list => FND_API.G_TRUE,
544: p_commit => FND_API.G_FALSE,
545: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
546: x_return_status => l_return_status,
547: x_msg_count => l_msg_count,

Line 544: p_commit => FND_API.G_FALSE,

540: AR_RECEIPT_API_PUB.Reverse(
541: -- Standard API parameters.
542: p_api_version => 1.0,
543: p_init_msg_list => FND_API.G_TRUE,
544: p_commit => FND_API.G_FALSE,
545: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
546: x_return_status => l_return_status,
547: x_msg_count => l_msg_count,
548: x_msg_data => l_msg_data,

Line 545: p_validation_level => FND_API.G_VALID_LEVEL_FULL,

541: -- Standard API parameters.
542: p_api_version => 1.0,
543: p_init_msg_list => FND_API.G_TRUE,
544: p_commit => FND_API.G_FALSE,
545: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
546: x_return_status => l_return_status,
547: x_msg_count => l_msg_count,
548: x_msg_data => l_msg_data,
549: -- Receipt reversal related parameters

Line 573: l_msg_data := fnd_msg_pub.get(p_encoded => fnd_api.g_false);

569:
570:
571: FOR x IN 1..l_msg_count LOOP
572:
573: l_msg_data := fnd_msg_pub.get(p_encoded => fnd_api.g_false);
574: fun_net_util.Log_String(g_event_level,l_path
575: ,'Reverse package Error message AR_RECEIPT_API_PUB.Reverse' ||l_msg_data||' '||' '||x);
576:
577: END LOOP;

Line 581: IF l_return_status = FND_API.G_RET_STS_ERROR THEN

577: END LOOP;
578:
579:
580: END IF;
581: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
582: fun_net_util.Log_String(g_state_level,l_path,'Error in reversing AR transactions');
583: x_return_status := FND_API.G_FALSE;
584: RETURN;
585: END IF;

Line 583: x_return_status := FND_API.G_FALSE;

579:
580: END IF;
581: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
582: fun_net_util.Log_String(g_state_level,l_path,'Error in reversing AR transactions');
583: x_return_status := FND_API.G_FALSE;
584: RETURN;
585: END IF;
586: END LOOP;
587: fun_net_util.Log_String(g_state_level,l_path,'Successfully reversed AR transactions');

Line 590: x_return_status := FND_API.G_FALSE;

586: END LOOP;
587: fun_net_util.Log_String(g_state_level,l_path,'Successfully reversed AR transactions');
588: EXCEPTION
589: WHEN OTHERS THEN
590: x_return_status := FND_API.G_FALSE;
591:
592: END reverse_ar_receipts;
593:
594: PROCEDURE Update_Amounts(

Line 605: x_return_status := FND_API.G_FALSE;

601: SET netted_amt = 0
602: WHERE batch_id = p_batch_id;
603: EXCEPTION
604: WHEN OTHERS THEN
605: x_return_status := FND_API.G_FALSE;
606: RETURN;
607: END;
608: BEGIN
609: UPDATE FUN_NET_AR_TXNS

Line 614: x_return_status := FND_API.G_FALSE;

610: SET netted_amt = 0
611: WHERE batch_id = p_batch_id;
612: EXCEPTION
613: WHEN OTHERS THEN
614: x_return_status := FND_API.G_FALSE;
615: RETURN;
616: END;
617: BEGIN
618: UPDATE FUN_NET_BATCHES

Line 623: x_return_status := FND_API.G_FALSE;

619: SET total_netted_amt = 0
620: WHERE batch_id = p_batch_id;
621: EXCEPTION
622: WHEN OTHERS THEN
623: x_return_status := FND_API.G_FALSE;
624: RETURN;
625: END;
626: EXCEPTION
627: WHEN OTHERS THEN

Line 628: x_return_status := FND_API.G_FALSE;

624: RETURN;
625: END;
626: EXCEPTION
627: WHEN OTHERS THEN
628: x_return_status := FND_API.G_FALSE;
629:
630: END;
631:
632: PROCEDURE reverse_net_batch(

Line 634: p_init_msg_list IN VARCHAR2 := FND_API.G_TRUE,

630: END;
631:
632: PROCEDURE reverse_net_batch(
633: -- ***** Standard API Parameters *****
634: p_init_msg_list IN VARCHAR2 := FND_API.G_TRUE,
635: p_commit IN VARCHAR2 := FND_API.G_FALSE,
636: x_return_status OUT NOCOPY VARCHAR2,
637: x_msg_count OUT NOCOPY NUMBER,
638: x_msg_data OUT NOCOPY VARCHAR2,

Line 635: p_commit IN VARCHAR2 := FND_API.G_FALSE,

631:
632: PROCEDURE reverse_net_batch(
633: -- ***** Standard API Parameters *****
634: p_init_msg_list IN VARCHAR2 := FND_API.G_TRUE,
635: p_commit IN VARCHAR2 := FND_API.G_FALSE,
636: x_return_status OUT NOCOPY VARCHAR2,
637: x_msg_count OUT NOCOPY NUMBER,
638: x_msg_data OUT NOCOPY VARCHAR2,
639: -- ***** Netting batch input parameters *****

Line 660: IF FND_API.to_Boolean( p_init_msg_list ) THEN

656: -- **** Standard start of API savepoint ****
657: SAVEPOINT reverse_net_batch_SP;
658: fun_net_util.Log_String(g_state_level,l_path,'Set the savepoint');
659: -- **** Initialize message list if p_init_msg_list is set to TRUE. ****
660: IF FND_API.to_Boolean( p_init_msg_list ) THEN
661: FND_MSG_PUB.initialize;
662: END IF;
663:
664: -- **** Initialize return status to SUCCESS *****

Line 665: x_return_status := FND_API.G_RET_STS_SUCCESS;

661: FND_MSG_PUB.initialize;
662: END IF;
663:
664: -- **** Initialize return status to SUCCESS *****
665: x_return_status := FND_API.G_RET_STS_SUCCESS;
666:
667: /*-----------------------------------------------+
668: | ======== START OF API BODY ============ |
669: +-----------------------------------------------*/

Line 674: RAISE FND_API.G_EXC_ERROR;

670:
671: /* Check for mandatory parameters */
672:
673: IF p_batch_id IS NULL THEN
674: RAISE FND_API.G_EXC_ERROR;
675: END IF;
676:
677: IF l_return_status = FND_API.G_FALSE THEN
678: RAISE FND_API.G_EXC_ERROR;

Line 677: IF l_return_status = FND_API.G_FALSE THEN

673: IF p_batch_id IS NULL THEN
674: RAISE FND_API.G_EXC_ERROR;
675: END IF;
676:
677: IF l_return_status = FND_API.G_FALSE THEN
678: RAISE FND_API.G_EXC_ERROR;
679: END IF;
680:
681: /* Check the batch status before reversing */

Line 678: RAISE FND_API.G_EXC_ERROR;

674: RAISE FND_API.G_EXC_ERROR;
675: END IF;
676:
677: IF l_return_status = FND_API.G_FALSE THEN
678: RAISE FND_API.G_EXC_ERROR;
679: END IF;
680:
681: /* Check the batch status before reversing */
682: fun_net_util.Log_String(g_state_level,l_path,'Validating batch status');

Line 688: IF l_return_status = FND_API.G_FALSE THEN

684: p_mode => 'REVERSE',
685: p_batch_id => p_batch_id,
686: x_return_status => l_return_status);
687:
688: IF l_return_status = FND_API.G_FALSE THEN
689: RAISE FND_API.G_EXC_ERROR;
690: END IF;
691:
692: /* Update Batch Status to Reversing */

Line 689: RAISE FND_API.G_EXC_ERROR;

685: p_batch_id => p_batch_id,
686: x_return_status => l_return_status);
687:
688: IF l_return_status = FND_API.G_FALSE THEN
689: RAISE FND_API.G_EXC_ERROR;
690: END IF;
691:
692: /* Update Batch Status to Reversing */
693: fun_net_util.Log_String(g_state_level,l_path,'Updating batch status');

Line 695: RAISE FND_API.G_EXC_ERROR;

691:
692: /* Update Batch Status to Reversing */
693: fun_net_util.Log_String(g_state_level,l_path,'Updating batch status');
694: IF NOT FUN_NET_ARAP_PKG.update_batch_status('REVERSING') THEN
695: RAISE FND_API.G_EXC_ERROR;
696: END IF;
697:
698: /* Reverse the Checks for the AP Invoices in the given batch */
699: fun_net_util.Log_String(g_state_level,l_path,'Reversing AP checks');

Line 704: IF l_return_status = FND_API.G_FALSE THEN

700: reverse_ap_checks(
701: p_batch_id => p_batch_id,
702: x_return_status => l_return_status);
703:
704: IF l_return_status = FND_API.G_FALSE THEN
705: RAISE FND_API.G_EXC_ERROR;
706: END IF;
707:
708: /* Reverse the Receipts created for the AR Txns in the batch */

Line 705: RAISE FND_API.G_EXC_ERROR;

701: p_batch_id => p_batch_id,
702: x_return_status => l_return_status);
703:
704: IF l_return_status = FND_API.G_FALSE THEN
705: RAISE FND_API.G_EXC_ERROR;
706: END IF;
707:
708: /* Reverse the Receipts created for the AR Txns in the batch */
709: fun_net_util.Log_String(g_state_level,l_path,'Reversing AR receipts');

Line 714: IF l_return_status = FND_API.G_FALSE THEN

710: reverse_ar_receipts(
711: p_batch_id => p_batch_id,
712: x_return_status => l_return_status);
713:
714: IF l_return_status = FND_API.G_FALSE THEN
715: RAISE FND_API.G_EXC_ERROR;
716: END IF;
717:
718: /* Update Agreement Status */

Line 715: RAISE FND_API.G_EXC_ERROR;

711: p_batch_id => p_batch_id,
712: x_return_status => l_return_status);
713:
714: IF l_return_status = FND_API.G_FALSE THEN
715: RAISE FND_API.G_EXC_ERROR;
716: END IF;
717:
718: /* Update Agreement Status */
719: fun_net_util.Log_String(g_state_level,l_path,'Get agreement');

Line 725: IF l_return_status = FND_API.G_FALSE THEN

721: p_batch_id => p_batch_id,
722: x_agreement_id => l_agreement_id,
723: x_return_status => l_return_status);
724:
725: IF l_return_status = FND_API.G_FALSE THEN
726: RAISE FND_API.G_EXC_ERROR;
727: END IF;
728: fun_net_util.Log_String(g_state_level,l_path,'Updating agreement status to N');
729: FUN_NET_ARAP_PKG.Set_Agreement_Status(

Line 726: RAISE FND_API.G_EXC_ERROR;

722: x_agreement_id => l_agreement_id,
723: x_return_status => l_return_status);
724:
725: IF l_return_status = FND_API.G_FALSE THEN
726: RAISE FND_API.G_EXC_ERROR;
727: END IF;
728: fun_net_util.Log_String(g_state_level,l_path,'Updating agreement status to N');
729: FUN_NET_ARAP_PKG.Set_Agreement_Status(
730: x_batch_id => p_batch_id,

Line 735: IF l_return_status = FND_API.G_FALSE THEN

731: x_agreement_id => l_agreement_id,
732: x_mode => 'UNSET',
733: x_return_status => l_return_status);
734:
735: IF l_return_status = FND_API.G_FALSE THEN
736: RAISE FND_API.G_EXC_ERROR;
737: END IF;
738: /* Update Amounts */
739: fun_net_util.Log_String(g_state_level,l_path,'Updating batch amounts');

Line 736: RAISE FND_API.G_EXC_ERROR;

732: x_mode => 'UNSET',
733: x_return_status => l_return_status);
734:
735: IF l_return_status = FND_API.G_FALSE THEN
736: RAISE FND_API.G_EXC_ERROR;
737: END IF;
738: /* Update Amounts */
739: fun_net_util.Log_String(g_state_level,l_path,'Updating batch amounts');
740: Update_amounts(

Line 744: IF l_return_status = FND_API.G_FALSE THEN

740: Update_amounts(
741: p_batch_id => p_batch_id,
742: x_return_status => l_return_status);
743:
744: IF l_return_status = FND_API.G_FALSE THEN
745: RAISE FND_API.G_EXC_ERROR;
746: END IF;
747:
748: /* Update Batch Status */

Line 745: RAISE FND_API.G_EXC_ERROR;

741: p_batch_id => p_batch_id,
742: x_return_status => l_return_status);
743:
744: IF l_return_status = FND_API.G_FALSE THEN
745: RAISE FND_API.G_EXC_ERROR;
746: END IF;
747:
748: /* Update Batch Status */
749: fun_net_util.Log_String(g_state_level,l_path,'Updating batch status to REVERSED');

Line 756: RAISE FND_API.G_EXC_ERROR;

752: WHERE batch_id = p_batch_id;
753:
754: /*IF NOT FUN_NET_ARAP_PKG.update_batch_status('REVERSED') THEN
755:
756: RAISE FND_API.G_EXC_ERROR;
757: END IF; */
758:
759: -- Standard check of p_commit.
760: IF FND_API.To_Boolean( p_commit ) THEN

Line 760: IF FND_API.To_Boolean( p_commit ) THEN

756: RAISE FND_API.G_EXC_ERROR;
757: END IF; */
758:
759: -- Standard check of p_commit.
760: IF FND_API.To_Boolean( p_commit ) THEN
761: COMMIT WORK;
762:
763: END IF;
764: fun_net_util.Log_String(g_state_level,l_path,'Successfully batch reversal');

Line 766: WHEN FND_API.G_EXC_ERROR THEN

762:
763: END IF;
764: fun_net_util.Log_String(g_state_level,l_path,'Successfully batch reversal');
765: EXCEPTION
766: WHEN FND_API.G_EXC_ERROR THEN
767: ROLLBACK TO Reverse_net_batch_SP;
768: x_return_status := FND_API.G_RET_STS_ERROR;
769: FND_MSG_PUB.Count_And_Get (
770: p_count => x_msg_count,

Line 768: x_return_status := FND_API.G_RET_STS_ERROR;

764: fun_net_util.Log_String(g_state_level,l_path,'Successfully batch reversal');
765: EXCEPTION
766: WHEN FND_API.G_EXC_ERROR THEN
767: ROLLBACK TO Reverse_net_batch_SP;
768: x_return_status := FND_API.G_RET_STS_ERROR;
769: FND_MSG_PUB.Count_And_Get (
770: p_count => x_msg_count,
771: p_data => x_msg_data );
772:

Line 773: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN

769: FND_MSG_PUB.Count_And_Get (
770: p_count => x_msg_count,
771: p_data => x_msg_data );
772:
773: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
774: ROLLBACK TO reverse_net_batch_SP;
775: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
776: FND_MSG_PUB.Count_And_Get (
777: p_count => x_msg_count,

Line 775: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;

771: p_data => x_msg_data );
772:
773: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
774: ROLLBACK TO reverse_net_batch_SP;
775: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
776: FND_MSG_PUB.Count_And_Get (
777: p_count => x_msg_count,
778: p_data => x_msg_data );
779:

Line 782: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;

778: p_data => x_msg_data );
779:
780: WHEN OTHERS THEN
781: ROLLBACK TO reverse_Net_Batch_SP;
782: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
783: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
784: --FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME, l_api_name);
785: FND_MSG_PUB.Add_Exc_Msg( 'FUN_ARAP_NET_PKG', 'reverse_net_batch');
786: END IF;