118: ROLLBACK;
119: END insert_data_adj;
120:
121: -- ===============================================================================
122: -- Procedure to insert data into IGI_IAC_DET_BALANCES
123: -- ===============================================================================
124: PROCEDURE insert_data_det(p_adjustment_id in IGI_IAC_DET_BALANCES.adjustment_id%type,
125: p_asset_id in IGI_IAC_DET_BALANCES.asset_id%type,
126: p_distribution_id in IGI_IAC_DET_BALANCES.distribution_id%type,
120:
121: -- ===============================================================================
122: -- Procedure to insert data into IGI_IAC_DET_BALANCES
123: -- ===============================================================================
124: PROCEDURE insert_data_det(p_adjustment_id in IGI_IAC_DET_BALANCES.adjustment_id%type,
125: p_asset_id in IGI_IAC_DET_BALANCES.asset_id%type,
126: p_distribution_id in IGI_IAC_DET_BALANCES.distribution_id%type,
127: p_period_counter in IGI_IAC_DET_BALANCES.period_counter%type,
128: p_book_type_code in IGI_IAC_DET_BALANCES.book_type_code%type,
121: -- ===============================================================================
122: -- Procedure to insert data into IGI_IAC_DET_BALANCES
123: -- ===============================================================================
124: PROCEDURE insert_data_det(p_adjustment_id in IGI_IAC_DET_BALANCES.adjustment_id%type,
125: p_asset_id in IGI_IAC_DET_BALANCES.asset_id%type,
126: p_distribution_id in IGI_IAC_DET_BALANCES.distribution_id%type,
127: p_period_counter in IGI_IAC_DET_BALANCES.period_counter%type,
128: p_book_type_code in IGI_IAC_DET_BALANCES.book_type_code%type,
129: p_adjusted_cost in IGI_IAC_DET_BALANCES.adjustment_cost%type,
122: -- Procedure to insert data into IGI_IAC_DET_BALANCES
123: -- ===============================================================================
124: PROCEDURE insert_data_det(p_adjustment_id in IGI_IAC_DET_BALANCES.adjustment_id%type,
125: p_asset_id in IGI_IAC_DET_BALANCES.asset_id%type,
126: p_distribution_id in IGI_IAC_DET_BALANCES.distribution_id%type,
127: p_period_counter in IGI_IAC_DET_BALANCES.period_counter%type,
128: p_book_type_code in IGI_IAC_DET_BALANCES.book_type_code%type,
129: p_adjusted_cost in IGI_IAC_DET_BALANCES.adjustment_cost%type,
130: p_net_book_value in IGI_IAC_DET_BALANCES.net_book_value%type,
123: -- ===============================================================================
124: PROCEDURE insert_data_det(p_adjustment_id in IGI_IAC_DET_BALANCES.adjustment_id%type,
125: p_asset_id in IGI_IAC_DET_BALANCES.asset_id%type,
126: p_distribution_id in IGI_IAC_DET_BALANCES.distribution_id%type,
127: p_period_counter in IGI_IAC_DET_BALANCES.period_counter%type,
128: p_book_type_code in IGI_IAC_DET_BALANCES.book_type_code%type,
129: p_adjusted_cost in IGI_IAC_DET_BALANCES.adjustment_cost%type,
130: p_net_book_value in IGI_IAC_DET_BALANCES.net_book_value%type,
131: p_reval_reserve in IGI_IAC_DET_BALANCES.reval_reserve_cost%type,
124: PROCEDURE insert_data_det(p_adjustment_id in IGI_IAC_DET_BALANCES.adjustment_id%type,
125: p_asset_id in IGI_IAC_DET_BALANCES.asset_id%type,
126: p_distribution_id in IGI_IAC_DET_BALANCES.distribution_id%type,
127: p_period_counter in IGI_IAC_DET_BALANCES.period_counter%type,
128: p_book_type_code in IGI_IAC_DET_BALANCES.book_type_code%type,
129: p_adjusted_cost in IGI_IAC_DET_BALANCES.adjustment_cost%type,
130: p_net_book_value in IGI_IAC_DET_BALANCES.net_book_value%type,
131: p_reval_reserve in IGI_IAC_DET_BALANCES.reval_reserve_cost%type,
132: p_reval_reserve_gen_fund in IGI_IAC_DET_BALANCES.reval_reserve_gen_fund%type,
125: p_asset_id in IGI_IAC_DET_BALANCES.asset_id%type,
126: p_distribution_id in IGI_IAC_DET_BALANCES.distribution_id%type,
127: p_period_counter in IGI_IAC_DET_BALANCES.period_counter%type,
128: p_book_type_code in IGI_IAC_DET_BALANCES.book_type_code%type,
129: p_adjusted_cost in IGI_IAC_DET_BALANCES.adjustment_cost%type,
130: p_net_book_value in IGI_IAC_DET_BALANCES.net_book_value%type,
131: p_reval_reserve in IGI_IAC_DET_BALANCES.reval_reserve_cost%type,
132: p_reval_reserve_gen_fund in IGI_IAC_DET_BALANCES.reval_reserve_gen_fund%type,
133: p_reval_reserve_backlog in IGI_IAC_DET_BALANCES.reval_reserve_backlog%type,
126: p_distribution_id in IGI_IAC_DET_BALANCES.distribution_id%type,
127: p_period_counter in IGI_IAC_DET_BALANCES.period_counter%type,
128: p_book_type_code in IGI_IAC_DET_BALANCES.book_type_code%type,
129: p_adjusted_cost in IGI_IAC_DET_BALANCES.adjustment_cost%type,
130: p_net_book_value in IGI_IAC_DET_BALANCES.net_book_value%type,
131: p_reval_reserve in IGI_IAC_DET_BALANCES.reval_reserve_cost%type,
132: p_reval_reserve_gen_fund in IGI_IAC_DET_BALANCES.reval_reserve_gen_fund%type,
133: p_reval_reserve_backlog in IGI_IAC_DET_BALANCES.reval_reserve_backlog%type,
134: p_op_acct in IGI_IAC_DET_BALANCES.operating_acct_cost%type,
127: p_period_counter in IGI_IAC_DET_BALANCES.period_counter%type,
128: p_book_type_code in IGI_IAC_DET_BALANCES.book_type_code%type,
129: p_adjusted_cost in IGI_IAC_DET_BALANCES.adjustment_cost%type,
130: p_net_book_value in IGI_IAC_DET_BALANCES.net_book_value%type,
131: p_reval_reserve in IGI_IAC_DET_BALANCES.reval_reserve_cost%type,
132: p_reval_reserve_gen_fund in IGI_IAC_DET_BALANCES.reval_reserve_gen_fund%type,
133: p_reval_reserve_backlog in IGI_IAC_DET_BALANCES.reval_reserve_backlog%type,
134: p_op_acct in IGI_IAC_DET_BALANCES.operating_acct_cost%type,
135: p_deprn_reserve in IGI_IAC_DET_BALANCES.deprn_reserve%type,
128: p_book_type_code in IGI_IAC_DET_BALANCES.book_type_code%type,
129: p_adjusted_cost in IGI_IAC_DET_BALANCES.adjustment_cost%type,
130: p_net_book_value in IGI_IAC_DET_BALANCES.net_book_value%type,
131: p_reval_reserve in IGI_IAC_DET_BALANCES.reval_reserve_cost%type,
132: p_reval_reserve_gen_fund in IGI_IAC_DET_BALANCES.reval_reserve_gen_fund%type,
133: p_reval_reserve_backlog in IGI_IAC_DET_BALANCES.reval_reserve_backlog%type,
134: p_op_acct in IGI_IAC_DET_BALANCES.operating_acct_cost%type,
135: p_deprn_reserve in IGI_IAC_DET_BALANCES.deprn_reserve%type,
136: p_deprn_reserve_backlog in IGI_IAC_DET_BALANCES.deprn_reserve_backlog%type,
129: p_adjusted_cost in IGI_IAC_DET_BALANCES.adjustment_cost%type,
130: p_net_book_value in IGI_IAC_DET_BALANCES.net_book_value%type,
131: p_reval_reserve in IGI_IAC_DET_BALANCES.reval_reserve_cost%type,
132: p_reval_reserve_gen_fund in IGI_IAC_DET_BALANCES.reval_reserve_gen_fund%type,
133: p_reval_reserve_backlog in IGI_IAC_DET_BALANCES.reval_reserve_backlog%type,
134: p_op_acct in IGI_IAC_DET_BALANCES.operating_acct_cost%type,
135: p_deprn_reserve in IGI_IAC_DET_BALANCES.deprn_reserve%type,
136: p_deprn_reserve_backlog in IGI_IAC_DET_BALANCES.deprn_reserve_backlog%type,
137: p_deprn_ytd in IGI_IAC_DET_BALANCES.deprn_ytd%type,
130: p_net_book_value in IGI_IAC_DET_BALANCES.net_book_value%type,
131: p_reval_reserve in IGI_IAC_DET_BALANCES.reval_reserve_cost%type,
132: p_reval_reserve_gen_fund in IGI_IAC_DET_BALANCES.reval_reserve_gen_fund%type,
133: p_reval_reserve_backlog in IGI_IAC_DET_BALANCES.reval_reserve_backlog%type,
134: p_op_acct in IGI_IAC_DET_BALANCES.operating_acct_cost%type,
135: p_deprn_reserve in IGI_IAC_DET_BALANCES.deprn_reserve%type,
136: p_deprn_reserve_backlog in IGI_IAC_DET_BALANCES.deprn_reserve_backlog%type,
137: p_deprn_ytd in IGI_IAC_DET_BALANCES.deprn_ytd%type,
138: p_deprn_period in IGI_IAC_DET_BALANCES.deprn_period%type,
131: p_reval_reserve in IGI_IAC_DET_BALANCES.reval_reserve_cost%type,
132: p_reval_reserve_gen_fund in IGI_IAC_DET_BALANCES.reval_reserve_gen_fund%type,
133: p_reval_reserve_backlog in IGI_IAC_DET_BALANCES.reval_reserve_backlog%type,
134: p_op_acct in IGI_IAC_DET_BALANCES.operating_acct_cost%type,
135: p_deprn_reserve in IGI_IAC_DET_BALANCES.deprn_reserve%type,
136: p_deprn_reserve_backlog in IGI_IAC_DET_BALANCES.deprn_reserve_backlog%type,
137: p_deprn_ytd in IGI_IAC_DET_BALANCES.deprn_ytd%type,
138: p_deprn_period in IGI_IAC_DET_BALANCES.deprn_period%type,
139: p_gen_fund_acc in IGI_IAC_DET_BALANCES.general_fund_acc%type,
132: p_reval_reserve_gen_fund in IGI_IAC_DET_BALANCES.reval_reserve_gen_fund%type,
133: p_reval_reserve_backlog in IGI_IAC_DET_BALANCES.reval_reserve_backlog%type,
134: p_op_acct in IGI_IAC_DET_BALANCES.operating_acct_cost%type,
135: p_deprn_reserve in IGI_IAC_DET_BALANCES.deprn_reserve%type,
136: p_deprn_reserve_backlog in IGI_IAC_DET_BALANCES.deprn_reserve_backlog%type,
137: p_deprn_ytd in IGI_IAC_DET_BALANCES.deprn_ytd%type,
138: p_deprn_period in IGI_IAC_DET_BALANCES.deprn_period%type,
139: p_gen_fund_acc in IGI_IAC_DET_BALANCES.general_fund_acc%type,
140: p_gen_fund_per in IGI_IAC_DET_BALANCES.general_fund_acc%type,
133: p_reval_reserve_backlog in IGI_IAC_DET_BALANCES.reval_reserve_backlog%type,
134: p_op_acct in IGI_IAC_DET_BALANCES.operating_acct_cost%type,
135: p_deprn_reserve in IGI_IAC_DET_BALANCES.deprn_reserve%type,
136: p_deprn_reserve_backlog in IGI_IAC_DET_BALANCES.deprn_reserve_backlog%type,
137: p_deprn_ytd in IGI_IAC_DET_BALANCES.deprn_ytd%type,
138: p_deprn_period in IGI_IAC_DET_BALANCES.deprn_period%type,
139: p_gen_fund_acc in IGI_IAC_DET_BALANCES.general_fund_acc%type,
140: p_gen_fund_per in IGI_IAC_DET_BALANCES.general_fund_acc%type,
141: p_current_reval_factor in IGI_IAC_DET_BALANCES.current_reval_factor%type,
134: p_op_acct in IGI_IAC_DET_BALANCES.operating_acct_cost%type,
135: p_deprn_reserve in IGI_IAC_DET_BALANCES.deprn_reserve%type,
136: p_deprn_reserve_backlog in IGI_IAC_DET_BALANCES.deprn_reserve_backlog%type,
137: p_deprn_ytd in IGI_IAC_DET_BALANCES.deprn_ytd%type,
138: p_deprn_period in IGI_IAC_DET_BALANCES.deprn_period%type,
139: p_gen_fund_acc in IGI_IAC_DET_BALANCES.general_fund_acc%type,
140: p_gen_fund_per in IGI_IAC_DET_BALANCES.general_fund_acc%type,
141: p_current_reval_factor in IGI_IAC_DET_BALANCES.current_reval_factor%type,
142: p_cumulative_reval_factor in IGI_IAC_DET_BALANCES.cumulative_reval_factor%type,
135: p_deprn_reserve in IGI_IAC_DET_BALANCES.deprn_reserve%type,
136: p_deprn_reserve_backlog in IGI_IAC_DET_BALANCES.deprn_reserve_backlog%type,
137: p_deprn_ytd in IGI_IAC_DET_BALANCES.deprn_ytd%type,
138: p_deprn_period in IGI_IAC_DET_BALANCES.deprn_period%type,
139: p_gen_fund_acc in IGI_IAC_DET_BALANCES.general_fund_acc%type,
140: p_gen_fund_per in IGI_IAC_DET_BALANCES.general_fund_acc%type,
141: p_current_reval_factor in IGI_IAC_DET_BALANCES.current_reval_factor%type,
142: p_cumulative_reval_factor in IGI_IAC_DET_BALANCES.cumulative_reval_factor%type,
143: p_reval_flag in IGI_IAC_DET_BALANCES.active_flag%type,
136: p_deprn_reserve_backlog in IGI_IAC_DET_BALANCES.deprn_reserve_backlog%type,
137: p_deprn_ytd in IGI_IAC_DET_BALANCES.deprn_ytd%type,
138: p_deprn_period in IGI_IAC_DET_BALANCES.deprn_period%type,
139: p_gen_fund_acc in IGI_IAC_DET_BALANCES.general_fund_acc%type,
140: p_gen_fund_per in IGI_IAC_DET_BALANCES.general_fund_acc%type,
141: p_current_reval_factor in IGI_IAC_DET_BALANCES.current_reval_factor%type,
142: p_cumulative_reval_factor in IGI_IAC_DET_BALANCES.cumulative_reval_factor%type,
143: p_reval_flag in IGI_IAC_DET_BALANCES.active_flag%type,
144: p_op_acct_ytd in IGI_IAC_DET_BALANCES.operating_acct_ytd%type,
137: p_deprn_ytd in IGI_IAC_DET_BALANCES.deprn_ytd%type,
138: p_deprn_period in IGI_IAC_DET_BALANCES.deprn_period%type,
139: p_gen_fund_acc in IGI_IAC_DET_BALANCES.general_fund_acc%type,
140: p_gen_fund_per in IGI_IAC_DET_BALANCES.general_fund_acc%type,
141: p_current_reval_factor in IGI_IAC_DET_BALANCES.current_reval_factor%type,
142: p_cumulative_reval_factor in IGI_IAC_DET_BALANCES.cumulative_reval_factor%type,
143: p_reval_flag in IGI_IAC_DET_BALANCES.active_flag%type,
144: p_op_acct_ytd in IGI_IAC_DET_BALANCES.operating_acct_ytd%type,
145: p_operating_acct_backlog in IGI_IAC_DET_BALANCES.operating_acct_backlog%type,
138: p_deprn_period in IGI_IAC_DET_BALANCES.deprn_period%type,
139: p_gen_fund_acc in IGI_IAC_DET_BALANCES.general_fund_acc%type,
140: p_gen_fund_per in IGI_IAC_DET_BALANCES.general_fund_acc%type,
141: p_current_reval_factor in IGI_IAC_DET_BALANCES.current_reval_factor%type,
142: p_cumulative_reval_factor in IGI_IAC_DET_BALANCES.cumulative_reval_factor%type,
143: p_reval_flag in IGI_IAC_DET_BALANCES.active_flag%type,
144: p_op_acct_ytd in IGI_IAC_DET_BALANCES.operating_acct_ytd%type,
145: p_operating_acct_backlog in IGI_IAC_DET_BALANCES.operating_acct_backlog%type,
146: p_last_reval_date in IGI_IAC_DET_BALANCES.last_reval_date%type
139: p_gen_fund_acc in IGI_IAC_DET_BALANCES.general_fund_acc%type,
140: p_gen_fund_per in IGI_IAC_DET_BALANCES.general_fund_acc%type,
141: p_current_reval_factor in IGI_IAC_DET_BALANCES.current_reval_factor%type,
142: p_cumulative_reval_factor in IGI_IAC_DET_BALANCES.cumulative_reval_factor%type,
143: p_reval_flag in IGI_IAC_DET_BALANCES.active_flag%type,
144: p_op_acct_ytd in IGI_IAC_DET_BALANCES.operating_acct_ytd%type,
145: p_operating_acct_backlog in IGI_IAC_DET_BALANCES.operating_acct_backlog%type,
146: p_last_reval_date in IGI_IAC_DET_BALANCES.last_reval_date%type
147: )
140: p_gen_fund_per in IGI_IAC_DET_BALANCES.general_fund_acc%type,
141: p_current_reval_factor in IGI_IAC_DET_BALANCES.current_reval_factor%type,
142: p_cumulative_reval_factor in IGI_IAC_DET_BALANCES.cumulative_reval_factor%type,
143: p_reval_flag in IGI_IAC_DET_BALANCES.active_flag%type,
144: p_op_acct_ytd in IGI_IAC_DET_BALANCES.operating_acct_ytd%type,
145: p_operating_acct_backlog in IGI_IAC_DET_BALANCES.operating_acct_backlog%type,
146: p_last_reval_date in IGI_IAC_DET_BALANCES.last_reval_date%type
147: )
148: IS
141: p_current_reval_factor in IGI_IAC_DET_BALANCES.current_reval_factor%type,
142: p_cumulative_reval_factor in IGI_IAC_DET_BALANCES.cumulative_reval_factor%type,
143: p_reval_flag in IGI_IAC_DET_BALANCES.active_flag%type,
144: p_op_acct_ytd in IGI_IAC_DET_BALANCES.operating_acct_ytd%type,
145: p_operating_acct_backlog in IGI_IAC_DET_BALANCES.operating_acct_backlog%type,
146: p_last_reval_date in IGI_IAC_DET_BALANCES.last_reval_date%type
147: )
148: IS
149:
142: p_cumulative_reval_factor in IGI_IAC_DET_BALANCES.cumulative_reval_factor%type,
143: p_reval_flag in IGI_IAC_DET_BALANCES.active_flag%type,
144: p_op_acct_ytd in IGI_IAC_DET_BALANCES.operating_acct_ytd%type,
145: p_operating_acct_backlog in IGI_IAC_DET_BALANCES.operating_acct_backlog%type,
146: p_last_reval_date in IGI_IAC_DET_BALANCES.last_reval_date%type
147: )
148: IS
149:
150: l_rowid VARCHAR2(25);
153: BEGIN
154:
155: l_path := g_path||'insert_data_det';
156:
157: -- Call to TBH for insert into IGI_IAC_DET_BALANCES
158: IGI_IAC_DET_BALANCES_PKG.insert_row(
159: x_rowid =>l_rowid,
160: x_adjustment_id =>p_adjustment_id,
161: x_asset_id =>p_asset_id,
154:
155: l_path := g_path||'insert_data_det';
156:
157: -- Call to TBH for insert into IGI_IAC_DET_BALANCES
158: IGI_IAC_DET_BALANCES_PKG.insert_row(
159: x_rowid =>l_rowid,
160: x_adjustment_id =>p_adjustment_id,
161: x_asset_id =>p_asset_id,
162: x_distribution_id =>p_distribution_id,
553: SELECT nvl(sum(iadb.reval_reserve_backlog), 0) reval_reserve_backlog,
554: nvl(sum(iadb.operating_acct_backlog), 0) operating_acct_backlog,
555: nvl(sum(iadb.general_fund_per), 0) general_fund_per,
556: nvl(sum(iadb.deprn_ytd), 0) ytd_deprn
557: FROM igi_iac_det_balances iadb
558: WHERE iadb.adjustment_id = cp_adjustment_id
559: AND iadb.active_flag IS NULL;
560:
561: -- Calculate the iac fa depreciation data for an adjustment
600: l_ab_backlog_data c_backlog_data%ROWTYPE;
601: l_iac_fa_deprn c_iac_fa_deprn%ROWTYPE;
602:
603: l_historic_deprn_expense fa_deprn_summary.deprn_amount%TYPE;
604: l_expense_diff igi_iac_det_balances.deprn_period%TYPE;
605: l_ab_op_exp igi_iac_asset_balances.operating_acct%TYPE;
606:
607: l_mesg VARCHAR2(500);
608: l_path varchar2(150);
765: -- ================================================================================
766: -- PROCEDURE Roll_Inactive_Forward: This procedure will roll all the inactive
767: -- distributions of the current adjustment_id to the new transfers adjustment_id
768: -- ================================================================================
769: PROCEDURE Roll_Inactive_Forward(p_adjustment_id IN igi_iac_det_balances.adjustment_id%TYPE,
770: p_new_adj_id IN igi_iac_det_balances.adjustment_id%TYPE,
771: p_book_type_code IN igi_iac_det_balances.book_type_code%TYPE,
772: p_asset_id IN igi_iac_det_balances.asset_id%TYPE,
773: p_curr_prd_cntr IN igi_iac_det_balances.period_counter%TYPE
766: -- PROCEDURE Roll_Inactive_Forward: This procedure will roll all the inactive
767: -- distributions of the current adjustment_id to the new transfers adjustment_id
768: -- ================================================================================
769: PROCEDURE Roll_Inactive_Forward(p_adjustment_id IN igi_iac_det_balances.adjustment_id%TYPE,
770: p_new_adj_id IN igi_iac_det_balances.adjustment_id%TYPE,
771: p_book_type_code IN igi_iac_det_balances.book_type_code%TYPE,
772: p_asset_id IN igi_iac_det_balances.asset_id%TYPE,
773: p_curr_prd_cntr IN igi_iac_det_balances.period_counter%TYPE
774: )
767: -- distributions of the current adjustment_id to the new transfers adjustment_id
768: -- ================================================================================
769: PROCEDURE Roll_Inactive_Forward(p_adjustment_id IN igi_iac_det_balances.adjustment_id%TYPE,
770: p_new_adj_id IN igi_iac_det_balances.adjustment_id%TYPE,
771: p_book_type_code IN igi_iac_det_balances.book_type_code%TYPE,
772: p_asset_id IN igi_iac_det_balances.asset_id%TYPE,
773: p_curr_prd_cntr IN igi_iac_det_balances.period_counter%TYPE
774: )
775: IS
768: -- ================================================================================
769: PROCEDURE Roll_Inactive_Forward(p_adjustment_id IN igi_iac_det_balances.adjustment_id%TYPE,
770: p_new_adj_id IN igi_iac_det_balances.adjustment_id%TYPE,
771: p_book_type_code IN igi_iac_det_balances.book_type_code%TYPE,
772: p_asset_id IN igi_iac_det_balances.asset_id%TYPE,
773: p_curr_prd_cntr IN igi_iac_det_balances.period_counter%TYPE
774: )
775: IS
776: -- Select all inactive distributions created by the previous transaction (keep)
769: PROCEDURE Roll_Inactive_Forward(p_adjustment_id IN igi_iac_det_balances.adjustment_id%TYPE,
770: p_new_adj_id IN igi_iac_det_balances.adjustment_id%TYPE,
771: p_book_type_code IN igi_iac_det_balances.book_type_code%TYPE,
772: p_asset_id IN igi_iac_det_balances.asset_id%TYPE,
773: p_curr_prd_cntr IN igi_iac_det_balances.period_counter%TYPE
774: )
775: IS
776: -- Select all inactive distributions created by the previous transaction (keep)
777: CURSOR c_inactive_dist(c_adjustment_id IGI_IAC_TRANSACTION_HEADERS.adjustment_id%TYPE)
776: -- Select all inactive distributions created by the previous transaction (keep)
777: CURSOR c_inactive_dist(c_adjustment_id IGI_IAC_TRANSACTION_HEADERS.adjustment_id%TYPE)
778: IS
779: SELECT *
780: FROM igi_iac_det_balances
781: WHERE adjustment_id=c_adjustment_id
782: AND book_type_code = p_book_type_code
783: AND asset_id = p_asset_id
784: AND active_flag='N';
994: AND adjustment_id = cp_adjustment_id
995: AND asset_id = p_asset_hdr_rec.asset_id
996: AND distribution_id = cp_dist_id;
997:
998: -- retrieve a row from igi_iac_det_balances
999: CURSOR c_iac_dist(cp_dist_id igi_iac_det_balances.distribution_id%TYPE,
1000: cp_adj_id igi_iac_det_balances.adjustment_id%TYPE)
1001: IS
1002: SELECT *
995: AND asset_id = p_asset_hdr_rec.asset_id
996: AND distribution_id = cp_dist_id;
997:
998: -- retrieve a row from igi_iac_det_balances
999: CURSOR c_iac_dist(cp_dist_id igi_iac_det_balances.distribution_id%TYPE,
1000: cp_adj_id igi_iac_det_balances.adjustment_id%TYPE)
1001: IS
1002: SELECT *
1003: FROM igi_iac_det_balances
996: AND distribution_id = cp_dist_id;
997:
998: -- retrieve a row from igi_iac_det_balances
999: CURSOR c_iac_dist(cp_dist_id igi_iac_det_balances.distribution_id%TYPE,
1000: cp_adj_id igi_iac_det_balances.adjustment_id%TYPE)
1001: IS
1002: SELECT *
1003: FROM igi_iac_det_balances
1004: WHERE adjustment_id = cp_adj_id
999: CURSOR c_iac_dist(cp_dist_id igi_iac_det_balances.distribution_id%TYPE,
1000: cp_adj_id igi_iac_det_balances.adjustment_id%TYPE)
1001: IS
1002: SELECT *
1003: FROM igi_iac_det_balances
1004: WHERE adjustment_id = cp_adj_id
1005: AND distribution_id = cp_dist_id;
1006:
1007: -- local variables
1039: l_interco_amount NUMBER ;
1040: l_interco_ccid igi_iac_adjustments.code_combination_id%TYPE;
1041: l_interco_drcr_flag igi_iac_adjustments.dr_cr_flag%TYPE;
1042:
1043: l_reval_reserve IGI_IAC_DET_BALANCES.reval_reserve_cost%type;
1044: l_general_fund IGI_IAC_DET_BALANCES.general_fund_acc%type;
1045: l_Backlog_deprn_reserve IGI_IAC_DET_BALANCES.deprn_reserve_backlog%type;
1046: l_deprn_reserve IGI_IAC_DET_BALANCES.deprn_reserve%type;
1047: l_adjusted_cost IGI_IAC_DET_BALANCES.adjustment_cost%type;
1040: l_interco_ccid igi_iac_adjustments.code_combination_id%TYPE;
1041: l_interco_drcr_flag igi_iac_adjustments.dr_cr_flag%TYPE;
1042:
1043: l_reval_reserve IGI_IAC_DET_BALANCES.reval_reserve_cost%type;
1044: l_general_fund IGI_IAC_DET_BALANCES.general_fund_acc%type;
1045: l_Backlog_deprn_reserve IGI_IAC_DET_BALANCES.deprn_reserve_backlog%type;
1046: l_deprn_reserve IGI_IAC_DET_BALANCES.deprn_reserve%type;
1047: l_adjusted_cost IGI_IAC_DET_BALANCES.adjustment_cost%type;
1048: l_net_book_value IGI_IAC_DET_BALANCES.net_book_value%type;
1041: l_interco_drcr_flag igi_iac_adjustments.dr_cr_flag%TYPE;
1042:
1043: l_reval_reserve IGI_IAC_DET_BALANCES.reval_reserve_cost%type;
1044: l_general_fund IGI_IAC_DET_BALANCES.general_fund_acc%type;
1045: l_Backlog_deprn_reserve IGI_IAC_DET_BALANCES.deprn_reserve_backlog%type;
1046: l_deprn_reserve IGI_IAC_DET_BALANCES.deprn_reserve%type;
1047: l_adjusted_cost IGI_IAC_DET_BALANCES.adjustment_cost%type;
1048: l_net_book_value IGI_IAC_DET_BALANCES.net_book_value%type;
1049: l_deprn_per IGI_IAC_DET_BALANCES.deprn_period%type;
1042:
1043: l_reval_reserve IGI_IAC_DET_BALANCES.reval_reserve_cost%type;
1044: l_general_fund IGI_IAC_DET_BALANCES.general_fund_acc%type;
1045: l_Backlog_deprn_reserve IGI_IAC_DET_BALANCES.deprn_reserve_backlog%type;
1046: l_deprn_reserve IGI_IAC_DET_BALANCES.deprn_reserve%type;
1047: l_adjusted_cost IGI_IAC_DET_BALANCES.adjustment_cost%type;
1048: l_net_book_value IGI_IAC_DET_BALANCES.net_book_value%type;
1049: l_deprn_per IGI_IAC_DET_BALANCES.deprn_period%type;
1050: l_ytd_deprn IGI_IAC_DET_BALANCES.deprn_ytd%type;
1043: l_reval_reserve IGI_IAC_DET_BALANCES.reval_reserve_cost%type;
1044: l_general_fund IGI_IAC_DET_BALANCES.general_fund_acc%type;
1045: l_Backlog_deprn_reserve IGI_IAC_DET_BALANCES.deprn_reserve_backlog%type;
1046: l_deprn_reserve IGI_IAC_DET_BALANCES.deprn_reserve%type;
1047: l_adjusted_cost IGI_IAC_DET_BALANCES.adjustment_cost%type;
1048: l_net_book_value IGI_IAC_DET_BALANCES.net_book_value%type;
1049: l_deprn_per IGI_IAC_DET_BALANCES.deprn_period%type;
1050: l_ytd_deprn IGI_IAC_DET_BALANCES.deprn_ytd%type;
1051: l_op_acct IGI_IAC_DET_BALANCES.operating_acct_ytd%type;
1044: l_general_fund IGI_IAC_DET_BALANCES.general_fund_acc%type;
1045: l_Backlog_deprn_reserve IGI_IAC_DET_BALANCES.deprn_reserve_backlog%type;
1046: l_deprn_reserve IGI_IAC_DET_BALANCES.deprn_reserve%type;
1047: l_adjusted_cost IGI_IAC_DET_BALANCES.adjustment_cost%type;
1048: l_net_book_value IGI_IAC_DET_BALANCES.net_book_value%type;
1049: l_deprn_per IGI_IAC_DET_BALANCES.deprn_period%type;
1050: l_ytd_deprn IGI_IAC_DET_BALANCES.deprn_ytd%type;
1051: l_op_acct IGI_IAC_DET_BALANCES.operating_acct_ytd%type;
1052: l_op_acct_ytd IGI_IAC_DET_BALANCES.operating_acct_ytd%type;
1045: l_Backlog_deprn_reserve IGI_IAC_DET_BALANCES.deprn_reserve_backlog%type;
1046: l_deprn_reserve IGI_IAC_DET_BALANCES.deprn_reserve%type;
1047: l_adjusted_cost IGI_IAC_DET_BALANCES.adjustment_cost%type;
1048: l_net_book_value IGI_IAC_DET_BALANCES.net_book_value%type;
1049: l_deprn_per IGI_IAC_DET_BALANCES.deprn_period%type;
1050: l_ytd_deprn IGI_IAC_DET_BALANCES.deprn_ytd%type;
1051: l_op_acct IGI_IAC_DET_BALANCES.operating_acct_ytd%type;
1052: l_op_acct_ytd IGI_IAC_DET_BALANCES.operating_acct_ytd%type;
1053: l_general_fund_per IGI_IAC_DET_BALANCES.general_fund_per%type;
1046: l_deprn_reserve IGI_IAC_DET_BALANCES.deprn_reserve%type;
1047: l_adjusted_cost IGI_IAC_DET_BALANCES.adjustment_cost%type;
1048: l_net_book_value IGI_IAC_DET_BALANCES.net_book_value%type;
1049: l_deprn_per IGI_IAC_DET_BALANCES.deprn_period%type;
1050: l_ytd_deprn IGI_IAC_DET_BALANCES.deprn_ytd%type;
1051: l_op_acct IGI_IAC_DET_BALANCES.operating_acct_ytd%type;
1052: l_op_acct_ytd IGI_IAC_DET_BALANCES.operating_acct_ytd%type;
1053: l_general_fund_per IGI_IAC_DET_BALANCES.general_fund_per%type;
1054: l_reval_reserve_backlog IGI_IAC_DET_BALANCES.reval_reserve_backlog%type;
1047: l_adjusted_cost IGI_IAC_DET_BALANCES.adjustment_cost%type;
1048: l_net_book_value IGI_IAC_DET_BALANCES.net_book_value%type;
1049: l_deprn_per IGI_IAC_DET_BALANCES.deprn_period%type;
1050: l_ytd_deprn IGI_IAC_DET_BALANCES.deprn_ytd%type;
1051: l_op_acct IGI_IAC_DET_BALANCES.operating_acct_ytd%type;
1052: l_op_acct_ytd IGI_IAC_DET_BALANCES.operating_acct_ytd%type;
1053: l_general_fund_per IGI_IAC_DET_BALANCES.general_fund_per%type;
1054: l_reval_reserve_backlog IGI_IAC_DET_BALANCES.reval_reserve_backlog%type;
1055: l_operating_acct_backlog IGI_IAC_DET_BALANCES.operating_acct_backlog%type;
1048: l_net_book_value IGI_IAC_DET_BALANCES.net_book_value%type;
1049: l_deprn_per IGI_IAC_DET_BALANCES.deprn_period%type;
1050: l_ytd_deprn IGI_IAC_DET_BALANCES.deprn_ytd%type;
1051: l_op_acct IGI_IAC_DET_BALANCES.operating_acct_ytd%type;
1052: l_op_acct_ytd IGI_IAC_DET_BALANCES.operating_acct_ytd%type;
1053: l_general_fund_per IGI_IAC_DET_BALANCES.general_fund_per%type;
1054: l_reval_reserve_backlog IGI_IAC_DET_BALANCES.reval_reserve_backlog%type;
1055: l_operating_acct_backlog IGI_IAC_DET_BALANCES.operating_acct_backlog%type;
1056:
1049: l_deprn_per IGI_IAC_DET_BALANCES.deprn_period%type;
1050: l_ytd_deprn IGI_IAC_DET_BALANCES.deprn_ytd%type;
1051: l_op_acct IGI_IAC_DET_BALANCES.operating_acct_ytd%type;
1052: l_op_acct_ytd IGI_IAC_DET_BALANCES.operating_acct_ytd%type;
1053: l_general_fund_per IGI_IAC_DET_BALANCES.general_fund_per%type;
1054: l_reval_reserve_backlog IGI_IAC_DET_BALANCES.reval_reserve_backlog%type;
1055: l_operating_acct_backlog IGI_IAC_DET_BALANCES.operating_acct_backlog%type;
1056:
1057: l_transaction_header_id IGI_IAC_TRANSACTION_HEADERS.transaction_header_id%type;
1050: l_ytd_deprn IGI_IAC_DET_BALANCES.deprn_ytd%type;
1051: l_op_acct IGI_IAC_DET_BALANCES.operating_acct_ytd%type;
1052: l_op_acct_ytd IGI_IAC_DET_BALANCES.operating_acct_ytd%type;
1053: l_general_fund_per IGI_IAC_DET_BALANCES.general_fund_per%type;
1054: l_reval_reserve_backlog IGI_IAC_DET_BALANCES.reval_reserve_backlog%type;
1055: l_operating_acct_backlog IGI_IAC_DET_BALANCES.operating_acct_backlog%type;
1056:
1057: l_transaction_header_id IGI_IAC_TRANSACTION_HEADERS.transaction_header_id%type;
1058: l_transaction_type_code IGI_IAC_TRANSACTION_HEADERS.transaction_type_code%type;
1051: l_op_acct IGI_IAC_DET_BALANCES.operating_acct_ytd%type;
1052: l_op_acct_ytd IGI_IAC_DET_BALANCES.operating_acct_ytd%type;
1053: l_general_fund_per IGI_IAC_DET_BALANCES.general_fund_per%type;
1054: l_reval_reserve_backlog IGI_IAC_DET_BALANCES.reval_reserve_backlog%type;
1055: l_operating_acct_backlog IGI_IAC_DET_BALANCES.operating_acct_backlog%type;
1056:
1057: l_transaction_header_id IGI_IAC_TRANSACTION_HEADERS.transaction_header_id%type;
1058: l_transaction_type_code IGI_IAC_TRANSACTION_HEADERS.transaction_type_code%type;
1059: l_mass_reference_id IGI_IAC_TRANSACTION_HEADERS.mass_reference_id%type;
1060: l_adjustment_id IGI_IAC_TRANSACTION_HEADERS.adjustment_id%type;
1061: l_prev_adjustment_id IGI_IAC_TRANSACTION_HEADERS.adjustment_id%type;
1062: l_adjustment_status IGI_IAC_TRANSACTION_HEADERS.adjustment_status%type;
1063:
1064: l_reval_reserve_sum igi_iac_det_balances.reval_reserve_cost%TYPE ;
1065: l_general_fund_sum igi_iac_det_balances.general_fund_acc%TYPE ;
1066: l_Backlog_deprn_reserve_sum igi_iac_det_balances.deprn_reserve_backlog%TYPE ;
1067: l_deprn_reserve_sum igi_iac_det_balances.deprn_reserve%TYPE ;
1068: l_adjusted_cost_sum igi_iac_det_balances.adjustment_cost%TYPE ;
1061: l_prev_adjustment_id IGI_IAC_TRANSACTION_HEADERS.adjustment_id%type;
1062: l_adjustment_status IGI_IAC_TRANSACTION_HEADERS.adjustment_status%type;
1063:
1064: l_reval_reserve_sum igi_iac_det_balances.reval_reserve_cost%TYPE ;
1065: l_general_fund_sum igi_iac_det_balances.general_fund_acc%TYPE ;
1066: l_Backlog_deprn_reserve_sum igi_iac_det_balances.deprn_reserve_backlog%TYPE ;
1067: l_deprn_reserve_sum igi_iac_det_balances.deprn_reserve%TYPE ;
1068: l_adjusted_cost_sum igi_iac_det_balances.adjustment_cost%TYPE ;
1069: l_net_book_value_sum igi_iac_det_balances.net_book_value%TYPE ;
1062: l_adjustment_status IGI_IAC_TRANSACTION_HEADERS.adjustment_status%type;
1063:
1064: l_reval_reserve_sum igi_iac_det_balances.reval_reserve_cost%TYPE ;
1065: l_general_fund_sum igi_iac_det_balances.general_fund_acc%TYPE ;
1066: l_Backlog_deprn_reserve_sum igi_iac_det_balances.deprn_reserve_backlog%TYPE ;
1067: l_deprn_reserve_sum igi_iac_det_balances.deprn_reserve%TYPE ;
1068: l_adjusted_cost_sum igi_iac_det_balances.adjustment_cost%TYPE ;
1069: l_net_book_value_sum igi_iac_det_balances.net_book_value%TYPE ;
1070: l_deprn_per_sum igi_iac_det_balances.deprn_period%TYPE ;
1063:
1064: l_reval_reserve_sum igi_iac_det_balances.reval_reserve_cost%TYPE ;
1065: l_general_fund_sum igi_iac_det_balances.general_fund_acc%TYPE ;
1066: l_Backlog_deprn_reserve_sum igi_iac_det_balances.deprn_reserve_backlog%TYPE ;
1067: l_deprn_reserve_sum igi_iac_det_balances.deprn_reserve%TYPE ;
1068: l_adjusted_cost_sum igi_iac_det_balances.adjustment_cost%TYPE ;
1069: l_net_book_value_sum igi_iac_det_balances.net_book_value%TYPE ;
1070: l_deprn_per_sum igi_iac_det_balances.deprn_period%TYPE ;
1071: l_ytd_deprn_sum igi_iac_det_balances.deprn_ytd%TYPE ;
1064: l_reval_reserve_sum igi_iac_det_balances.reval_reserve_cost%TYPE ;
1065: l_general_fund_sum igi_iac_det_balances.general_fund_acc%TYPE ;
1066: l_Backlog_deprn_reserve_sum igi_iac_det_balances.deprn_reserve_backlog%TYPE ;
1067: l_deprn_reserve_sum igi_iac_det_balances.deprn_reserve%TYPE ;
1068: l_adjusted_cost_sum igi_iac_det_balances.adjustment_cost%TYPE ;
1069: l_net_book_value_sum igi_iac_det_balances.net_book_value%TYPE ;
1070: l_deprn_per_sum igi_iac_det_balances.deprn_period%TYPE ;
1071: l_ytd_deprn_sum igi_iac_det_balances.deprn_ytd%TYPE ;
1072: l_op_acct_sum igi_iac_det_balances.operating_acct_ytd%TYPE ;
1065: l_general_fund_sum igi_iac_det_balances.general_fund_acc%TYPE ;
1066: l_Backlog_deprn_reserve_sum igi_iac_det_balances.deprn_reserve_backlog%TYPE ;
1067: l_deprn_reserve_sum igi_iac_det_balances.deprn_reserve%TYPE ;
1068: l_adjusted_cost_sum igi_iac_det_balances.adjustment_cost%TYPE ;
1069: l_net_book_value_sum igi_iac_det_balances.net_book_value%TYPE ;
1070: l_deprn_per_sum igi_iac_det_balances.deprn_period%TYPE ;
1071: l_ytd_deprn_sum igi_iac_det_balances.deprn_ytd%TYPE ;
1072: l_op_acct_sum igi_iac_det_balances.operating_acct_ytd%TYPE ;
1073: l_op_acct_ytd_sum igi_iac_det_balances.operating_acct_ytd%TYPE ;
1066: l_Backlog_deprn_reserve_sum igi_iac_det_balances.deprn_reserve_backlog%TYPE ;
1067: l_deprn_reserve_sum igi_iac_det_balances.deprn_reserve%TYPE ;
1068: l_adjusted_cost_sum igi_iac_det_balances.adjustment_cost%TYPE ;
1069: l_net_book_value_sum igi_iac_det_balances.net_book_value%TYPE ;
1070: l_deprn_per_sum igi_iac_det_balances.deprn_period%TYPE ;
1071: l_ytd_deprn_sum igi_iac_det_balances.deprn_ytd%TYPE ;
1072: l_op_acct_sum igi_iac_det_balances.operating_acct_ytd%TYPE ;
1073: l_op_acct_ytd_sum igi_iac_det_balances.operating_acct_ytd%TYPE ;
1074: l_general_fund_per_sum igi_iac_det_balances.general_fund_per%TYPE ;
1067: l_deprn_reserve_sum igi_iac_det_balances.deprn_reserve%TYPE ;
1068: l_adjusted_cost_sum igi_iac_det_balances.adjustment_cost%TYPE ;
1069: l_net_book_value_sum igi_iac_det_balances.net_book_value%TYPE ;
1070: l_deprn_per_sum igi_iac_det_balances.deprn_period%TYPE ;
1071: l_ytd_deprn_sum igi_iac_det_balances.deprn_ytd%TYPE ;
1072: l_op_acct_sum igi_iac_det_balances.operating_acct_ytd%TYPE ;
1073: l_op_acct_ytd_sum igi_iac_det_balances.operating_acct_ytd%TYPE ;
1074: l_general_fund_per_sum igi_iac_det_balances.general_fund_per%TYPE ;
1075: l_reval_reserve_backlog_sum igi_iac_det_balances.reval_reserve_backlog%TYPE ;
1068: l_adjusted_cost_sum igi_iac_det_balances.adjustment_cost%TYPE ;
1069: l_net_book_value_sum igi_iac_det_balances.net_book_value%TYPE ;
1070: l_deprn_per_sum igi_iac_det_balances.deprn_period%TYPE ;
1071: l_ytd_deprn_sum igi_iac_det_balances.deprn_ytd%TYPE ;
1072: l_op_acct_sum igi_iac_det_balances.operating_acct_ytd%TYPE ;
1073: l_op_acct_ytd_sum igi_iac_det_balances.operating_acct_ytd%TYPE ;
1074: l_general_fund_per_sum igi_iac_det_balances.general_fund_per%TYPE ;
1075: l_reval_reserve_backlog_sum igi_iac_det_balances.reval_reserve_backlog%TYPE ;
1076: l_operating_acct_backlog_sum igi_iac_det_balances.operating_acct_backlog%TYPE;
1069: l_net_book_value_sum igi_iac_det_balances.net_book_value%TYPE ;
1070: l_deprn_per_sum igi_iac_det_balances.deprn_period%TYPE ;
1071: l_ytd_deprn_sum igi_iac_det_balances.deprn_ytd%TYPE ;
1072: l_op_acct_sum igi_iac_det_balances.operating_acct_ytd%TYPE ;
1073: l_op_acct_ytd_sum igi_iac_det_balances.operating_acct_ytd%TYPE ;
1074: l_general_fund_per_sum igi_iac_det_balances.general_fund_per%TYPE ;
1075: l_reval_reserve_backlog_sum igi_iac_det_balances.reval_reserve_backlog%TYPE ;
1076: l_operating_acct_backlog_sum igi_iac_det_balances.operating_acct_backlog%TYPE;
1077:
1070: l_deprn_per_sum igi_iac_det_balances.deprn_period%TYPE ;
1071: l_ytd_deprn_sum igi_iac_det_balances.deprn_ytd%TYPE ;
1072: l_op_acct_sum igi_iac_det_balances.operating_acct_ytd%TYPE ;
1073: l_op_acct_ytd_sum igi_iac_det_balances.operating_acct_ytd%TYPE ;
1074: l_general_fund_per_sum igi_iac_det_balances.general_fund_per%TYPE ;
1075: l_reval_reserve_backlog_sum igi_iac_det_balances.reval_reserve_backlog%TYPE ;
1076: l_operating_acct_backlog_sum igi_iac_det_balances.operating_acct_backlog%TYPE;
1077:
1078: l_reval_ccid igi_iac_adjustments.code_combination_id%TYPE;
1071: l_ytd_deprn_sum igi_iac_det_balances.deprn_ytd%TYPE ;
1072: l_op_acct_sum igi_iac_det_balances.operating_acct_ytd%TYPE ;
1073: l_op_acct_ytd_sum igi_iac_det_balances.operating_acct_ytd%TYPE ;
1074: l_general_fund_per_sum igi_iac_det_balances.general_fund_per%TYPE ;
1075: l_reval_reserve_backlog_sum igi_iac_det_balances.reval_reserve_backlog%TYPE ;
1076: l_operating_acct_backlog_sum igi_iac_det_balances.operating_acct_backlog%TYPE;
1077:
1078: l_reval_ccid igi_iac_adjustments.code_combination_id%TYPE;
1079: l_gen_fund_ccid igi_iac_adjustments.code_combination_id%TYPE;
1072: l_op_acct_sum igi_iac_det_balances.operating_acct_ytd%TYPE ;
1073: l_op_acct_ytd_sum igi_iac_det_balances.operating_acct_ytd%TYPE ;
1074: l_general_fund_per_sum igi_iac_det_balances.general_fund_per%TYPE ;
1075: l_reval_reserve_backlog_sum igi_iac_det_balances.reval_reserve_backlog%TYPE ;
1076: l_operating_acct_backlog_sum igi_iac_det_balances.operating_acct_backlog%TYPE;
1077:
1078: l_reval_ccid igi_iac_adjustments.code_combination_id%TYPE;
1079: l_gen_fund_ccid igi_iac_adjustments.code_combination_id%TYPE;
1080: l_backlog_ccid igi_iac_adjustments.code_combination_id%TYPE;
1441: ELSE
1442: -- for other distributions which are active but not affected by
1443: -- Transfers and the distributions which will be made ineffective by
1444: -- the Transfers process, retrieve the amounts for the distribution from
1445: -- igi_iac_det_balances table
1446: OPEN c_iac_dist(l_all_dist.distribution_id,
1447: l_prev_adjustment_id
1448: );
1449: FETCH c_iac_dist INTO l_iac_dist;
1513: l_op_expense_ccid,
1514: l_expense_ccid
1515: );
1516:
1517: -- prepare distribution data for igi_iac_det_balances
1518: -- igi_iac_fa_deprn and igi_iac_adjustments
1519: -- Rounding All amounts
1520: IF IGI_IAC_COMMON_UTILS.Iac_round(l_reval_reserve,
1521: p_asset_hdr_rec.book_type_code) THEN
2509: AND period_counter=p_period_counter
2510: AND transaction_type_code='TRANSFER';
2511:
2512:
2513: CURSOR c_deprn_expense(cp_asset_id igi_iac_det_balances.asset_id%TYPE,
2514: cp_adjustment_id IGI_IAC_DET_BALANCES.adjustment_id%type) IS
2515: SELECT sum(deprn_period)
2516: FROM igi_iac_det_balances
2517: WHERE book_type_code = p_book_type_code
2510: AND transaction_type_code='TRANSFER';
2511:
2512:
2513: CURSOR c_deprn_expense(cp_asset_id igi_iac_det_balances.asset_id%TYPE,
2514: cp_adjustment_id IGI_IAC_DET_BALANCES.adjustment_id%type) IS
2515: SELECT sum(deprn_period)
2516: FROM igi_iac_det_balances
2517: WHERE book_type_code = p_book_type_code
2518: AND asset_id = cp_asset_id
2512:
2513: CURSOR c_deprn_expense(cp_asset_id igi_iac_det_balances.asset_id%TYPE,
2514: cp_adjustment_id IGI_IAC_DET_BALANCES.adjustment_id%type) IS
2515: SELECT sum(deprn_period)
2516: FROM igi_iac_det_balances
2517: WHERE book_type_code = p_book_type_code
2518: AND asset_id = cp_asset_id
2519: AND adjustment_id = cp_adjustment_id;
2520:
2539: /* Cursor to select impacted distributions for roll back */
2540:
2541: CURSOR c_dist(c_adjustment_id igi_iac_adjustments.adjustment_id%type) IS
2542: SELECT distribution_id
2543: FROM igi_iac_det_balances
2544: WHERE adjustment_id=c_adjustment_id;
2545:
2546: CURSOR c_fa_dist(cp_adjustment_id igi_iac_adjustments.adjustment_id%type,
2547: cp_asset_id igi_iac_fa_deprn.asset_id%TYPE) IS
2557: l_amounts c_amounts%rowtype;
2558: l_prd_rec_prior igi_iac_types.prd_rec;
2559:
2560: l_deprn_expense FA_DEPRN_SUMMARY.deprn_amount%type;
2561: l_Expense_diff IGI_IAC_DET_BALANCES.deprn_period%type;
2562: l_prior_period_counter IGI_IAC_DET_BALANCES.period_counter%type;
2563: l_current_period_counter IGI_IAC_DET_BALANCES.period_counter%type;
2564: l_prev_adjustment igi_iac_transaction_headers%ROWTYPE;
2565:
2558: l_prd_rec_prior igi_iac_types.prd_rec;
2559:
2560: l_deprn_expense FA_DEPRN_SUMMARY.deprn_amount%type;
2561: l_Expense_diff IGI_IAC_DET_BALANCES.deprn_period%type;
2562: l_prior_period_counter IGI_IAC_DET_BALANCES.period_counter%type;
2563: l_current_period_counter IGI_IAC_DET_BALANCES.period_counter%type;
2564: l_prev_adjustment igi_iac_transaction_headers%ROWTYPE;
2565:
2566: l_path varchar2(150);
2559:
2560: l_deprn_expense FA_DEPRN_SUMMARY.deprn_amount%type;
2561: l_Expense_diff IGI_IAC_DET_BALANCES.deprn_period%type;
2562: l_prior_period_counter IGI_IAC_DET_BALANCES.period_counter%type;
2563: l_current_period_counter IGI_IAC_DET_BALANCES.period_counter%type;
2564: l_prev_adjustment igi_iac_transaction_headers%ROWTYPE;
2565:
2566: l_path varchar2(150);
2567: BEGIN
2601: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'============================================================');
2602: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'Deleting From detail balances...');
2603: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'============================================================');
2604:
2605: /*DELETE from igi_iac_det_balances
2606: WHERE book_type_code=p_book_type_code
2607: AND period_counter=p_period_counter
2608: AND adjustment_id=l_trans_headers.adjustment_id;*/
2609:
2609:
2610:
2611: FOR l_dist in c_dist(l_trans_headers.adjustment_id)
2612: loop
2613: IGI_IAC_DET_BALANCES_PKG.delete_row(
2614: x_adjustment_id =>l_trans_headers.adjustment_id,
2615: x_asset_id =>l_trans_headers.asset_id,
2616: x_distribution_id =>l_dist.distribution_id,
2617: x_book_type_code =>l_trans_headers.book_type_code,