8374: p_v_string => 'Calling finpl_lock_records' );
8375:
8376: l_n_rec_count := 0;
8377:
8378: -- Before processing, obtain a lock in table IGS_FI_SPA_FEE_PRDS for the given Person-Course-Fee Period.
8379: IF NOT finpl_lock_records(p_n_person_id => p_person_id,
8380: p_v_course_cd => p_course_cd,
8381: p_v_fee_cal_type => p_fee_cal_type,
8382: p_n_fee_ci_sequence_number => p_fee_ci_sequence_num) THEN
10758: PRAGMA AUTONOMOUS_TRANSACTION;
10759: /*************************************************************
10760: Created By : Priya Athipatla
10761: Date Created By : 01-Jul-2004
10762: Purpose : Function inserts records into table IGS_FI_SPA_FEE_PRDS
10763: if such a record doesnt exist already. Invoked from
10764: finpl_lock_records().
10765:
10766: Returns TRUE if insertion was successful, FALSE otherwise.
10774:
10775: BEGIN
10776:
10777: log_to_fnd( p_v_module => 'finpl_insert_record',
10778: p_v_string => 'Proceeding to insert an Assessment record into IGS_FI_SPA_FEE_PRDS' );
10779:
10780: l_rowid := NULL;
10781: igs_fi_spa_fee_prds_pkg.insert_row ( x_rowid => l_rowid,
10782: x_person_id => p_n_person_id,
10777: log_to_fnd( p_v_module => 'finpl_insert_record',
10778: p_v_string => 'Proceeding to insert an Assessment record into IGS_FI_SPA_FEE_PRDS' );
10779:
10780: l_rowid := NULL;
10781: igs_fi_spa_fee_prds_pkg.insert_row ( x_rowid => l_rowid,
10782: x_person_id => p_n_person_id,
10783: x_course_cd => p_v_course_cd,
10784: x_fee_cal_type => p_v_fee_cal_type,
10785: x_fee_ci_sequence_number => p_n_fee_ci_sequence_number,
10787: x_transaction_type => 'ASSESSMENT'
10788: );
10789: COMMIT;
10790: log_to_fnd( p_v_module => 'finpl_insert_record',
10791: p_v_string => 'Record inserted into IGS_FI_SPA_FEE_PRDS, Commit successful, Return TRUE' );
10792:
10793: RETURN TRUE;
10794:
10795: EXCEPTION
10812: RETURN BOOLEAN IS
10813: /*************************************************************
10814: Created By : Priya Athipatla
10815: Date Created By : 01-Jul-2004
10816: Purpose : This function locks the record in the table IGS_FI_SPA_FEE_PRDS
10817: based on the combination of Person-Course-Fee Period that is
10818: passed as the input parameters. Added as a fix to prevent
10819: concurrent running of multiple instances of the process.
10820:
10825: Who When What
10826: akandreg 31-May-2006 Bug 5134636 - Modified cur_fee_spa to add check on TRANSACTION_TYPE
10827: ***************************************************************/
10828:
10829: CURSOR cur_fee_spa (cp_person_id igs_fi_spa_fee_prds.person_id%TYPE,
10830: cp_course_cd igs_fi_spa_fee_prds.course_cd%TYPE,
10831: cp_fee_cal_type igs_fi_spa_fee_prds.fee_cal_type%TYPE,
10832: cp_fee_ci_sequence_number igs_fi_spa_fee_prds.fee_ci_sequence_number%TYPE,
10833: cp_transaction_type igs_fi_spa_fee_prds.transaction_type%TYPE) IS
10826: akandreg 31-May-2006 Bug 5134636 - Modified cur_fee_spa to add check on TRANSACTION_TYPE
10827: ***************************************************************/
10828:
10829: CURSOR cur_fee_spa (cp_person_id igs_fi_spa_fee_prds.person_id%TYPE,
10830: cp_course_cd igs_fi_spa_fee_prds.course_cd%TYPE,
10831: cp_fee_cal_type igs_fi_spa_fee_prds.fee_cal_type%TYPE,
10832: cp_fee_ci_sequence_number igs_fi_spa_fee_prds.fee_ci_sequence_number%TYPE,
10833: cp_transaction_type igs_fi_spa_fee_prds.transaction_type%TYPE) IS
10834: SELECT 'x'
10827: ***************************************************************/
10828:
10829: CURSOR cur_fee_spa (cp_person_id igs_fi_spa_fee_prds.person_id%TYPE,
10830: cp_course_cd igs_fi_spa_fee_prds.course_cd%TYPE,
10831: cp_fee_cal_type igs_fi_spa_fee_prds.fee_cal_type%TYPE,
10832: cp_fee_ci_sequence_number igs_fi_spa_fee_prds.fee_ci_sequence_number%TYPE,
10833: cp_transaction_type igs_fi_spa_fee_prds.transaction_type%TYPE) IS
10834: SELECT 'x'
10835: FROM igs_fi_spa_fee_prds
10828:
10829: CURSOR cur_fee_spa (cp_person_id igs_fi_spa_fee_prds.person_id%TYPE,
10830: cp_course_cd igs_fi_spa_fee_prds.course_cd%TYPE,
10831: cp_fee_cal_type igs_fi_spa_fee_prds.fee_cal_type%TYPE,
10832: cp_fee_ci_sequence_number igs_fi_spa_fee_prds.fee_ci_sequence_number%TYPE,
10833: cp_transaction_type igs_fi_spa_fee_prds.transaction_type%TYPE) IS
10834: SELECT 'x'
10835: FROM igs_fi_spa_fee_prds
10836: WHERE person_id = cp_person_id
10829: CURSOR cur_fee_spa (cp_person_id igs_fi_spa_fee_prds.person_id%TYPE,
10830: cp_course_cd igs_fi_spa_fee_prds.course_cd%TYPE,
10831: cp_fee_cal_type igs_fi_spa_fee_prds.fee_cal_type%TYPE,
10832: cp_fee_ci_sequence_number igs_fi_spa_fee_prds.fee_ci_sequence_number%TYPE,
10833: cp_transaction_type igs_fi_spa_fee_prds.transaction_type%TYPE) IS
10834: SELECT 'x'
10835: FROM igs_fi_spa_fee_prds
10836: WHERE person_id = cp_person_id
10837: AND course_cd = cp_course_cd
10831: cp_fee_cal_type igs_fi_spa_fee_prds.fee_cal_type%TYPE,
10832: cp_fee_ci_sequence_number igs_fi_spa_fee_prds.fee_ci_sequence_number%TYPE,
10833: cp_transaction_type igs_fi_spa_fee_prds.transaction_type%TYPE) IS
10834: SELECT 'x'
10835: FROM igs_fi_spa_fee_prds
10836: WHERE person_id = cp_person_id
10837: AND course_cd = cp_course_cd
10838: AND fee_cal_type = cp_fee_cal_type
10839: AND fee_ci_sequence_number = cp_fee_ci_sequence_number
10844:
10845: BEGIN
10846:
10847: log_to_fnd( p_v_module => 'finpl_lock_records',
10848: p_v_string => 'Checking if record already exists in IGS_FI_SPA_FEE_PRDS to lock' );
10849:
10850: OPEN cur_fee_spa(p_n_person_id,
10851: p_v_course_cd,
10852: p_v_fee_cal_type,
10855: FETCH cur_fee_spa INTO l_v_dummy;
10856: IF cur_fee_spa%NOTFOUND THEN
10857: -- If the record does not exist in igs_fi_spa_fee_period table, then insert into the table.
10858: log_to_fnd( p_v_module => 'finpl_lock_records',
10859: p_v_string => 'Record not present in IGS_FI_SPA_FEE_PRDS, so call finpl_insert_record' );
10860: CLOSE cur_fee_spa;
10861: -- Call autonomous function to insert into IGS_FI_SPA_FEE_PRDS
10862: IF finpl_insert_record(p_n_person_id,
10863: p_v_course_cd,
10857: -- If the record does not exist in igs_fi_spa_fee_period table, then insert into the table.
10858: log_to_fnd( p_v_module => 'finpl_lock_records',
10859: p_v_string => 'Record not present in IGS_FI_SPA_FEE_PRDS, so call finpl_insert_record' );
10860: CLOSE cur_fee_spa;
10861: -- Call autonomous function to insert into IGS_FI_SPA_FEE_PRDS
10862: IF finpl_insert_record(p_n_person_id,
10863: p_v_course_cd,
10864: p_v_fee_cal_type,
10865: p_n_fee_ci_sequence_number) THEN
10864: p_v_fee_cal_type,
10865: p_n_fee_ci_sequence_number) THEN
10866: -- After insertion (if insertion was successful), lock the record
10867: log_to_fnd( p_v_module => 'finpl_lock_records',
10868: p_v_string => 'Insertion of record in IGS_FI_SPA_FEE_PRDS successful, lock and return TRUE');
10869: OPEN cur_fee_spa(p_n_person_id,
10870: p_v_course_cd,
10871: p_v_fee_cal_type,
10872: p_n_fee_ci_sequence_number,
10876: RETURN TRUE;
10877: ELSE
10878: -- Insertion failed, return FALSE
10879: log_to_fnd( p_v_module => 'finpl_lock_records',
10880: p_v_string => 'Insertion of record into IGS_FI_SPA_FEE_PRDS not successful, return FALSE');
10881: RETURN FALSE;
10882: END IF;
10883: ELSE
10884: -- If record exists in table igs_fi_spa_fee_period, then lock the record.
10883: ELSE
10884: -- If record exists in table igs_fi_spa_fee_period, then lock the record.
10885: CLOSE cur_fee_spa;
10886: log_to_fnd( p_v_module => 'finpl_lock_records',
10887: p_v_string => 'Record exists in IGS_FI_SPA_FEE_PRDS, so lock and return TRUE');
10888: RETURN TRUE;
10889: END IF; -- End if for cursor cur_fee_spa NOTFOUND
10890:
10891: EXCEPTION