141: ROLLBACK;
142: END insert_data_adj;
143:
144: -- ===============================================================================
145: -- Procedure to insert data into IGI_IAC_DET_BALANCES
146: -- ===============================================================================
147: PROCEDURE insert_data_det(p_adjustment_id in IGI_IAC_DET_BALANCES.adjustment_id%type,
148: p_asset_id in IGI_IAC_DET_BALANCES.asset_id%type,
149: p_distribution_id in IGI_IAC_DET_BALANCES.distribution_id%type,
143:
144: -- ===============================================================================
145: -- Procedure to insert data into IGI_IAC_DET_BALANCES
146: -- ===============================================================================
147: PROCEDURE insert_data_det(p_adjustment_id in IGI_IAC_DET_BALANCES.adjustment_id%type,
148: p_asset_id in IGI_IAC_DET_BALANCES.asset_id%type,
149: p_distribution_id in IGI_IAC_DET_BALANCES.distribution_id%type,
150: p_period_counter in IGI_IAC_DET_BALANCES.period_counter%type,
151: p_book_type_code in IGI_IAC_DET_BALANCES.book_type_code%type,
144: -- ===============================================================================
145: -- Procedure to insert data into IGI_IAC_DET_BALANCES
146: -- ===============================================================================
147: PROCEDURE insert_data_det(p_adjustment_id in IGI_IAC_DET_BALANCES.adjustment_id%type,
148: p_asset_id in IGI_IAC_DET_BALANCES.asset_id%type,
149: p_distribution_id in IGI_IAC_DET_BALANCES.distribution_id%type,
150: p_period_counter in IGI_IAC_DET_BALANCES.period_counter%type,
151: p_book_type_code in IGI_IAC_DET_BALANCES.book_type_code%type,
152: p_adjusted_cost in IGI_IAC_DET_BALANCES.adjustment_cost%type,
145: -- Procedure to insert data into IGI_IAC_DET_BALANCES
146: -- ===============================================================================
147: PROCEDURE insert_data_det(p_adjustment_id in IGI_IAC_DET_BALANCES.adjustment_id%type,
148: p_asset_id in IGI_IAC_DET_BALANCES.asset_id%type,
149: p_distribution_id in IGI_IAC_DET_BALANCES.distribution_id%type,
150: p_period_counter in IGI_IAC_DET_BALANCES.period_counter%type,
151: p_book_type_code in IGI_IAC_DET_BALANCES.book_type_code%type,
152: p_adjusted_cost in IGI_IAC_DET_BALANCES.adjustment_cost%type,
153: p_net_book_value in IGI_IAC_DET_BALANCES.net_book_value%type,
146: -- ===============================================================================
147: PROCEDURE insert_data_det(p_adjustment_id in IGI_IAC_DET_BALANCES.adjustment_id%type,
148: p_asset_id in IGI_IAC_DET_BALANCES.asset_id%type,
149: p_distribution_id in IGI_IAC_DET_BALANCES.distribution_id%type,
150: p_period_counter in IGI_IAC_DET_BALANCES.period_counter%type,
151: p_book_type_code in IGI_IAC_DET_BALANCES.book_type_code%type,
152: p_adjusted_cost in IGI_IAC_DET_BALANCES.adjustment_cost%type,
153: p_net_book_value in IGI_IAC_DET_BALANCES.net_book_value%type,
154: p_reval_reserve in IGI_IAC_DET_BALANCES.reval_reserve_cost%type,
147: PROCEDURE insert_data_det(p_adjustment_id in IGI_IAC_DET_BALANCES.adjustment_id%type,
148: p_asset_id in IGI_IAC_DET_BALANCES.asset_id%type,
149: p_distribution_id in IGI_IAC_DET_BALANCES.distribution_id%type,
150: p_period_counter in IGI_IAC_DET_BALANCES.period_counter%type,
151: p_book_type_code in IGI_IAC_DET_BALANCES.book_type_code%type,
152: p_adjusted_cost in IGI_IAC_DET_BALANCES.adjustment_cost%type,
153: p_net_book_value in IGI_IAC_DET_BALANCES.net_book_value%type,
154: p_reval_reserve in IGI_IAC_DET_BALANCES.reval_reserve_cost%type,
155: p_reval_reserve_gen_fund in IGI_IAC_DET_BALANCES.reval_reserve_gen_fund%type,
148: p_asset_id in IGI_IAC_DET_BALANCES.asset_id%type,
149: p_distribution_id in IGI_IAC_DET_BALANCES.distribution_id%type,
150: p_period_counter in IGI_IAC_DET_BALANCES.period_counter%type,
151: p_book_type_code in IGI_IAC_DET_BALANCES.book_type_code%type,
152: p_adjusted_cost in IGI_IAC_DET_BALANCES.adjustment_cost%type,
153: p_net_book_value in IGI_IAC_DET_BALANCES.net_book_value%type,
154: p_reval_reserve in IGI_IAC_DET_BALANCES.reval_reserve_cost%type,
155: p_reval_reserve_gen_fund in IGI_IAC_DET_BALANCES.reval_reserve_gen_fund%type,
156: p_reval_reserve_backlog in IGI_IAC_DET_BALANCES.reval_reserve_backlog%type,
149: p_distribution_id in IGI_IAC_DET_BALANCES.distribution_id%type,
150: p_period_counter in IGI_IAC_DET_BALANCES.period_counter%type,
151: p_book_type_code in IGI_IAC_DET_BALANCES.book_type_code%type,
152: p_adjusted_cost in IGI_IAC_DET_BALANCES.adjustment_cost%type,
153: p_net_book_value in IGI_IAC_DET_BALANCES.net_book_value%type,
154: p_reval_reserve in IGI_IAC_DET_BALANCES.reval_reserve_cost%type,
155: p_reval_reserve_gen_fund in IGI_IAC_DET_BALANCES.reval_reserve_gen_fund%type,
156: p_reval_reserve_backlog in IGI_IAC_DET_BALANCES.reval_reserve_backlog%type,
157: p_op_acct in IGI_IAC_DET_BALANCES.operating_acct_cost%type,
150: p_period_counter in IGI_IAC_DET_BALANCES.period_counter%type,
151: p_book_type_code in IGI_IAC_DET_BALANCES.book_type_code%type,
152: p_adjusted_cost in IGI_IAC_DET_BALANCES.adjustment_cost%type,
153: p_net_book_value in IGI_IAC_DET_BALANCES.net_book_value%type,
154: p_reval_reserve in IGI_IAC_DET_BALANCES.reval_reserve_cost%type,
155: p_reval_reserve_gen_fund in IGI_IAC_DET_BALANCES.reval_reserve_gen_fund%type,
156: p_reval_reserve_backlog in IGI_IAC_DET_BALANCES.reval_reserve_backlog%type,
157: p_op_acct in IGI_IAC_DET_BALANCES.operating_acct_cost%type,
158: p_deprn_reserve in IGI_IAC_DET_BALANCES.deprn_reserve%type,
151: p_book_type_code in IGI_IAC_DET_BALANCES.book_type_code%type,
152: p_adjusted_cost in IGI_IAC_DET_BALANCES.adjustment_cost%type,
153: p_net_book_value in IGI_IAC_DET_BALANCES.net_book_value%type,
154: p_reval_reserve in IGI_IAC_DET_BALANCES.reval_reserve_cost%type,
155: p_reval_reserve_gen_fund in IGI_IAC_DET_BALANCES.reval_reserve_gen_fund%type,
156: p_reval_reserve_backlog in IGI_IAC_DET_BALANCES.reval_reserve_backlog%type,
157: p_op_acct in IGI_IAC_DET_BALANCES.operating_acct_cost%type,
158: p_deprn_reserve in IGI_IAC_DET_BALANCES.deprn_reserve%type,
159: p_deprn_reserve_backlog in IGI_IAC_DET_BALANCES.deprn_reserve_backlog%type,
152: p_adjusted_cost in IGI_IAC_DET_BALANCES.adjustment_cost%type,
153: p_net_book_value in IGI_IAC_DET_BALANCES.net_book_value%type,
154: p_reval_reserve in IGI_IAC_DET_BALANCES.reval_reserve_cost%type,
155: p_reval_reserve_gen_fund in IGI_IAC_DET_BALANCES.reval_reserve_gen_fund%type,
156: p_reval_reserve_backlog in IGI_IAC_DET_BALANCES.reval_reserve_backlog%type,
157: p_op_acct in IGI_IAC_DET_BALANCES.operating_acct_cost%type,
158: p_deprn_reserve in IGI_IAC_DET_BALANCES.deprn_reserve%type,
159: p_deprn_reserve_backlog in IGI_IAC_DET_BALANCES.deprn_reserve_backlog%type,
160: p_deprn_ytd in IGI_IAC_DET_BALANCES.deprn_ytd%type,
153: p_net_book_value in IGI_IAC_DET_BALANCES.net_book_value%type,
154: p_reval_reserve in IGI_IAC_DET_BALANCES.reval_reserve_cost%type,
155: p_reval_reserve_gen_fund in IGI_IAC_DET_BALANCES.reval_reserve_gen_fund%type,
156: p_reval_reserve_backlog in IGI_IAC_DET_BALANCES.reval_reserve_backlog%type,
157: p_op_acct in IGI_IAC_DET_BALANCES.operating_acct_cost%type,
158: p_deprn_reserve in IGI_IAC_DET_BALANCES.deprn_reserve%type,
159: p_deprn_reserve_backlog in IGI_IAC_DET_BALANCES.deprn_reserve_backlog%type,
160: p_deprn_ytd in IGI_IAC_DET_BALANCES.deprn_ytd%type,
161: p_deprn_period in IGI_IAC_DET_BALANCES.deprn_period%type,
154: p_reval_reserve in IGI_IAC_DET_BALANCES.reval_reserve_cost%type,
155: p_reval_reserve_gen_fund in IGI_IAC_DET_BALANCES.reval_reserve_gen_fund%type,
156: p_reval_reserve_backlog in IGI_IAC_DET_BALANCES.reval_reserve_backlog%type,
157: p_op_acct in IGI_IAC_DET_BALANCES.operating_acct_cost%type,
158: p_deprn_reserve in IGI_IAC_DET_BALANCES.deprn_reserve%type,
159: p_deprn_reserve_backlog in IGI_IAC_DET_BALANCES.deprn_reserve_backlog%type,
160: p_deprn_ytd in IGI_IAC_DET_BALANCES.deprn_ytd%type,
161: p_deprn_period in IGI_IAC_DET_BALANCES.deprn_period%type,
162: p_gen_fund_acc in IGI_IAC_DET_BALANCES.general_fund_acc%type,
155: p_reval_reserve_gen_fund in IGI_IAC_DET_BALANCES.reval_reserve_gen_fund%type,
156: p_reval_reserve_backlog in IGI_IAC_DET_BALANCES.reval_reserve_backlog%type,
157: p_op_acct in IGI_IAC_DET_BALANCES.operating_acct_cost%type,
158: p_deprn_reserve in IGI_IAC_DET_BALANCES.deprn_reserve%type,
159: p_deprn_reserve_backlog in IGI_IAC_DET_BALANCES.deprn_reserve_backlog%type,
160: p_deprn_ytd in IGI_IAC_DET_BALANCES.deprn_ytd%type,
161: p_deprn_period in IGI_IAC_DET_BALANCES.deprn_period%type,
162: p_gen_fund_acc in IGI_IAC_DET_BALANCES.general_fund_acc%type,
163: p_gen_fund_per in IGI_IAC_DET_BALANCES.general_fund_acc%type,
156: p_reval_reserve_backlog in IGI_IAC_DET_BALANCES.reval_reserve_backlog%type,
157: p_op_acct in IGI_IAC_DET_BALANCES.operating_acct_cost%type,
158: p_deprn_reserve in IGI_IAC_DET_BALANCES.deprn_reserve%type,
159: p_deprn_reserve_backlog in IGI_IAC_DET_BALANCES.deprn_reserve_backlog%type,
160: p_deprn_ytd in IGI_IAC_DET_BALANCES.deprn_ytd%type,
161: p_deprn_period in IGI_IAC_DET_BALANCES.deprn_period%type,
162: p_gen_fund_acc in IGI_IAC_DET_BALANCES.general_fund_acc%type,
163: p_gen_fund_per in IGI_IAC_DET_BALANCES.general_fund_acc%type,
164: p_current_reval_factor in IGI_IAC_DET_BALANCES.current_reval_factor%type,
157: p_op_acct in IGI_IAC_DET_BALANCES.operating_acct_cost%type,
158: p_deprn_reserve in IGI_IAC_DET_BALANCES.deprn_reserve%type,
159: p_deprn_reserve_backlog in IGI_IAC_DET_BALANCES.deprn_reserve_backlog%type,
160: p_deprn_ytd in IGI_IAC_DET_BALANCES.deprn_ytd%type,
161: p_deprn_period in IGI_IAC_DET_BALANCES.deprn_period%type,
162: p_gen_fund_acc in IGI_IAC_DET_BALANCES.general_fund_acc%type,
163: p_gen_fund_per in IGI_IAC_DET_BALANCES.general_fund_acc%type,
164: p_current_reval_factor in IGI_IAC_DET_BALANCES.current_reval_factor%type,
165: p_cumulative_reval_factor in IGI_IAC_DET_BALANCES.cumulative_reval_factor%type,
158: p_deprn_reserve in IGI_IAC_DET_BALANCES.deprn_reserve%type,
159: p_deprn_reserve_backlog in IGI_IAC_DET_BALANCES.deprn_reserve_backlog%type,
160: p_deprn_ytd in IGI_IAC_DET_BALANCES.deprn_ytd%type,
161: p_deprn_period in IGI_IAC_DET_BALANCES.deprn_period%type,
162: p_gen_fund_acc in IGI_IAC_DET_BALANCES.general_fund_acc%type,
163: p_gen_fund_per in IGI_IAC_DET_BALANCES.general_fund_acc%type,
164: p_current_reval_factor in IGI_IAC_DET_BALANCES.current_reval_factor%type,
165: p_cumulative_reval_factor in IGI_IAC_DET_BALANCES.cumulative_reval_factor%type,
166: p_reval_flag in IGI_IAC_DET_BALANCES.active_flag%type,
159: p_deprn_reserve_backlog in IGI_IAC_DET_BALANCES.deprn_reserve_backlog%type,
160: p_deprn_ytd in IGI_IAC_DET_BALANCES.deprn_ytd%type,
161: p_deprn_period in IGI_IAC_DET_BALANCES.deprn_period%type,
162: p_gen_fund_acc in IGI_IAC_DET_BALANCES.general_fund_acc%type,
163: p_gen_fund_per in IGI_IAC_DET_BALANCES.general_fund_acc%type,
164: p_current_reval_factor in IGI_IAC_DET_BALANCES.current_reval_factor%type,
165: p_cumulative_reval_factor in IGI_IAC_DET_BALANCES.cumulative_reval_factor%type,
166: p_reval_flag in IGI_IAC_DET_BALANCES.active_flag%type,
167: p_op_acct_ytd in IGI_IAC_DET_BALANCES.operating_acct_ytd%type,
160: p_deprn_ytd in IGI_IAC_DET_BALANCES.deprn_ytd%type,
161: p_deprn_period in IGI_IAC_DET_BALANCES.deprn_period%type,
162: p_gen_fund_acc in IGI_IAC_DET_BALANCES.general_fund_acc%type,
163: p_gen_fund_per in IGI_IAC_DET_BALANCES.general_fund_acc%type,
164: p_current_reval_factor in IGI_IAC_DET_BALANCES.current_reval_factor%type,
165: p_cumulative_reval_factor in IGI_IAC_DET_BALANCES.cumulative_reval_factor%type,
166: p_reval_flag in IGI_IAC_DET_BALANCES.active_flag%type,
167: p_op_acct_ytd in IGI_IAC_DET_BALANCES.operating_acct_ytd%type,
168: p_operating_acct_backlog in IGI_IAC_DET_BALANCES.operating_acct_backlog%type,
161: p_deprn_period in IGI_IAC_DET_BALANCES.deprn_period%type,
162: p_gen_fund_acc in IGI_IAC_DET_BALANCES.general_fund_acc%type,
163: p_gen_fund_per in IGI_IAC_DET_BALANCES.general_fund_acc%type,
164: p_current_reval_factor in IGI_IAC_DET_BALANCES.current_reval_factor%type,
165: p_cumulative_reval_factor in IGI_IAC_DET_BALANCES.cumulative_reval_factor%type,
166: p_reval_flag in IGI_IAC_DET_BALANCES.active_flag%type,
167: p_op_acct_ytd in IGI_IAC_DET_BALANCES.operating_acct_ytd%type,
168: p_operating_acct_backlog in IGI_IAC_DET_BALANCES.operating_acct_backlog%type,
169: p_last_reval_date in IGI_IAC_DET_BALANCES.last_reval_date%type
162: p_gen_fund_acc in IGI_IAC_DET_BALANCES.general_fund_acc%type,
163: p_gen_fund_per in IGI_IAC_DET_BALANCES.general_fund_acc%type,
164: p_current_reval_factor in IGI_IAC_DET_BALANCES.current_reval_factor%type,
165: p_cumulative_reval_factor in IGI_IAC_DET_BALANCES.cumulative_reval_factor%type,
166: p_reval_flag in IGI_IAC_DET_BALANCES.active_flag%type,
167: p_op_acct_ytd in IGI_IAC_DET_BALANCES.operating_acct_ytd%type,
168: p_operating_acct_backlog in IGI_IAC_DET_BALANCES.operating_acct_backlog%type,
169: p_last_reval_date in IGI_IAC_DET_BALANCES.last_reval_date%type
170: )
163: p_gen_fund_per in IGI_IAC_DET_BALANCES.general_fund_acc%type,
164: p_current_reval_factor in IGI_IAC_DET_BALANCES.current_reval_factor%type,
165: p_cumulative_reval_factor in IGI_IAC_DET_BALANCES.cumulative_reval_factor%type,
166: p_reval_flag in IGI_IAC_DET_BALANCES.active_flag%type,
167: p_op_acct_ytd in IGI_IAC_DET_BALANCES.operating_acct_ytd%type,
168: p_operating_acct_backlog in IGI_IAC_DET_BALANCES.operating_acct_backlog%type,
169: p_last_reval_date in IGI_IAC_DET_BALANCES.last_reval_date%type
170: )
171: IS
164: p_current_reval_factor in IGI_IAC_DET_BALANCES.current_reval_factor%type,
165: p_cumulative_reval_factor in IGI_IAC_DET_BALANCES.cumulative_reval_factor%type,
166: p_reval_flag in IGI_IAC_DET_BALANCES.active_flag%type,
167: p_op_acct_ytd in IGI_IAC_DET_BALANCES.operating_acct_ytd%type,
168: p_operating_acct_backlog in IGI_IAC_DET_BALANCES.operating_acct_backlog%type,
169: p_last_reval_date in IGI_IAC_DET_BALANCES.last_reval_date%type
170: )
171: IS
172:
165: p_cumulative_reval_factor in IGI_IAC_DET_BALANCES.cumulative_reval_factor%type,
166: p_reval_flag in IGI_IAC_DET_BALANCES.active_flag%type,
167: p_op_acct_ytd in IGI_IAC_DET_BALANCES.operating_acct_ytd%type,
168: p_operating_acct_backlog in IGI_IAC_DET_BALANCES.operating_acct_backlog%type,
169: p_last_reval_date in IGI_IAC_DET_BALANCES.last_reval_date%type
170: )
171: IS
172:
173: l_rowid VARCHAR2(25);
176: BEGIN
177:
178: l_path := g_path||'insert_data_det';
179:
180: -- Call to TBH for insert into IGI_IAC_DET_BALANCES
181: IGI_IAC_DET_BALANCES_PKG.insert_row(
182: x_rowid =>l_rowid,
183: x_adjustment_id =>p_adjustment_id,
184: x_asset_id =>p_asset_id,
177:
178: l_path := g_path||'insert_data_det';
179:
180: -- Call to TBH for insert into IGI_IAC_DET_BALANCES
181: IGI_IAC_DET_BALANCES_PKG.insert_row(
182: x_rowid =>l_rowid,
183: x_adjustment_id =>p_adjustment_id,
184: x_asset_id =>p_asset_id,
185: x_distribution_id =>p_distribution_id,
623: SELECT nvl(sum(iadb.reval_reserve_backlog), 0) reval_reserve_backlog,
624: nvl(sum(iadb.operating_acct_backlog), 0) operating_acct_backlog,
625: nvl(sum(iadb.general_fund_per), 0) general_fund_per,
626: nvl(sum(iadb.deprn_ytd), 0) ytd_deprn
627: FROM igi_iac_det_balances iadb
628: WHERE iadb.adjustment_id = cp_adjustment_id
629: AND iadb.active_flag IS NULL;
630:
631: -- Calculate the iac fa depreciation data for an adjustment
670: l_ab_backlog_data c_backlog_data%ROWTYPE;
671: l_iac_fa_deprn c_iac_fa_deprn%ROWTYPE;
672:
673: l_historic_deprn_expense fa_deprn_summary.deprn_amount%TYPE;
674: l_expense_diff igi_iac_det_balances.deprn_period%TYPE;
675: l_ab_op_exp igi_iac_asset_balances.operating_acct%TYPE;
676:
677: l_mesg VARCHAR2(500);
678: l_path varchar2(150);
856: -- ================================================================================
857: -- PROCEDURE Roll_Inactive_Forward: This procedure will roll all the inactive
858: -- distributions of the current adjustment_id to the new transfers adjustment_id
859: -- ================================================================================
860: PROCEDURE Roll_Inactive_Forward(p_adjustment_id IN igi_iac_det_balances.adjustment_id%TYPE,
861: p_new_adj_id IN igi_iac_det_balances.adjustment_id%TYPE,
862: p_book_type_code IN igi_iac_det_balances.book_type_code%TYPE,
863: p_asset_id IN igi_iac_det_balances.asset_id%TYPE,
864: p_curr_prd_cntr IN igi_iac_det_balances.period_counter%TYPE
857: -- PROCEDURE Roll_Inactive_Forward: This procedure will roll all the inactive
858: -- distributions of the current adjustment_id to the new transfers adjustment_id
859: -- ================================================================================
860: PROCEDURE Roll_Inactive_Forward(p_adjustment_id IN igi_iac_det_balances.adjustment_id%TYPE,
861: p_new_adj_id IN igi_iac_det_balances.adjustment_id%TYPE,
862: p_book_type_code IN igi_iac_det_balances.book_type_code%TYPE,
863: p_asset_id IN igi_iac_det_balances.asset_id%TYPE,
864: p_curr_prd_cntr IN igi_iac_det_balances.period_counter%TYPE
865: )
858: -- distributions of the current adjustment_id to the new transfers adjustment_id
859: -- ================================================================================
860: PROCEDURE Roll_Inactive_Forward(p_adjustment_id IN igi_iac_det_balances.adjustment_id%TYPE,
861: p_new_adj_id IN igi_iac_det_balances.adjustment_id%TYPE,
862: p_book_type_code IN igi_iac_det_balances.book_type_code%TYPE,
863: p_asset_id IN igi_iac_det_balances.asset_id%TYPE,
864: p_curr_prd_cntr IN igi_iac_det_balances.period_counter%TYPE
865: )
866: IS
859: -- ================================================================================
860: PROCEDURE Roll_Inactive_Forward(p_adjustment_id IN igi_iac_det_balances.adjustment_id%TYPE,
861: p_new_adj_id IN igi_iac_det_balances.adjustment_id%TYPE,
862: p_book_type_code IN igi_iac_det_balances.book_type_code%TYPE,
863: p_asset_id IN igi_iac_det_balances.asset_id%TYPE,
864: p_curr_prd_cntr IN igi_iac_det_balances.period_counter%TYPE
865: )
866: IS
867: -- Select all inactive distributions created by the previous transaction (keep)
860: PROCEDURE Roll_Inactive_Forward(p_adjustment_id IN igi_iac_det_balances.adjustment_id%TYPE,
861: p_new_adj_id IN igi_iac_det_balances.adjustment_id%TYPE,
862: p_book_type_code IN igi_iac_det_balances.book_type_code%TYPE,
863: p_asset_id IN igi_iac_det_balances.asset_id%TYPE,
864: p_curr_prd_cntr IN igi_iac_det_balances.period_counter%TYPE
865: )
866: IS
867: -- Select all inactive distributions created by the previous transaction (keep)
868: CURSOR c_inactive_dist(c_adjustment_id IGI_IAC_TRANSACTION_HEADERS.adjustment_id%TYPE)
867: -- Select all inactive distributions created by the previous transaction (keep)
868: CURSOR c_inactive_dist(c_adjustment_id IGI_IAC_TRANSACTION_HEADERS.adjustment_id%TYPE)
869: IS
870: SELECT *
871: FROM igi_iac_det_balances
872: WHERE adjustment_id=c_adjustment_id
873: AND book_type_code = p_book_type_code
874: AND asset_id = p_asset_id
875: AND active_flag='N';
1085: AND adjustment_id = cp_adjustment_id
1086: AND asset_id = p_asset_hdr_rec.asset_id
1087: AND distribution_id = cp_dist_id;
1088:
1089: -- retrieve a row from igi_iac_det_balances
1090: CURSOR c_iac_dist(cp_dist_id igi_iac_det_balances.distribution_id%TYPE,
1091: cp_adj_id igi_iac_det_balances.adjustment_id%TYPE)
1092: IS
1093: SELECT *
1086: AND asset_id = p_asset_hdr_rec.asset_id
1087: AND distribution_id = cp_dist_id;
1088:
1089: -- retrieve a row from igi_iac_det_balances
1090: CURSOR c_iac_dist(cp_dist_id igi_iac_det_balances.distribution_id%TYPE,
1091: cp_adj_id igi_iac_det_balances.adjustment_id%TYPE)
1092: IS
1093: SELECT *
1094: FROM igi_iac_det_balances
1087: AND distribution_id = cp_dist_id;
1088:
1089: -- retrieve a row from igi_iac_det_balances
1090: CURSOR c_iac_dist(cp_dist_id igi_iac_det_balances.distribution_id%TYPE,
1091: cp_adj_id igi_iac_det_balances.adjustment_id%TYPE)
1092: IS
1093: SELECT *
1094: FROM igi_iac_det_balances
1095: WHERE adjustment_id = cp_adj_id
1090: CURSOR c_iac_dist(cp_dist_id igi_iac_det_balances.distribution_id%TYPE,
1091: cp_adj_id igi_iac_det_balances.adjustment_id%TYPE)
1092: IS
1093: SELECT *
1094: FROM igi_iac_det_balances
1095: WHERE adjustment_id = cp_adj_id
1096: AND distribution_id = cp_dist_id;
1097:
1098: -- local variables
1130: l_interco_amount NUMBER ;
1131: l_interco_ccid igi_iac_adjustments.code_combination_id%TYPE;
1132: l_interco_drcr_flag igi_iac_adjustments.dr_cr_flag%TYPE;
1133:
1134: l_reval_reserve IGI_IAC_DET_BALANCES.reval_reserve_cost%type;
1135: l_general_fund IGI_IAC_DET_BALANCES.general_fund_acc%type;
1136: l_Backlog_deprn_reserve IGI_IAC_DET_BALANCES.deprn_reserve_backlog%type;
1137: l_deprn_reserve IGI_IAC_DET_BALANCES.deprn_reserve%type;
1138: l_adjusted_cost IGI_IAC_DET_BALANCES.adjustment_cost%type;
1131: l_interco_ccid igi_iac_adjustments.code_combination_id%TYPE;
1132: l_interco_drcr_flag igi_iac_adjustments.dr_cr_flag%TYPE;
1133:
1134: l_reval_reserve IGI_IAC_DET_BALANCES.reval_reserve_cost%type;
1135: l_general_fund IGI_IAC_DET_BALANCES.general_fund_acc%type;
1136: l_Backlog_deprn_reserve IGI_IAC_DET_BALANCES.deprn_reserve_backlog%type;
1137: l_deprn_reserve IGI_IAC_DET_BALANCES.deprn_reserve%type;
1138: l_adjusted_cost IGI_IAC_DET_BALANCES.adjustment_cost%type;
1139: l_net_book_value IGI_IAC_DET_BALANCES.net_book_value%type;
1132: l_interco_drcr_flag igi_iac_adjustments.dr_cr_flag%TYPE;
1133:
1134: l_reval_reserve IGI_IAC_DET_BALANCES.reval_reserve_cost%type;
1135: l_general_fund IGI_IAC_DET_BALANCES.general_fund_acc%type;
1136: l_Backlog_deprn_reserve IGI_IAC_DET_BALANCES.deprn_reserve_backlog%type;
1137: l_deprn_reserve IGI_IAC_DET_BALANCES.deprn_reserve%type;
1138: l_adjusted_cost IGI_IAC_DET_BALANCES.adjustment_cost%type;
1139: l_net_book_value IGI_IAC_DET_BALANCES.net_book_value%type;
1140: l_deprn_per IGI_IAC_DET_BALANCES.deprn_period%type;
1133:
1134: l_reval_reserve IGI_IAC_DET_BALANCES.reval_reserve_cost%type;
1135: l_general_fund IGI_IAC_DET_BALANCES.general_fund_acc%type;
1136: l_Backlog_deprn_reserve IGI_IAC_DET_BALANCES.deprn_reserve_backlog%type;
1137: l_deprn_reserve IGI_IAC_DET_BALANCES.deprn_reserve%type;
1138: l_adjusted_cost IGI_IAC_DET_BALANCES.adjustment_cost%type;
1139: l_net_book_value IGI_IAC_DET_BALANCES.net_book_value%type;
1140: l_deprn_per IGI_IAC_DET_BALANCES.deprn_period%type;
1141: l_ytd_deprn IGI_IAC_DET_BALANCES.deprn_ytd%type;
1134: l_reval_reserve IGI_IAC_DET_BALANCES.reval_reserve_cost%type;
1135: l_general_fund IGI_IAC_DET_BALANCES.general_fund_acc%type;
1136: l_Backlog_deprn_reserve IGI_IAC_DET_BALANCES.deprn_reserve_backlog%type;
1137: l_deprn_reserve IGI_IAC_DET_BALANCES.deprn_reserve%type;
1138: l_adjusted_cost IGI_IAC_DET_BALANCES.adjustment_cost%type;
1139: l_net_book_value IGI_IAC_DET_BALANCES.net_book_value%type;
1140: l_deprn_per IGI_IAC_DET_BALANCES.deprn_period%type;
1141: l_ytd_deprn IGI_IAC_DET_BALANCES.deprn_ytd%type;
1142: l_op_acct IGI_IAC_DET_BALANCES.operating_acct_ytd%type;
1135: l_general_fund IGI_IAC_DET_BALANCES.general_fund_acc%type;
1136: l_Backlog_deprn_reserve IGI_IAC_DET_BALANCES.deprn_reserve_backlog%type;
1137: l_deprn_reserve IGI_IAC_DET_BALANCES.deprn_reserve%type;
1138: l_adjusted_cost IGI_IAC_DET_BALANCES.adjustment_cost%type;
1139: l_net_book_value IGI_IAC_DET_BALANCES.net_book_value%type;
1140: l_deprn_per IGI_IAC_DET_BALANCES.deprn_period%type;
1141: l_ytd_deprn IGI_IAC_DET_BALANCES.deprn_ytd%type;
1142: l_op_acct IGI_IAC_DET_BALANCES.operating_acct_ytd%type;
1143: l_op_acct_ytd IGI_IAC_DET_BALANCES.operating_acct_ytd%type;
1136: l_Backlog_deprn_reserve IGI_IAC_DET_BALANCES.deprn_reserve_backlog%type;
1137: l_deprn_reserve IGI_IAC_DET_BALANCES.deprn_reserve%type;
1138: l_adjusted_cost IGI_IAC_DET_BALANCES.adjustment_cost%type;
1139: l_net_book_value IGI_IAC_DET_BALANCES.net_book_value%type;
1140: l_deprn_per IGI_IAC_DET_BALANCES.deprn_period%type;
1141: l_ytd_deprn IGI_IAC_DET_BALANCES.deprn_ytd%type;
1142: l_op_acct IGI_IAC_DET_BALANCES.operating_acct_ytd%type;
1143: l_op_acct_ytd IGI_IAC_DET_BALANCES.operating_acct_ytd%type;
1144: l_general_fund_per IGI_IAC_DET_BALANCES.general_fund_per%type;
1137: l_deprn_reserve IGI_IAC_DET_BALANCES.deprn_reserve%type;
1138: l_adjusted_cost IGI_IAC_DET_BALANCES.adjustment_cost%type;
1139: l_net_book_value IGI_IAC_DET_BALANCES.net_book_value%type;
1140: l_deprn_per IGI_IAC_DET_BALANCES.deprn_period%type;
1141: l_ytd_deprn IGI_IAC_DET_BALANCES.deprn_ytd%type;
1142: l_op_acct IGI_IAC_DET_BALANCES.operating_acct_ytd%type;
1143: l_op_acct_ytd IGI_IAC_DET_BALANCES.operating_acct_ytd%type;
1144: l_general_fund_per IGI_IAC_DET_BALANCES.general_fund_per%type;
1145: l_reval_reserve_backlog IGI_IAC_DET_BALANCES.reval_reserve_backlog%type;
1138: l_adjusted_cost IGI_IAC_DET_BALANCES.adjustment_cost%type;
1139: l_net_book_value IGI_IAC_DET_BALANCES.net_book_value%type;
1140: l_deprn_per IGI_IAC_DET_BALANCES.deprn_period%type;
1141: l_ytd_deprn IGI_IAC_DET_BALANCES.deprn_ytd%type;
1142: l_op_acct IGI_IAC_DET_BALANCES.operating_acct_ytd%type;
1143: l_op_acct_ytd IGI_IAC_DET_BALANCES.operating_acct_ytd%type;
1144: l_general_fund_per IGI_IAC_DET_BALANCES.general_fund_per%type;
1145: l_reval_reserve_backlog IGI_IAC_DET_BALANCES.reval_reserve_backlog%type;
1146: l_operating_acct_backlog IGI_IAC_DET_BALANCES.operating_acct_backlog%type;
1139: l_net_book_value IGI_IAC_DET_BALANCES.net_book_value%type;
1140: l_deprn_per IGI_IAC_DET_BALANCES.deprn_period%type;
1141: l_ytd_deprn IGI_IAC_DET_BALANCES.deprn_ytd%type;
1142: l_op_acct IGI_IAC_DET_BALANCES.operating_acct_ytd%type;
1143: l_op_acct_ytd IGI_IAC_DET_BALANCES.operating_acct_ytd%type;
1144: l_general_fund_per IGI_IAC_DET_BALANCES.general_fund_per%type;
1145: l_reval_reserve_backlog IGI_IAC_DET_BALANCES.reval_reserve_backlog%type;
1146: l_operating_acct_backlog IGI_IAC_DET_BALANCES.operating_acct_backlog%type;
1147:
1140: l_deprn_per IGI_IAC_DET_BALANCES.deprn_period%type;
1141: l_ytd_deprn IGI_IAC_DET_BALANCES.deprn_ytd%type;
1142: l_op_acct IGI_IAC_DET_BALANCES.operating_acct_ytd%type;
1143: l_op_acct_ytd IGI_IAC_DET_BALANCES.operating_acct_ytd%type;
1144: l_general_fund_per IGI_IAC_DET_BALANCES.general_fund_per%type;
1145: l_reval_reserve_backlog IGI_IAC_DET_BALANCES.reval_reserve_backlog%type;
1146: l_operating_acct_backlog IGI_IAC_DET_BALANCES.operating_acct_backlog%type;
1147:
1148: l_transaction_header_id IGI_IAC_TRANSACTION_HEADERS.transaction_header_id%type;
1141: l_ytd_deprn IGI_IAC_DET_BALANCES.deprn_ytd%type;
1142: l_op_acct IGI_IAC_DET_BALANCES.operating_acct_ytd%type;
1143: l_op_acct_ytd IGI_IAC_DET_BALANCES.operating_acct_ytd%type;
1144: l_general_fund_per IGI_IAC_DET_BALANCES.general_fund_per%type;
1145: l_reval_reserve_backlog IGI_IAC_DET_BALANCES.reval_reserve_backlog%type;
1146: l_operating_acct_backlog IGI_IAC_DET_BALANCES.operating_acct_backlog%type;
1147:
1148: l_transaction_header_id IGI_IAC_TRANSACTION_HEADERS.transaction_header_id%type;
1149: l_transaction_type_code IGI_IAC_TRANSACTION_HEADERS.transaction_type_code%type;
1142: l_op_acct IGI_IAC_DET_BALANCES.operating_acct_ytd%type;
1143: l_op_acct_ytd IGI_IAC_DET_BALANCES.operating_acct_ytd%type;
1144: l_general_fund_per IGI_IAC_DET_BALANCES.general_fund_per%type;
1145: l_reval_reserve_backlog IGI_IAC_DET_BALANCES.reval_reserve_backlog%type;
1146: l_operating_acct_backlog IGI_IAC_DET_BALANCES.operating_acct_backlog%type;
1147:
1148: l_transaction_header_id IGI_IAC_TRANSACTION_HEADERS.transaction_header_id%type;
1149: l_transaction_type_code IGI_IAC_TRANSACTION_HEADERS.transaction_type_code%type;
1150: l_mass_reference_id IGI_IAC_TRANSACTION_HEADERS.mass_reference_id%type;
1151: l_adjustment_id IGI_IAC_TRANSACTION_HEADERS.adjustment_id%type;
1152: l_prev_adjustment_id IGI_IAC_TRANSACTION_HEADERS.adjustment_id%type;
1153: l_adjustment_status IGI_IAC_TRANSACTION_HEADERS.adjustment_status%type;
1154:
1155: l_reval_reserve_sum igi_iac_det_balances.reval_reserve_cost%TYPE ;
1156: l_general_fund_sum igi_iac_det_balances.general_fund_acc%TYPE ;
1157: l_Backlog_deprn_reserve_sum igi_iac_det_balances.deprn_reserve_backlog%TYPE ;
1158: l_deprn_reserve_sum igi_iac_det_balances.deprn_reserve%TYPE ;
1159: l_adjusted_cost_sum igi_iac_det_balances.adjustment_cost%TYPE ;
1152: l_prev_adjustment_id IGI_IAC_TRANSACTION_HEADERS.adjustment_id%type;
1153: l_adjustment_status IGI_IAC_TRANSACTION_HEADERS.adjustment_status%type;
1154:
1155: l_reval_reserve_sum igi_iac_det_balances.reval_reserve_cost%TYPE ;
1156: l_general_fund_sum igi_iac_det_balances.general_fund_acc%TYPE ;
1157: l_Backlog_deprn_reserve_sum igi_iac_det_balances.deprn_reserve_backlog%TYPE ;
1158: l_deprn_reserve_sum igi_iac_det_balances.deprn_reserve%TYPE ;
1159: l_adjusted_cost_sum igi_iac_det_balances.adjustment_cost%TYPE ;
1160: l_net_book_value_sum igi_iac_det_balances.net_book_value%TYPE ;
1153: l_adjustment_status IGI_IAC_TRANSACTION_HEADERS.adjustment_status%type;
1154:
1155: l_reval_reserve_sum igi_iac_det_balances.reval_reserve_cost%TYPE ;
1156: l_general_fund_sum igi_iac_det_balances.general_fund_acc%TYPE ;
1157: l_Backlog_deprn_reserve_sum igi_iac_det_balances.deprn_reserve_backlog%TYPE ;
1158: l_deprn_reserve_sum igi_iac_det_balances.deprn_reserve%TYPE ;
1159: l_adjusted_cost_sum igi_iac_det_balances.adjustment_cost%TYPE ;
1160: l_net_book_value_sum igi_iac_det_balances.net_book_value%TYPE ;
1161: l_deprn_per_sum igi_iac_det_balances.deprn_period%TYPE ;
1154:
1155: l_reval_reserve_sum igi_iac_det_balances.reval_reserve_cost%TYPE ;
1156: l_general_fund_sum igi_iac_det_balances.general_fund_acc%TYPE ;
1157: l_Backlog_deprn_reserve_sum igi_iac_det_balances.deprn_reserve_backlog%TYPE ;
1158: l_deprn_reserve_sum igi_iac_det_balances.deprn_reserve%TYPE ;
1159: l_adjusted_cost_sum igi_iac_det_balances.adjustment_cost%TYPE ;
1160: l_net_book_value_sum igi_iac_det_balances.net_book_value%TYPE ;
1161: l_deprn_per_sum igi_iac_det_balances.deprn_period%TYPE ;
1162: l_ytd_deprn_sum igi_iac_det_balances.deprn_ytd%TYPE ;
1155: l_reval_reserve_sum igi_iac_det_balances.reval_reserve_cost%TYPE ;
1156: l_general_fund_sum igi_iac_det_balances.general_fund_acc%TYPE ;
1157: l_Backlog_deprn_reserve_sum igi_iac_det_balances.deprn_reserve_backlog%TYPE ;
1158: l_deprn_reserve_sum igi_iac_det_balances.deprn_reserve%TYPE ;
1159: l_adjusted_cost_sum igi_iac_det_balances.adjustment_cost%TYPE ;
1160: l_net_book_value_sum igi_iac_det_balances.net_book_value%TYPE ;
1161: l_deprn_per_sum igi_iac_det_balances.deprn_period%TYPE ;
1162: l_ytd_deprn_sum igi_iac_det_balances.deprn_ytd%TYPE ;
1163: l_op_acct_sum igi_iac_det_balances.operating_acct_ytd%TYPE ;
1156: l_general_fund_sum igi_iac_det_balances.general_fund_acc%TYPE ;
1157: l_Backlog_deprn_reserve_sum igi_iac_det_balances.deprn_reserve_backlog%TYPE ;
1158: l_deprn_reserve_sum igi_iac_det_balances.deprn_reserve%TYPE ;
1159: l_adjusted_cost_sum igi_iac_det_balances.adjustment_cost%TYPE ;
1160: l_net_book_value_sum igi_iac_det_balances.net_book_value%TYPE ;
1161: l_deprn_per_sum igi_iac_det_balances.deprn_period%TYPE ;
1162: l_ytd_deprn_sum igi_iac_det_balances.deprn_ytd%TYPE ;
1163: l_op_acct_sum igi_iac_det_balances.operating_acct_ytd%TYPE ;
1164: l_op_acct_ytd_sum igi_iac_det_balances.operating_acct_ytd%TYPE ;
1157: l_Backlog_deprn_reserve_sum igi_iac_det_balances.deprn_reserve_backlog%TYPE ;
1158: l_deprn_reserve_sum igi_iac_det_balances.deprn_reserve%TYPE ;
1159: l_adjusted_cost_sum igi_iac_det_balances.adjustment_cost%TYPE ;
1160: l_net_book_value_sum igi_iac_det_balances.net_book_value%TYPE ;
1161: l_deprn_per_sum igi_iac_det_balances.deprn_period%TYPE ;
1162: l_ytd_deprn_sum igi_iac_det_balances.deprn_ytd%TYPE ;
1163: l_op_acct_sum igi_iac_det_balances.operating_acct_ytd%TYPE ;
1164: l_op_acct_ytd_sum igi_iac_det_balances.operating_acct_ytd%TYPE ;
1165: l_general_fund_per_sum igi_iac_det_balances.general_fund_per%TYPE ;
1158: l_deprn_reserve_sum igi_iac_det_balances.deprn_reserve%TYPE ;
1159: l_adjusted_cost_sum igi_iac_det_balances.adjustment_cost%TYPE ;
1160: l_net_book_value_sum igi_iac_det_balances.net_book_value%TYPE ;
1161: l_deprn_per_sum igi_iac_det_balances.deprn_period%TYPE ;
1162: l_ytd_deprn_sum igi_iac_det_balances.deprn_ytd%TYPE ;
1163: l_op_acct_sum igi_iac_det_balances.operating_acct_ytd%TYPE ;
1164: l_op_acct_ytd_sum igi_iac_det_balances.operating_acct_ytd%TYPE ;
1165: l_general_fund_per_sum igi_iac_det_balances.general_fund_per%TYPE ;
1166: l_reval_reserve_backlog_sum igi_iac_det_balances.reval_reserve_backlog%TYPE ;
1159: l_adjusted_cost_sum igi_iac_det_balances.adjustment_cost%TYPE ;
1160: l_net_book_value_sum igi_iac_det_balances.net_book_value%TYPE ;
1161: l_deprn_per_sum igi_iac_det_balances.deprn_period%TYPE ;
1162: l_ytd_deprn_sum igi_iac_det_balances.deprn_ytd%TYPE ;
1163: l_op_acct_sum igi_iac_det_balances.operating_acct_ytd%TYPE ;
1164: l_op_acct_ytd_sum igi_iac_det_balances.operating_acct_ytd%TYPE ;
1165: l_general_fund_per_sum igi_iac_det_balances.general_fund_per%TYPE ;
1166: l_reval_reserve_backlog_sum igi_iac_det_balances.reval_reserve_backlog%TYPE ;
1167: l_operating_acct_backlog_sum igi_iac_det_balances.operating_acct_backlog%TYPE;
1160: l_net_book_value_sum igi_iac_det_balances.net_book_value%TYPE ;
1161: l_deprn_per_sum igi_iac_det_balances.deprn_period%TYPE ;
1162: l_ytd_deprn_sum igi_iac_det_balances.deprn_ytd%TYPE ;
1163: l_op_acct_sum igi_iac_det_balances.operating_acct_ytd%TYPE ;
1164: l_op_acct_ytd_sum igi_iac_det_balances.operating_acct_ytd%TYPE ;
1165: l_general_fund_per_sum igi_iac_det_balances.general_fund_per%TYPE ;
1166: l_reval_reserve_backlog_sum igi_iac_det_balances.reval_reserve_backlog%TYPE ;
1167: l_operating_acct_backlog_sum igi_iac_det_balances.operating_acct_backlog%TYPE;
1168:
1161: l_deprn_per_sum igi_iac_det_balances.deprn_period%TYPE ;
1162: l_ytd_deprn_sum igi_iac_det_balances.deprn_ytd%TYPE ;
1163: l_op_acct_sum igi_iac_det_balances.operating_acct_ytd%TYPE ;
1164: l_op_acct_ytd_sum igi_iac_det_balances.operating_acct_ytd%TYPE ;
1165: l_general_fund_per_sum igi_iac_det_balances.general_fund_per%TYPE ;
1166: l_reval_reserve_backlog_sum igi_iac_det_balances.reval_reserve_backlog%TYPE ;
1167: l_operating_acct_backlog_sum igi_iac_det_balances.operating_acct_backlog%TYPE;
1168:
1169: l_reval_ccid igi_iac_adjustments.code_combination_id%TYPE;
1162: l_ytd_deprn_sum igi_iac_det_balances.deprn_ytd%TYPE ;
1163: l_op_acct_sum igi_iac_det_balances.operating_acct_ytd%TYPE ;
1164: l_op_acct_ytd_sum igi_iac_det_balances.operating_acct_ytd%TYPE ;
1165: l_general_fund_per_sum igi_iac_det_balances.general_fund_per%TYPE ;
1166: l_reval_reserve_backlog_sum igi_iac_det_balances.reval_reserve_backlog%TYPE ;
1167: l_operating_acct_backlog_sum igi_iac_det_balances.operating_acct_backlog%TYPE;
1168:
1169: l_reval_ccid igi_iac_adjustments.code_combination_id%TYPE;
1170: l_gen_fund_ccid igi_iac_adjustments.code_combination_id%TYPE;
1163: l_op_acct_sum igi_iac_det_balances.operating_acct_ytd%TYPE ;
1164: l_op_acct_ytd_sum igi_iac_det_balances.operating_acct_ytd%TYPE ;
1165: l_general_fund_per_sum igi_iac_det_balances.general_fund_per%TYPE ;
1166: l_reval_reserve_backlog_sum igi_iac_det_balances.reval_reserve_backlog%TYPE ;
1167: l_operating_acct_backlog_sum igi_iac_det_balances.operating_acct_backlog%TYPE;
1168:
1169: l_reval_ccid igi_iac_adjustments.code_combination_id%TYPE;
1170: l_gen_fund_ccid igi_iac_adjustments.code_combination_id%TYPE;
1171: l_backlog_ccid igi_iac_adjustments.code_combination_id%TYPE;
1574: ELSE
1575: -- for other distributions which are active but not affected by
1576: -- Transfers and the distributions which will be made ineffective by
1577: -- the Transfers process, retrieve the amounts for the distribution from
1578: -- igi_iac_det_balances table
1579: OPEN c_iac_dist(l_all_dist.distribution_id,
1580: l_prev_adjustment_id
1581: );
1582: FETCH c_iac_dist INTO l_iac_dist;
1681: IF (NVL(l_expense_ccid,0) = 0) THEN
1682: RETURN FALSE;
1683: END IF;
1684:
1685: -- prepare distribution data for igi_iac_det_balances
1686: -- igi_iac_fa_deprn and igi_iac_adjustments
1687: -- Rounding All amounts
1688: IF IGI_IAC_COMMON_UTILS.Iac_round(l_reval_reserve,
1689: p_asset_hdr_rec.book_type_code) THEN
2748: AND period_counter=p_period_counter
2749: AND transaction_type_code='TRANSFER';
2750:
2751:
2752: CURSOR c_deprn_expense(cp_asset_id igi_iac_det_balances.asset_id%TYPE,
2753: cp_adjustment_id IGI_IAC_DET_BALANCES.adjustment_id%type) IS
2754: SELECT sum(deprn_period)
2755: FROM igi_iac_det_balances
2756: WHERE book_type_code = p_book_type_code
2749: AND transaction_type_code='TRANSFER';
2750:
2751:
2752: CURSOR c_deprn_expense(cp_asset_id igi_iac_det_balances.asset_id%TYPE,
2753: cp_adjustment_id IGI_IAC_DET_BALANCES.adjustment_id%type) IS
2754: SELECT sum(deprn_period)
2755: FROM igi_iac_det_balances
2756: WHERE book_type_code = p_book_type_code
2757: AND asset_id = cp_asset_id
2751:
2752: CURSOR c_deprn_expense(cp_asset_id igi_iac_det_balances.asset_id%TYPE,
2753: cp_adjustment_id IGI_IAC_DET_BALANCES.adjustment_id%type) IS
2754: SELECT sum(deprn_period)
2755: FROM igi_iac_det_balances
2756: WHERE book_type_code = p_book_type_code
2757: AND asset_id = cp_asset_id
2758: AND adjustment_id = cp_adjustment_id;
2759:
2778: /* Cursor to select impacted distributions for roll back */
2779:
2780: CURSOR c_dist(c_adjustment_id igi_iac_adjustments.adjustment_id%type) IS
2781: SELECT distribution_id
2782: FROM igi_iac_det_balances
2783: WHERE adjustment_id=c_adjustment_id;
2784:
2785: CURSOR c_fa_dist(cp_adjustment_id igi_iac_adjustments.adjustment_id%type,
2786: cp_asset_id igi_iac_fa_deprn.asset_id%TYPE) IS
2796: l_amounts c_amounts%rowtype;
2797: l_prd_rec_prior igi_iac_types.prd_rec;
2798:
2799: l_deprn_expense FA_DEPRN_SUMMARY.deprn_amount%type;
2800: l_Expense_diff IGI_IAC_DET_BALANCES.deprn_period%type;
2801: l_prior_period_counter IGI_IAC_DET_BALANCES.period_counter%type;
2802: l_current_period_counter IGI_IAC_DET_BALANCES.period_counter%type;
2803: l_prev_adjustment igi_iac_transaction_headers%ROWTYPE;
2804:
2797: l_prd_rec_prior igi_iac_types.prd_rec;
2798:
2799: l_deprn_expense FA_DEPRN_SUMMARY.deprn_amount%type;
2800: l_Expense_diff IGI_IAC_DET_BALANCES.deprn_period%type;
2801: l_prior_period_counter IGI_IAC_DET_BALANCES.period_counter%type;
2802: l_current_period_counter IGI_IAC_DET_BALANCES.period_counter%type;
2803: l_prev_adjustment igi_iac_transaction_headers%ROWTYPE;
2804:
2805: l_path varchar2(150);
2798:
2799: l_deprn_expense FA_DEPRN_SUMMARY.deprn_amount%type;
2800: l_Expense_diff IGI_IAC_DET_BALANCES.deprn_period%type;
2801: l_prior_period_counter IGI_IAC_DET_BALANCES.period_counter%type;
2802: l_current_period_counter IGI_IAC_DET_BALANCES.period_counter%type;
2803: l_prev_adjustment igi_iac_transaction_headers%ROWTYPE;
2804:
2805: l_path varchar2(150);
2806: BEGIN
2840: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'============================================================');
2841: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'Deleting From detail balances...');
2842: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'============================================================');
2843:
2844: /*DELETE from igi_iac_det_balances
2845: WHERE book_type_code=p_book_type_code
2846: AND period_counter=p_period_counter
2847: AND adjustment_id=l_trans_headers.adjustment_id;*/
2848:
2848:
2849:
2850: FOR l_dist in c_dist(l_trans_headers.adjustment_id)
2851: loop
2852: IGI_IAC_DET_BALANCES_PKG.delete_row(
2853: x_adjustment_id =>l_trans_headers.adjustment_id,
2854: x_asset_id =>l_trans_headers.asset_id,
2855: x_distribution_id =>l_dist.distribution_id,
2856: x_book_type_code =>l_trans_headers.book_type_code,