1: PACKAGE BODY AR_ADJUST_PUB AS
2: /* $Header: ARXPADJB.pls 120.30.12020000.2 2012/07/03 22:38:00 dgaurab ship $*/
3:
4: G_PKG_NAME CONSTANT VARCHAR2(30) :='AR_ADJUST_PUB';
5: G_MSG_UERROR CONSTANT NUMBER := FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR;
6: G_MSG_ERROR CONSTANT NUMBER := FND_MSG_PUB.G_MSG_LVL_ERROR;
7: G_MSG_HIGH CONSTANT NUMBER := FND_MSG_PUB.G_MSG_LVL_DEBUG_HIGH;
8: G_MSG_MEDIUM CONSTANT NUMBER := FND_MSG_PUB.G_MSG_LVL_DEBUG_MEDIUM;
9: G_MSG_LOW CONSTANT NUMBER := FND_MSG_PUB.G_MSG_LVL_DEBUG_LOW;
2: /* $Header: ARXPADJB.pls 120.30.12020000.2 2012/07/03 22:38:00 dgaurab ship $*/
3:
4: G_PKG_NAME CONSTANT VARCHAR2(30) :='AR_ADJUST_PUB';
5: G_MSG_UERROR CONSTANT NUMBER := FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR;
6: G_MSG_ERROR CONSTANT NUMBER := FND_MSG_PUB.G_MSG_LVL_ERROR;
7: G_MSG_HIGH CONSTANT NUMBER := FND_MSG_PUB.G_MSG_LVL_DEBUG_HIGH;
8: G_MSG_MEDIUM CONSTANT NUMBER := FND_MSG_PUB.G_MSG_LVL_DEBUG_MEDIUM;
9: G_MSG_LOW CONSTANT NUMBER := FND_MSG_PUB.G_MSG_LVL_DEBUG_LOW;
10:
3:
4: G_PKG_NAME CONSTANT VARCHAR2(30) :='AR_ADJUST_PUB';
5: G_MSG_UERROR CONSTANT NUMBER := FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR;
6: G_MSG_ERROR CONSTANT NUMBER := FND_MSG_PUB.G_MSG_LVL_ERROR;
7: G_MSG_HIGH CONSTANT NUMBER := FND_MSG_PUB.G_MSG_LVL_DEBUG_HIGH;
8: G_MSG_MEDIUM CONSTANT NUMBER := FND_MSG_PUB.G_MSG_LVL_DEBUG_MEDIUM;
9: G_MSG_LOW CONSTANT NUMBER := FND_MSG_PUB.G_MSG_LVL_DEBUG_LOW;
10:
11: /*===========================================================================+
4: G_PKG_NAME CONSTANT VARCHAR2(30) :='AR_ADJUST_PUB';
5: G_MSG_UERROR CONSTANT NUMBER := FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR;
6: G_MSG_ERROR CONSTANT NUMBER := FND_MSG_PUB.G_MSG_LVL_ERROR;
7: G_MSG_HIGH CONSTANT NUMBER := FND_MSG_PUB.G_MSG_LVL_DEBUG_HIGH;
8: G_MSG_MEDIUM CONSTANT NUMBER := FND_MSG_PUB.G_MSG_LVL_DEBUG_MEDIUM;
9: G_MSG_LOW CONSTANT NUMBER := FND_MSG_PUB.G_MSG_LVL_DEBUG_LOW;
10:
11: /*===========================================================================+
12: | PROCEDURE |
5: G_MSG_UERROR CONSTANT NUMBER := FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR;
6: G_MSG_ERROR CONSTANT NUMBER := FND_MSG_PUB.G_MSG_LVL_ERROR;
7: G_MSG_HIGH CONSTANT NUMBER := FND_MSG_PUB.G_MSG_LVL_DEBUG_HIGH;
8: G_MSG_MEDIUM CONSTANT NUMBER := FND_MSG_PUB.G_MSG_LVL_DEBUG_MEDIUM;
9: G_MSG_LOW CONSTANT NUMBER := FND_MSG_PUB.G_MSG_LVL_DEBUG_LOW;
10:
11: /*===========================================================================+
12: | PROCEDURE |
13: | Validate_Adj_Insert |
24: | fnd_api.g_ret_sts_error |
25: | fnd_api.g_ret_sts_error |
26: | fnd_api.g_ret_sts_success |
27: | fnd_api.to_boolean |
28: | fnd_msg_pub.check_msg_level |
29: | fnd_msg_pub.count_and_get |
30: | fnd_msg_pub.initialize |
31: | ar_adjvalidate_pvt.Validate_Type |
32: | ar_adjvalidate_pvt.Validate_Payschd |
25: | fnd_api.g_ret_sts_error |
26: | fnd_api.g_ret_sts_success |
27: | fnd_api.to_boolean |
28: | fnd_msg_pub.check_msg_level |
29: | fnd_msg_pub.count_and_get |
30: | fnd_msg_pub.initialize |
31: | ar_adjvalidate_pvt.Validate_Type |
32: | ar_adjvalidate_pvt.Validate_Payschd |
33: | ar_adjvalidate_pvt.Validate_amount |
26: | fnd_api.g_ret_sts_success |
27: | fnd_api.to_boolean |
28: | fnd_msg_pub.check_msg_level |
29: | fnd_msg_pub.count_and_get |
30: | fnd_msg_pub.initialize |
31: | ar_adjvalidate_pvt.Validate_Type |
32: | ar_adjvalidate_pvt.Validate_Payschd |
33: | ar_adjvalidate_pvt.Validate_amount |
34: | ar_adjvalidate_pvt.Validate_Rcvtrxccid |
234: /*-----------------------------------------------+
235: | Set the message |
236: +-----------------------------------------------*/
237: FND_MESSAGE.SET_NAME('AR','AR_TW_PRORATE_ADJ_NO_TAX_RATE');
238: FND_MSG_PUB.ADD ;
239: p_validation_status := FND_API.G_RET_STS_ERROR;
240: ELSIF (l_error_num = 2) THEN
241: IF PG_DEBUG in ('Y', 'C') THEN
242: arp_util.debug('Validate_Adj_Insert: ' || 'cal_prorated_amount failed - error num 2');
244: /*-----------------------------------------------+
245: | Set the message |
246: +-----------------------------------------------*/
247: FND_MESSAGE.SET_NAME('AR','AR_TW_PRORATE_ADJ_OVERAPPLY');
248: FND_MSG_PUB.ADD ;
249: p_validation_status := FND_API.G_RET_STS_ERROR;
250: ELSIF (l_error_num = 3) THEN
251: IF PG_DEBUG in ('Y', 'C') THEN
252: arp_util.debug('Validate_Adj_Insert: ' || 'cal_prorated_amount failed - error num 3');
420: WHEN OTHERS THEN
421: IF PG_DEBUG in ('Y', 'C') THEN
422: arp_util.debug('EXCEPTION: Validate_Adj_Insert() ');
423: END IF;
424: FND_MSG_PUB.Add_Exc_Msg (G_PKG_NAME,'Validate_Adj_Insert');
425: p_validation_status := FND_API.G_RET_STS_UNEXP_ERROR ;
426: RETURN;
427:
428:
508: WHEN OTHERS THEN
509: IF PG_DEBUG in ('Y', 'C') THEN
510: arp_util.debug('EXCEPTION: Set_Remaining_Attributes() ');
511: END IF;
512: FND_MSG_PUB.Add_Exc_Msg (G_PKG_NAME,'Set_Remaining_Attributes');
513: p_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
514: RETURN;
515:
516: END Set_Remaining_Attributes;
584: OR (p_old_adj_rec.status = 'R')) /*Bug 4303601*/
585: THEN
586: FND_MESSAGE.SET_NAME ('AR', 'AR_AAPI_NO_CHANGE_OR_REVERSE');
587: FND_MESSAGE.SET_TOKEN ( 'STATUS', p_old_adj_rec.status ) ;
588: FND_MSG_PUB.ADD ;
589: p_validation_status := FND_API.G_RET_STS_ERROR;
590: IF PG_DEBUG in ('Y', 'C') THEN
591: arp_util.debug('Validate_Adj_modify: ' || 'The old adjustment status is A, cannot modify');
592: END IF;
600: (p_adj_rec.associated_application_id IS NULL ) AND
601: (p_adj_rec.associated_cash_receipt_id IS NULL)
602: ) THEN
603: FND_MESSAGE.SET_NAME ('AR', 'AR_RAPI_RCPT_RA_ID_X_INVALID');
604: FND_MSG_PUB.ADD ;
605: p_validation_status := FND_API.G_RET_STS_ERROR;
606: IF PG_DEBUG in ('Y', 'C') THEN
607: arp_util.debug('Validate_Adj_modify: ' || 'Invalid associated cash_receipt_id or application id -should not be null');
608: END IF;
618: (p_adj_rec.gl_date IS NOT NULL )))
619: THEN
620: FND_MESSAGE.SET_NAME ('AR', 'AR_AAPI_NO_CHANGE_OR_REVERSE');
621: FND_MESSAGE.SET_TOKEN ( 'STATUS', p_old_adj_rec.status ) ;
622: FND_MSG_PUB.ADD ;
623: p_validation_status := FND_API.G_RET_STS_ERROR;
624: IF PG_DEBUG in ('Y', 'C') THEN
625: arp_util.debug('Validate_Adj_modify: ' || 'Cannot modify comments,status or gl date of an approved adjustment');
626: END IF;
635: (p_adj_rec.status NOT IN ('A', 'R', 'W', 'M')) )
636: THEN
637: FND_MESSAGE.SET_NAME ('AR', 'AR_AAPI_INVALID_CHANGE_STATUS');
638: FND_MESSAGE.SET_TOKEN ( 'STATUS', p_adj_rec.status ) ;
639: FND_MSG_PUB.ADD ;
640: p_validation_status := FND_API.G_RET_STS_ERROR;
641: IF PG_DEBUG in ('Y', 'C') THEN
642: arp_util.debug('Validate_Adj_modify: ' || 'The new adjustment status is not valid, cannot modify');
643: END IF;
666: | Set the message and status accordingly |
667: +-----------------------------------------------*/
668: FND_MESSAGE.SET_NAME ( 'AR', 'AR_AAPI_INVALID_PAYMENT_SCHEDULE');
669: FND_MESSAGE.SET_TOKEN('PAYMENT_SCHEDULE_ID',to_char(p_old_adj_rec.payment_schedule_id));
670: FND_MSG_PUB.ADD ;
671:
672: p_validation_status := FND_API.G_RET_STS_ERROR;
673: IF PG_DEBUG in ('Y', 'C') THEN
674: arp_util.debug('Validate_Adj_modify: ' || 'Invalid Payment Schedule Id');
706:
707: IF ( l_approved_flag <> FND_API.G_TRUE )
708: THEN
709: FND_MESSAGE.SET_NAME ( 'AR', 'AR_VAL_AMT_APPROVAL_LIMIT');
710: FND_MSG_PUB.ADD ;
711: p_validation_status := FND_API.G_RET_STS_ERROR;
712: IF PG_DEBUG in ('Y', 'C') THEN
713: arp_util.debug('Validate_Adj_modify: ' || 'amount not in approval limits ');
714: END IF;
777: AND applied_payment_schedule_id= p_old_adj_rec.payment_schedule_id;
778: EXCEPTION
779: WHEN no_data_found THEN
780: FND_MESSAGE.SET_NAME ( 'AR', 'AR_RAPI_REC_APP_ID_INVALID');
781: FND_MSG_PUB.ADD ;
782: p_validation_status := FND_API.G_RET_STS_ERROR;
783: IF PG_DEBUG in ('Y', 'C') THEN
784: arp_util.debug('Validate_Adj_modify: ' || 'Associated Application ID passed is invalid');
785: END IF;
794: ( p_adj_rec.associated_cash_receipt_id IS NULL ) AND
795: ( l_cash_receipt_id IS NULL )) THEN
796:
797: FND_MESSAGE.SET_NAME ( 'AR', 'AR_RAPI_REC_APP_ID_INVALID');
798: FND_MSG_PUB.ADD ;
799: p_validation_status := FND_API.G_RET_STS_ERROR;
800: IF PG_DEBUG in ('Y', 'C') THEN
801: arp_util.debug('Validate_Adj_modify: ' || 'Associated Application ID should belongs to valid Receipt,pass cash receipt id');
802: END IF;
858: WHEN OTHERS THEN
859: IF PG_DEBUG in ('Y', 'C') THEN
860: arp_util.debug('EXCEPTION: Validate_Adj_Modify() ');
861: END IF;
862: FND_MSG_PUB.Add_Exc_Msg (G_PKG_NAME,'Validate_Adj_Modify');
863: p_validation_status := FND_API.G_RET_STS_UNEXP_ERROR ;
864: RETURN;
865:
866:
923: IF ( p_old_adj_rec.status <> 'A' )
924: THEN
925: FND_MESSAGE.SET_NAME ( 'AR', 'AR_AAPI_NO_CHANGE_OR_REVERSE');
926: FND_MESSAGE.SET_TOKEN ( 'STATUS', p_old_adj_rec.status);
927: FND_MSG_PUB.ADD ;
928: p_validation_status := FND_API.G_RET_STS_ERROR;
929: IF PG_DEBUG in ('Y', 'C') THEN
930: arp_util.debug('Validate_Adj_Reverse: ' || 'the status of the old adj is not A ');
931: END IF;
967: +-----------------------------------------------*/
968:
969: FND_MESSAGE.SET_NAME ('AR', 'AR_AAPI_INVALID_PAYMENT_SCHEDULE');
970: FND_MESSAGE.SET_TOKEN ( 'PAYMENT_SCHEDULE_ID', to_char(p_old_adj_rec.payment_schedule_id) ) ;
971: FND_MSG_PUB.ADD ;
972:
973: p_validation_status := FND_API.G_RET_STS_ERROR;
974: IF PG_DEBUG in ('Y', 'C') THEN
975: arp_util.debug('Validate_Adj_Reverse: ' || 'invalid payment schedule id');
1002: WHEN OTHERS THEN
1003: IF PG_DEBUG in ('Y', 'C') THEN
1004: arp_util.debug('EXCEPTION: Validate_Adj_Reverse() ');
1005: END IF;
1006: FND_MSG_PUB.Add_Exc_Msg (G_PKG_NAME,'Validate_Adj_Reverse');
1007: p_validation_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1008: RETURN;
1009:
1010:
1070: THEN
1071:
1072: FND_MESSAGE.SET_NAME ('AR', 'AR_AAPI_NO_CHANGE_OR_REVERSE');
1073: FND_MESSAGE.SET_TOKEN ( 'STATUS', p_old_adj_rec.status ) ;
1074: FND_MSG_PUB.ADD ;
1075: p_validation_status := FND_API.G_RET_STS_ERROR;
1076: IF PG_DEBUG in ('Y', 'C') THEN
1077: arp_util.debug('Validate_Adj_Approve: ' || 'the adjustment is already approved or rejected');
1078: END IF;
1096: THEN
1097:
1098: FND_MESSAGE.SET_NAME ('AR', 'AR_AAPI_INVALID_CHANGE_STATUS');
1099: FND_MESSAGE.SET_TOKEN ( 'STATUS', p_adj_rec.status ) ;
1100: FND_MSG_PUB.ADD ;
1101: p_validation_status := FND_API.G_RET_STS_ERROR;
1102: IF PG_DEBUG in ('Y', 'C') THEN
1103: arp_util.debug('Validate_Adj_Approve: ' || 'the value of the new status is not in A, R, W, M');
1104: END IF;
1131: +-----------------------------------------------*/
1132:
1133: FND_MESSAGE.SET_NAME ('AR', 'AR_AAPI_INVALID_PAYMENT_SCHEDULE');
1134: FND_MESSAGE.SET_TOKEN('PAYMENT_SCHEDULE_ID',to_char(p_old_adj_rec.payment_schedule_id));
1135: FND_MSG_PUB.ADD ;
1136: p_validation_status := FND_API.G_RET_STS_ERROR;
1137: IF PG_DEBUG in ('Y', 'C') THEN
1138: arp_util.debug('Validate_Adj_Approve: ' || 'Invalid payment schedule id');
1139: END IF;
1170:
1171: IF ( l_approved_flag <> FND_API.G_TRUE )
1172: THEN
1173: FND_MESSAGE.SET_NAME ('AR', 'AR_VAL_AMT_APPROVAL_LIMIT');
1174: FND_MSG_PUB.ADD ;
1175:
1176: p_validation_status := FND_API.G_RET_STS_ERROR;
1177: IF PG_DEBUG in ('Y', 'C') THEN
1178: arp_util.debug('Validate_Adj_Approve: ' || 'not within approval limits');
1244: WHEN OTHERS THEN
1245: IF PG_DEBUG in ('Y', 'C') THEN
1246: arp_util.debug('EXCEPTION: Validate_Adj_Approve() ');
1247: END IF;
1248: FND_MSG_PUB.Add_Exc_Msg (G_PKG_NAME,'Validate_Adj_Approve');
1249: p_validation_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1250: RETURN;
1251:
1252:
1423:
1424: l_return_status := FND_API.G_RET_STS_ERROR ;
1425: FND_MESSAGE.SET_NAME ('AR', 'AR_ADJ_API_TYPE_DISALLOW');
1426: FND_MESSAGE.SET_TOKEN ( 'TYPE', p_adj_rec.TYPE ) ;
1427: FND_MSG_PUB.ADD ;
1428:
1429: IF PG_DEBUG in ('Y', 'C') THEN
1430: arp_util.debug('create_linelevel_adjustment : ' || 'Error(s) occurred. Rolling back and setting status to ERROR');
1431: arp_util.debug('create_linelevel_adjustment : ' || 'line level adjustment can only allowed for type LINE');
1437: THEN
1438:
1439: FND_MESSAGE.SET_NAME ('AR', 'AR_ADJ_API_CUST_LINE_ID_IG');
1440: FND_MESSAGE.SET_TOKEN ( 'CUSTOMER_TRX_LINE_ID', p_adj_rec.customer_trx_line_id ) ;
1441: FND_MSG_PUB.ADD ;
1442:
1443: IF PG_DEBUG in ('Y', 'C') THEN
1444: arp_util.debug('create_linelevel_adjustment : ' || 'Warning(s) occurred. Ignoring header level customer trx line id');
1445:
1452: THEN
1453:
1454: FND_MESSAGE.SET_NAME ('AR', 'AR_ADJ_API_RECV_TRX_ID_IG');
1455: FND_MESSAGE.SET_TOKEN ( 'RECEIVABLES_TRX_ID', p_adj_rec.receivables_trx_id ) ;
1456: FND_MSG_PUB.ADD ;
1457:
1458: IF PG_DEBUG in ('Y', 'C') THEN
1459: arp_util.debug('create_linelevel_adjustment : ' || 'Warning(s) occurred. Ignoring header level receivables trx id');
1460:
1465: IF p_adj_rec.amount IS NOT NULL
1466: THEN
1467: FND_MESSAGE.SET_NAME ('AR', 'AR_ADJ_API_AMOUNT_IG');
1468: FND_MESSAGE.SET_TOKEN ( 'AMOUNT', p_adj_rec.amount ) ;
1469: FND_MSG_PUB.ADD ;
1470:
1471: IF PG_DEBUG in ('Y', 'C') THEN
1472: arp_util.debug('create_linelevel_adjustment : ' || 'Warning(s) occurred. Ignoring header level Amount');
1473:
1486: THEN
1487: l_return_status := FND_API.G_RET_STS_ERROR ;
1488: FND_MESSAGE.SET_NAME ('AR', 'AR_LL_ADJ_INSTALL_NOT_ALLOWED');
1489: FND_MESSAGE.SET_TOKEN ( 'CUST_TRX_ID', p_adj_rec.customer_trx_id ) ;
1490: FND_MSG_PUB.ADD ;
1491: IF PG_DEBUG in ('Y', 'C') THEN
1492: arp_util.debug('create_linelevel_adjustment : ' || 'Error(s) occurred. Rolling back and setting status to ERROR');
1493: arp_util.debug('create_linelevel_adjustment : ' || 'Multiple Installment transaction not allowed at line-level');
1494: END IF;
1507: THEN
1508: l_return_status := FND_API.G_RET_STS_ERROR ;
1509: FND_MESSAGE.SET_NAME ('AR', 'AR_LL_ADJ_LEGACY_NOT_ALLOWED');
1510: FND_MESSAGE.SET_TOKEN ( 'CUST_TRX_ID', p_adj_rec.customer_trx_id ) ;
1511: FND_MSG_PUB.ADD ;
1512: IF PG_DEBUG in ('Y', 'C') THEN
1513: arp_util.debug('create_linelevel_adjustment : ' || 'Error(s) occurred. Rolling back and setting status to ERROR');
1514: arp_util.debug('create_linelevel_adjustment : ' || 'Legacy data with activity not allowed at line-level');
1515: END IF;
1555: | fnd_api.g_ret_sts_error |
1556: | fnd_api.g_ret_sts_error |
1557: | fnd_api.g_ret_sts_success |
1558: | fnd_api.to_boolean |
1559: | fnd_msg_pub.check_msg_level |
1560: | fnd_msg_pub.count_and_get |
1561: | fnd_msg_pub.initialize |
1562: | ar_adjvalidate_pvt.Init_Context_Rec |
1563: | ar_adjvalidate_pvt.Cache_Details |
1556: | fnd_api.g_ret_sts_error |
1557: | fnd_api.g_ret_sts_success |
1558: | fnd_api.to_boolean |
1559: | fnd_msg_pub.check_msg_level |
1560: | fnd_msg_pub.count_and_get |
1561: | fnd_msg_pub.initialize |
1562: | ar_adjvalidate_pvt.Init_Context_Rec |
1563: | ar_adjvalidate_pvt.Cache_Details |
1564: | |
1557: | fnd_api.g_ret_sts_success |
1558: | fnd_api.to_boolean |
1559: | fnd_msg_pub.check_msg_level |
1560: | fnd_msg_pub.count_and_get |
1561: | fnd_msg_pub.initialize |
1562: | ar_adjvalidate_pvt.Init_Context_Rec |
1563: | ar_adjvalidate_pvt.Cache_Details |
1564: | |
1565: | ARGUMENTS : IN: |
1654:
1655: BEGIN
1656:
1657:
1658: IF (FND_MSG_PUB.Check_Msg_Level (G_MSG_LOW)) THEN
1659: select hsecs
1660: into G_START_TIME
1661: from v$timer;
1662: END IF;
1689: +-------------------------------------------------------------*/
1690:
1691: IF FND_API.to_Boolean( p_init_msg_list )
1692: THEN
1693: FND_MSG_PUB.initialize;
1694: END IF;
1695:
1696: -- arp_util.enable_debug(100000);
1697:
1940:
1941: FND_MESSAGE.set_name( 'AR', 'GENERIC_MESSAGE' );
1942: FND_MESSAGE.set_token( 'GENERIC_TEXT', 'arp_process_adjustment.insert_adjustment exception: '||SQLERRM );
1943: --2920926
1944: FND_MSG_PUB.ADD;
1945: /*--------------------------------------------------+
1946: | Get message count and if 1, return message data |
1947: +---------------------------------------------------*/
1948:
1945: /*--------------------------------------------------+
1946: | Get message count and if 1, return message data |
1947: +---------------------------------------------------*/
1948:
1949: FND_MSG_PUB.Count_And_Get(
1950: p_encoded => FND_API.G_FALSE,
1951: p_count => p_msg_count,
1952: p_data => p_msg_data
1953: );
1971: /*---------------------------------------------------+
1972: | Get message count and if 1, return message data |
1973: +---------------------------------------------------*/
1974:
1975: FND_MSG_PUB.Count_And_Get(
1976: p_encoded => FND_API.G_FALSE,
1977: p_count => p_msg_count,
1978: p_data => p_msg_data
1979: );
1993: IF PG_DEBUG in ('Y', 'C') THEN
1994: arp_util.debug('Create_Adjustment()- ');
1995: END IF;
1996:
1997: IF (FND_MSG_PUB.Check_Msg_Level (G_MSG_LOW)) THEN
1998: select TO_CHAR( (hsecs - G_START_TIME) / 100)
1999: into l_hsec
2000: from v$timer;
2001: IF PG_DEBUG in ('Y', 'C') THEN
2012: END IF;
2013:
2014: ROLLBACK TO ar_adjust_PUB;
2015: p_return_status := FND_API.G_RET_STS_ERROR ;
2016: FND_MSG_PUB.Count_And_Get( p_encoded => FND_API.G_FALSE,
2017: p_count => p_msg_count,
2018: p_data => p_msg_data
2019: );
2020:
2024: arp_util.debug('Create_Adjustment: ' || SQLERRM);
2025: END IF;
2026: ROLLBACK TO ar_adjust_PUB ;
2027: p_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
2028: FND_MSG_PUB.Count_And_Get( p_encoded => FND_API.G_FALSE,
2029: p_count => p_msg_count,
2030: p_data => p_msg_data
2031: );
2032:
2047: 'Completion validation error(s) occurred. ' ||
2048: 'Rolling back and setting status to ERROR');
2049: END IF;
2050:
2051: FND_MSG_PUB.Count_And_Get( p_encoded => FND_API.G_FALSE,
2052: p_count => p_msg_count,
2053: p_data => p_msg_data
2054: );
2055: RETURN;
2078: | fnd_api.g_ret_sts_error |
2079: | fnd_api.g_ret_sts_error |
2080: | fnd_api.g_ret_sts_success |
2081: | fnd_api.to_boolean |
2082: | fnd_msg_pub.check_msg_level |
2083: | fnd_msg_pub.count_and_get |
2084: | fnd_msg_pub.initialize |
2085: | ar_adjvalidate_pvt.Init_Context_Rec |
2086: | ar_adjvalidate_pvt.Cache_Details |
2079: | fnd_api.g_ret_sts_error |
2080: | fnd_api.g_ret_sts_success |
2081: | fnd_api.to_boolean |
2082: | fnd_msg_pub.check_msg_level |
2083: | fnd_msg_pub.count_and_get |
2084: | fnd_msg_pub.initialize |
2085: | ar_adjvalidate_pvt.Init_Context_Rec |
2086: | ar_adjvalidate_pvt.Cache_Details |
2087: | |
2080: | fnd_api.g_ret_sts_success |
2081: | fnd_api.to_boolean |
2082: | fnd_msg_pub.check_msg_level |
2083: | fnd_msg_pub.count_and_get |
2084: | fnd_msg_pub.initialize |
2085: | ar_adjvalidate_pvt.Init_Context_Rec |
2086: | ar_adjvalidate_pvt.Cache_Details |
2087: | |
2088: | ARGUMENTS : IN: |
2166:
2167: BEGIN
2168:
2169:
2170: IF (FND_MSG_PUB.Check_Msg_Level (G_MSG_LOW)) THEN
2171: select hsecs
2172: into G_START_TIME
2173: from v$timer;
2174: END IF;
2201: +-------------------------------------------------------------*/
2202:
2203: IF FND_API.to_Boolean( p_init_msg_list )
2204: THEN
2205: FND_MSG_PUB.initialize;
2206: END IF;
2207:
2208: -- arp_util.enable_debug(100000);
2209:
2227: ELSE
2228: --Verify whether line level adjustment is allowed for given org/invoice
2229: IF NOT arp_standard.is_llca_allowed(l_org_id,p_adj_rec.customer_trx_id) THEN
2230: FND_MESSAGE.set_name('AR', 'AR_SUMMARIZED_DIST_NO_LLCA_ADJ');
2231: FND_MSG_PUB.Add;
2232: l_return_status := FND_API.G_RET_STS_ERROR;
2233: RAISE FND_API.G_EXC_ERROR;
2234: END IF;
2235:
2540:
2541: FND_MESSAGE.set_name( 'AR', 'GENERIC_MESSAGE' );
2542: FND_MESSAGE.set_token( 'GENERIC_TEXT', 'arp_process_adjustment.insert_adjustment exception: '||SQLERRM );
2543: --2920926
2544: FND_MSG_PUB.ADD;
2545: /*--------------------------------------------------+
2546: | Get message count and if 1, return message data |
2547: +---------------------------------------------------*/
2548:
2545: /*--------------------------------------------------+
2546: | Get message count and if 1, return message data |
2547: +---------------------------------------------------*/
2548:
2549: FND_MSG_PUB.Count_And_Get(
2550: p_encoded => FND_API.G_FALSE,
2551: p_count => p_msg_count,
2552: p_data => p_msg_data
2553: );
2580: /*---------------------------------------------------+
2581: | Get message count and if 1, return message data |
2582: +---------------------------------------------------*/
2583:
2584: FND_MSG_PUB.Count_And_Get(
2585: p_encoded => FND_API.G_FALSE,
2586: p_count => p_msg_count,
2587: p_data => p_msg_data
2588: );
2602: IF PG_DEBUG in ('Y', 'C') THEN
2603: arp_util.debug('create_linelevel_adjustment()- ');
2604: END IF;
2605:
2606: IF (FND_MSG_PUB.Check_Msg_Level (G_MSG_LOW)) THEN
2607: select TO_CHAR( (hsecs - G_START_TIME) / 100)
2608: into l_hsec
2609: from v$timer;
2610: IF PG_DEBUG in ('Y', 'C') THEN
2621: END IF;
2622:
2623: ROLLBACK TO ar_adjust_line_PUB;
2624: p_return_status := FND_API.G_RET_STS_ERROR ;
2625: FND_MSG_PUB.Count_And_Get( p_encoded => FND_API.G_FALSE,
2626: p_count => p_msg_count,
2627: p_data => p_msg_data
2628: );
2629:
2633: arp_util.debug('create_linelevel_adjustment: ' || SQLERRM);
2634: END IF;
2635: ROLLBACK TO ar_adjust_line_PUB ;
2636: p_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
2637: FND_MSG_PUB.Count_And_Get( p_encoded => FND_API.G_FALSE,
2638: p_count => p_msg_count,
2639: p_data => p_msg_data
2640: );
2641:
2656: 'Completion validation error(s) occurred. ' ||
2657: 'Rolling back and setting status to ERROR');
2658: END IF;
2659:
2660: FND_MSG_PUB.Count_And_Get( p_encoded => FND_API.G_FALSE,
2661: p_count => p_msg_count,
2662: p_data => p_msg_data
2663: );
2664: RETURN;
2686: | fnd_api.g_ret_sts_error |
2687: | fnd_api.g_ret_sts_error |
2688: | fnd_api.g_ret_sts_success |
2689: | fnd_api.to_boolean |
2690: | fnd_msg_pub.check_msg_level |
2691: | fnd_msg_pub.count_and_get |
2692: | fnd_msg_pub.initialize |
2693: | ar_adjustments_pkg.fetch_p |
2694: | ar_process_adjustment.update_adjustment |
2687: | fnd_api.g_ret_sts_error |
2688: | fnd_api.g_ret_sts_success |
2689: | fnd_api.to_boolean |
2690: | fnd_msg_pub.check_msg_level |
2691: | fnd_msg_pub.count_and_get |
2692: | fnd_msg_pub.initialize |
2693: | ar_adjustments_pkg.fetch_p |
2694: | ar_process_adjustment.update_adjustment |
2695: | ar_adjvalidate_pvt.within_approval_limit |
2688: | fnd_api.g_ret_sts_success |
2689: | fnd_api.to_boolean |
2690: | fnd_msg_pub.check_msg_level |
2691: | fnd_msg_pub.count_and_get |
2692: | fnd_msg_pub.initialize |
2693: | ar_adjustments_pkg.fetch_p |
2694: | ar_process_adjustment.update_adjustment |
2695: | ar_adjvalidate_pvt.within_approval_limit |
2696: | |
2758: l_org_id NUMBER;
2759:
2760:
2761: BEGIN
2762: IF (FND_MSG_PUB.Check_Msg_Level (G_MSG_LOW)) THEN
2763: select hsecs
2764: into G_START_TIME
2765: from v$timer;
2766: END IF;
2793: +-------------------------------------------------------------*/
2794:
2795: IF FND_API.to_Boolean( p_init_msg_list )
2796: THEN
2797: FND_MSG_PUB.initialize;
2798: END IF;
2799:
2800: -- arp_util.enable_debug(100000);
2801:
2886: ROLLBACK TO ar_adjust_PUB;
2887: p_return_status := FND_API.G_RET_STS_ERROR ;
2888: FND_MESSAGE.SET_NAME ('AR', 'AR_AAPI_INVALID_ADJ_ID');
2889: FND_MESSAGE.SET_TOKEN ( 'ADJUSTMENT_ID', to_char(p_old_adjust_id) ) ;
2890: FND_MSG_PUB.ADD ;
2891: RETURN;
2892: END ;
2893:
2894: /* Removed the validation for Line Level adjustment as part of Bug 13036360. */
2976:
2977: FND_MESSAGE.set_name( 'AR', 'GENERIC_MESSAGE' );
2978: FND_MESSAGE.set_token( 'GENERIC_TEXT', 'arp_process_adjustment.update_adjustment exception: '||SQLERRM );
2979: --2920926
2980: FND_MSG_PUB.ADD;
2981:
2982: /*--------------------------------------------------+
2983: | Get message count and if 1, return message data |
2984: +---------------------------------------------------*/
2982: /*--------------------------------------------------+
2983: | Get message count and if 1, return message data |
2984: +---------------------------------------------------*/
2985:
2986: FND_MSG_PUB.Count_And_Get(
2987: p_encoded => FND_API.G_FALSE,
2988: p_count => p_msg_count,
2989: p_data => p_msg_data
2990: );
3006: /*---------------------------------------------------+
3007: | Get message count and if 1, return message data |
3008: +---------------------------------------------------*/
3009:
3010: FND_MSG_PUB.Count_And_Get(
3011: p_encoded => FND_API.G_FALSE,
3012: p_count => p_msg_count,
3013: p_data => p_msg_data
3014: );
3028: IF PG_DEBUG in ('Y', 'C') THEN
3029: arp_util.debug('Modify_Adjustment()- ');
3030: END IF;
3031:
3032: IF (FND_MSG_PUB.Check_Msg_Level (G_MSG_LOW)) THEN
3033: select TO_CHAR( (hsecs - G_START_TIME) / 100)
3034: into l_hsec
3035: from v$timer;
3036: IF PG_DEBUG in ('Y', 'C') THEN
3049: END IF;
3050:
3051: ROLLBACK TO ar_adjust_PUB;
3052: p_return_status := FND_API.G_RET_STS_ERROR ;
3053: FND_MSG_PUB.Count_And_Get( p_encoded => FND_API.G_FALSE,
3054: p_count => p_msg_count,
3055: p_data => p_msg_data
3056: );
3057:
3061: arp_util.debug('Modify_Adjustment: ' || SQLERRM);
3062: END IF;
3063: ROLLBACK TO ar_adjust_PUB ;
3064: p_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
3065: FND_MSG_PUB.Count_And_Get( p_encoded => FND_API.G_FALSE,
3066: p_count => p_msg_count,
3067: p_data => p_msg_data
3068: );
3069:
3083: arp_util.debug('Modify_Adjustment: ' ||
3084: 'Completion validation error(s) occurred. ' ||
3085: 'Rolling back and setting status to ERROR');
3086: END IF;
3087: FND_MSG_PUB.Count_And_Get( p_encoded => FND_API.G_FALSE,
3088: p_count => p_msg_count,
3089: p_data => p_msg_data
3090: );
3091: RETURN;
3113: | fnd_api.g_ret_sts_error |
3114: | fnd_api.g_ret_sts_error |
3115: | fnd_api.g_ret_sts_success |
3116: | fnd_api.to_boolean |
3117: | fnd_msg_pub.check_msg_level |
3118: | fnd_msg_pub.count_and_get |
3119: | fnd_msg_pub.initialize |
3120: | ar_adjustments_pkg.fetch_p |
3121: | ar_process_adjustment.reverse_adjustment |
3114: | fnd_api.g_ret_sts_error |
3115: | fnd_api.g_ret_sts_success |
3116: | fnd_api.to_boolean |
3117: | fnd_msg_pub.check_msg_level |
3118: | fnd_msg_pub.count_and_get |
3119: | fnd_msg_pub.initialize |
3120: | ar_adjustments_pkg.fetch_p |
3121: | ar_process_adjustment.reverse_adjustment |
3122: | |
3115: | fnd_api.g_ret_sts_success |
3116: | fnd_api.to_boolean |
3117: | fnd_msg_pub.check_msg_level |
3118: | fnd_msg_pub.count_and_get |
3119: | fnd_msg_pub.initialize |
3120: | ar_adjustments_pkg.fetch_p |
3121: | ar_process_adjustment.reverse_adjustment |
3122: | |
3123: | ARGUMENTS : IN: |
3202:
3203:
3204:
3205: BEGIN
3206: IF (FND_MSG_PUB.Check_Msg_Level (G_MSG_LOW)) THEN
3207: select hsecs
3208: into G_START_TIME
3209: from v$timer;
3210: END IF;
3237: +-------------------------------------------------------------*/
3238:
3239: IF FND_API.to_Boolean( p_init_msg_list )
3240: THEN
3241: FND_MSG_PUB.initialize;
3242: END IF;
3243:
3244: -- arp_util.enable_debug(100000);
3245:
3309: p_return_status := FND_API.G_RET_STS_ERROR ;
3310:
3311: FND_MESSAGE.SET_NAME ('AR', 'AR_AAPI_INVALID_ADJ_ID');
3312: FND_MESSAGE.SET_TOKEN ( 'ADJUSTMENT_ID', to_char(p_old_adjust_id) ) ;
3313: FND_MSG_PUB.ADD ;
3314: RETURN;
3315: END ;
3316:
3317: /*------------------------------------------------+
3554: /*--------------------------------------------------+
3555: | Get message count and if 1, return message data |
3556: +---------------------------------------------------*/
3557:
3558: FND_MSG_PUB.Count_And_Get(
3559: p_encoded => FND_API.G_FALSE,
3560: p_count => p_msg_count,
3561: p_data => p_msg_data
3562: );
3584: /*---------------------------------------------------+
3585: | Get message count and if 1, return message data |
3586: +---------------------------------------------------*/
3587:
3588: FND_MSG_PUB.Count_And_Get(
3589: p_encoded =>FND_API.G_FALSE,
3590: p_count => p_msg_count,
3591: p_data => p_msg_data
3592: );
3606: IF PG_DEBUG in ('Y', 'C') THEN
3607: arp_util.debug('Reverse_Adjustment()- ');
3608: END IF;
3609:
3610: IF (FND_MSG_PUB.Check_Msg_Level (G_MSG_LOW)) THEN
3611: select TO_CHAR( (hsecs - G_START_TIME) / 100)
3612: into l_hsec
3613: from v$timer;
3614: IF PG_DEBUG in ('Y', 'C') THEN
3626: END IF;
3627:
3628: ROLLBACK TO ar_adjust_PUB;
3629: p_return_status := FND_API.G_RET_STS_ERROR ;
3630: FND_MSG_PUB.Count_And_Get( p_encoded => FND_API.G_FALSE,
3631: p_count => p_msg_count,
3632: p_data => p_msg_data
3633: );
3634:
3638: arp_util.debug('Reverse_Adjustment: ' || SQLERRM);
3639: END IF;
3640: ROLLBACK TO ar_adjust_PUB ;
3641: p_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
3642: FND_MSG_PUB.Count_And_Get( p_encoded => FND_API.G_FALSE,
3643: p_count => p_msg_count,
3644: p_data => p_msg_data
3645: );
3646:
3661: 'Completion validation error(s) occurred. ' ||
3662: 'Rolling back and setting status to ERROR');
3663: END IF;
3664:
3665: FND_MSG_PUB.Count_And_Get( p_encoded => FND_API.G_FALSE,
3666: p_count => p_msg_count,
3667: p_data => p_msg_data
3668: );
3669: RETURN;
3691: | fnd_api.g_ret_sts_error |
3692: | fnd_api.g_ret_sts_error |
3693: | fnd_api.g_ret_sts_success |
3694: | fnd_api.to_boolean |
3695: | fnd_msg_pub.check_msg_level |
3696: | fnd_msg_pub.count_and_get |
3697: | fnd_msg_pub.initialize |
3698: | ar_adjustments_pkg.fetch_p |
3699: | ar_process_adjustment.update_approve_adjustment |
3692: | fnd_api.g_ret_sts_error |
3693: | fnd_api.g_ret_sts_success |
3694: | fnd_api.to_boolean |
3695: | fnd_msg_pub.check_msg_level |
3696: | fnd_msg_pub.count_and_get |
3697: | fnd_msg_pub.initialize |
3698: | ar_adjustments_pkg.fetch_p |
3699: | ar_process_adjustment.update_approve_adjustment |
3700: | |
3693: | fnd_api.g_ret_sts_success |
3694: | fnd_api.to_boolean |
3695: | fnd_msg_pub.check_msg_level |
3696: | fnd_msg_pub.count_and_get |
3697: | fnd_msg_pub.initialize |
3698: | ar_adjustments_pkg.fetch_p |
3699: | ar_process_adjustment.update_approve_adjustment |
3700: | |
3701: | ARGUMENTS : IN: |
3766: l_org_id NUMBER;
3767:
3768:
3769: BEGIN
3770: IF (FND_MSG_PUB.Check_Msg_Level (G_MSG_LOW)) THEN
3771: select hsecs
3772: into G_START_TIME
3773: from v$timer;
3774: END IF;
3801: +-------------------------------------------------------------*/
3802:
3803: IF FND_API.to_Boolean( p_init_msg_list )
3804: THEN
3805: FND_MSG_PUB.initialize;
3806: END IF;
3807:
3808: -- arp_util.enable_debug(100000);
3809:
3904: p_return_status := FND_API.G_RET_STS_ERROR ;
3905:
3906: FND_MESSAGE.SET_NAME ('AR', 'AR_AAPI_INVALID_ADJ_ID');
3907: FND_MESSAGE.SET_TOKEN ( 'ADJUSTMENT_ID', to_char(p_old_adjust_id) ) ;
3908: FND_MSG_PUB.ADD ;
3909: RETURN;
3910: END ;
3911:
3912: /*------------------------------------------+
3987:
3988: FND_MESSAGE.set_name( 'AR', 'GENERIC_MESSAGE' );
3989: FND_MESSAGE.set_token( 'GENERIC_TEXT', 'arp_process_adjustment.update_approve_adj exception: '||SQLERRM );
3990: --2920926
3991: FND_MSG_PUB.ADD;
3992: /*--------------------------------------------------+
3993: | Get message count and if 1, return message data |
3994: +---------------------------------------------------*/
3995:
3992: /*--------------------------------------------------+
3993: | Get message count and if 1, return message data |
3994: +---------------------------------------------------*/
3995:
3996: FND_MSG_PUB.Count_And_Get(
3997: p_encoded => FND_API.G_FALSE,
3998: p_count => p_msg_count,
3999: p_data => p_msg_data
4000: );
4018: /*---------------------------------------------------+
4019: | Get message count and if 1, return message data |
4020: +---------------------------------------------------*/
4021:
4022: FND_MSG_PUB.Count_And_Get(
4023: p_encoded => FND_API.G_FALSE,
4024: p_count => p_msg_count,
4025: p_data => p_msg_data
4026: );
4040: IF PG_DEBUG in ('Y', 'C') THEN
4041: arp_util.debug('Approve_Adjustment()- ');
4042: END IF;
4043:
4044: IF (FND_MSG_PUB.Check_Msg_Level (G_MSG_LOW)) THEN
4045: select TO_CHAR( (hsecs - G_START_TIME) / 100)
4046: into l_hsec
4047: from v$timer;
4048: IF PG_DEBUG in ('Y', 'C') THEN
4060: END IF;
4061:
4062: ROLLBACK TO ar_adjust_PUB;
4063: p_return_status := FND_API.G_RET_STS_ERROR ;
4064: FND_MSG_PUB.Count_And_Get( p_encoded => FND_API.G_FALSE,
4065: p_count => p_msg_count,
4066: p_data => p_msg_data
4067: );
4068:
4072: arp_util.debug('Approve_Adjustment: ' || SQLERRM);
4073: END IF;
4074: ROLLBACK TO ar_adjust_PUB ;
4075: p_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
4076: FND_MSG_PUB.Count_And_Get( p_encoded => FND_API.G_FALSE,
4077: p_count => p_msg_count,
4078: p_data => p_msg_data
4079: );
4080:
4095: 'Completion validation error(s) occurred. ' ||
4096: 'Rolling back and setting status to ERROR');
4097: END IF;
4098:
4099: FND_MSG_PUB.Count_And_Get( p_encoded => FND_API.G_FALSE,
4100: p_count => p_msg_count,
4101: p_data => p_msg_data
4102: );
4103: RETURN;