[Home] [Help]
139: --FUNCTION to calculate holds balance amount
140:
141: FUNCTION holds_balance( p_person_id IN igs_pe_person_v.person_id%TYPE ,
142: p_person_number IN igs_pe_person_v.person_number%TYPE ,
143: p_hold_plan_name IN igs_fi_hold_plan.hold_plan_name%Type,
144: P_fee_cal_type IN igs_fi_inv_int.fee_cal_type%TYPE,
145: P_fee_ci_sequence_number IN igs_fi_inv_int.fee_ci_sequence_number%TYPE,
146: p_process_end_date IN igs_fi_person_holds.process_end_dT%TYPE ,
147: p_process_start_date IN igs_fi_person_holds.process_start_dT%TYPE ,
145: P_fee_ci_sequence_number IN igs_fi_inv_int.fee_ci_sequence_number%TYPE,
146: p_process_end_date IN igs_fi_person_holds.process_end_dT%TYPE ,
147: p_process_start_date IN igs_fi_person_holds.process_start_dT%TYPE ,
148: P_test_run IN VARCHAR2 ,
149: P_hold_type OUT NOCOPY igs_fi_hold_plan.hold_type%Type,
150: P_hold_plan_level OUT NOCOPY igs_fi_hold_plan.hold_plan_level%TYPE,
151: P_holds_charges OUT NOCOPY igs_fi_inv_int.invoice_amount%TYPE,
152: P_holds_final_balance OUT NOCOPY igs_fi_credits.amount%TYPE,
153: p_offset_days OUT NOCOPY igs_fi_hold_plan.offset_days%TYPE,
146: p_process_end_date IN igs_fi_person_holds.process_end_dT%TYPE ,
147: p_process_start_date IN igs_fi_person_holds.process_start_dT%TYPE ,
148: P_test_run IN VARCHAR2 ,
149: P_hold_type OUT NOCOPY igs_fi_hold_plan.hold_type%Type,
150: P_hold_plan_level OUT NOCOPY igs_fi_hold_plan.hold_plan_level%TYPE,
151: P_holds_charges OUT NOCOPY igs_fi_inv_int.invoice_amount%TYPE,
152: P_holds_final_balance OUT NOCOPY igs_fi_credits.amount%TYPE,
153: p_offset_days OUT NOCOPY igs_fi_hold_plan.offset_days%TYPE,
154: p_n_student_plan_id OUT NOCOPY igs_fi_pp_std_attrs.student_plan_id%TYPE,
149: P_hold_type OUT NOCOPY igs_fi_hold_plan.hold_type%Type,
150: P_hold_plan_level OUT NOCOPY igs_fi_hold_plan.hold_plan_level%TYPE,
151: P_holds_charges OUT NOCOPY igs_fi_inv_int.invoice_amount%TYPE,
152: P_holds_final_balance OUT NOCOPY igs_fi_credits.amount%TYPE,
153: p_offset_days OUT NOCOPY igs_fi_hold_plan.offset_days%TYPE,
154: p_n_student_plan_id OUT NOCOPY igs_fi_pp_std_attrs.student_plan_id%TYPE,
155: p_d_last_inst_due_date OUT NOCOPY igs_fi_pp_instlmnts.due_date%TYPE)
156: RETURN BOOLEAN
157: IS
187: fee_type,
188: offset_days ,
189: payment_plan_threshold_amt ,
190: payment_plan_threshold_pcent
191: FROM igs_fi_hold_plan
192: WHERE hold_plan_name = p_hold_plan_name;
193:
194: --to SELECT holds_balance for the passed party_id AND date range
195: CURSOR c_holds_balance IS
276: l_credit_subac igs_fi_credits.amount%TYPE :=0;
277: l_tot_credits igs_fi_credits.amount%TYPE :=0;
278: l_charges igs_fi_inv_int.invoice_amount%TYPE :=0;
279: l_final_balance igs_fi_credits.amount%TYPE :=0;
280: l_ratio igs_fi_hold_plan.threshold_percent%TYPE;
281:
282: -- Changes due to SFCR018
283: -- Call the local function to get the value of planned_credits_ind
284: l_v_pln_cr_ind igs_fi_control_all.planned_credits_ind%TYPE := get_planned_credits_ind;
285: l_v_pln_cr_message fnd_new_messages.message_name%TYPE :=NULL;
286: l_n_planned_credit igs_fi_credits.amount%TYPE :=0;
287: -- Changes due to SFCR018
288:
289: l_n_threshold_amount igs_fi_hold_plan.threshold_amount%TYPE ;
290: l_n_threshold_percent igs_fi_hold_plan.threshold_percent%TYPE ;
291: l_n_act_plan_id igs_fi_pp_std_attrs.student_plan_id%TYPE ;
292: l_v_act_plan_name igs_fi_pp_templates.payment_plan_name%TYPE;
293: l_d_pay_det_date DATE;
286: l_n_planned_credit igs_fi_credits.amount%TYPE :=0;
287: -- Changes due to SFCR018
288:
289: l_n_threshold_amount igs_fi_hold_plan.threshold_amount%TYPE ;
290: l_n_threshold_percent igs_fi_hold_plan.threshold_percent%TYPE ;
291: l_n_act_plan_id igs_fi_pp_std_attrs.student_plan_id%TYPE ;
292: l_v_act_plan_name igs_fi_pp_templates.payment_plan_name%TYPE;
293: l_d_pay_det_date DATE;
294:
572:
573: FUNCTION validate_holds(p_person_id IN igs_pe_person_v.person_id%TYPE ,
574: p_person_number IN igs_pe_person_v.person_number%TYPE ,
575: p_hold_start_date IN igs_fi_person_holds.hold_start_dt%type,
576: p_hold_type IN igs_fi_hold_plan.hold_type%TYPE,
577: p_hold_plan_name IN igs_fi_hold_plan.hold_plan_name%TYPE,
578: p_hold_plan_level IN igs_fi_hold_plan.hold_plan_level%TYPE,
579: p_process_start_dt IN igs_fi_person_holds.process_start_dT%TYPE ,
580: p_process_end_dt IN igs_fi_person_holds.process_end_dT%TYPE ,
573: FUNCTION validate_holds(p_person_id IN igs_pe_person_v.person_id%TYPE ,
574: p_person_number IN igs_pe_person_v.person_number%TYPE ,
575: p_hold_start_date IN igs_fi_person_holds.hold_start_dt%type,
576: p_hold_type IN igs_fi_hold_plan.hold_type%TYPE,
577: p_hold_plan_name IN igs_fi_hold_plan.hold_plan_name%TYPE,
578: p_hold_plan_level IN igs_fi_hold_plan.hold_plan_level%TYPE,
579: p_process_start_dt IN igs_fi_person_holds.process_start_dT%TYPE ,
580: p_process_end_dt IN igs_fi_person_holds.process_end_dT%TYPE ,
581: p_offset_days IN NUMBER,
574: p_person_number IN igs_pe_person_v.person_number%TYPE ,
575: p_hold_start_date IN igs_fi_person_holds.hold_start_dt%type,
576: p_hold_type IN igs_fi_hold_plan.hold_type%TYPE,
577: p_hold_plan_name IN igs_fi_hold_plan.hold_plan_name%TYPE,
578: p_hold_plan_level IN igs_fi_hold_plan.hold_plan_level%TYPE,
579: p_process_start_dt IN igs_fi_person_holds.process_start_dT%TYPE ,
580: p_process_end_dt IN igs_fi_person_holds.process_end_dT%TYPE ,
581: p_offset_days IN NUMBER,
582: p_holds_charges IN igs_fi_inv_int.invoice_amount%TYPE,
788: FUNCTION validate_param(p_person_id IN igs_pe_person_v.person_id%TYPE ,
789: p_person_id_group IN igs_pe_persid_group_v.group_id%TYPE ,
790: P_process_start_date IN igs_fi_person_holds.process_start_dT%TYPE ,
791: P_process_end_date IN igs_fi_person_holds.process_end_dT%TYPE ,
792: P_hold_plan_name IN igs_fi_hold_plan.hold_plan_name%Type,
793: P_fee_cal_type IN igs_fi_inv_int.fee_cal_type%TYPE,
794: P_fee_ci_sequence_number IN igs_fi_inv_int.fee_ci_sequence_number%TYPE
795: )
796: RETURN BOOLEAN
834: CURSOR c_hold_plan_name IS
835: SELECT hold_plan_name,
836: hold_plan_level,
837: offset_days
838: FROM igs_fi_hold_plan
839: WHERE hold_plan_name = p_hold_plan_name
840: AND closed_ind = 'N';
841:
842: --to get fee related info based on the prameters value passed
1023: p_person_id IN igs_pe_person_v.person_id%TYPE ,
1024: p_person_id_group IN igs_pe_persid_group_v.group_id%TYPE ,
1025: P_process_start_date IN VARCHAR2 ,
1026: P_process_end_date IN VARCHAR2 ,
1027: P_hold_plan_name IN igs_fi_hold_plan.hold_plan_name%Type,
1028: P_fee_period IN VARCHAR2,
1029: P_test_run IN VARCHAR2 )
1030:
1031: IS
1084: l_person_number igs_pe_person.person_number%TYPE :=NULL;
1085: l_person_name igs_pe_person_base_v.full_name%TYPE :=NULL;
1086: l_message_name fnd_new_messages.message_name%TYPE :=NULL;
1087: l_message_name_1 fnd_new_messages.message_name%TYPE :=NULL;
1088: l_hold_type igs_fi_hold_plan.hold_type%TYPE;
1089: l_hold_plan_level igs_fi_hold_plan.hold_plan_level%TYPE;
1090: l_hold_plan_name igs_fi_hold_plan.hold_plan_name%TYPE;
1091: l_holds_charges igs_fi_inv_int.invoice_amount%TYPE := 0;
1092: l_holds_final_balance igs_fi_credits.amount%TYPE := 0;
1085: l_person_name igs_pe_person_base_v.full_name%TYPE :=NULL;
1086: l_message_name fnd_new_messages.message_name%TYPE :=NULL;
1087: l_message_name_1 fnd_new_messages.message_name%TYPE :=NULL;
1088: l_hold_type igs_fi_hold_plan.hold_type%TYPE;
1089: l_hold_plan_level igs_fi_hold_plan.hold_plan_level%TYPE;
1090: l_hold_plan_name igs_fi_hold_plan.hold_plan_name%TYPE;
1091: l_holds_charges igs_fi_inv_int.invoice_amount%TYPE := 0;
1092: l_holds_final_balance igs_fi_credits.amount%TYPE := 0;
1093: l_count PLS_INTEGER := 0;
1086: l_message_name fnd_new_messages.message_name%TYPE :=NULL;
1087: l_message_name_1 fnd_new_messages.message_name%TYPE :=NULL;
1088: l_hold_type igs_fi_hold_plan.hold_type%TYPE;
1089: l_hold_plan_level igs_fi_hold_plan.hold_plan_level%TYPE;
1090: l_hold_plan_name igs_fi_hold_plan.hold_plan_name%TYPE;
1091: l_holds_charges igs_fi_inv_int.invoice_amount%TYPE := 0;
1092: l_holds_final_balance igs_fi_credits.amount%TYPE := 0;
1093: l_count PLS_INTEGER := 0;
1094: l_msg_str_0 VARCHAR2(1000) :=NULL;
1099: l_process_run_ind igs_fi_control_all.conv_process_run_ind%TYPE;
1100:
1101: l_v_manage_acc igs_fi_control_all.manage_accounts%TYPE := NULL;
1102: l_v_message_name fnd_new_messages.message_name%TYPE :=NULL;
1103: l_n_offset_days igs_fi_hold_plan.offset_days%TYPE :=0;
1104: l_n_student_plan_id igs_fi_pp_std_attrs.student_plan_id%TYPE;
1105: l_d_last_inst_due_date igs_fi_pp_instlmnts.due_date%TYPE;
1106: l_n_fnd_user_id fnd_user.user_id%TYPE;
1107: l_v_person_number hz_parties.party_number%TYPE;
1517:
1518:
1519: FUNCTION validate_param(p_person_id IN igs_pe_person_v.person_id%TYPE,
1520: p_person_id_group IN igs_pe_persid_group_v.group_id%TYPE,
1521: P_hold_plan_name IN igs_fi_hold_plan.hold_plan_name%Type,
1522: P_message_name OUT NOCOPY fnd_new_messages.message_name%TYPE)
1523: RETURN BOOLEAN
1524: IS
1525: /***************************************************************
1547:
1548: CURSOR c_hold_plan_name
1549: IS
1550: SELECT hold_plan_name
1551: FROM igs_fi_hold_plan
1552: WHERE hold_plan_name = p_hold_plan_name;
1553:
1554: l_person_group_id_rec c_person_group_id%ROWTYPE;
1555: l_hold_plan_name_rec c_hold_plan_name%ROWTYPE;
1624:
1625:
1626:
1627: FUNCTION validate_holds( p_person_id IN igs_pe_person.person_id%TYPE,
1628: P_hold_plan_name IN igs_fi_hold_plan.hold_plan_name%TYPE,
1629: P_test_run IN VARCHAR2 ,
1630: P_release OUT NOCOPY PLS_INTEGER,
1631: P_message_name OUT NOCOPY fnd_new_messages.message_name%TYPE,
1632: p_release_credit_id IN igs_fi_person_holds.release_credit_id%TYPE := NULL,
1629: P_test_run IN VARCHAR2 ,
1630: P_release OUT NOCOPY PLS_INTEGER,
1631: P_message_name OUT NOCOPY fnd_new_messages.message_name%TYPE,
1632: p_release_credit_id IN igs_fi_person_holds.release_credit_id%TYPE := NULL,
1633: p_hold_plan_level IN igs_fi_hold_plan.hold_plan_level%TYPE := NULL
1634: ) RETURN BOOLEAN IS
1635: /***************************************************************
1636: Created By : bayadav
1637: Date Created By : 29-Nov-2001
1643: shtatiko 17-OCT-2003 Bug# 3192641, Added code to consider charges that are waived when calculating Holds Balance.
1644: smadathi 28-Aug-2003 Enh Bug 3045007.
1645: pathipat 12-Aug-2003 Enh 3076768 - Auto Release of Holds. Modification as per TD
1646: Added two IN params - p_release_credit_id and p_hold_plan_level
1647: Modified cursor c_hold_type - added join with igs_fi_hold_plan, removed trunc for start and end dates
1648: Removed cursor c_hold_plan, modified TBH calls to igs_fi_person_holds
1649: vvutukur 05-Mar-2003 Enh#2824994.Modified code such that log file output is not shown in horizontal tabular format, instead it
1650: it is shown in linear/logging format.Also used global variables to log the details instead of calling generic function
1651: everytime to get the lookup meaning.
1700: c.student_plan_id student_plan_id,
1701: c.last_instlmnt_due_date last_instlmnt_due_date
1702: FROM igs_pe_pers_encumb a,
1703: igs_fi_person_holds c,
1704: igs_fi_hold_plan hplan
1705: WHERE (a.person_id = p_person_id OR p_person_id IS NULL)
1706: AND a.start_dt <= TRUNC(SYSDATE)
1707: AND (a.expiry_dt IS NULL OR TRUNC(SYSDATE) < a.expiry_dt )
1708: AND c.hold_plan_name = hplan.hold_plan_name
1725: AND crd.credit_type_id = crt.credit_type_id
1726: AND crt.credit_class NOT IN ('ENRDEPOSIT','OTHDEPOSIT')
1727: ORDER BY crd.credit_id;
1728:
1729: CURSOR c_igs_fi_hold_plan(cp_c_hold_plan_name igs_fi_hold_plan.hold_plan_name%TYPE) IS
1730: SELECT fee_type
1731: FROM igs_fi_hold_plan fhpl
1732: WHERE fhpl.hold_plan_name = cp_c_hold_plan_name;
1733:
1727: ORDER BY crd.credit_id;
1728:
1729: CURSOR c_igs_fi_hold_plan(cp_c_hold_plan_name igs_fi_hold_plan.hold_plan_name%TYPE) IS
1730: SELECT fee_type
1731: FROM igs_fi_hold_plan fhpl
1732: WHERE fhpl.hold_plan_name = cp_c_hold_plan_name;
1733:
1734: l_c_fee_type igs_fi_fee_type_all.fee_type%TYPE;
1735:
1796:
1797: l_hold_type_rec c_hold_type%ROWTYPE;
1798: l_credit_amount_rec c_credit_amount%ROWTYPE;
1799: l_total_balance_rec c_total_balance%ROWTYPE;
1800: l_hold_plan_name igs_fi_hold_plan.hold_plan_name%TYPE;
1801: l_message_name fnd_new_messages.message_name%TYPE := NULL;
1802: l_tot_amnt_all_subact igs_fi_credits.amount%TYPE := 0;
1803: l_non_ex_amnt_each_sc igs_fi_credits.amount%TYPE := 0;
1804: l_total_charges igs_fi_balances.holds_balance%TYPE := 0.0;
1819: l_n_planned_credit igs_fi_credits.amount%TYPE;
1820: -- Changes due to SFCR018
1821:
1822: l_c_message_name fnd_new_messages.message_name%TYPE := NULL;
1823: l_n_threshold_amount igs_fi_hold_plan.threshold_amount%TYPE ;
1824: l_n_threshold_percent igs_fi_hold_plan.threshold_percent%TYPE ;
1825: --Boolean variable added for Bug 3049184
1826: l_b_ret_amt_grt_msg_flag BOOLEAN ;
1827: BEGIN
1820: -- Changes due to SFCR018
1821:
1822: l_c_message_name fnd_new_messages.message_name%TYPE := NULL;
1823: l_n_threshold_amount igs_fi_hold_plan.threshold_amount%TYPE ;
1824: l_n_threshold_percent igs_fi_hold_plan.threshold_percent%TYPE ;
1825: --Boolean variable added for Bug 3049184
1826: l_b_ret_amt_grt_msg_flag BOOLEAN ;
1827: BEGIN
1828: l_b_ret_amt_grt_msg_flag := FALSE;
1962: --3
1963: END IF;
1964: ELSIF l_hold_type_rec.hold_plan_level = 'F' THEN
1965:
1966: OPEN c_igs_fi_hold_plan(l_hold_plan_name);
1967: FETCH c_igs_fi_hold_plan INTO l_c_fee_type;
1968: CLOSE c_igs_fi_hold_plan;
1969: --fetched fee_type_invoice_amount that stores the value of charges as on the process_start_date when the Holds application process ran and placed a hold on the student.
1970: l_total_charges := l_hold_type_rec.fee_type_invoice_amount ;
1963: END IF;
1964: ELSIF l_hold_type_rec.hold_plan_level = 'F' THEN
1965:
1966: OPEN c_igs_fi_hold_plan(l_hold_plan_name);
1967: FETCH c_igs_fi_hold_plan INTO l_c_fee_type;
1968: CLOSE c_igs_fi_hold_plan;
1969: --fetched fee_type_invoice_amount that stores the value of charges as on the process_start_date when the Holds application process ran and placed a hold on the student.
1970: l_total_charges := l_hold_type_rec.fee_type_invoice_amount ;
1971: --get the outstanding balance for the particular student for the fee types defined in the hold plan in the fee period from the intermediate table IGS_FI_PERSON_HOLDS
1964: ELSIF l_hold_type_rec.hold_plan_level = 'F' THEN
1965:
1966: OPEN c_igs_fi_hold_plan(l_hold_plan_name);
1967: FETCH c_igs_fi_hold_plan INTO l_c_fee_type;
1968: CLOSE c_igs_fi_hold_plan;
1969: --fetched fee_type_invoice_amount that stores the value of charges as on the process_start_date when the Holds application process ran and placed a hold on the student.
1970: l_total_charges := l_hold_type_rec.fee_type_invoice_amount ;
1971: --get the outstanding balance for the particular student for the fee types defined in the hold plan in the fee period from the intermediate table IGS_FI_PERSON_HOLDS
1972: OPEN c_total_balance(l_hold_type_rec.fee_cal_type ,
2216:
2217:
2218: PROCEDURE finp_release_holds_main(p_person_id IN igs_pe_person.person_id%TYPE ,
2219: p_person_id_group IN igs_pe_persid_group_v.group_id%TYPE ,
2220: P_hold_plan_name IN Igs_fi_hold_plan.hold_plan_name%TYPE ,
2221: P_test_run IN VARCHAR2 ,
2222: P_message_name OUT NOCOPY fnd_new_messages.message_name%TYPE)
2223: IS
2224: /***************************************************************
2268: l_person_hold_rec c_person_hold%ROWTYPE;
2269: l_person_number igs_pe_person.person_number%TYPE :=NULL;
2270: l_start_date igs_pe_pers_encumb.start_dt%TYPE;
2271: l_passed_hold_type igs_fi_person_holds.hold_type%TYPE ;
2272: l_hold_plan_name igs_fi_hold_plan.hold_plan_name%TYPE :=NULL;
2273: l_message_name fnd_new_messages.message_name%TYPE :=NULL;
2274: l_message_name_1 fnd_new_messages.message_name%TYPE :=NULL;
2275: l_release_hold VARCHAR2(10) :='Y';
2276: l_release NUMBER :=0;
2570: PROCEDURE finp_release_holds( errbuf OUT NOCOPY VARCHAR2,
2571: retcode OUT NOCOPY NUMBER,
2572: p_person_id IN igs_pe_person.person_id%TYPE ,
2573: p_person_id_group IN igs_pe_persid_group_v.group_id%TYPE ,
2574: p_hold_plan_name IN Igs_fi_hold_plan.hold_plan_name%Type,
2575: p_test_run IN VARCHAR2)
2576:
2577: IS
2578: /***************************************************************
2657:
2658: -- Cursor to check if the student has any active Balance level
2659: -- or Fee Type level.
2660: CURSOR cur_active_holds(cp_person_id igs_fi_person_holds.person_id%TYPE,
2661: cp_hold_plan_level igs_fi_hold_plan.hold_plan_level%TYPE) IS
2662: SELECT 'X'
2663: FROM igs_pe_pers_encumb pe_encmb,
2664: igs_fi_person_holds fi_holds,
2665: igs_fi_hold_plan hplan
2661: cp_hold_plan_level igs_fi_hold_plan.hold_plan_level%TYPE) IS
2662: SELECT 'X'
2663: FROM igs_pe_pers_encumb pe_encmb,
2664: igs_fi_person_holds fi_holds,
2665: igs_fi_hold_plan hplan
2666: WHERE pe_encmb.person_id = p_person_id
2667: AND pe_encmb.start_dt <= TRUNC(SYSDATE)
2668: AND (pe_encmb.expiry_dt IS NULL OR TRUNC(SYSDATE) < pe_encmb.expiry_dt)
2669: AND fi_holds.person_id = pe_encmb.person_id