[Home] [Help]
1456: where CURRENCY = l_ccy;
1457: --
1458: cursor SETOFF_CAL_DATE is
1459: select distinct BALANCE_DATE
1460: from XTR_BANK_BALANCES
1461: where BALANCE_DATE >= (select max(BALANCE_DATE)
1462: from XTR_BANK_BAL_INTERFACE)
1463: and SETOFF = l_setoff
1464: order by BALANCE_DATE asc;
1464: order by BALANCE_DATE asc;
1465: --
1466: cursor SETOFF_PRV_RATE is
1467: select INTEREST_RATE
1468: from XTR_BANK_BALANCES
1469: where ACCOUNT_NUMBER = l_setoff||'-'||l_bank_code
1470: and BALANCE_DATE = l_prv_date;
1471: --
1472: cursor SETOFF_PREV_DETAILS is
1471: --
1472: cursor SETOFF_PREV_DETAILS is
1473: select a.BALANCE_DATE,nvl(sum(a.BALANCE_CFLOW),0),
1474: nvl(sum(a.ACCUM_INT_CFWD),0)
1475: from XTR_BANK_BALANCES a
1476: where ACCOUNT_NUMBER = l_setoff||'-'||l_bank_code
1477: and a.BALANCE_DATE = (select max(b.BALANCE_DATE)
1478: from XTR_BANK_BALANCES b
1479: where ACCOUNT_NUMBER = l_setoff||'-'||l_bank_code
1474: nvl(sum(a.ACCUM_INT_CFWD),0)
1475: from XTR_BANK_BALANCES a
1476: where ACCOUNT_NUMBER = l_setoff||'-'||l_bank_code
1477: and a.BALANCE_DATE = (select max(b.BALANCE_DATE)
1478: from XTR_BANK_BALANCES b
1479: where ACCOUNT_NUMBER = l_setoff||'-'||l_bank_code
1480: and b.BALANCE_DATE < l_calc_date)
1481: group by a.BALANCE_DATE,a.ACCOUNT_NUMBER;
1482: --
1481: group by a.BALANCE_DATE,a.ACCOUNT_NUMBER;
1482: --
1483: cursor SETOFF_THIS_DETAILS is
1484: select nvl(sum(a.BALANCE_CFLOW),0)
1485: from XTR_BANK_BALANCES a
1486: where SETOFF = l_setoff
1487: and a.BALANCE_DATE = l_calc_date;
1488: --
1489: begin
1492: LOOP
1493: fetch SEL_SETOFF_ACCT INTO l_setoff,l_bank_code,
1494: l_setoff_company,l_ccy;
1495: EXIT WHEN SEL_SETOFF_ACCT%NOTFOUND;
1496: delete XTR_BANK_BALANCES
1497: where ACCOUNT_NUMBER = l_setoff||'-'||l_bank_code
1498: and BALANCE_DATE >= (select max(BALANCE_DATE)
1499: from XTR_BANK_BAL_INTERFACE);
1500: open SETOFF_CAL_DATE;
1532: l_interest := round(l_prv_bal * l_prv_rate / 100 * l_no_days
1533: / yr_basis,roundfac);
1534: l_int_cf := l_int_bf + l_interest;
1535: l_rate := nvl(l_rate,0);
1536: insert into XTR_BANK_BALANCES
1537: (COMPANY_CODE,ACCOUNT_NUMBER,BALANCE_DATE,NO_OF_DAYS,
1538: STATEMENT_BALANCE,BALANCE_ADJUSTMENT,BALANCE_CFLOW,
1539: ACCUM_INT_BFWD,INTEREST,INTEREST_RATE,INTEREST_SETTLED,
1540: INTEREST_SETTLED_HCE,ACCUM_INT_CFWD,