1429:
1430:
1431: BEGIN
1432:
1433: x_return_status := FND_API.G_RET_STS_SUCCESS;
1434: x_msg_count := 0;
1435:
1436:
1437: /* Get the current record version number in draft invoice table */
1444:
1445: /* Check that it matches the one passed by the calling process */
1446:
1447: if (nvl(p_rec_version_number,0) <> nvl(l_record_version_number,0)) then
1448: l_return_status := FND_API.G_RET_STS_ERROR;
1449: l_msg_data := 'PA_REC_ALREADY_UPDATED';
1450: /* This means that another session has updated the record_version_number and fired
1451: the concurrent request for invoice processing since the start of the current session.
1452: Hence the current session needs to rollback and restart in order to include the changes
1452: Hence the current session needs to rollback and restart in order to include the changes
1453: from the other session.
1454: */
1455: rollback;
1456: RAISE FND_API.G_EXC_ERROR;
1457: End if;
1458:
1459: /* Check the last request identifier that was run for crediting the current invoice
1460: and get the status of the last run
1504: if (l_dev_phase = 'PENDING' or
1505: l_dev_phase = 'RUNNING' or
1506: l_dev_phase = 'INACTIVE'
1507: ) then
1508: l_return_status := FND_API.G_RET_STS_ERROR;
1509: l_msg_data := 'PA_CREDIT_IN_PROGRESS';
1510: /* This means that the request for invoice processing fired by another session is still in
1511: progress. Hence the current session needs to rollback and restart after the prior request
1512: has been completed, and no more changes are pending from the prior request, in order to
1512: has been completed, and no more changes are pending from the prior request, in order to
1513: include the changes from the other session.
1514: */
1515: ROLLBACK;
1516: RAISE FND_API.G_EXC_ERROR;
1517: elsif (l_dev_phase = 'COMPLETE') then
1518: null;
1519: end if;
1520:
1521: end if; -- (l_last_credit_request_id is not null)
1522:
1523: EXCEPTION
1524:
1525: WHEN FND_API.G_EXC_ERROR THEN
1526: x_return_status := l_return_status;
1527: x_msg_count := l_msg_count;
1528: x_msg_data := l_msg_data;
1529:
1526: x_return_status := l_return_status;
1527: x_msg_count := l_msg_count;
1528: x_msg_data := l_msg_data;
1529:
1530: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1531: x_return_status := l_return_status;
1532: x_msg_count := l_msg_count;
1533: x_msg_data := l_msg_data;
1534:
1532: x_msg_count := l_msg_count;
1533: x_msg_data := l_msg_data;
1534:
1535: WHEN others then
1536: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1537: x_msg_count := l_msg_count;
1538: x_msg_data := SUBSTR(SQLERRM,1,100);
1539:
1540: END check_concurrency_issue;
1584: l_tot_credited_amt NUMBER ;
1585:
1586: BEGIN
1587:
1588: x_return_status := FND_API.G_RET_STS_SUCCESS;
1589: x_msg_count := 0;
1590: x_tot_credited_amt := 0;
1591:
1592: /* First Check - Check if Invoice Amount is negative.
1593: Write-Off/Concession cannot be performed when Invoice Amount is negative. */
1594:
1595: IF sign(p_invoice_amount) <> 1 THEN
1596:
1597: l_return_status := FND_API.G_RET_STS_ERROR;
1598: l_msg_data := 'PA_IN_CRD_NOT_POSITIVE';
1599: l_msg_count := 1;
1600:
1601: RAISE FND_API.G_EXC_ERROR;
1597: l_return_status := FND_API.G_RET_STS_ERROR;
1598: l_msg_data := 'PA_IN_CRD_NOT_POSITIVE';
1599: l_msg_count := 1;
1600:
1601: RAISE FND_API.G_EXC_ERROR;
1602:
1603: END IF;
1604:
1605: /* Second Check - Check if net invoice amount of the selected lines is negative.
1607: selected lines is negative. */
1608: IF (p_credit_action_type in ('GROUP', 'LINE'))THEN
1609: IF sign(p_net_inv_amount) <> 1 THEN
1610:
1611: l_return_status := FND_API.G_RET_STS_ERROR;
1612: l_msg_data := 'PA_IN_LINE_CRD_NOT_POSITIVE';
1613: l_msg_count := 1;
1614:
1615: RAISE FND_API.G_EXC_ERROR;
1611: l_return_status := FND_API.G_RET_STS_ERROR;
1612: l_msg_data := 'PA_IN_LINE_CRD_NOT_POSITIVE';
1613: l_msg_count := 1;
1614:
1615: RAISE FND_API.G_EXC_ERROR;
1616: END IF;
1617: END IF;
1618:
1619: BEGIN
1650: This check is to warn the user that the Credit amount entered is going to result
1651: to over-credit. If user chooses to continue, Concession Invoice will get
1652: processed otherwise no. */
1653: IF p_credit_action = 'CONCESSION' THEN
1654: l_return_status := FND_API.G_RET_STS_ERROR;
1655: l_msg_data := 'PA_OVER_CREDIT_INV';
1656: l_msg_count := 1;
1657:
1658: RAISE FND_API.G_EXC_ERROR;
1654: l_return_status := FND_API.G_RET_STS_ERROR;
1655: l_msg_data := 'PA_OVER_CREDIT_INV';
1656: l_msg_count := 1;
1657:
1658: RAISE FND_API.G_EXC_ERROR;
1659:
1660: ELSE
1661: /* The ELSE part is for credit action WRITE-OFF */
1662: /* The balance due in PA should not be <= 0.
1661: /* The ELSE part is for credit action WRITE-OFF */
1662: /* The balance due in PA should not be <= 0.
1663: Write-Off cannot be performed if balance due <= 0. */
1664: IF sign(p_invoice_amount - l_tot_credited_amt) <> 1 THEN
1665: l_return_status := FND_API.G_RET_STS_ERROR;
1666: --l_msg_data := 'PA_IN_CRD_NOT_POSITIVE';
1667: l_msg_data := 'PA_IN_CRD_NOT_POSITIVE_WO'; --Created new message for Bug3725206
1668: l_msg_count := 1;
1669:
1666: --l_msg_data := 'PA_IN_CRD_NOT_POSITIVE';
1667: l_msg_data := 'PA_IN_CRD_NOT_POSITIVE_WO'; --Created new message for Bug3725206
1668: l_msg_count := 1;
1669:
1670: RAISE FND_API.G_EXC_ERROR;
1671:
1672: ELSE
1673: /* The entered credit amount should not exceed the balance due in PA. */
1674: l_return_status := FND_API.G_RET_STS_ERROR;
1670: RAISE FND_API.G_EXC_ERROR;
1671:
1672: ELSE
1673: /* The entered credit amount should not exceed the balance due in PA. */
1674: l_return_status := FND_API.G_RET_STS_ERROR;
1675: l_msg_data := 'PA_IN_CRD_NOT_EXCEED_BAL';
1676: l_msg_count := 1;
1677:
1678: RAISE FND_API.G_EXC_ERROR;
1674: l_return_status := FND_API.G_RET_STS_ERROR;
1675: l_msg_data := 'PA_IN_CRD_NOT_EXCEED_BAL';
1676: l_msg_count := 1;
1677:
1678: RAISE FND_API.G_EXC_ERROR;
1679:
1680: END IF;
1681:
1682: END IF;
1686: /* Fourth check - The entered credit amount should not exceed the balance due in AR
1687: for credit action Write-Off. */
1688: IF p_credit_action = 'WRITE_OFF' THEN
1689: IF p_credit_amount > p_balance_due THEN
1690: l_return_status := FND_API.G_RET_STS_ERROR;
1691: l_msg_data := 'PA_IN_CRD_EXCEED';
1692: l_msg_count := 1;
1693:
1694: RAISE FND_API.G_EXC_ERROR;
1690: l_return_status := FND_API.G_RET_STS_ERROR;
1691: l_msg_data := 'PA_IN_CRD_EXCEED';
1692: l_msg_count := 1;
1693:
1694: RAISE FND_API.G_EXC_ERROR;
1695: END IF;
1696: END IF;
1697:
1698: /* Initialises the credit related columns as previous credit data might have not been wiped out */
1703: x_return_status => l_return_status,
1704: x_msg_count => l_msg_count,
1705: x_msg_data => l_msg_data );
1706:
1707: IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1708:
1709: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1710:
1711: ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
1705: x_msg_data => l_msg_data );
1706:
1707: IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1708:
1709: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1710:
1711: ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
1712:
1713: RAISE FND_API.G_EXC_ERROR;
1707: IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1708:
1709: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1710:
1711: ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
1712:
1713: RAISE FND_API.G_EXC_ERROR;
1714:
1715: END IF;
1709: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1710:
1711: ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
1712:
1713: RAISE FND_API.G_EXC_ERROR;
1714:
1715: END IF;
1716:
1717:
1725:
1726: if p_credit_action_type = 'LINE' then
1727: null;
1728: else
1729: l_return_status := FND_API.G_RET_STS_ERROR;
1730: l_msg_data := 'PA_IN_ENT_CREDIT_AMT';
1731: l_msg_count := 1;
1732:
1733: RAISE FND_API.G_EXC_ERROR;
1729: l_return_status := FND_API.G_RET_STS_ERROR;
1730: l_msg_data := 'PA_IN_ENT_CREDIT_AMT';
1731: l_msg_count := 1;
1732:
1733: RAISE FND_API.G_EXC_ERROR;
1734:
1735: end if;
1736: END IF;
1737:
1738: /* Sixth check - the total credit amount should not be negative */
1739: --For bug 4231721 :Changing the if condition from <>1 to <0 So that check is valid only is Credit amount <0
1740: IF sign(nvl(p_credit_amount,0)) < 0 THEN
1741:
1742: l_return_status := FND_API.G_RET_STS_ERROR;
1743: l_msg_data := 'PA_SU_NEGATIVE_NUM_NOT_ALLOWED';
1744: l_msg_count := 1;
1745:
1746: RAISE FND_API.G_EXC_ERROR;
1742: l_return_status := FND_API.G_RET_STS_ERROR;
1743: l_msg_data := 'PA_SU_NEGATIVE_NUM_NOT_ALLOWED';
1744: l_msg_count := 1;
1745:
1746: RAISE FND_API.G_EXC_ERROR;
1747:
1748: END IF;
1749:
1750:
1749:
1750:
1751: EXCEPTION
1752:
1753: WHEN FND_API.G_EXC_ERROR THEN
1754: x_return_status := l_return_status;
1755: x_msg_count := l_msg_count;
1756: x_msg_data := l_msg_data;
1757:
1757:
1758: /* ATG Changes */
1759: x_tot_credited_amt := null;
1760:
1761: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1762: x_return_status := l_return_status;
1763: x_msg_count := l_msg_count;
1764: x_msg_data := l_msg_data;
1765:
1766: /* ATG Changes */
1767: x_tot_credited_amt := null;
1768:
1769: WHEN others then
1770: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1771: x_msg_count := l_msg_count;
1772: x_msg_data := SUBSTR(SQLERRM,1,100);
1773:
1774: /* ATG Changes */
1804: l_msg_data VARCHAR2(250) := NULL;
1805:
1806: BEGIN
1807:
1808: x_return_status := FND_API.G_RET_STS_SUCCESS;
1809: x_msg_count := 0;
1810:
1811: /* Update credit_process_flag, credit_amount to NULL */
1812:
1818:
1819: EXCEPTION
1820:
1821: WHEN others then
1822: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1823: x_msg_count := l_msg_count;
1824: x_msg_data := SUBSTR(SQLERRM,1,100);
1825:
1826:
1864: l_msg_data VARCHAR2(250) := NULL;
1865:
1866: BEGIN
1867:
1868: x_return_status := FND_API.G_RET_STS_SUCCESS;
1869: x_msg_count := 0;
1870:
1871: /* In the case of credit action type at
1872:
1931:
1932: EXCEPTION
1933:
1934: WHEN others then
1935: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1936: x_msg_count := l_msg_count;
1937: x_msg_data := SUBSTR(SQLERRM,1,100);
1938:
1939: END update_credit_qual_lines;
1977:
1978:
1979: BEGIN
1980:
1981: x_return_status := FND_API.G_RET_STS_SUCCESS;
1982: x_msg_count := 0;
1983:
1984: /* If credit is performed at GROUP, the total credit amount passed should not exceed the
1985: total selected line invoice amount for credit action WRITE-OFF. For Concession, we allow
1992: IF p_credit_action = 'CONCESSION' THEN
1993: NULL;
1994: ELSE
1995: IF p_credit_amount > p_inv_amount THEN
1996: l_return_status := FND_API.G_RET_STS_ERROR;
1997: l_msg_data := 'PA_IN_CRD_NOT_EXCEED_BAL';
1998:
1999: RAISE FND_API.G_EXC_ERROR;
2000: END IF;
1995: IF p_credit_amount > p_inv_amount THEN
1996: l_return_status := FND_API.G_RET_STS_ERROR;
1997: l_msg_data := 'PA_IN_CRD_NOT_EXCEED_BAL';
1998:
1999: RAISE FND_API.G_EXC_ERROR;
2000: END IF;
2001: END IF;
2002:
2003: ELSE
2006:
2007: /* First check - Line credit amount should be greater than zero */
2008:
2009: IF p_credit_amount = 0 THEN
2010: l_return_status := FND_API.G_RET_STS_ERROR;
2011: l_msg_data := 'PA_IN_ENT_CREDIT_AMT';
2012: l_msg_count := 1;
2013:
2014: RAISE FND_API.G_EXC_ERROR;
2010: l_return_status := FND_API.G_RET_STS_ERROR;
2011: l_msg_data := 'PA_IN_ENT_CREDIT_AMT';
2012: l_msg_count := 1;
2013:
2014: RAISE FND_API.G_EXC_ERROR;
2015:
2016: END IF;
2017:
2018: /* Second check - Line credit amount should be of the same sign as the line invoice amount */
2017:
2018: /* Second check - Line credit amount should be of the same sign as the line invoice amount */
2019:
2020: IF sign(p_inv_amount) <> sign(p_credit_amount) THEN
2021: l_return_status := FND_API.G_RET_STS_ERROR;
2022: l_msg_data := 'PA_IN_CRD_SIGN_INV';
2023: l_msg_count := 1;
2024:
2025: RAISE FND_API.G_EXC_ERROR;
2021: l_return_status := FND_API.G_RET_STS_ERROR;
2022: l_msg_data := 'PA_IN_CRD_SIGN_INV';
2023: l_msg_count := 1;
2024:
2025: RAISE FND_API.G_EXC_ERROR;
2026:
2027: END IF;
2028: END IF;
2029:
2035:
2036:
2037: EXCEPTION
2038:
2039: WHEN FND_API.G_EXC_ERROR THEN
2040: x_return_status := l_return_status;
2041: x_msg_count := l_msg_count;
2042: x_msg_data := l_msg_data;
2043:
2040: x_return_status := l_return_status;
2041: x_msg_count := l_msg_count;
2042: x_msg_data := l_msg_data;
2043:
2044: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2045: x_return_status := l_return_status;
2046: x_msg_count := l_msg_count;
2047: x_msg_data := l_msg_data;
2048:
2046: x_msg_count := l_msg_count;
2047: x_msg_data := l_msg_data;
2048:
2049: WHEN others then
2050: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2051: x_msg_count := l_msg_count;
2052: x_msg_data := SUBSTR(SQLERRM,1,100);
2053:
2054: END validate_line_credit_amount;
2091: l_msg_data VARCHAR2(250) := NULL;
2092:
2093: BEGIN
2094:
2095: x_return_status := FND_API.G_RET_STS_SUCCESS;
2096: x_msg_count := 0;
2097:
2098: -- insert into bss_conc (serial_no, proc_ind) values (1, 'DIST_CREDIT_AMT');
2099:
2139: x_return_status => l_return_status,
2140: x_msg_count => l_msg_count,
2141: x_msg_data => l_msg_data );
2142:
2143: IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2144:
2145: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2146:
2147: ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
2141: x_msg_data => l_msg_data );
2142:
2143: IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2144:
2145: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2146:
2147: ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
2148:
2149: RAISE FND_API.G_EXC_ERROR;
2143: IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2144:
2145: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2146:
2147: ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
2148:
2149: RAISE FND_API.G_EXC_ERROR;
2150:
2151: END IF;
2145: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2146:
2147: ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
2148:
2149: RAISE FND_API.G_EXC_ERROR;
2150:
2151: END IF;
2152:
2153:
2153:
2154:
2155: EXCEPTION
2156:
2157: WHEN FND_API.G_EXC_ERROR THEN
2158: ROLLBACK;
2159: x_return_status := l_return_status;
2160: x_msg_count := l_msg_count;
2161: x_msg_data := l_msg_data;
2159: x_return_status := l_return_status;
2160: x_msg_count := l_msg_count;
2161: x_msg_data := l_msg_data;
2162:
2163: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2164: ROLLBACK;
2165: x_return_status := l_return_status;
2166: x_msg_count := l_msg_count;
2167: x_msg_data := l_msg_data;
2167: x_msg_data := l_msg_data;
2168:
2169: WHEN others then
2170: ROLLBACK;
2171: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2172: x_msg_count := l_msg_count;
2173: x_msg_data := SUBSTR(SQLERRM,1,100);
2174:
2175: END distribute_credit_amount;
2216: l_msg_data VARCHAR2(250) := NULL;
2217:
2218: BEGIN
2219:
2220: x_return_status := FND_API.G_RET_STS_SUCCESS;
2221: x_msg_count := 0;
2222:
2223: /* insert into bss_conc
2224: (serial_no, proc_ind)
2330: x_return_status => l_return_status,
2331: x_msg_count => l_msg_count,
2332: x_msg_data => l_msg_data );
2333:
2334: IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2335:
2336: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2337:
2338: ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
2332: x_msg_data => l_msg_data );
2333:
2334: IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2335:
2336: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2337:
2338: ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
2339:
2340: RAISE FND_API.G_EXC_ERROR;
2334: IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2335:
2336: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2337:
2338: ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
2339:
2340: RAISE FND_API.G_EXC_ERROR;
2341:
2342: END IF;
2336: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2337:
2338: ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
2339:
2340: RAISE FND_API.G_EXC_ERROR;
2341:
2342: END IF;
2343:
2344: end if; -- retained_amount <> 0
2380: x_msg_count => l_msg_count,
2381: x_msg_data => l_msg_data );
2382:
2383:
2384: IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2385:
2386: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2387:
2388: ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
2382:
2383:
2384: IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2385:
2386: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2387:
2388: ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
2389:
2390: RAISE FND_API.G_EXC_ERROR;
2384: IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2385:
2386: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2387:
2388: ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
2389:
2390: RAISE FND_API.G_EXC_ERROR;
2391:
2392: END IF;
2386: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2387:
2388: ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
2389:
2390: RAISE FND_API.G_EXC_ERROR;
2391:
2392: END IF;
2393:
2394: end if; -- l_retained_amunt <> 0
2431: x_return_status => l_return_status,
2432: x_msg_count => l_msg_count,
2433: x_msg_data => l_msg_data );
2434:
2435: IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2436:
2437: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2438:
2439: ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
2433: x_msg_data => l_msg_data );
2434:
2435: IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2436:
2437: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2438:
2439: ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
2440:
2441: RAISE FND_API.G_EXC_ERROR;
2435: IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2436:
2437: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2438:
2439: ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
2440:
2441: RAISE FND_API.G_EXC_ERROR;
2442:
2443: END IF;
2437: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2438:
2439: ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
2440:
2441: RAISE FND_API.G_EXC_ERROR;
2442:
2443: END IF;
2444:
2445: end if; -- l_retained_amunt <> 0
2466:
2467: WHEN no_data_found then
2468: pa_mcb_invoice_pkg.log_message('No retention lines');
2469:
2470: WHEN FND_API.G_EXC_ERROR THEN
2471: ROLLBACK;
2472: x_return_status := l_return_status;
2473: x_msg_count := l_msg_count;
2474: x_msg_data := l_msg_data;
2472: x_return_status := l_return_status;
2473: x_msg_count := l_msg_count;
2474: x_msg_data := l_msg_data;
2475:
2476: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2477: ROLLBACK;
2478: x_return_status := l_return_status;
2479: x_msg_count := l_msg_count;
2480: x_msg_data := l_msg_data;
2480: x_msg_data := l_msg_data;
2481:
2482: WHEN others then
2483: ROLLBACK;
2484: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2485: x_msg_count := l_msg_count;
2486: x_msg_data := SUBSTR(SQLERRM,1,100);
2487:
2488: END distribute_credit_amount_retn;
2533: l_msg_count NUMBER := NULL;
2534: l_msg_data VARCHAR2(250) := NULL;
2535: BEGIN
2536:
2537: x_return_status := FND_API.G_RET_STS_SUCCESS;
2538: x_msg_count := 0;
2539:
2540: /* If the retention setup defines only the retention % (no threshold_amount, no retention amount)
2541: then this percentage will be applied on the line credit amount (p_credit_amount) to get retention
2575: WHEN no_data_found then
2576: pa_mcb_invoice_pkg.log_message('No retention lines');
2577:
2578: WHEN others then
2579: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2580: x_msg_count := l_msg_count;
2581: x_msg_data := SUBSTR(SQLERRM,1,100);
2582:
2583: END compute_retn_credit_amount;