326: l_prv_day_count_type XTR_BANK_BALANCES.day_count_type%TYPE;
327: l_prv_rounding_type XTR_BANK_BALANCES.rounding_type%TYPE;
328:
329:
330: l_ccy xtr_bank_accounts.currency%TYPE;
331: l_portfolio_code xtr_bank_accounts.portfolio_code%TYPE;
332: l_bank_code xtr_bank_accounts.bank_code%TYPE;
333: l_yr_type xtr_bank_accounts.year_calc_type%TYPE;
334: l_rounding_type xtr_bank_accounts.rounding_type%TYPE;
327: l_prv_rounding_type XTR_BANK_BALANCES.rounding_type%TYPE;
328:
329:
330: l_ccy xtr_bank_accounts.currency%TYPE;
331: l_portfolio_code xtr_bank_accounts.portfolio_code%TYPE;
332: l_bank_code xtr_bank_accounts.bank_code%TYPE;
333: l_yr_type xtr_bank_accounts.year_calc_type%TYPE;
334: l_rounding_type xtr_bank_accounts.rounding_type%TYPE;
335: l_day_count_type xtr_bank_accounts.day_count_type%TYPE;
328:
329:
330: l_ccy xtr_bank_accounts.currency%TYPE;
331: l_portfolio_code xtr_bank_accounts.portfolio_code%TYPE;
332: l_bank_code xtr_bank_accounts.bank_code%TYPE;
333: l_yr_type xtr_bank_accounts.year_calc_type%TYPE;
334: l_rounding_type xtr_bank_accounts.rounding_type%TYPE;
335: l_day_count_type xtr_bank_accounts.day_count_type%TYPE;
336: l_ce_bank_account_id xtr_bank_accounts.ce_bank_account_id%TYPE;
329:
330: l_ccy xtr_bank_accounts.currency%TYPE;
331: l_portfolio_code xtr_bank_accounts.portfolio_code%TYPE;
332: l_bank_code xtr_bank_accounts.bank_code%TYPE;
333: l_yr_type xtr_bank_accounts.year_calc_type%TYPE;
334: l_rounding_type xtr_bank_accounts.rounding_type%TYPE;
335: l_day_count_type xtr_bank_accounts.day_count_type%TYPE;
336: l_ce_bank_account_id xtr_bank_accounts.ce_bank_account_id%TYPE;
337:
330: l_ccy xtr_bank_accounts.currency%TYPE;
331: l_portfolio_code xtr_bank_accounts.portfolio_code%TYPE;
332: l_bank_code xtr_bank_accounts.bank_code%TYPE;
333: l_yr_type xtr_bank_accounts.year_calc_type%TYPE;
334: l_rounding_type xtr_bank_accounts.rounding_type%TYPE;
335: l_day_count_type xtr_bank_accounts.day_count_type%TYPE;
336: l_ce_bank_account_id xtr_bank_accounts.ce_bank_account_id%TYPE;
337:
338: l_round_factor XTR_MASTER_CURRENCIES_V.ROUNDING_FACTOR%TYPE;
331: l_portfolio_code xtr_bank_accounts.portfolio_code%TYPE;
332: l_bank_code xtr_bank_accounts.bank_code%TYPE;
333: l_yr_type xtr_bank_accounts.year_calc_type%TYPE;
334: l_rounding_type xtr_bank_accounts.rounding_type%TYPE;
335: l_day_count_type xtr_bank_accounts.day_count_type%TYPE;
336: l_ce_bank_account_id xtr_bank_accounts.ce_bank_account_id%TYPE;
337:
338: l_round_factor XTR_MASTER_CURRENCIES_V.ROUNDING_FACTOR%TYPE;
339: l_yr_basis XTR_MASTER_CURRENCIES_V.YEAR_BASIS%TYPE;
332: l_bank_code xtr_bank_accounts.bank_code%TYPE;
333: l_yr_type xtr_bank_accounts.year_calc_type%TYPE;
334: l_rounding_type xtr_bank_accounts.rounding_type%TYPE;
335: l_day_count_type xtr_bank_accounts.day_count_type%TYPE;
336: l_ce_bank_account_id xtr_bank_accounts.ce_bank_account_id%TYPE;
337:
338: l_round_factor XTR_MASTER_CURRENCIES_V.ROUNDING_FACTOR%TYPE;
339: l_yr_basis XTR_MASTER_CURRENCIES_V.YEAR_BASIS%TYPE;
340: l_hce_rate XTR_MASTER_CURRENCIES_V.HCE_RATE%TYPE;
370: WHERE b.ACCOUNT_NUMBER = p_balance_rec.account_number
371: AND b.COMPANY_CODE = p_balance_rec.company_code);
372:
373:
374: -- Check whether the bank account exist in the xtr_bank_accounts table
375: CURSOR BANK_ACCT_DETAILS IS
376: SELECT CURRENCY,PORTFOLIO_CODE,BANK_CODE,nvl(YEAR_CALC_TYPE,'ACTUAL/ACTUAL') year_calc_type,rounding_type, day_count_type,ce_bank_account_id
377: FROM XTR_BANK_ACCOUNTS
378: WHERE ACCOUNT_NUMBER = p_balance_rec.account_number
373:
374: -- Check whether the bank account exist in the xtr_bank_accounts table
375: CURSOR BANK_ACCT_DETAILS IS
376: SELECT CURRENCY,PORTFOLIO_CODE,BANK_CODE,nvl(YEAR_CALC_TYPE,'ACTUAL/ACTUAL') year_calc_type,rounding_type, day_count_type,ce_bank_account_id
377: FROM XTR_BANK_ACCOUNTS
378: WHERE ACCOUNT_NUMBER = p_balance_rec.account_number
379: AND PARTY_CODE = p_balance_rec.company_code;
380: --
381:
665:
666: l_cross_ref xtr_party_info.cross_ref_to_other_party%TYPE;
667: l_exists VARCHAR2(1);
668: l_ce_bank_acct_bal_id xtr_bank_balances.ce_bank_account_balance_id%TYPE;
669: l_ccy xtr_bank_accounts.currency%TYPE;
670:
671: -- Finding the subsidiary for the company
672: CURSOR C_CROSS_REF IS
673: SELECT CROSS_REF_TO_OTHER_PARTY
677:
678: -- Finding the currency for the account number and company combination
679: CURSOR C_CURRENCY IS
680: SELECT CURRENCY
681: FROM XTR_BANK_ACCOUNTS
682: WHERE PARTY_CODE = P_BALANCE_REC.COMPANY_CODE
683: AND ACCOUNT_NUMBER = P_BALANCE_REC.ACCOUNT_NUMBER;
684:
685:
804: x_return_status OUT NOCOPY VARCHAR2
805: )
806: IS
807:
808: l_portfolio_code xtr_bank_accounts.portfolio_code%TYPE;
809: l_currency xtr_bank_accounts.currency%TYPE;
810: l_bank_code xtr_bank_accounts.bank_code%TYPE;
811: l_result BOOLEAN;
812: l_duplicate NUMBER;
805: )
806: IS
807:
808: l_portfolio_code xtr_bank_accounts.portfolio_code%TYPE;
809: l_currency xtr_bank_accounts.currency%TYPE;
810: l_bank_code xtr_bank_accounts.bank_code%TYPE;
811: l_result BOOLEAN;
812: l_duplicate NUMBER;
813: l_return_error VARCHAR2(30);
806: IS
807:
808: l_portfolio_code xtr_bank_accounts.portfolio_code%TYPE;
809: l_currency xtr_bank_accounts.currency%TYPE;
810: l_bank_code xtr_bank_accounts.bank_code%TYPE;
811: l_result BOOLEAN;
812: l_duplicate NUMBER;
813: l_return_error VARCHAR2(30);
814: l_authorised VARCHAR2(1);
811: l_result BOOLEAN;
812: l_duplicate NUMBER;
813: l_return_error VARCHAR2(30);
814: l_authorised VARCHAR2(1);
815: l_ce_bank_account_id xtr_bank_accounts.ce_bank_account_id%TYPE ;
816: l_int_schedule_id ce_bank_accounts.interest_schedule_id%TYPE ;
817: l_pricing_model xtr_bank_accounts.pricing_model%TYPE;
818:
819:
813: l_return_error VARCHAR2(30);
814: l_authorised VARCHAR2(1);
815: l_ce_bank_account_id xtr_bank_accounts.ce_bank_account_id%TYPE ;
816: l_int_schedule_id ce_bank_accounts.interest_schedule_id%TYPE ;
817: l_pricing_model xtr_bank_accounts.pricing_model%TYPE;
818:
819:
820: -- Check whether the portfolio code exists for the bank account for which balacnes
821: -- are to be entered
821: -- are to be entered
822: CURSOR C_PORTFOLIO IS
823: SELECT PORTFOLIO_CODE, CURRENCY , BANK_CODE, PRICING_MODEL,
824: ce_bank_account_id /* Bug 5346243 */
825: FROM xtr_bank_accounts
826: WHERE ACCOUNT_NUMBER = p_account_number
827: AND PARTY_CODE = p_company_code;
828:
829:
830: -- Check whether the balance does not already exist for
831: CURSOR C_DUPLICATE_DATE IS
832: SELECT 1
833: FROM XTR_BANK_BALANCES_V A,
834: XTR_BANK_ACCOUNTS_V B
835: WHERE A.BALANCE_DATE = p_balance_date
836: AND A.ACCOUNT_NUMBER = B.ACCOUNT_NUMBER
837: AND A.COMPANY_CODE = B.PARTY_CODE
838: AND B.CURRENCY = l_currency
1137:
1138:
1139: FUNCTION CHK_ACCRUAL ( p_company_code IN xtr_bank_balances.company_code%TYPE
1140: , p_account_number IN xtr_bank_balances.account_number%TYPE
1141: , p_currency IN xtr_bank_accounts.currency%TYPE
1142: , p_balance_date IN xtr_bank_balances.balance_date%TYPE
1143: , p_ce_bank_account_balance_id IN xtr_bank_balances.ce_bank_account_balance_id%TYPE DEFAULT NULL
1144: , p_interest_calc_balance IN NUMBER
1145: , p_action_flag IN VARCHAR2
1156: -- Check whether the accruals have been run for that particular deal
1157: CURSOR c_accrl_deal IS
1158: SELECT max(period_to)
1159: FROM
1160: xtr_bank_balances bb, xtr_bank_accounts ba,
1161: xtr_deal_date_amounts dd, xtr_accrls_amort aa
1162: WHERE bb.company_code = p_company_code
1163: AND bb.account_number = p_account_number
1164: AND bb.company_code = ba.party_code
1250: -- insertion/updation/deletion
1251:
1252: FUNCTION CHK_REVAL ( p_company_code IN xtr_bank_balances.company_code%TYPE
1253: , p_account_number IN xtr_bank_balances.account_number%TYPE
1254: , p_currency IN xtr_bank_accounts.currency%TYPE
1255: , p_balance_date IN xtr_bank_balances.balance_date%TYPE
1256: , p_ce_bank_account_balance_id IN xtr_bank_balances.ce_bank_account_balance_id%TYPE DEFAULT NULL
1257: , p_balance_cflow IN xtr_bank_balances.balance_cflow%TYPE
1258: , p_action_flag IN VARCHAR2
1282:
1283: CURSOR c_deal_delete IS
1284: SELECT max(bb.balance_date)
1285: FROM
1286: xtr_bank_balances bb,xtr_bank_accounts ba
1287: WHERE
1288: bb.company_code = p_company_code
1289: AND bb.account_number = p_account_number
1290: AND bb.company_code = ba.party_code
1296: -- Check whether the revaluations have been run for that particular deal
1297: CURSOR c_reval_deal IS
1298: SELECT max(period_to)
1299: FROM
1300: xtr_bank_balances bb,xtr_bank_accounts ba,
1301: xtr_revaluation_details rd
1302: WHERE
1303: bb.company_code = p_company_code
1304: AND bb.account_number = p_account_number
1390: x_return_status OUT NOCOPY VARCHAR2
1391: )
1392: IS
1393:
1394: l_ccy xtr_bank_accounts.currency%TYPE;
1395: l_portfolio_code xtr_bank_accounts.portfolio_code%TYPE;
1396: l_bank_code xtr_bank_accounts.bank_code%TYPE;
1397: l_cross_ref xtr_party_info.cross_ref_to_other_party%TYPE;
1398: l_bal_exists VARCHAR2(10);
1391: )
1392: IS
1393:
1394: l_ccy xtr_bank_accounts.currency%TYPE;
1395: l_portfolio_code xtr_bank_accounts.portfolio_code%TYPE;
1396: l_bank_code xtr_bank_accounts.bank_code%TYPE;
1397: l_cross_ref xtr_party_info.cross_ref_to_other_party%TYPE;
1398: l_bal_exists VARCHAR2(10);
1399: l_dummy_num VARCHAR2(1);
1392: IS
1393:
1394: l_ccy xtr_bank_accounts.currency%TYPE;
1395: l_portfolio_code xtr_bank_accounts.portfolio_code%TYPE;
1396: l_bank_code xtr_bank_accounts.bank_code%TYPE;
1397: l_cross_ref xtr_party_info.cross_ref_to_other_party%TYPE;
1398: l_bal_exists VARCHAR2(10);
1399: l_dummy_num VARCHAR2(1);
1400: l_bal_date xtr_bank_balances.balance_date%TYPE;
1407:
1408:
1409: CURSOR C_ACCT_DETAILS IS
1410: SELECT CURRENCY,PORTFOLIO_CODE,BANK_CODE
1411: FROM XTR_BANK_ACCOUNTS
1412: WHERE ACCOUNT_NUMBER = p_account_number
1413: AND PARTY_CODE = p_company_code;
1414:
1415: -- To check whether the 'BAL' row exists in DDA table
1585: deletion of the record
1586: */
1587:
1588: FUNCTION CHK_INTEREST_SETTLED
1589: ( p_ce_bank_account_id IN xtr_bank_accounts.ce_bank_account_id%TYPE
1590: , p_balance_date IN xtr_bank_balances.balance_date%TYPE
1591: )return VARCHAR2 is
1592:
1593: l_return VARCHAR2(2);
1591: )return VARCHAR2 is
1592:
1593: l_return VARCHAR2(2);
1594: l_dummy VARCHAR2(1);
1595: l_company_code XTR_BANK_ACCOUNTS.party_code%TYPE;
1596: l_account_number XTR_BANK_ACCOUNTS.account_number%TYPE;
1597: l_currency XTR_BANK_ACCOUNTS.currency%TYPE;
1598:
1599:
1592:
1593: l_return VARCHAR2(2);
1594: l_dummy VARCHAR2(1);
1595: l_company_code XTR_BANK_ACCOUNTS.party_code%TYPE;
1596: l_account_number XTR_BANK_ACCOUNTS.account_number%TYPE;
1597: l_currency XTR_BANK_ACCOUNTS.currency%TYPE;
1598:
1599:
1600: CURSOR c_account_details IS
1593: l_return VARCHAR2(2);
1594: l_dummy VARCHAR2(1);
1595: l_company_code XTR_BANK_ACCOUNTS.party_code%TYPE;
1596: l_account_number XTR_BANK_ACCOUNTS.account_number%TYPE;
1597: l_currency XTR_BANK_ACCOUNTS.currency%TYPE;
1598:
1599:
1600: CURSOR c_account_details IS
1601: SELECT party_code, account_number,currency
1598:
1599:
1600: CURSOR c_account_details IS
1601: SELECT party_code, account_number,currency
1602: FROM XTR_BANK_ACCOUNTS
1603: WHERE ce_bank_account_id = p_ce_bank_account_id;
1604:
1605: cursor INT_SETTLED is
1606: select 'Y'
1646:
1647: FUNCTION CHK_REVAL_ON_RENDER
1648: ( p_company_code IN xtr_bank_balances.company_code%TYPE
1649: , p_account_number IN xtr_bank_balances.account_number%TYPE
1650: , p_currency IN xtr_bank_accounts.currency%TYPE
1651: , p_balance_date IN xtr_bank_balances.balance_date%TYPE
1652: )RETURN BOOLEAN
1653: IS
1654:
1658: -- Check whether the revaluations have been run for that particular deal
1659: CURSOR c_reval_deal IS
1660: SELECT max(period_to)
1661: FROM
1662: xtr_bank_balances bb,xtr_bank_accounts ba,
1663: xtr_revaluation_details rd
1664: WHERE
1665: bb.company_code = p_company_code
1666: AND bb.account_number = p_account_number
1673:
1674: CURSOR c_deal_delete IS
1675: SELECT max(bb.balance_date)
1676: FROM
1677: xtr_bank_balances bb,xtr_bank_accounts ba
1678: WHERE
1679: bb.company_code = p_company_code
1680: AND bb.account_number = p_account_number
1681: AND bb.company_code = ba.party_code
1708: -- to enable/disable the interest calculated balance
1709: FUNCTION CHK_ACCRUAL_ON_RENDER
1710: ( p_company_code IN xtr_bank_balances.company_code%TYPE
1711: , p_account_number IN xtr_bank_balances.account_number%TYPE
1712: , p_currency IN xtr_bank_accounts.currency%TYPE
1713: , p_balance_date IN xtr_bank_balances.balance_date%TYPE
1714: )RETURN BOOLEAN
1715: IS
1716:
1719: -- Check whether the accruals have been run for that particular deal
1720: CURSOR c_accrl_deal IS
1721: SELECT max(period_to)
1722: FROM
1723: xtr_bank_balances bb, xtr_bank_accounts ba,
1724: xtr_deal_date_amounts dd, xtr_accrls_amort aa
1725: WHERE bb.company_code = p_company_code
1726: AND bb.account_number = p_account_number
1727: AND bb.company_code = ba.party_code
1748:
1749: END CHK_ACCRUAL_ON_RENDER;
1750:
1751: FUNCTION CHK_ACCRUAL_ON_RENDER
1752: ( p_ce_bank_account_id IN xtr_bank_accounts.ce_bank_account_id%TYPE
1753: , p_balance_date IN xtr_bank_balances.balance_date%TYPE
1754: )return VARCHAR2 is
1755: l_return VARCHAR2(2);
1756: l_company_code XTR_BANK_ACCOUNTS.party_code%TYPE;
1752: ( p_ce_bank_account_id IN xtr_bank_accounts.ce_bank_account_id%TYPE
1753: , p_balance_date IN xtr_bank_balances.balance_date%TYPE
1754: )return VARCHAR2 is
1755: l_return VARCHAR2(2);
1756: l_company_code XTR_BANK_ACCOUNTS.party_code%TYPE;
1757: l_account_number XTR_BANK_ACCOUNTS.account_number%TYPE;
1758: l_currency XTR_BANK_ACCOUNTS.currency%TYPE;
1759: CURSOR c_account_details IS
1760: SELECT party_code, account_number,currency
1753: , p_balance_date IN xtr_bank_balances.balance_date%TYPE
1754: )return VARCHAR2 is
1755: l_return VARCHAR2(2);
1756: l_company_code XTR_BANK_ACCOUNTS.party_code%TYPE;
1757: l_account_number XTR_BANK_ACCOUNTS.account_number%TYPE;
1758: l_currency XTR_BANK_ACCOUNTS.currency%TYPE;
1759: CURSOR c_account_details IS
1760: SELECT party_code, account_number,currency
1761: FROM XTR_BANK_ACCOUNTS
1754: )return VARCHAR2 is
1755: l_return VARCHAR2(2);
1756: l_company_code XTR_BANK_ACCOUNTS.party_code%TYPE;
1757: l_account_number XTR_BANK_ACCOUNTS.account_number%TYPE;
1758: l_currency XTR_BANK_ACCOUNTS.currency%TYPE;
1759: CURSOR c_account_details IS
1760: SELECT party_code, account_number,currency
1761: FROM XTR_BANK_ACCOUNTS
1762: WHERE ce_bank_account_id = p_ce_bank_account_id;
1757: l_account_number XTR_BANK_ACCOUNTS.account_number%TYPE;
1758: l_currency XTR_BANK_ACCOUNTS.currency%TYPE;
1759: CURSOR c_account_details IS
1760: SELECT party_code, account_number,currency
1761: FROM XTR_BANK_ACCOUNTS
1762: WHERE ce_bank_account_id = p_ce_bank_account_id;
1763: BEGIN
1764: l_return := 'Y';
1765: IF(p_ce_bank_account_id is not null and p_balance_date is not null) THEN
1777:
1778:
1779:
1780: FUNCTION CHK_REVAL_ON_RENDER
1781: ( p_ce_bank_account_id IN xtr_bank_accounts.ce_bank_account_id%TYPE
1782: , p_balance_date IN xtr_bank_balances.balance_date%TYPE
1783: )return VARCHAR2 is
1784: l_return VARCHAR2(2);
1785: l_company_code XTR_BANK_ACCOUNTS.party_code%TYPE;
1781: ( p_ce_bank_account_id IN xtr_bank_accounts.ce_bank_account_id%TYPE
1782: , p_balance_date IN xtr_bank_balances.balance_date%TYPE
1783: )return VARCHAR2 is
1784: l_return VARCHAR2(2);
1785: l_company_code XTR_BANK_ACCOUNTS.party_code%TYPE;
1786: l_account_number XTR_BANK_ACCOUNTS.account_number%TYPE;
1787: l_currency XTR_BANK_ACCOUNTS.currency%TYPE;
1788:
1789: CURSOR c_account_details IS
1782: , p_balance_date IN xtr_bank_balances.balance_date%TYPE
1783: )return VARCHAR2 is
1784: l_return VARCHAR2(2);
1785: l_company_code XTR_BANK_ACCOUNTS.party_code%TYPE;
1786: l_account_number XTR_BANK_ACCOUNTS.account_number%TYPE;
1787: l_currency XTR_BANK_ACCOUNTS.currency%TYPE;
1788:
1789: CURSOR c_account_details IS
1790: SELECT party_code, account_number,currency
1783: )return VARCHAR2 is
1784: l_return VARCHAR2(2);
1785: l_company_code XTR_BANK_ACCOUNTS.party_code%TYPE;
1786: l_account_number XTR_BANK_ACCOUNTS.account_number%TYPE;
1787: l_currency XTR_BANK_ACCOUNTS.currency%TYPE;
1788:
1789: CURSOR c_account_details IS
1790: SELECT party_code, account_number,currency
1791: FROM XTR_BANK_ACCOUNTS
1787: l_currency XTR_BANK_ACCOUNTS.currency%TYPE;
1788:
1789: CURSOR c_account_details IS
1790: SELECT party_code, account_number,currency
1791: FROM XTR_BANK_ACCOUNTS
1792: WHERE ce_bank_account_id = p_ce_bank_account_id;
1793:
1794: BEGIN
1795: l_return := 'Y';
1901: END LOG_ERR_MSG;
1902:
1903:
1904: /* This procedure updates the rounding_type and the day_count_type in the
1905: xtr_bank_balances IF THE same has been updated IN THE xtr_bank_accounts TABLE
1906:
1907: This will be called FORM xtr_replicate_bank_accounts API WHEN THE rounding TYPE/
1908: day_count_type has been updated IN THE interest schedules page OR THE
1909: schedule has been changed BY THE USER */
1909: schedule has been changed BY THE USER */
1910:
1911:
1912: PROCEDURE UPDATE_ROUNDING_DAYCOUNT
1913: (p_ce_bank_account_id xtr_bank_accounts.ce_bank_account_id%TYPE
1914: ,p_rounding_type xtr_bank_accounts.rounding_type%TYPE
1915: ,p_day_count_type xtr_bank_accounts.day_count_type%TYPE
1916: ,x_return_status OUT NOCOPY VARCHAR2
1917: )
1910:
1911:
1912: PROCEDURE UPDATE_ROUNDING_DAYCOUNT
1913: (p_ce_bank_account_id xtr_bank_accounts.ce_bank_account_id%TYPE
1914: ,p_rounding_type xtr_bank_accounts.rounding_type%TYPE
1915: ,p_day_count_type xtr_bank_accounts.day_count_type%TYPE
1916: ,x_return_status OUT NOCOPY VARCHAR2
1917: )
1918:
1911:
1912: PROCEDURE UPDATE_ROUNDING_DAYCOUNT
1913: (p_ce_bank_account_id xtr_bank_accounts.ce_bank_account_id%TYPE
1914: ,p_rounding_type xtr_bank_accounts.rounding_type%TYPE
1915: ,p_day_count_type xtr_bank_accounts.day_count_type%TYPE
1916: ,x_return_status OUT NOCOPY VARCHAR2
1917: )
1918:
1919: IS
1917: )
1918:
1919: IS
1920:
1921: l_old_rounding_type xtr_bank_accounts.rounding_type%TYPE;
1922: l_old_day_count_type xtr_bank_accounts.day_count_type%TYPE;
1923: l_day_count_type xtr_bank_accounts.day_count_type%TYPE;
1924: l_party_code xtr_bank_accounts.party_code%TYPE;
1925: l_account_number xtr_bank_accounts.account_number%TYPE;
1918:
1919: IS
1920:
1921: l_old_rounding_type xtr_bank_accounts.rounding_type%TYPE;
1922: l_old_day_count_type xtr_bank_accounts.day_count_type%TYPE;
1923: l_day_count_type xtr_bank_accounts.day_count_type%TYPE;
1924: l_party_code xtr_bank_accounts.party_code%TYPE;
1925: l_account_number xtr_bank_accounts.account_number%TYPE;
1926: l_latest_date DATE;
1919: IS
1920:
1921: l_old_rounding_type xtr_bank_accounts.rounding_type%TYPE;
1922: l_old_day_count_type xtr_bank_accounts.day_count_type%TYPE;
1923: l_day_count_type xtr_bank_accounts.day_count_type%TYPE;
1924: l_party_code xtr_bank_accounts.party_code%TYPE;
1925: l_account_number xtr_bank_accounts.account_number%TYPE;
1926: l_latest_date DATE;
1927: l_oldest_date DATE;
1920:
1921: l_old_rounding_type xtr_bank_accounts.rounding_type%TYPE;
1922: l_old_day_count_type xtr_bank_accounts.day_count_type%TYPE;
1923: l_day_count_type xtr_bank_accounts.day_count_type%TYPE;
1924: l_party_code xtr_bank_accounts.party_code%TYPE;
1925: l_account_number xtr_bank_accounts.account_number%TYPE;
1926: l_latest_date DATE;
1927: l_oldest_date DATE;
1928: l_acc_status varchar2(20);
1921: l_old_rounding_type xtr_bank_accounts.rounding_type%TYPE;
1922: l_old_day_count_type xtr_bank_accounts.day_count_type%TYPE;
1923: l_day_count_type xtr_bank_accounts.day_count_type%TYPE;
1924: l_party_code xtr_bank_accounts.party_code%TYPE;
1925: l_account_number xtr_bank_accounts.account_number%TYPE;
1926: l_latest_date DATE;
1927: l_oldest_date DATE;
1928: l_acc_status varchar2(20);
1929: l_batch_error varchar2(20);
1928: l_acc_status varchar2(20);
1929: l_batch_error varchar2(20);
1930:
1931: -- This cursor gets the existing rounding type/day count type from the
1932: -- xtr_bank_accounts table
1933:
1934: CURSOR c_old_types IS
1935: SELECT rounding_type, day_count_type, party_code, account_number
1936: FROM XTR_BANK_ACCOUNTS
1932: -- xtr_bank_accounts table
1933:
1934: CURSOR c_old_types IS
1935: SELECT rounding_type, day_count_type, party_code, account_number
1936: FROM XTR_BANK_ACCOUNTS
1937: WHERE ce_bank_account_id = p_ce_bank_account_id;
1938:
1939: -- Gets the maximum balance date and the minimum balance date for that
1940: -- company and account
2036:
2037:
2038:
2039: FUNCTION CHK_INT_OVERRIDE (
2040: p_party_code xtr_bank_accounts.party_code%type
2041: ,p_account_number xtr_bank_accounts.account_number%type
2042: ,p_oldest_date DATE
2043: ) RETURN VARCHAR2 IS
2044:
2037:
2038:
2039: FUNCTION CHK_INT_OVERRIDE (
2040: p_party_code xtr_bank_accounts.party_code%type
2041: ,p_account_number xtr_bank_accounts.account_number%type
2042: ,p_oldest_date DATE
2043: ) RETURN VARCHAR2 IS
2044:
2045: l_check_status varchar2(1);
2109:
2110:
2111:
2112: FUNCTION CHK_ACCRUAL_INT (
2113: p_party_code xtr_bank_accounts.party_code%type
2114: ,p_account_number xtr_bank_accounts.account_number%type
2115: )RETURN varchar2 IS
2116:
2117: l_acc_int number;
2110:
2111:
2112: FUNCTION CHK_ACCRUAL_INT (
2113: p_party_code xtr_bank_accounts.party_code%type
2114: ,p_account_number xtr_bank_accounts.account_number%type
2115: )RETURN varchar2 IS
2116:
2117: l_acc_int number;
2118: l_acc_status varchar2(20);
2145: END CHK_ACCRUAL_INT;
2146:
2147:
2148: PROCEDURE CHK_ACCRUAL_REVAL_WARNINGS
2149: (p_ce_bank_account_id IN xtr_bank_accounts.ce_bank_account_id%TYPE
2150: ,p_balance_date IN xtr_bank_balances.balance_date%TYPE
2151: ,p_ce_bank_account_balance_id IN xtr_bank_balances.ce_bank_account_balance_id%TYPE default null
2152: ,p_interest_calc_balance IN NUMBER
2153: ,p_balance_cflow IN xtr_bank_balances.balance_cflow%TYPE
2157: ,x_msg_data OUT NOCOPY VARCHAR2 )IS
2158:
2159: CURSOR c_bank_acct_details IS
2160: SELECT party_code,account_number,currency
2161: FROM XTR_BANK_ACCOUNTS
2162: WHERE ce_bank_account_id = p_ce_bank_account_id;
2163:
2164: l_company_code xtr_bank_accounts.party_code%TYPE;
2165: l_account_number xtr_bank_accounts.account_number%TYPE;
2160: SELECT party_code,account_number,currency
2161: FROM XTR_BANK_ACCOUNTS
2162: WHERE ce_bank_account_id = p_ce_bank_account_id;
2163:
2164: l_company_code xtr_bank_accounts.party_code%TYPE;
2165: l_account_number xtr_bank_accounts.account_number%TYPE;
2166: l_currency xtr_bank_accounts.currency%TYPE;
2167: l_return_error VARCHAR2(30);
2168:
2161: FROM XTR_BANK_ACCOUNTS
2162: WHERE ce_bank_account_id = p_ce_bank_account_id;
2163:
2164: l_company_code xtr_bank_accounts.party_code%TYPE;
2165: l_account_number xtr_bank_accounts.account_number%TYPE;
2166: l_currency xtr_bank_accounts.currency%TYPE;
2167: l_return_error VARCHAR2(30);
2168:
2169: BEGIN
2162: WHERE ce_bank_account_id = p_ce_bank_account_id;
2163:
2164: l_company_code xtr_bank_accounts.party_code%TYPE;
2165: l_account_number xtr_bank_accounts.account_number%TYPE;
2166: l_currency xtr_bank_accounts.currency%TYPE;
2167: l_return_error VARCHAR2(30);
2168:
2169: BEGIN
2170: FND_MSG_PUB.Initialize;