75: RETURN VARCHAR2 IS
76:
77: CURSOR proration_rule_vr_c IS
78: SELECT proration_rule
79: FROM pn_var_rents_all
80: WHERE var_rent_id = p_var_rent_id;
81:
82: CURSOR proration_rule_prd_c IS
83: SELECT proration_rule
80: WHERE var_rent_id = p_var_rent_id;
81:
82: CURSOR proration_rule_prd_c IS
83: SELECT proration_rule
84: FROM pn_var_rents_all vr
85: ,pn_var_periods_all prd
86: WHERE vr.var_rent_id = prd.var_rent_id
87: AND prd.period_id = p_period_id;
88:
651: ,vr.commencement_date
652: ,vr.termination_date
653: ,vr.proration_rule
654: FROM
655: pn_var_rents_all vr
656: WHERE
657: vr.var_rent_id = p_vr_id;
658:
659: /* trx header containing LY start date */
838: ,vr.commencement_date
839: ,vr.termination_date
840: ,vr.proration_rule
841: FROM
842: pn_var_rents_all vr
843: WHERE
844: vr.var_rent_id = p_vr_id;
845:
846: /* get rates for trx header containing FY end date */
1029: ,vr.commencement_date
1030: ,vr.termination_date
1031: ,vr.proration_rule
1032: FROM
1033: pn_var_rents_all vr
1034: WHERE
1035: vr.var_rent_id = p_vr_id;
1036:
1037: /* VR info */
1492: ,vr.termination_date
1493: ,vr.proration_rule
1494: ,vr.cumulative_vol
1495: FROM
1496: pn_var_rents_all vr
1497: WHERE
1498: vr.var_rent_id = p_vr_id;
1499:
1500: l_proration_rule pn_var_rents_all.proration_rule%TYPE;
1496: pn_var_rents_all vr
1497: WHERE
1498: vr.var_rent_id = p_vr_id;
1499:
1500: l_proration_rule pn_var_rents_all.proration_rule%TYPE;
1501:
1502: /* get the period details - we use the first 2 periods */
1503: CURSOR periods_c(p_vr_id IN NUMBER) IS
1504: SELECT
1793: ,vr.termination_date
1794: ,vr.proration_rule
1795: ,vr.cumulative_vol
1796: FROM
1797: pn_var_rents_all vr
1798: WHERE
1799: vr.var_rent_id = p_vr_id;
1800:
1801: l_proration_rule pn_var_rents_all.proration_rule%TYPE;
1797: pn_var_rents_all vr
1798: WHERE
1799: vr.var_rent_id = p_vr_id;
1800:
1801: l_proration_rule pn_var_rents_all.proration_rule%TYPE;
1802: l_calculation_method pn_var_rents_all.cumulative_vol%TYPE;
1803:
1804: /* get the period details - we use the first 2 periods for CYP, CYNP */
1805: CURSOR periods_c(p_vr_id IN NUMBER) IS
1798: WHERE
1799: vr.var_rent_id = p_vr_id;
1800:
1801: l_proration_rule pn_var_rents_all.proration_rule%TYPE;
1802: l_calculation_method pn_var_rents_all.cumulative_vol%TYPE;
1803:
1804: /* get the period details - we use the first 2 periods for CYP, CYNP */
1805: CURSOR periods_c(p_vr_id IN NUMBER) IS
1806: SELECT
1867: prd.period_id
1868: ,prd.partial_period
1869: FROM
1870: pn_var_periods_all prd,
1871: pn_var_rents_all var
1872: WHERE
1873: prd.period_id = p_period_id AND
1874: prd.var_rent_id = var.var_rent_id AND
1875: prd.end_date = var.termination_date AND
2093: ,vr.termination_date
2094: ,vr.proration_rule
2095: ,vr.cumulative_vol
2096: FROM
2097: pn_var_rents_all vr
2098: WHERE
2099: vr.var_rent_id = p_vr_id;
2100:
2101: /* variables for vr_c */
2098: WHERE
2099: vr.var_rent_id = p_vr_id;
2100:
2101: /* variables for vr_c */
2102: l_org_id pn_var_rents_all.org_id%TYPE;
2103: l_vr_commencement_date pn_var_rents_all.commencement_date%TYPE;
2104: l_vr_termination_date pn_var_rents_all.termination_date%TYPE;
2105: l_proration_rule pn_var_rents_all.proration_rule%TYPE;
2106: l_calculation_method pn_var_rents_all.cumulative_vol%TYPE;
2099: vr.var_rent_id = p_vr_id;
2100:
2101: /* variables for vr_c */
2102: l_org_id pn_var_rents_all.org_id%TYPE;
2103: l_vr_commencement_date pn_var_rents_all.commencement_date%TYPE;
2104: l_vr_termination_date pn_var_rents_all.termination_date%TYPE;
2105: l_proration_rule pn_var_rents_all.proration_rule%TYPE;
2106: l_calculation_method pn_var_rents_all.cumulative_vol%TYPE;
2107:
2100:
2101: /* variables for vr_c */
2102: l_org_id pn_var_rents_all.org_id%TYPE;
2103: l_vr_commencement_date pn_var_rents_all.commencement_date%TYPE;
2104: l_vr_termination_date pn_var_rents_all.termination_date%TYPE;
2105: l_proration_rule pn_var_rents_all.proration_rule%TYPE;
2106: l_calculation_method pn_var_rents_all.cumulative_vol%TYPE;
2107:
2108: /* get the periods that do not exist anymore */
2101: /* variables for vr_c */
2102: l_org_id pn_var_rents_all.org_id%TYPE;
2103: l_vr_commencement_date pn_var_rents_all.commencement_date%TYPE;
2104: l_vr_termination_date pn_var_rents_all.termination_date%TYPE;
2105: l_proration_rule pn_var_rents_all.proration_rule%TYPE;
2106: l_calculation_method pn_var_rents_all.cumulative_vol%TYPE;
2107:
2108: /* get the periods that do not exist anymore */
2109: CURSOR chk_for_del_prd_c(p_vr_id IN NUMBER) IS
2102: l_org_id pn_var_rents_all.org_id%TYPE;
2103: l_vr_commencement_date pn_var_rents_all.commencement_date%TYPE;
2104: l_vr_termination_date pn_var_rents_all.termination_date%TYPE;
2105: l_proration_rule pn_var_rents_all.proration_rule%TYPE;
2106: l_calculation_method pn_var_rents_all.cumulative_vol%TYPE;
2107:
2108: /* get the periods that do not exist anymore */
2109: CURSOR chk_for_del_prd_c(p_vr_id IN NUMBER) IS
2110: SELECT
3177: ,vr.commencement_date
3178: ,vr.termination_date
3179: ,vr.proration_rule
3180: FROM
3181: pn_var_rents_all vr
3182: WHERE
3183: vr.var_rent_id = p_vr_id;
3184:
3185: l_vr_commencement_date DATE;
3300: ,vr.commencement_date
3301: ,vr.termination_date
3302: ,vr.proration_rule
3303: FROM
3304: pn_var_rents_all vr
3305: WHERE
3306: vr.var_rent_id = p_vr_id;
3307:
3308: l_vr_commencement_date DATE;
3417: SELECT
3418: vr.var_rent_id
3419: ,vr.proration_rule
3420: FROM
3421: pn_var_rents_all vr
3422: WHERE
3423: vr.var_rent_id = p_vr_id;
3424:
3425: l_proration_rule pn_var_rents_all.proration_rule%TYPE;
3421: pn_var_rents_all vr
3422: WHERE
3423: vr.var_rent_id = p_vr_id;
3424:
3425: l_proration_rule pn_var_rents_all.proration_rule%TYPE;
3426:
3427: /* get the line items with updated sales for FY, LY, FLY, STD, NP */
3428: CURSOR lines_c(p_vr_id IN NUMBER) IS
3429: SELECT
3695: ,vr.termination_date
3696: ,vr.proration_rule
3697: ,vr.cumulative_vol
3698: FROM
3699: pn_var_rents_all vr
3700: WHERE
3701: vr.var_rent_id = p_vr_id;
3702:
3703: l_org_id pn_var_rents_all.org_id%TYPE;
3699: pn_var_rents_all vr
3700: WHERE
3701: vr.var_rent_id = p_vr_id;
3702:
3703: l_org_id pn_var_rents_all.org_id%TYPE;
3704: l_vr_commencement_date pn_var_rents_all.commencement_date%TYPE;
3705: l_vr_termination_date pn_var_rents_all.termination_date%TYPE;
3706: l_proration_rule pn_var_rents_all.proration_rule%TYPE;
3707: l_calculation_method pn_var_rents_all.cumulative_vol%TYPE;
3700: WHERE
3701: vr.var_rent_id = p_vr_id;
3702:
3703: l_org_id pn_var_rents_all.org_id%TYPE;
3704: l_vr_commencement_date pn_var_rents_all.commencement_date%TYPE;
3705: l_vr_termination_date pn_var_rents_all.termination_date%TYPE;
3706: l_proration_rule pn_var_rents_all.proration_rule%TYPE;
3707: l_calculation_method pn_var_rents_all.cumulative_vol%TYPE;
3708:
3701: vr.var_rent_id = p_vr_id;
3702:
3703: l_org_id pn_var_rents_all.org_id%TYPE;
3704: l_vr_commencement_date pn_var_rents_all.commencement_date%TYPE;
3705: l_vr_termination_date pn_var_rents_all.termination_date%TYPE;
3706: l_proration_rule pn_var_rents_all.proration_rule%TYPE;
3707: l_calculation_method pn_var_rents_all.cumulative_vol%TYPE;
3708:
3709: /* get the line items with updated sales */
3702:
3703: l_org_id pn_var_rents_all.org_id%TYPE;
3704: l_vr_commencement_date pn_var_rents_all.commencement_date%TYPE;
3705: l_vr_termination_date pn_var_rents_all.termination_date%TYPE;
3706: l_proration_rule pn_var_rents_all.proration_rule%TYPE;
3707: l_calculation_method pn_var_rents_all.cumulative_vol%TYPE;
3708:
3709: /* get the line items with updated sales */
3710: CURSOR lines_c(p_vr_id IN NUMBER) IS
3703: l_org_id pn_var_rents_all.org_id%TYPE;
3704: l_vr_commencement_date pn_var_rents_all.commencement_date%TYPE;
3705: l_vr_termination_date pn_var_rents_all.termination_date%TYPE;
3706: l_proration_rule pn_var_rents_all.proration_rule%TYPE;
3707: l_calculation_method pn_var_rents_all.cumulative_vol%TYPE;
3708:
3709: /* get the line items with updated sales */
3710: CURSOR lines_c(p_vr_id IN NUMBER) IS
3711: SELECT
4183: SELECT
4184: vr.var_rent_id
4185: ,vr.cumulative_vol
4186: FROM
4187: pn_var_rents_all vr
4188: WHERE
4189: vr.var_rent_id = p_vr_id;
4190:
4191: l_proration_rule pn_var_rents_all.proration_rule%TYPE;
4187: pn_var_rents_all vr
4188: WHERE
4189: vr.var_rent_id = p_vr_id;
4190:
4191: l_proration_rule pn_var_rents_all.proration_rule%TYPE;
4192: l_calculation_method pn_var_rents_all.cumulative_vol%TYPE;
4193:
4194: /* get the line items with updated sales for FY, LY, FLY, STD, NP */
4195: CURSOR lines_c(p_vr_id IN NUMBER) IS
4188: WHERE
4189: vr.var_rent_id = p_vr_id;
4190:
4191: l_proration_rule pn_var_rents_all.proration_rule%TYPE;
4192: l_calculation_method pn_var_rents_all.cumulative_vol%TYPE;
4193:
4194: /* get the line items with updated sales for FY, LY, FLY, STD, NP */
4195: CURSOR lines_c(p_vr_id IN NUMBER) IS
4196: SELECT
4305: ,vr.termination_date
4306: ,vr.proration_rule
4307: ,vr.cumulative_vol
4308: FROM
4309: pn_var_rents_all vr
4310: WHERE
4311: vr.var_rent_id = p_vr_id;
4312:
4313: l_org_id pn_var_rents_all.org_id%TYPE;
4309: pn_var_rents_all vr
4310: WHERE
4311: vr.var_rent_id = p_vr_id;
4312:
4313: l_org_id pn_var_rents_all.org_id%TYPE;
4314: l_vr_commencement_date pn_var_rents_all.commencement_date%TYPE;
4315: l_vr_termination_date pn_var_rents_all.termination_date%TYPE;
4316: l_proration_rule pn_var_rents_all.proration_rule%TYPE;
4317: l_calculation_method pn_var_rents_all.cumulative_vol%TYPE;
4310: WHERE
4311: vr.var_rent_id = p_vr_id;
4312:
4313: l_org_id pn_var_rents_all.org_id%TYPE;
4314: l_vr_commencement_date pn_var_rents_all.commencement_date%TYPE;
4315: l_vr_termination_date pn_var_rents_all.termination_date%TYPE;
4316: l_proration_rule pn_var_rents_all.proration_rule%TYPE;
4317: l_calculation_method pn_var_rents_all.cumulative_vol%TYPE;
4318:
4311: vr.var_rent_id = p_vr_id;
4312:
4313: l_org_id pn_var_rents_all.org_id%TYPE;
4314: l_vr_commencement_date pn_var_rents_all.commencement_date%TYPE;
4315: l_vr_termination_date pn_var_rents_all.termination_date%TYPE;
4316: l_proration_rule pn_var_rents_all.proration_rule%TYPE;
4317: l_calculation_method pn_var_rents_all.cumulative_vol%TYPE;
4318:
4319: /* get the line items with updated sales */
4312:
4313: l_org_id pn_var_rents_all.org_id%TYPE;
4314: l_vr_commencement_date pn_var_rents_all.commencement_date%TYPE;
4315: l_vr_termination_date pn_var_rents_all.termination_date%TYPE;
4316: l_proration_rule pn_var_rents_all.proration_rule%TYPE;
4317: l_calculation_method pn_var_rents_all.cumulative_vol%TYPE;
4318:
4319: /* get the line items with updated sales */
4320: CURSOR lines_c(p_vr_id IN NUMBER) IS
4313: l_org_id pn_var_rents_all.org_id%TYPE;
4314: l_vr_commencement_date pn_var_rents_all.commencement_date%TYPE;
4315: l_vr_termination_date pn_var_rents_all.termination_date%TYPE;
4316: l_proration_rule pn_var_rents_all.proration_rule%TYPE;
4317: l_calculation_method pn_var_rents_all.cumulative_vol%TYPE;
4318:
4319: /* get the line items with updated sales */
4320: CURSOR lines_c(p_vr_id IN NUMBER) IS
4321: SELECT
4759: ,vr.commencement_date
4760: ,vr.termination_date
4761: ,vr.proration_rule
4762: FROM
4763: pn_var_rents_all vr
4764: WHERE
4765: vr.var_rent_id = p_vr_id;
4766:
4767: l_vr_commencement_date DATE;
4857: ,vr.commencement_date
4858: ,vr.termination_date
4859: ,vr.proration_rule
4860: FROM
4861: pn_var_rents_all vr
4862: WHERE
4863: vr.var_rent_id = p_vr_id;
4864:
4865: l_vr_commencement_date DATE;
4950: SELECT
4951: vr.var_rent_id
4952: ,vr.proration_rule
4953: FROM
4954: pn_var_rents_all vr
4955: WHERE
4956: vr.var_rent_id = p_vr_id;
4957:
4958: l_proration_rule pn_var_rents_all.proration_rule%TYPE;
4954: pn_var_rents_all vr
4955: WHERE
4956: vr.var_rent_id = p_vr_id;
4957:
4958: l_proration_rule pn_var_rents_all.proration_rule%TYPE;
4959:
4960: /* get the line items with updated deductions for FY, LY, FLY, STD, NP */
4961: CURSOR lines_c(p_vr_id IN NUMBER) IS
4962: SELECT
5226: ,vr.termination_date
5227: ,vr.proration_rule
5228: ,vr.cumulative_vol
5229: FROM
5230: pn_var_rents_all vr
5231: WHERE
5232: vr.var_rent_id = p_vr_id;
5233:
5234: l_org_id pn_var_rents_all.org_id%TYPE;
5230: pn_var_rents_all vr
5231: WHERE
5232: vr.var_rent_id = p_vr_id;
5233:
5234: l_org_id pn_var_rents_all.org_id%TYPE;
5235: l_vr_commencement_date pn_var_rents_all.commencement_date%TYPE;
5236: l_vr_termination_date pn_var_rents_all.termination_date%TYPE;
5237: l_proration_rule pn_var_rents_all.proration_rule%TYPE;
5238: l_calculation_method pn_var_rents_all.cumulative_vol%TYPE;
5231: WHERE
5232: vr.var_rent_id = p_vr_id;
5233:
5234: l_org_id pn_var_rents_all.org_id%TYPE;
5235: l_vr_commencement_date pn_var_rents_all.commencement_date%TYPE;
5236: l_vr_termination_date pn_var_rents_all.termination_date%TYPE;
5237: l_proration_rule pn_var_rents_all.proration_rule%TYPE;
5238: l_calculation_method pn_var_rents_all.cumulative_vol%TYPE;
5239:
5232: vr.var_rent_id = p_vr_id;
5233:
5234: l_org_id pn_var_rents_all.org_id%TYPE;
5235: l_vr_commencement_date pn_var_rents_all.commencement_date%TYPE;
5236: l_vr_termination_date pn_var_rents_all.termination_date%TYPE;
5237: l_proration_rule pn_var_rents_all.proration_rule%TYPE;
5238: l_calculation_method pn_var_rents_all.cumulative_vol%TYPE;
5239:
5240: /* get the line items*/
5233:
5234: l_org_id pn_var_rents_all.org_id%TYPE;
5235: l_vr_commencement_date pn_var_rents_all.commencement_date%TYPE;
5236: l_vr_termination_date pn_var_rents_all.termination_date%TYPE;
5237: l_proration_rule pn_var_rents_all.proration_rule%TYPE;
5238: l_calculation_method pn_var_rents_all.cumulative_vol%TYPE;
5239:
5240: /* get the line items*/
5241: CURSOR lines_c(p_vr_id IN NUMBER) IS
5234: l_org_id pn_var_rents_all.org_id%TYPE;
5235: l_vr_commencement_date pn_var_rents_all.commencement_date%TYPE;
5236: l_vr_termination_date pn_var_rents_all.termination_date%TYPE;
5237: l_proration_rule pn_var_rents_all.proration_rule%TYPE;
5238: l_calculation_method pn_var_rents_all.cumulative_vol%TYPE;
5239:
5240: /* get the line items*/
5241: CURSOR lines_c(p_vr_id IN NUMBER) IS
5242: SELECT