1: PACKAGE BODY jl_ar_receivable_applications AS
2: /* $Header: jlbrrrab.pls 120.22 2011/07/12 20:55:53 abuissa ship $ */
3:
4: /*----------------------------------------------------------------------------*
5: | PRIVATE FUNCTIONS/PROCEDURES |
76: --Bug 12323016 start
77: BEGIN
78: SELECT receivable_application_id
79: INTO l_rec_appln_id
80: FROM ar_receivable_applications_all
81: WHERE cash_receipt_id = x_cash_receipt_id
82: AND applied_payment_schedule_id = x_payment_schedule_id;
83: EXCEPTION
84: WHEN OTHERS THEN null;
855:
856: BEGIN
857:
858: IF PG_DEBUG in ('Y', 'C') THEN
859: arp_util.debug('jl_ar_receivable_applications.Apply_br()+');
860: END IF;
861:
862: p_return_status := FND_API.G_RET_STS_SUCCESS;
863:
1122:
1123: END IF;
1124:
1125: IF PG_DEBUG in ('Y', 'C') THEN
1126: arp_util.debug('jl_ar_receivable_applications.Apply_br()-');
1127: END IF;
1128:
1129: EXCEPTION
1130: WHEN validation_error THEN
1150:
1151: BEGIN
1152:
1153: IF PG_DEBUG in ('Y', 'C') THEN
1154: arp_util.debug('jl_ar_receivable_applications.Unapply_br()+');
1155: END IF;
1156:
1157: p_return_status := FND_API.G_RET_STS_SUCCESS;
1158:
1158:
1159: BEGIN
1160: SELECT apply_date
1161: INTO x_apply_date
1162: FROM ar_receivable_applications
1163: WHERE cash_receipt_id = p_cash_receipt_id
1164: AND applied_payment_schedule_id = p_applied_payment_schedule_id;
1165: EXCEPTION
1166: WHEN OTHERS THEN
1219:
1220: END IF;
1221:
1222: IF PG_DEBUG in ('Y', 'C') THEN
1223: arp_util.debug('jl_ar_receivable_applications.Unapply_br()-');
1224: END IF;
1225:
1226: END Unapply_br;
1227:
1232: Cursor pay_sched is
1233: Select applied_payment_schedule_id pay_sched_id,
1234: global_attribute3 calculated_interest,
1235: apply_date
1236: from ar_receivable_applications
1237: where status = 'APP'
1238: and cash_receipt_id = p_cash_receipt_id;
1239:
1240: ps_rec pay_sched%ROWTYPE;
1254:
1255: BEGIN
1256:
1257: IF PG_DEBUG in ('Y', 'C') THEN
1258: arp_util.debug('jl_ar_receivable_applications.Reverse_br()+');
1259: END IF;
1260:
1261: jl_zz_ar_library_1_pkg.get_interest_reversal_flag(p_cash_receipt_id,
1262: x_interest_reversal,
1338: p_return_status := FND_API.G_RET_STS_ERROR;
1339: END IF;
1340:
1341: IF PG_DEBUG in ('Y', 'C') THEN
1342: arp_util.debug('jl_ar_receivable_applications.Reverse_br()-');
1343: END IF;
1344:
1345: END Reverse_br;
1346:
1389: BEGIN
1390:
1391:
1392: IF PG_DEBUG in ('Y', 'C') THEN
1393: arp_util.debug('jl_ar_receivable_applications.Apply()+');
1394: END IF;
1395:
1396: --l_country_code := FND_PROFILE.VALUE('JGZZ_COUNTRY_CODE');
1397: l_org_id := MO_GLOBAL.get_current_org_id;
1455: END IF;
1456: END IF;
1457:
1458: IF PG_DEBUG in ('Y', 'C') THEN
1459: arp_util.debug('jl_ar_receivable_applications.Apply()-');
1460: END IF;
1461:
1462:
1463: END Apply;
1472:
1473: BEGIN
1474:
1475: IF PG_DEBUG in ('Y', 'C') THEN
1476: arp_util.debug('jl_ar_receivable_applications.Unapply()+');
1477: END IF;
1478:
1479: l_org_id := MO_GLOBAL.get_current_org_id;
1480:
1491: p_return_status);
1492: END IF;
1493:
1494: IF PG_DEBUG in ('Y', 'C') THEN
1495: arp_util.debug('jl_ar_receivable_applications.Unapply()-');
1496: END IF;
1497:
1498:
1499: END Unapply;
1507:
1508: BEGIN
1509:
1510: IF PG_DEBUG in ('Y', 'C') THEN
1511: arp_util.debug('jl_ar_receivable_applications.Reverse()+');
1512: END IF;
1513:
1514: l_org_id := MO_GLOBAL.get_current_org_id;
1515:
1524: p_return_status);
1525: END IF;
1526:
1527: IF PG_DEBUG in ('Y', 'C') THEN
1528: arp_util.debug('jl_ar_receivable_applications.Reverse()-');
1529: END IF;
1530:
1531: END Reverse;
1532:
1596: aicl.global_attribute6,
1597: aicl.global_attribute7,
1598: aicl.global_attribute8,
1599: aicl.global_attribute10
1600: from ar_receivable_applications_all ara,
1601: ar_cash_receipts_all acr,
1602: ar_interim_cash_rcpt_lines_all aicl
1603: --ar_interim_cash_receipts_all aic
1604: where ara.request_id = p_request_id
1609:
1610: cursor p(p_request_id IN NUMBER) is
1611: select ara.cash_receipt_id,
1612: ara.applied_payment_schedule_id
1613: from ar_receivable_applications_all ara
1614: where request_id = p_request_id;
1615:
1616:
1617: BEGIN
1616:
1617: BEGIN
1618:
1619: --IF PG_DEBUG in ('Y', 'C') THEN
1620: fnd_file.put_line(fnd_file.log,'Inside3 jl_ar_receivable_applications.Create_interest_adjustment()+');
1621: --END IF;
1622:
1623: fnd_file.put_line(fnd_file.log,'Rec Appl Id :'||to_char(p_post_quickcash_req_id));
1624:
1627: Loop
1628:
1629: fnd_file.put_line(fnd_file.log,'After opening the cursor()+');
1630:
1631: update ar_receivable_applications_all
1632: set global_attribute1 = rint.global_attribute3 ,
1633: global_attribute2 = rint.global_attribute4 ,
1634: global_attribute3 = rint.global_attribute1 ,
1635: global_attribute4 = rint.global_attribute2 ,
1703:
1704: End Loop;
1705:
1706: --IF PG_DEBUG in ('Y', 'C') THEN
1707: arp_util.debug('jl_ar_receivable_applications.Create_interest_adjustments()-');
1708: --END IF;
1709:
1710: END Create_interest_adjustment;
1711:
1716: delete from ar_adjustments_all
1717: where associated_cash_receipt_id = p_cash_receipt_id;
1718: END delete_interest_adjustment;
1719:
1720: END jl_ar_receivable_applications;