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' or 'SUSPENDED' or 'ERROR' 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 OR SUSPENDED OR ERROR
101: AR Transactions are not locked at this point */
102: --Bug: 8342419

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 361: x_return_status := FND_API.G_TRUE;

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

Line 391: x_return_status := FND_API.G_FALSE;

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

Line 396: x_return_status := FND_API.G_FALSE;

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

Line 432: x_return_status := FND_API.G_TRUE;

428: l_reversal_date DATE; -- Bug # 8904763
429:
430: BEGIN
431: l_path := g_path || 'reverse_ap_checks';
432: x_return_status := FND_API.G_TRUE;
433:
434:
435: OPEN c_get_batch_details; -- Bug # 8904763
436: FETCH c_get_batch_details INTO l_gl_date,l_settlement_date;

Line 458: IF l_return_status = FND_API.G_FALSE THEN

454: x_period_name => l_period_name,
455: x_return_status => l_return_status,
456: x_return_msg => l_return_msg);
457:
458: IF l_return_status = FND_API.G_FALSE THEN
459: x_return_status := FND_API.G_FALSE;
460: RETURN;
461: END IF;
462:

Line 459: x_return_status := FND_API.G_FALSE;

455: x_return_status => l_return_status,
456: x_return_msg => l_return_msg);
457:
458: IF l_return_status = FND_API.G_FALSE THEN
459: x_return_status := FND_API.G_FALSE;
460: RETURN;
461: END IF;
462:
463:

Line 491: IF l_return_status = FND_API.G_FALSE THEN

487: X_msg_count => l_msg_count,
488: X_msg_data => l_msg_data);
489:
490:
491: IF l_return_status = FND_API.G_FALSE THEN
492: x_return_status := FND_API.G_FALSE;
493: RETURN;
494: END IF;
495:

Line 492: x_return_status := FND_API.G_FALSE;

488: X_msg_data => l_msg_data);
489:
490:
491: IF l_return_status = FND_API.G_FALSE THEN
492: x_return_status := FND_API.G_FALSE;
493: RETURN;
494: END IF;
495:
496: END LOOP;

Line 500: x_return_status := FND_API.G_FALSE;

496: END LOOP;
497: fun_net_util.Log_String(g_state_level,l_path,'Successfully reversed AP invoices');
498: EXCEPTION
499: WHEN OTHERS THEN
500: x_return_status := FND_API.G_FALSE;
501: END reverse_ap_checks;
502:
503: /* Validates the GL Period for the Reversal Date. If the Period is not 'Open'
504: or 'Future' then raises an error.

Line 539: x_return_status := FND_API.G_TRUE;

535: l_reversal_date DATE;
536: l_path VARCHAR2(100);
537: BEGIN
538: l_path := g_path || 'reverse_ar_receipts';
539: x_return_status := FND_API.G_TRUE;
540:
541:
542: FOR ar_txn_rec IN ar_txn_cur(p_batch_id)
543: LOOP

Line 567: IF x_return_status = FND_API.G_FALSE THEN

563: x_period_name => l_period_name,
564: x_return_status => x_return_status,
565: x_return_msg => l_msg_data);
566:
567: IF x_return_status = FND_API.G_FALSE THEN
568: RETURN;
569: END IF;
570:
571: AR_RECEIPT_API_PUB.Reverse(

Line 574: p_init_msg_list => FND_API.G_TRUE,

570:
571: AR_RECEIPT_API_PUB.Reverse(
572: -- Standard API parameters.
573: p_api_version => 1.0,
574: p_init_msg_list => FND_API.G_TRUE,
575: p_commit => FND_API.G_FALSE,
576: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
577: x_return_status => l_return_status,
578: x_msg_count => l_msg_count,

Line 575: p_commit => FND_API.G_FALSE,

571: AR_RECEIPT_API_PUB.Reverse(
572: -- Standard API parameters.
573: p_api_version => 1.0,
574: p_init_msg_list => FND_API.G_TRUE,
575: p_commit => FND_API.G_FALSE,
576: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
577: x_return_status => l_return_status,
578: x_msg_count => l_msg_count,
579: x_msg_data => l_msg_data,

Line 576: p_validation_level => FND_API.G_VALID_LEVEL_FULL,

572: -- Standard API parameters.
573: p_api_version => 1.0,
574: p_init_msg_list => FND_API.G_TRUE,
575: p_commit => FND_API.G_FALSE,
576: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
577: x_return_status => l_return_status,
578: x_msg_count => l_msg_count,
579: x_msg_data => l_msg_data,
580: -- Receipt reversal related parameters

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

600:
601:
602: FOR x IN 1..l_msg_count LOOP
603:
604: l_msg_data := fnd_msg_pub.get(p_encoded => fnd_api.g_false);
605: fun_net_util.Log_String(g_event_level,l_path
606: ,'Reverse package Error message AR_RECEIPT_API_PUB.Reverse' ||l_msg_data||' '||' '||x);
607:
608: END LOOP;

Line 612: IF l_return_status = FND_API.G_RET_STS_ERROR THEN

608: END LOOP;
609:
610:
611: END IF;
612: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
613: fun_net_util.Log_String(g_state_level,l_path,'Error in reversing AR transactions');
614: x_return_status := FND_API.G_FALSE;
615: RETURN;
616: END IF;

Line 614: x_return_status := FND_API.G_FALSE;

610:
611: END IF;
612: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
613: fun_net_util.Log_String(g_state_level,l_path,'Error in reversing AR transactions');
614: x_return_status := FND_API.G_FALSE;
615: RETURN;
616: END IF;
617: END LOOP;
618: fun_net_util.Log_String(g_state_level,l_path,'Successfully reversed AR transactions');

Line 621: x_return_status := FND_API.G_FALSE;

617: END LOOP;
618: fun_net_util.Log_String(g_state_level,l_path,'Successfully reversed AR transactions');
619: EXCEPTION
620: WHEN OTHERS THEN
621: x_return_status := FND_API.G_FALSE;
622:
623: END reverse_ar_receipts;
624:
625: PROCEDURE Update_Amounts(

Line 636: x_return_status := FND_API.G_FALSE;

632: SET netted_amt = 0
633: WHERE batch_id = p_batch_id;
634: EXCEPTION
635: WHEN OTHERS THEN
636: x_return_status := FND_API.G_FALSE;
637: RETURN;
638: END;
639: BEGIN
640: UPDATE FUN_NET_AR_TXNS

Line 645: x_return_status := FND_API.G_FALSE;

641: SET netted_amt = 0
642: WHERE batch_id = p_batch_id;
643: EXCEPTION
644: WHEN OTHERS THEN
645: x_return_status := FND_API.G_FALSE;
646: RETURN;
647: END;
648: BEGIN
649: UPDATE FUN_NET_BATCHES

Line 654: x_return_status := FND_API.G_FALSE;

650: SET total_netted_amt = 0
651: WHERE batch_id = p_batch_id;
652: EXCEPTION
653: WHEN OTHERS THEN
654: x_return_status := FND_API.G_FALSE;
655: RETURN;
656: END;
657: EXCEPTION
658: WHEN OTHERS THEN

Line 659: x_return_status := FND_API.G_FALSE;

655: RETURN;
656: END;
657: EXCEPTION
658: WHEN OTHERS THEN
659: x_return_status := FND_API.G_FALSE;
660:
661: END;
662:
663: PROCEDURE reverse_net_batch(

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

661: END;
662:
663: PROCEDURE reverse_net_batch(
664: -- ***** Standard API Parameters *****
665: p_init_msg_list IN VARCHAR2 := FND_API.G_TRUE,
666: p_commit IN VARCHAR2 := FND_API.G_FALSE,
667: x_return_status OUT NOCOPY VARCHAR2,
668: x_msg_count OUT NOCOPY NUMBER,
669: x_msg_data OUT NOCOPY VARCHAR2,

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

662:
663: PROCEDURE reverse_net_batch(
664: -- ***** Standard API Parameters *****
665: p_init_msg_list IN VARCHAR2 := FND_API.G_TRUE,
666: p_commit IN VARCHAR2 := FND_API.G_FALSE,
667: x_return_status OUT NOCOPY VARCHAR2,
668: x_msg_count OUT NOCOPY NUMBER,
669: x_msg_data OUT NOCOPY VARCHAR2,
670: -- ***** Netting batch input parameters *****

Line 691: IF FND_API.to_Boolean( p_init_msg_list ) THEN

687: -- **** Standard start of API savepoint ****
688: SAVEPOINT reverse_net_batch_SP;
689: fun_net_util.Log_String(g_state_level,l_path,'Set the savepoint');
690: -- **** Initialize message list if p_init_msg_list is set to TRUE. ****
691: IF FND_API.to_Boolean( p_init_msg_list ) THEN
692: FND_MSG_PUB.initialize;
693: END IF;
694:
695: -- **** Initialize return status to SUCCESS *****

Line 696: x_return_status := FND_API.G_RET_STS_SUCCESS;

692: FND_MSG_PUB.initialize;
693: END IF;
694:
695: -- **** Initialize return status to SUCCESS *****
696: x_return_status := FND_API.G_RET_STS_SUCCESS;
697:
698: /*-----------------------------------------------+
699: | ======== START OF API BODY ============ |
700: +-----------------------------------------------*/

Line 705: RAISE FND_API.G_EXC_ERROR;

701:
702: /* Check for mandatory parameters */
703:
704: IF p_batch_id IS NULL THEN
705: RAISE FND_API.G_EXC_ERROR;
706: END IF;
707:
708: IF l_return_status = FND_API.G_FALSE THEN
709: RAISE FND_API.G_EXC_ERROR;

Line 708: IF l_return_status = FND_API.G_FALSE THEN

704: IF p_batch_id IS NULL THEN
705: RAISE FND_API.G_EXC_ERROR;
706: END IF;
707:
708: IF l_return_status = FND_API.G_FALSE THEN
709: RAISE FND_API.G_EXC_ERROR;
710: END IF;
711:
712: /* Check the batch status before reversing */

Line 709: RAISE FND_API.G_EXC_ERROR;

705: RAISE FND_API.G_EXC_ERROR;
706: END IF;
707:
708: IF l_return_status = FND_API.G_FALSE THEN
709: RAISE FND_API.G_EXC_ERROR;
710: END IF;
711:
712: /* Check the batch status before reversing */
713: fun_net_util.Log_String(g_state_level,l_path,'Validating batch status');

Line 719: IF l_return_status = FND_API.G_FALSE THEN

715: p_mode => 'REVERSE',
716: p_batch_id => p_batch_id,
717: x_return_status => l_return_status);
718:
719: IF l_return_status = FND_API.G_FALSE THEN
720: RAISE FND_API.G_EXC_ERROR;
721: END IF;
722:
723: /* Update Batch Status to Reversing */

Line 720: RAISE FND_API.G_EXC_ERROR;

716: p_batch_id => p_batch_id,
717: x_return_status => l_return_status);
718:
719: IF l_return_status = FND_API.G_FALSE THEN
720: RAISE FND_API.G_EXC_ERROR;
721: END IF;
722:
723: /* Update Batch Status to Reversing */
724: fun_net_util.Log_String(g_state_level,l_path,'Updating batch status');

Line 726: RAISE FND_API.G_EXC_ERROR;

722:
723: /* Update Batch Status to Reversing */
724: fun_net_util.Log_String(g_state_level,l_path,'Updating batch status');
725: IF NOT FUN_NET_ARAP_PKG.update_batch_status('REVERSING') THEN
726: RAISE FND_API.G_EXC_ERROR;
727: END IF;
728:
729: /* Reverse the Checks for the AP Invoices in the given batch */
730: fun_net_util.Log_String(g_state_level,l_path,'Reversing AP checks');

Line 735: IF l_return_status = FND_API.G_FALSE THEN

731: reverse_ap_checks(
732: p_batch_id => p_batch_id,
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:
739: /* Reverse the Receipts created for the AR Txns in the batch */

Line 736: RAISE FND_API.G_EXC_ERROR;

732: p_batch_id => p_batch_id,
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:
739: /* Reverse the Receipts created for the AR Txns in the batch */
740: fun_net_util.Log_String(g_state_level,l_path,'Reversing AR receipts');

Line 745: IF l_return_status = FND_API.G_FALSE THEN

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

Line 746: RAISE FND_API.G_EXC_ERROR;

742: p_batch_id => p_batch_id,
743: x_return_status => l_return_status);
744:
745: IF l_return_status = FND_API.G_FALSE THEN
746: RAISE FND_API.G_EXC_ERROR;
747: END IF;
748:
749: /* Update Agreement Status */
750: fun_net_util.Log_String(g_state_level,l_path,'Get agreement');

Line 756: IF l_return_status = FND_API.G_FALSE THEN

752: p_batch_id => p_batch_id,
753: x_agreement_id => l_agreement_id,
754: x_return_status => l_return_status);
755:
756: IF l_return_status = FND_API.G_FALSE THEN
757: RAISE FND_API.G_EXC_ERROR;
758: END IF;
759: fun_net_util.Log_String(g_state_level,l_path,'Updating agreement status to N');
760: FUN_NET_ARAP_PKG.Set_Agreement_Status(

Line 757: RAISE FND_API.G_EXC_ERROR;

753: x_agreement_id => l_agreement_id,
754: x_return_status => l_return_status);
755:
756: IF l_return_status = FND_API.G_FALSE THEN
757: RAISE FND_API.G_EXC_ERROR;
758: END IF;
759: fun_net_util.Log_String(g_state_level,l_path,'Updating agreement status to N');
760: FUN_NET_ARAP_PKG.Set_Agreement_Status(
761: x_batch_id => p_batch_id,

Line 766: IF l_return_status = FND_API.G_FALSE THEN

762: x_agreement_id => l_agreement_id,
763: x_mode => 'UNSET',
764: x_return_status => l_return_status);
765:
766: IF l_return_status = FND_API.G_FALSE THEN
767: RAISE FND_API.G_EXC_ERROR;
768: END IF;
769: /* Update Amounts */
770: fun_net_util.Log_String(g_state_level,l_path,'Updating batch amounts');

Line 767: RAISE FND_API.G_EXC_ERROR;

763: x_mode => 'UNSET',
764: x_return_status => l_return_status);
765:
766: IF l_return_status = FND_API.G_FALSE THEN
767: RAISE FND_API.G_EXC_ERROR;
768: END IF;
769: /* Update Amounts */
770: fun_net_util.Log_String(g_state_level,l_path,'Updating batch amounts');
771: Update_amounts(

Line 775: IF l_return_status = FND_API.G_FALSE THEN

771: Update_amounts(
772: p_batch_id => p_batch_id,
773: x_return_status => l_return_status);
774:
775: IF l_return_status = FND_API.G_FALSE THEN
776: RAISE FND_API.G_EXC_ERROR;
777: END IF;
778:
779: /* Update Batch Status */

Line 776: RAISE FND_API.G_EXC_ERROR;

772: p_batch_id => p_batch_id,
773: x_return_status => l_return_status);
774:
775: IF l_return_status = FND_API.G_FALSE THEN
776: RAISE FND_API.G_EXC_ERROR;
777: END IF;
778:
779: /* Update Batch Status */
780: fun_net_util.Log_String(g_state_level,l_path,'Updating batch status to REVERSED');

Line 787: RAISE FND_API.G_EXC_ERROR;

783: WHERE batch_id = p_batch_id;
784:
785: /*IF NOT FUN_NET_ARAP_PKG.update_batch_status('REVERSED') THEN
786:
787: RAISE FND_API.G_EXC_ERROR;
788: END IF; */
789:
790: -- Standard check of p_commit.
791: IF FND_API.To_Boolean( p_commit ) THEN

Line 791: IF FND_API.To_Boolean( p_commit ) THEN

787: RAISE FND_API.G_EXC_ERROR;
788: END IF; */
789:
790: -- Standard check of p_commit.
791: IF FND_API.To_Boolean( p_commit ) THEN
792: COMMIT WORK;
793:
794: END IF;
795: fun_net_util.Log_String(g_state_level,l_path,'Successfully batch reversal');

Line 797: WHEN FND_API.G_EXC_ERROR THEN

793:
794: END IF;
795: fun_net_util.Log_String(g_state_level,l_path,'Successfully batch reversal');
796: EXCEPTION
797: WHEN FND_API.G_EXC_ERROR THEN
798: ROLLBACK TO Reverse_net_batch_SP;
799: x_return_status := FND_API.G_RET_STS_ERROR;
800: FND_MSG_PUB.Count_And_Get (
801: p_count => x_msg_count,

Line 799: x_return_status := FND_API.G_RET_STS_ERROR;

795: fun_net_util.Log_String(g_state_level,l_path,'Successfully batch reversal');
796: EXCEPTION
797: WHEN FND_API.G_EXC_ERROR THEN
798: ROLLBACK TO Reverse_net_batch_SP;
799: x_return_status := FND_API.G_RET_STS_ERROR;
800: FND_MSG_PUB.Count_And_Get (
801: p_count => x_msg_count,
802: p_data => x_msg_data );
803:

Line 804: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN

800: FND_MSG_PUB.Count_And_Get (
801: p_count => x_msg_count,
802: p_data => x_msg_data );
803:
804: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
805: ROLLBACK TO reverse_net_batch_SP;
806: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
807: FND_MSG_PUB.Count_And_Get (
808: p_count => x_msg_count,

Line 806: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;

802: p_data => x_msg_data );
803:
804: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
805: ROLLBACK TO reverse_net_batch_SP;
806: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
807: FND_MSG_PUB.Count_And_Get (
808: p_count => x_msg_count,
809: p_data => x_msg_data );
810:

Line 813: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;

809: p_data => x_msg_data );
810:
811: WHEN OTHERS THEN
812: ROLLBACK TO reverse_Net_Batch_SP;
813: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
814: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
815: --FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME, l_api_name);
816: FND_MSG_PUB.Add_Exc_Msg( 'FUN_ARAP_NET_PKG', 'reverse_net_batch');
817: END IF;