DBA Data[Home] [Help]

APPS.XTR_REVAL_PROCESS_P dependencies on XTR_DEALS

Line 117: from XTR_DEALS

113: --
114: /*
115: cursor GET_BOND_ISSUE is
116: select distinct currency,bond_issue
117: from XTR_DEALS
118: where deal_type='BOND'
119: and status_code='CURRENT'
120: and maturity_date >l_end_date;
121:

Line 552: and deal_no in (select deal_no from xtr_deals where deal_type = 'RTMM'

548:
549: Cursor c_rtmm_deal is
550: Select * from XTR_RTMM_ELIGIBLE_DEALS_V
551: where eligible_date <= l_batch_end and company_code = l_company_code
552: and deal_no in (select deal_no from xtr_deals where deal_type = 'RTMM'
553: and last_reval_batch_id is null);
554:
555: Cursor c_stock_deal is
556: select * from XTR_STOCK_ELIGIBLE_DEALS_V

Line 735: from XTR_DEALS

731: -- Insert realized g/l info to XTR_REVALUATION_DETAILS
732: if rec.status_code = 'CLOSED' then -- this deal is predeliever/rollover
733: select profit_loss, fx_ro_pd_rate
734: into rel_pl_value, l_fx_rate
735: from XTR_DEALS
736: where deal_no = rec.deal_no;
737:
738: rec.fair_value := rel_pl_value + rec.init_fv;
739: rec.reval_rate := l_fx_rate;

Line 946: from XTR_DEALS

942:
943: if l_close_no is NOT NULL then
944: select decode(l_accounting, 'TRADE', deal_date, start_date)
945: into l_reneg_date
946: from XTR_DEALS
947: where deal_no = l_close_no;
948: end if;
949:
950: xtr_revl_get_fairvalue(rec, l_fv, retcode);

Line 966: from XTR_DEALS

962: rec.fair_value := rel_pl_value + rec.init_fv;
963: -- Insert reval rate equal to new resale deal's rate
964: select interest_rate
965: into rec.reval_rate
966: from XTR_DEALS
967: where deal_no = (select trans_closeout_no
968: from XTR_ROLLOVER_TRANSACTIONS
969: where deal_number = rec.deal_no
970: and transaction_number = rec.trans_no);

Line 1423: from XTR_DEALS

1419: rec.init_fv := 0;
1420: else
1421: select initial_fair_value
1422: into rec.init_fv
1423: from XTR_DEALS
1424: where deal_no = rec.deal_no;
1425: end if;
1426:
1427: if rec.deal_type = 'STOCK' then

Line 1499: l_knock_type XTR_DEALS.knock_type%TYPE;

1495: l_market_set VARCHAR2(30);
1496: l_ric_code XTR_BOND_ISSUES.ric_code%TYPE;
1497: l_dummy NUMBER;
1498: l_dummy1 NUMBER;
1499: l_knock_type XTR_DEALS.knock_type%TYPE;
1500: l_knock_date DATE;
1501: l_strike_price NUMBER;
1502: l_base_ccy VARCHAR2(15);
1503: l_contra_ccy VARCHAR2(15);

Line 1557: from xtr_deals

1553: elsif rec.effective_date <= rec.revldate and rec.status_code = 'EXERCISED' then -- realized
1554: if rec.settle_amount is not null then -- Cash settlement
1555: select exercise_price
1556: into rec.reval_rate
1557: from xtr_deals
1558: where deal_no = rec.deal_no;
1559:
1560: fair_value := rec.settle_amount;
1561: else

Line 1564: from xtr_deals

1560: fair_value := rec.settle_amount;
1561: else
1562: select base_rate, capital_price -- Get exercise price for BDO
1563: into rec.reval_rate, l_strike_price
1564: from xtr_deals
1565: where deal_no = rec.deal_no;
1566:
1567: fair_value := round((rec.face_value * (rec.reval_rate - l_strike_price) /100), l_round);
1568: if rec.deal_subtype in ('BFLOOR', 'SCAP') then

Line 1595: from XTR_DEALS

1591: elsif rec.effective_date <= rec.revldate and rec.status_code = 'EXERCISED' then -- realized
1592: if rec.settle_amount is not null then -- Cash settlement
1593: select settle_rate
1594: into rec.reval_rate
1595: from XTR_DEALS
1596: where deal_no = rec.deal_no;
1597: else -- Create Interest Swap, the reval rate is equal to the interest rate
1598: -- on Pay or Rec side of created swap(other side from Swaption 'Action')
1599: select interest_rate

Line 1601: from XTR_DEALS

1597: else -- Create Interest Swap, the reval rate is equal to the interest rate
1598: -- on Pay or Rec side of created swap(other side from Swaption 'Action')
1599: select interest_rate
1600: into rec.reval_rate
1601: from XTR_DEALS
1602: where int_swap_ref = (select swap_ref from XTR_DEALS
1603: where deal_no = rec.deal_no)
1604: and deal_subtype = (select decode(D.coupon_action, 'REC', 'FUND', 'INVEST')
1605: from XTR_DEALS D where d.deal_no = rec.deal_no);

Line 1602: where int_swap_ref = (select swap_ref from XTR_DEALS

1598: -- on Pay or Rec side of created swap(other side from Swaption 'Action')
1599: select interest_rate
1600: into rec.reval_rate
1601: from XTR_DEALS
1602: where int_swap_ref = (select swap_ref from XTR_DEALS
1603: where deal_no = rec.deal_no)
1604: and deal_subtype = (select decode(D.coupon_action, 'REC', 'FUND', 'INVEST')
1605: from XTR_DEALS D where d.deal_no = rec.deal_no);
1606: end if;

Line 1605: from XTR_DEALS D where d.deal_no = rec.deal_no);

1601: from XTR_DEALS
1602: where int_swap_ref = (select swap_ref from XTR_DEALS
1603: where deal_no = rec.deal_no)
1604: and deal_subtype = (select decode(D.coupon_action, 'REC', 'FUND', 'INVEST')
1605: from XTR_DEALS D where d.deal_no = rec.deal_no);
1606: end if;
1607: xtr_end_fv(rec, fair_value);
1608: else
1609: fair_value := null; -- user need to provide unrealized Fair value

Line 1632: from xtr_deals

1628: FND_FILE.put_line(fnd_file.log, l_buf);
1629: elsif rec.effective_date <= rec.revldate and rec.status_code = 'SETTLED' then -- realized
1630: select settle_rate
1631: into rec.reval_rate
1632: from xtr_deals
1633: where deal_no = rec.deal_no;
1634:
1635: xtr_end_fv(rec, fair_value); -- realized, fair value = ending fair value
1636: else -- unrealized. Using formula

Line 1689: from XTR_DEALS

1685: /************** FXO fair value *******************/
1686: elsif rec.deal_type = 'FXO' then
1687: select knock_type, knock_execute_date
1688: into l_knock_type, l_knock_date
1689: from XTR_DEALS
1690: where deal_no = rec.deal_no;
1691:
1692: if rec.effective_date <= rec.revldate and rec.status_code = 'CURRENT' then
1693: -- This deal should be mature, but not settled yet, create unrealized record.

Line 1722: from xtr_deals

1718: fair_value := 0;
1719: elsif rec.effective_date <= rec.revldate and rec.status_code = 'EXERCISED' then -- realized
1720: select base_rate
1721: into rec.reval_rate
1722: from xtr_deals
1723: where deal_no = (select fxo_deal_no
1724: from xtr_deals
1725: where deal_no = rec.deal_no);
1726: xtr_end_fv(rec, fair_value);

Line 1724: from xtr_deals

1720: select base_rate
1721: into rec.reval_rate
1722: from xtr_deals
1723: where deal_no = (select fxo_deal_no
1724: from xtr_deals
1725: where deal_no = rec.deal_no);
1726: xtr_end_fv(rec, fair_value);
1727: else -- calcualte unrealized fair value using formula
1728: if (l_knock_type = 'I' and l_knock_date is null) or -- Not yet knock-in. fair value is 0

Line 1782: from xtr_deals

1778: fair_value := 0;
1779: elsif rec.effective_date <= rec.revldate and rec.status_code = 'EXERCISED' then -- realized
1780: select settle_rate
1781: into rec.reval_rate
1782: from xtr_deals
1783: where deal_no = rec.deal_no;
1784: xtr_end_fv(rec, fair_value); -- realized, fair value = ending fair value
1785: else -- unrealized. Using formula
1786: if rec.pricing_model = 'BLACK' then

Line 2030: from XTR_DEALS

2026: where principal_action = 'INCRSE'
2027: and DEAL_NUMBER = rec.deal_no
2028: and START_DATE <= rec.revldate
2029: and start_date <> (select start_date
2030: from XTR_DEALS
2031: where deal_no = rec.deal_no);
2032:
2033: select sum(PRINCIPAL_ADJUST)
2034: into l_de_pri_adjust

Line 2040: from XTR_DEALS

2036: where principal_action = 'DECRSE'
2037: and DEAL_NUMBER = rec.deal_no
2038: and START_DATE <= rec.revldate
2039: and start_date <> (select maturity_date
2040: from XTR_DEALS
2041: where deal_no = rec.deal_no);
2042:
2043: l_pri_adjust := nvl(l_in_pri_adjust,0) - nvl(l_de_pri_adjust,0);
2044: else

Line 2053: from XTR_DEALS

2049: and DEAL_NUMBER = rec.deal_no
2050: and START_DATE <= rec.revldate
2051: and START_DATE >= rec.period_start
2052: and start_date <> (select start_date
2053: from XTR_DEALS
2054: where deal_no = rec.deal_no);
2055:
2056: select sum(PRINCIPAL_ADJUST)
2057: into l_de_pri_adjust

Line 2064: from XTR_DEALS

2060: and DEAL_NUMBER = rec.deal_no
2061: and START_DATE <= rec.revldate
2062: and START_DATE >= rec.period_start
2063: and start_date <> (select maturity_date
2064: from XTR_DEALS
2065: where deal_no = rec.deal_no);
2066:
2067: l_pri_adjust := nvl(l_in_pri_adjust,0) - nvl(l_de_pri_adjust,0);
2068: end if;

Line 2092: from XTR_DEALS

2088: where principal_action = 'INCRSE'
2089: and DEAL_NUMBER = rec.deal_no
2090: and START_DATE <= rec.revldate
2091: and start_date <> (select start_date
2092: from XTR_DEALS
2093: where deal_no = rec.deal_no);
2094:
2095: select sum(PRINCIPAL_ADJUST)
2096: into l_de_pri_adjust

Line 2102: from XTR_DEALS

2098: where principal_action = 'DECRSE'
2099: and DEAL_NUMBER = rec.deal_no
2100: and START_DATE <= rec.revldate
2101: and start_date <> (select maturity_date
2102: from XTR_DEALS
2103: where deal_no = rec.deal_no);
2104:
2105: select sum(pi_amount_received)
2106: into l_recon

Line 2128: from XTR_DEALS

2124: and DEAL_NUMBER = rec.deal_no
2125: and START_DATE <= rec.revldate
2126: and START_DATE >= rec.period_start
2127: and start_date <> (select start_date
2128: from XTR_DEALS
2129: where deal_no = rec.deal_no);
2130: select sum(PRINCIPAL_ADJUST)
2131: into l_de_pri_adjust
2132: from xtr_rollover_transactions

Line 2138: from XTR_DEALS

2134: and DEAL_NUMBER = rec.deal_no
2135: and START_DATE <= rec.revldate
2136: and START_DATE >= rec.period_start
2137: and start_date <> (select maturity_date
2138: from XTR_DEALS
2139: where deal_no = rec.deal_no);
2140:
2141: select sum(pi_amount_received)
2142: into l_recon

Line 2234: /* XTR_DEALS */

2230: end xtr_revl_get_unrel_pl;
2231: --------------------------------------------------------------
2232: /*************************************************************************************/
2233: /* This procedure gets all rates information for XTR_REVALUATION_DETAILS and */
2234: /* XTR_DEALS */
2235: /* For Revaluation table: exchange_rate_one = reval_ccy/SOB ccy on revaluation date */
2236: /* except for FX, exchange_rate_one = base_ccy/SOB ccy on revaluation date */
2237: /* exchange_rate_two for FX = contra_ccy/SOB ccy on revaluation date */
2238: /* ctr_curr_sob_curr_fwd_rate = contra_ccy/SOB FX forward rate */

Line 2273: -- Get XTR_DEALS table exchange_rate_one and exchange_rate_two

2269: rec.deal_ex_rate_two :=NULL;
2270: rec.reval_ex_rate_one :=NULL;
2271: rec.reval_ex_rate_two :=NULL;
2272:
2273: -- Get XTR_DEALS table exchange_rate_one and exchange_rate_two
2274: If rec.deal_type = 'FX' then
2275: GL_CURRENCY_API.get_triangulation_rate
2276: (l_base_ccy, rec.sob_ccy, rec.eligible_date, rec.ex_rate_type,
2277: l_deno, l_numer, rec.deal_ex_rate_one);

Line 4144: from XTR_DEALS

4140: and transaction_number = rec.trans_no;
4141: else
4142: select initial_fair_value
4143: into p_fair_value
4144: from XTR_DEALS
4145: where deal_no = rec.deal_no;
4146: end if;
4147: p_reval_rate := rec.transaction_rate;
4148: p_cumm_unrel_gl := 0;

Line 4216: from xtr_deals

4212:
4213: elsif rec.deal_type = 'IRS' then
4214: select discount
4215: into l_discount
4216: from xtr_deals
4217: where deal_no = rec.deal_no;
4218:
4219: if nvl(l_discount, 'N') = 'N' then -- No principal cashflow, IFV = 0
4220: init_fv := 0;

Line 4224: from xtr_deals

4220: init_fv := 0;
4221: else
4222: select face_value_amount, deal_subtype
4223: into init_fv, l_deal_subtype
4224: from xtr_deals
4225: where deal_no = rec.deal_no;
4226:
4227: if l_deal_subtype = 'FUND' then
4228: init_fv := init_fv * (-1);

Line 4236: from xtr_deals

4232: elsif rec.deal_type = 'FX' then
4233: if l_inclu_cost = 'Y' then
4234: select brokerage_amount
4235: into init_fv
4236: from xtr_deals
4237: where deal_no = rec.deal_no;
4238: else
4239: init_fv := 0;
4240: end if;

Line 4247: from xtr_deals

4243: -- For these Options, no transaction cost column shown on form,
4244: -- so we don't need to consider for now.
4245: select premium_action, premium_amount
4246: into l_pre_action, l_pre_amt
4247: from xtr_deals
4248: where deal_no = rec.deal_no;
4249:
4250: if l_pre_action = 'PAY' then
4251: init_fv := l_pre_amt;

Line 4273: from xtr_deals

4269: elsif rec.deal_type = 'BOND' then
4270: select maturity_amount, brokerage_amount,
4271: nvl(base_rate, capital_price), deal_subtype
4272: into l_face_value, l_brk_amt, l_int_rate, l_deal_subtype
4273: from xtr_deals
4274: where deal_no = rec.deal_no;
4275:
4276: if l_inclu_cost = 'Y' then
4277: init_fv := (l_face_value * l_int_rate)/100

Line 4290: from XTR_DEALS

4286:
4287: elsif rec.deal_type = 'STOCK' then
4288: select start_amount, brokerage_amount
4289: into l_face_value, l_brk_amt
4290: from XTR_DEALS
4291: where deal_no = rec.deal_no;
4292:
4293: if l_inclu_cost = 'Y' then
4294: init_fv := l_face_value + nvl(l_brk_amt, 0);

Line 4302: from xtr_deals

4298:
4299: elsif rec.deal_type in ('RTMM', 'TMM') then
4300: select face_value_amount, brokerage_amount, deal_subtype
4301: into l_face_value, l_brk_amt, l_deal_subtype
4302: from xtr_deals
4303: where deal_no = rec.deal_no;
4304:
4305: if l_inclu_cost = 'Y' then
4306: init_fv := l_face_value + nvl(l_brk_amt, 0);

Line 4360: p_deal_no in XTR_DEALS.DEAL_NO%TYPE,

4356:
4357: -------------------------------------------------------------------
4358: Procedure xtr_ins_init_fv
4359: (p_company_code in XTR_PARTY_INFO.PARTY_CODE%TYPE,
4360: p_deal_no in XTR_DEALS.DEAL_NO%TYPE,
4361: p_deal_type in XTR_DEALS.DEAL_TYPE%TYPE,
4362: p_transaction_no in XTR_DEALS.TRANSACTION_NO%TYPE,
4363: p_day_count_type in XTR_DEALS.DAY_COUNT_TYPE%TYPE
4364: )

Line 4361: p_deal_type in XTR_DEALS.DEAL_TYPE%TYPE,

4357: -------------------------------------------------------------------
4358: Procedure xtr_ins_init_fv
4359: (p_company_code in XTR_PARTY_INFO.PARTY_CODE%TYPE,
4360: p_deal_no in XTR_DEALS.DEAL_NO%TYPE,
4361: p_deal_type in XTR_DEALS.DEAL_TYPE%TYPE,
4362: p_transaction_no in XTR_DEALS.TRANSACTION_NO%TYPE,
4363: p_day_count_type in XTR_DEALS.DAY_COUNT_TYPE%TYPE
4364: )
4365: IS

Line 4362: p_transaction_no in XTR_DEALS.TRANSACTION_NO%TYPE,

4358: Procedure xtr_ins_init_fv
4359: (p_company_code in XTR_PARTY_INFO.PARTY_CODE%TYPE,
4360: p_deal_no in XTR_DEALS.DEAL_NO%TYPE,
4361: p_deal_type in XTR_DEALS.DEAL_TYPE%TYPE,
4362: p_transaction_no in XTR_DEALS.TRANSACTION_NO%TYPE,
4363: p_day_count_type in XTR_DEALS.DAY_COUNT_TYPE%TYPE
4364: )
4365: IS
4366: --

Line 4363: p_day_count_type in XTR_DEALS.DAY_COUNT_TYPE%TYPE

4359: (p_company_code in XTR_PARTY_INFO.PARTY_CODE%TYPE,
4360: p_deal_no in XTR_DEALS.DEAL_NO%TYPE,
4361: p_deal_type in XTR_DEALS.DEAL_TYPE%TYPE,
4362: p_transaction_no in XTR_DEALS.TRANSACTION_NO%TYPE,
4363: p_day_count_type in XTR_DEALS.DAY_COUNT_TYPE%TYPE
4364: )
4365: IS
4366: --
4367: -- Purpose: This Procedure inserts the INITIAL_FAIR_VALUE into the

Line 4368: -- tables XTR_DEALS or XTR_ROLLOVER_TRANSACTIONS or others depending

4364: )
4365: IS
4366: --
4367: -- Purpose: This Procedure inserts the INITIAL_FAIR_VALUE into the
4368: -- tables XTR_DEALS or XTR_ROLLOVER_TRANSACTIONS or others depending
4369: -- on the Deal Type.This will be callled from the forms either after
4370: -- the POST-DATA-BASE-COMMIT Trigger or POST-INSERT Triggers or other
4371: -- appropriate triggers.
4372: -- This procedure uses xtr_reval_process_p.xtr_init_fv() for getting

Line 4402: update xtr_deals set initial_fair_value = fv

4398:
4399: If p_deal_type in ('FRA', 'IRS','FX','BDO', 'FXO', 'IRO', 'STOCK',
4400: 'SWPTN','BOND','RTMM', 'TMM') then
4401: If p_transaction_no is NOT NULL then
4402: update xtr_deals set initial_fair_value = fv
4403: where deal_no = p_deal_no and
4404: deal_type = p_deal_type and
4405: transaction_no = p_transaction_no and
4406: company_code = p_company_code;

Line 4408: update xtr_deals set initial_fair_value = fv

4404: deal_type = p_deal_type and
4405: transaction_no = p_transaction_no and
4406: company_code = p_company_code;
4407: Else
4408: update xtr_deals set initial_fair_value = fv
4409: where deal_no = p_deal_no and
4410: deal_type = p_deal_type and
4411: company_code = p_company_code;
4412: End If;

Line 4442: from xtr_deals D,

4438: -------------------------------------------------------
4439: select rt.balance_out, nvl(rt.brokerage_amount, 0), d.year_calc_type,
4440: d.calc_basis, rt.start_date, rt.maturity_date
4441: into l_face_value, l_brk_amt, l_year_calc_type, l_disc_yield, l_start_date, l_end_date
4442: from xtr_deals D,
4443: xtr_rollover_transactions RT
4444: where D.deal_no = p_deal_no
4445: and D.deal_no = RT.deal_number
4446: and RT.transaction_number = p_transaction_no;

Line 4465: from xtr_deals D, xtr_rollover_transactions RT

4461: select rt.balance_out, nvl(rt.brokerage_amount, 0), d.year_calc_type,
4462: d.calc_basis, rt.start_date, rt.maturity_date
4463: into l_face_value, l_brk_amt, l_year_calc_type, l_disc_yield,
4464: l_start_date, l_end_date
4465: from xtr_deals D, xtr_rollover_transactions RT
4466: where D.deal_no = p_deal_no
4467: and D.deal_no = RT.deal_number
4468: and RT.transaction_number = p_transaction_no;
4469:

Line 4643: from XTR_DEALS

4639: if rec.cap_or_floor = 'PAY' then -- paying leg is the default leg of Swap deal
4640: select decode(discount,'Y', (initial_fair_value - face_value_amount),
4641: initial_fair_value)
4642: into end_fv
4643: from XTR_DEALS
4644: where deal_subtype = 'FUND'
4645: and int_swap_ref = (select swap_ref
4646: from XTR_DEALS
4647: where deal_no = rec.deal_no);

Line 4646: from XTR_DEALS

4642: into end_fv
4643: from XTR_DEALS
4644: where deal_subtype = 'FUND'
4645: and int_swap_ref = (select swap_ref
4646: from XTR_DEALS
4647: where deal_no = rec.deal_no);
4648: else -- 'REC'
4649: select decode(discount,'Y', (initial_fair_value - face_value_amount),
4650: initial_fair_value)

Line 4652: from XTR_DEALS

4648: else -- 'REC'
4649: select decode(discount,'Y', (initial_fair_value - face_value_amount),
4650: initial_fair_value)
4651: into end_fv
4652: from XTR_DEALS
4653: where deal_subtype = 'INVEST'
4654: and int_swap_ref = (select swap_ref
4655: from XTR_DEALS
4656: where deal_no = rec.deal_no);

Line 4655: from XTR_DEALS

4651: into end_fv
4652: from XTR_DEALS
4653: where deal_subtype = 'INVEST'
4654: and int_swap_ref = (select swap_ref
4655: from XTR_DEALS
4656: where deal_no = rec.deal_no);
4657: End if;
4658: End if;
4659:

Line 4784: /* XTR_DEALS table. */

4780: /****************************************************************/
4781: /* This procedure get forward rate for the following deal types:*/
4782: /* FRA, IRO, IRS, and TMM */
4783: /* For FRA and IRO, start_date and maturity_date come from */
4784: /* XTR_DEALS table. */
4785: /* For TMM and IRS, start_date and maturity_date come from */
4786: /* XTR_ROLLOVER_TRANSACTIONS table */
4787: /****************************************************************/
4788: PROCEDURE xtr_revl_getprice_fwd(

Line 5625: -- store contra -> SOB currency as exchange_rate_two in xtr_deals table

5621: /* --------------------------------------------------------------------
5622: This part is for later use if we decide to change the definition of exchange rate
5623: ------------------------------------------------------------
5624: -- Store base-> SOB currency as exchange_rate_one and
5625: -- store contra -> SOB currency as exchange_rate_two in xtr_deals table
5626: ------------------------------------------------------------
5627: GL_CURRENCY_API.get_triangulation_rate(l_base_ccy, rec.sob_ccy,
5628: l_begin_date, rec.ex_rate_type,l_deno, l_numer, rec.deal_ex_rate_one);
5629:

Line 7172: from XTR_DEALS

7168: TRANSACTION_NUMBER = rec.trans_no;
7169:
7170: select MARGIN, CALC_BASIS
7171: into l_margin, l_disc_yield_basis
7172: from XTR_DEALS
7173: where deal_no = rec.deal_no;
7174:
7175: l_int_rate := rec.transaction_rate;
7176: l_market_set := rec.MARKET_DATA_SET;

Line 7394: l_bond_issue XTR_DEALS.bond_issue%TYPE;

7390: /*********************************************************/
7391: PROCEDURE xtr_revl_getprice_bond(
7392: rec IN xtr_revl_rec,
7393: p_bond_clean_price OUT NOCOPY NUMBER) IS
7394: l_bond_issue XTR_DEALS.bond_issue%TYPE;
7395: l_ric_code XTR_BOND_ISSUES.ric_code%TYPE;
7396: l_margin XTR_DEALS.margin%TYPE;
7397: l_coupon_action XTR_DEALS.coupon_action%TYPE;
7398: l_side VARCHAR2(1);

Line 7396: l_margin XTR_DEALS.margin%TYPE;

7392: rec IN xtr_revl_rec,
7393: p_bond_clean_price OUT NOCOPY NUMBER) IS
7394: l_bond_issue XTR_DEALS.bond_issue%TYPE;
7395: l_ric_code XTR_BOND_ISSUES.ric_code%TYPE;
7396: l_margin XTR_DEALS.margin%TYPE;
7397: l_coupon_action XTR_DEALS.coupon_action%TYPE;
7398: l_side VARCHAR2(1);
7399: l_bond_yield_m NUMBER;
7400: l_yield NUMBER;

Line 7397: l_coupon_action XTR_DEALS.coupon_action%TYPE;

7393: p_bond_clean_price OUT NOCOPY NUMBER) IS
7394: l_bond_issue XTR_DEALS.bond_issue%TYPE;
7395: l_ric_code XTR_BOND_ISSUES.ric_code%TYPE;
7396: l_margin XTR_DEALS.margin%TYPE;
7397: l_coupon_action XTR_DEALS.coupon_action%TYPE;
7398: l_side VARCHAR2(1);
7399: l_bond_yield_m NUMBER;
7400: l_yield NUMBER;
7401: l_accrued_interest NUMBER;

Line 7427: from XTR_DEALS

7423: End if;
7424:
7425: select MARGIN, COUPON_ACTION
7426: into l_margin, l_coupon_action
7427: from XTR_DEALS
7428: where DEAL_NO = rec.deal_no;
7429:
7430: select RIC_CODE
7431: into l_ric_code

Line 7598: XTR_DEALS D

7594: decode(cp.parameter_value_code, 'TRADE', bond.cross_ref_deal_date,
7595: bond.cross_ref_start_date) resale_rec_date
7596: from XTR_BOND_ALLOC_DETAILS BOND,
7597: XTR_COMPANY_PARAMETERS CP,
7598: XTR_DEALS D
7599: Where bond.deal_no = rec.deal_no
7600: and bond.deal_no = d.deal_no
7601: and bond.batch_id is null
7602: and cp.company_code = d.company_code

Line 7625: bo_rec.maturity_face_value := rec.face_value; -- xtr_deals.maturity_amount

7621:
7622: bo_rec.batch_id := rec.batch_id;
7623: xtr_first_reval(rec, l_first);
7624: if l_first = TRUE then -- first time reval
7625: bo_rec.maturity_face_value := rec.face_value; -- xtr_deals.maturity_amount
7626: bo_rec.start_face_value := rec.face_value;
7627: bo_rec.cum_unrel_gl := 0;
7628: bo_rec.cum_unrel_gl_bal := 0;
7629: bo_rec.start_fair_value := rec.init_fv;

Line 7669: update XTR_DEALS

7665: bo_rec.mtm_real, bo_rec.clean_px, bo_rec.resale_rec_date;
7666: End loop;
7667:
7668: if bo_rec.maturity_face_value = 0 then
7669: update XTR_DEALS
7670: set last_reval_batch_id = rec.batch_id
7671: where deal_no = rec.deal_no;
7672: else
7673: l_resale := FALSE;

Line 7681: update XTR_DEALS

7677: -- Bug 2990046 - Issue #6.
7678: -- Corrected oversight from original flow logic to update last batch id
7679: -- of a deal which has matured, making it ineligible for future revaluation batch.
7680:
7681: update XTR_DEALS
7682: set last_reval_batch_id = rec.batch_id
7683: where deal_no = rec.deal_no;
7684:
7685: -- End 2990046 - Issue #6 additions.

Line 7836: rec.fair_value := rec.fxo_sell_ref_amount; -- xtr_deals.maturity_balance_amount

7832: rec.period_end := rec.maturity_date;
7833: rec.effective_date:= rec.maturity_date;
7834: r_rd.transaction_period := rec.period_end - rec.period_start;
7835: rec.reval_rate := 100;
7836: rec.fair_value := rec.fxo_sell_ref_amount; -- xtr_deals.maturity_balance_amount
7837:
7838: if rec.deal_subtype in ('SHORT', 'ISSUE') then
7839: rec.fair_value := rec.fair_value * (-1);
7840: end if;

Line 7848: from xtr_deals

7844: -- last period's realized MTM gain/loss at time of maturity.
7845:
7846: Select nvl(initial_fair_value,rec.fair_value)
7847: into l_full_init_fv
7848: from xtr_deals
7849: where deal_no = rec.deal_no;
7850:
7851: -- End 3046471 additions.
7852:

Line 7865: rec.face_value := rec.fxo_sell_ref_amount; -- xtr_deals.maturity_balance_amount

7861: where deal_no = rec.deal_no;
7862: --3046471 l_begin_fv := rec.init_fv - l_bond_init_fv;
7863: l_begin_fv := l_full_init_fv - l_bond_init_fv; -- 3046471.
7864: end if;
7865: rec.face_value := rec.fxo_sell_ref_amount; -- xtr_deals.maturity_balance_amount
7866: rel_pl_value := rec.fair_value - l_begin_fv;
7867: End if;
7868:
7869: If rec.reval_ccy = rec.sob_ccy then

Line 8021: rec.face_value := rec.fxo_sell_ref_amount; -- xtr_deals.maturity_balance_amount

8017: and deal_no = rec.deal_no
8018: and transaction_no = rec.trans_no
8019: and amount_type = 'REAL';
8020:
8021: rec.face_value := rec.fxo_sell_ref_amount; -- xtr_deals.maturity_balance_amount
8022: rec.fair_value := rec.fxo_sell_ref_amount;
8023: rec.period_end := rec.maturity_date;
8024: unrel_pl_value := l_mtm_real - bo_rec.cum_unrel_gl_bal;
8025: cum_pl_value := l_mtm_real;

Line 8203: from XTR_DEALS_V

8199:
8200: Begin
8201: select day_count_type, rounding_type, prepaid_interest
8202: into l_day_count_type, l_round_type, l_pre_int
8203: from XTR_DEALS_V
8204: where deal_no = rec.deal_no;
8205:
8206: select rounding_factor
8207: into l_round

Line 8648: XTR_DEALS D

8644: stock.price_per_share, decode(cp.parameter_value_code, 'TRADE',
8645: stock.cross_ref_deal_date, stock.cross_ref_start_date) resale_rec_date
8646: from XTR_STOCK_ALLOC_DETAILS STOCK,
8647: XTR_COMPANY_PARAMETERS CP,
8648: XTR_DEALS D
8649: Where stock.deal_no = rec.deal_no
8650: and stock.deal_no = d.deal_no
8651: and stock.batch_id is null
8652: and cp.company_code = d.company_code

Line 8724: update XTR_DEALS

8720: End loop;
8721:
8722: If st_rec.remaining_quantity = 0 and
8723: nvl(st_rec.resale_rec_date, rec.revldate +1) <= rec.revldate then -- totally resale
8724: update XTR_DEALS
8725: set last_reval_batch_id = rec.batch_id
8726: where deal_no = rec.deal_no;
8727: Else
8728: l_resale := FALSE;

Line 9057: l_stock_issue XTR_DEALS.bond_issue%TYPE;

9053: PROCEDURE xtr_revl_getprice_stock(
9054: rec IN xtr_revl_rec,
9055: p_stock_price OUT NOCOPY NUMBER) IS
9056:
9057: l_stock_issue XTR_DEALS.bond_issue%TYPE;
9058: l_ric_code XTR_BOND_ISSUES.ric_code%TYPE;
9059: l_side VARCHAR2(1);
9060: r_md_in xtr_market_data_p.md_from_set_in_rec_type;
9061: r_md_out xtr_market_data_p.md_from_set_out_rec_type;

Line 9354: from XTR_DEALS_V

9350:
9351: select fixed_or_floating_rate, day_count_type, rounding_type, start_date, margin
9352: into l_fix_float, l_day_count_type, l_round_type, l_deal_begin_date,
9353: l_margin -- Bug 3230779
9354: from XTR_DEALS_V
9355: where deal_no = rec.deal_no;
9356:
9357: select max(transaction_number)
9358: into l_max_trans_no

Line 9659: from xtr_rollover_transactions, xtr_deals

9655: where currency = rec.reval_ccy;
9656:
9657: select all_in_rate, rounding_type
9658: into l_all_in_rate, l_rounding_type -- 5130446
9659: from xtr_rollover_transactions, xtr_deals
9660: where deal_number = rec.deal_no
9661: and deal_number= deal_no
9662: and transaction_number = rec.trans_no;
9663:

Line 9819: /* Also update xtr_deals and xtr_rollover_transactions, */

9815:
9816: --------------------------------------------------------
9817: /*****************************************************************/
9818: /* This procedure insert unrealized values into xtr_revaluation_details table*/
9819: /* Also update xtr_deals and xtr_rollover_transactions, */
9820: /* xtr_bank_balance, xtr_intergroup_transfers */
9821: /******************************************************************/
9822: PROCEDURE xtr_revl_unreal_log(
9823: rec IN xtr_revl_rec,

Line 9843: from XTR_DEALS

9839: r_err_log err_log; -- record type
9840:
9841: Cursor CHK_LOCK_DEAL is
9842: select rowid
9843: from XTR_DEALS
9844: where DEAL_NO = rec.deal_no
9845: and DEAL_TYPE not in ('NI', 'ONC', 'CA', 'IG')
9846: and FIRST_REVAL_BATCH_ID is null
9847: for update of FIRST_REVAL_BATCH_ID NOWAIT;

Line 9941: -- For NI and ONC, we insert into Rollover table, other deal types go to XTR_DEALS

9937: X_QUANTITY => rec.quantity
9938: );
9939:
9940: -- Insert FIRST_REVAL_BATCH_ID to deal table for the first time revaluation
9941: -- For NI and ONC, we insert into Rollover table, other deal types go to XTR_DEALS
9942:
9943: Open CHK_LOCK_DEAL;
9944: Fetch CHK_LOCK_DEAL into l_deal_rowid;
9945: if CHK_LOCK_DEAL%FOUND then

Line 9946: Update XTR_DEALS

9942:
9943: Open CHK_LOCK_DEAL;
9944: Fetch CHK_LOCK_DEAL into l_deal_rowid;
9945: if CHK_LOCK_DEAL%FOUND then
9946: Update XTR_DEALS
9947: Set FIRST_REVAL_BATCH_ID = rec.batch_id,
9948: EXCHANGE_RATE_ONE = rec.deal_ex_rate_one,
9949: EXCHANGE_RATE_TWO = rec.deal_ex_rate_two
9950: Where rowid = l_deal_rowid;

Line 10022: /* Also update xtr_deals and xtr_rollover_transactions, */

10018:
10019: --------------------------------------------------------------------
10020: /*****************************************************************/
10021: /* This procedure insert realized values into xtr_revaluation_details table*/
10022: /* Also update xtr_deals and xtr_rollover_transactions, */
10023: /* xtr_bank_balance, xtr_intergroup_transfers */
10024: /******************************************************************/
10025: PROCEDURE xtr_revl_real_log (
10026: rec IN xtr_revl_rec,

Line 10044: from XTR_DEALS

10040: r_err_log err_log; -- record type
10041:
10042: Cursor CHK_LOCK_DEAL is
10043: select rowid
10044: from XTR_DEALS
10045: where DEAL_NO = rec.deal_no
10046: and ((DEAL_TYPE not in ('NI', 'ONC', 'CA', 'IG', 'BOND', 'STOCK','TMM', 'IRS'))
10047: or (DEAL_TYPE in ('TMM', 'IRS') and rec.effective_date <= rec.revldate))
10048: for update of FIRST_REVAL_BATCH_ID NOWAIT;

Line 10125: -- For NI and ONC, we insert into Rollover table, other deal types go to XTR_DEALS

10121: X_QUANTITY => rec.quantity
10122: );
10123:
10124: -- Insert LAST_REVAL_BATCH_ID to deal table once realized G/L has obtained.
10125: -- For NI and ONC, we insert into Rollover table, other deal types go to XTR_DEALS
10126:
10127: Open CHK_LOCK_DEAL;
10128: Fetch CHK_LOCK_DEAL into l_deal_rowid;
10129: if CHK_LOCK_DEAL%FOUND then

Line 10131: Update XTR_DEALS

10127: Open CHK_LOCK_DEAL;
10128: Fetch CHK_LOCK_DEAL into l_deal_rowid;
10129: if CHK_LOCK_DEAL%FOUND then
10130: close CHK_LOCK_DEAL;
10131: Update XTR_DEALS
10132: Set LAST_REVAL_BATCH_ID = rec.batch_id
10133: Where rowid = l_deal_rowid;
10134: else
10135: Close CHK_LOCK_DEAL;

Line 10306: from XTR_DEALS

10302: p_out OUT NOCOPY BOOLEAN) is
10303:
10304: cursor C_FIRST_DEAL is
10305: select 'Y'
10306: from XTR_DEALS
10307: where deal_no = rec.deal_no
10308: and deal_type not in ('CA', 'IG', 'ONC', 'NI')
10309: and first_reval_batch_id is NOT NULL
10310: and first_reval_batch_id <> rec.batch_id;