DBA Data[Home] [Help]

APPS.FA_GAINLOSS_UND_PKG dependencies on FA_ADJUSTMENTS

Line 36: FROM fa_adjustments faadj, fa_distribution_history fadh

32: faadj.debit_credit_flag,
33: faadj.adjustment_amount,
34: 'N' adj_rec_found,
35: faadj.code_combination_id adj_ccid
36: FROM fa_adjustments faadj, fa_distribution_history fadh
37: WHERE 1=0;
38:
39: cursor c_g_cost_ret IS
40: SELECT faadj.adjustment_type,

Line 45: from fa_adjustments faadj

41: faadj.adjustment_amount,
42: faadj.debit_credit_flag,
43: faadj.debit_credit_flag rev_debit_credit_flag,
44: faadj.code_combination_id adj_ccid
45: from fa_adjustments faadj
46: where 1=0;
47:
48: type tbl_adj is table of c_g_adj%rowtype index by pls_integer;
49: type tbl_ret is table of c_g_ret%rowtype index by pls_integer;

Line 57: dist_id fa_adjustments.distribution_id%type,

53: g_tbl_adj_rsv tbl_adj;
54:
55: type typ_adj_rec is RECORD
56: (asset_id fa_books.asset_id%type,
57: dist_id fa_adjustments.distribution_id%type,
58: ccid fa_adjustments.code_combination_id%type,
59: adj_type fa_adjustments.adjustment_type%type,
60: dr_cr fa_adjustments.debit_credit_flag%type,
61: cost fa_adjustments.adjustment_amount%type);

Line 58: ccid fa_adjustments.code_combination_id%type,

54:
55: type typ_adj_rec is RECORD
56: (asset_id fa_books.asset_id%type,
57: dist_id fa_adjustments.distribution_id%type,
58: ccid fa_adjustments.code_combination_id%type,
59: adj_type fa_adjustments.adjustment_type%type,
60: dr_cr fa_adjustments.debit_credit_flag%type,
61: cost fa_adjustments.adjustment_amount%type);
62: type tbl_final_adj is table of typ_adj_rec index by binary_integer;

Line 59: adj_type fa_adjustments.adjustment_type%type,

55: type typ_adj_rec is RECORD
56: (asset_id fa_books.asset_id%type,
57: dist_id fa_adjustments.distribution_id%type,
58: ccid fa_adjustments.code_combination_id%type,
59: adj_type fa_adjustments.adjustment_type%type,
60: dr_cr fa_adjustments.debit_credit_flag%type,
61: cost fa_adjustments.adjustment_amount%type);
62: type tbl_final_adj is table of typ_adj_rec index by binary_integer;
63:

Line 60: dr_cr fa_adjustments.debit_credit_flag%type,

56: (asset_id fa_books.asset_id%type,
57: dist_id fa_adjustments.distribution_id%type,
58: ccid fa_adjustments.code_combination_id%type,
59: adj_type fa_adjustments.adjustment_type%type,
60: dr_cr fa_adjustments.debit_credit_flag%type,
61: cost fa_adjustments.adjustment_amount%type);
62: type tbl_final_adj is table of typ_adj_rec index by binary_integer;
63:
64: function process_adj_table(p_mode IN VARCHAR2,

Line 61: cost fa_adjustments.adjustment_amount%type);

57: dist_id fa_adjustments.distribution_id%type,
58: ccid fa_adjustments.code_combination_id%type,
59: adj_type fa_adjustments.adjustment_type%type,
60: dr_cr fa_adjustments.debit_credit_flag%type,
61: cost fa_adjustments.adjustment_amount%type);
62: type tbl_final_adj is table of typ_adj_rec index by binary_integer;
63:
64: function process_adj_table(p_mode IN VARCHAR2,
65: RET IN fa_ret_types.ret_struct,

Line 138: fa_adjustments faadj, fa_retirements faret, fa_deprn_periods dp

134: DECODE(faadj.debit_credit_flag, 'CR', 'DR', 'CR'),
135: faadj.adjustment_amount,
136: faadj.track_member_flag --Bug8244128
137: FROM
138: fa_adjustments faadj, fa_retirements faret, fa_deprn_periods dp
139: WHERE faadj.transaction_header_id = faret.transaction_header_id_in
140: AND faadj.asset_id = faret.asset_id
141: AND faadj.book_type_Code = faret.book_type_code
142: AND faadj.source_type_code = decode(p_wip_asset, 1, 'CIP RETIREMENT',

Line 165: fa_adjustments faadj, fa_retirements faret, fa_deprn_periods dp

161: DECODE(faadj.debit_credit_flag, 'CR', 'DR', 'CR'),
162: faadj.adjustment_amount,
163: faadj.track_member_flag --Bug8244128
164: FROM
165: fa_adjustments faadj, fa_retirements faret, fa_deprn_periods dp
166: WHERE faadj.transaction_header_id = p_group_thid
167: AND faadj.asset_id = p_group_asset_id
168: AND faadj.book_type_Code = faret.book_type_code
169: AND faadj.source_type_code = decode(p_wip_asset, 1, 'CIP RETIREMENT',

Line 627: -- fa_adjustments rows. Insert into fa_adjustments only if asset is

623:
624: -- fix for bug 688397: check if asset is added in a prior period
625: -- in the tax book. If it is a current period period add call
626: -- fadpdtl to update 'B' row with new distribution and not create
627: -- fa_adjustments rows. Insert into fa_adjustments only if asset is
628: -- not a current period add in tax book. snarayan Jul 4 1998
629:
630: -- count will be 0 if it is a current period add
631:

Line 684: else -- added in prior period,insert into fa_adjustments

680: end if;
681:
682: end if; -- (h_group_asset_id is not null)
683:
684: else -- added in prior period,insert into fa_adjustments
685:
686: -- SLA UPTAKE
687: -- assign an event for the transaction
688: if (h_mrc_sob_type_code = 'P') then

Line 2018: UPDATE fa_adjustments aj

2014: FETCH PRET INTO h_pdistid;
2015: exit when PRET%notfound or PRET%notfound IS NULL;
2016:
2017: if ret.mrc_sob_type_code <> 'R' then
2018: UPDATE fa_adjustments aj
2019: SET distribution_id = h_tdistid
2020: WHERE aj.asset_id = h_asset_id
2021: AND aj.book_type_code = h_book
2022: AND aj.distribution_id = h_pdistid

Line 2056: UPDATE fa_adjustments aj

2052: fa_debug_pkg.add(l_calling_fn, '++ h_tdistid NEW DIST', h_tdistid, p_log_level_rec => p_log_level_rec);
2053: end if;
2054:
2055: if ret.mrc_sob_type_code <> 'R' then
2056: UPDATE fa_adjustments aj
2057: SET distribution_id = h_tdistid
2058: WHERE aj.asset_id = h_asset_id
2059: AND aj.book_type_code = h_book
2060: AND aj.distribution_id = h_pdistid

Line 2384: -- Update FA_ADJUSTMENTS so that it contain the new distribution

2380: WHERE distribution_id = h_rdistid;
2381:
2382: end if;
2383:
2384: -- Update FA_ADJUSTMENTS so that it contain the new distribution
2385: -- id instead of the old one. Reserve Ledger needs this new id
2386:
2387: -- Fix for Bug #1256872.The distributions we want to change are the
2388: -- distributions from original retirement and may not be those that

Line 2394: UPDATE FA_ADJUSTMENTS

2390:
2391: -- if (h_mrc_primary_book_flag = 1) then
2392: if (ret.mrc_sob_type_code <> 'R') then
2393:
2394: UPDATE FA_ADJUSTMENTS
2395: SET DISTRIBUTION_ID = new_distid
2396:
2397: WHERE TRANSACTION_HEADER_ID = h_rethdrout
2398: AND DISTRIBUTION_ID =

Line 2490: -- CHECK: this was fa_adjustments table before which i think was wrong

2486: AND r.location_id = d.location_id
2487: AND nvl (r.assigned_to, -99) = nvl (d.assigned_to, -99)
2488: );
2489:
2490: -- CHECK: this was fa_adjustments table before which i think was wrong
2491: UPDATE FA_MC_ADJUSTMENTS
2492: SET DISTRIBUTION_ID = C1_rec.distribution_id
2493: WHERE TRANSACTION_HEADER_ID = h_rethdrout
2494: AND book_type_code = h_book /* Added for bug 7659930*/

Line 2540: -- fa_adjustments to balance the initial retirement come from

2536: end if;
2537:
2538:
2539: -- Fix for Bug #1256872. Also need to make sure that rows in
2540: -- fa_adjustments to balance the initial retirement come from
2541: -- the distribution that was just terminated and not the new
2542: -- distribution created from the initial retirement
2543:
2544: if (ret.mrc_sob_type_code <> 'R') then

Line 2546: UPDATE FA_ADJUSTMENTS

2542: -- distribution created from the initial retirement
2543:
2544: if (ret.mrc_sob_type_code <> 'R') then
2545:
2546: UPDATE FA_ADJUSTMENTS
2547: SET DISTRIBUTION_ID = h_adj_distid
2548: WHERE TRANSACTION_HEADER_ID = h_rethdrout
2549: AND DISTRIBUTION_ID <> h_adj_distid
2550: AND DISTRIBUTION_ID =

Line 2707: --Bug#8810791 - Modified to fetch adjustment type from fa_adjustments

2703: AND fadh.date_ineffective is null
2704: AND fadh.transaction_units is null
2705: order by distribution_id;
2706:
2707: --Bug#8810791 - Modified to fetch adjustment type from fa_adjustments
2708: cursor c_ret is
2709: SELECT min(fadh.distribution_id) distribution_id,
2710: faadj.transaction_header_id,
2711: fadh.code_combination_id,

Line 2721: FROM fa_adjustments faadj, fa_distribution_history fadh

2717: abs(sum(decode(faadj.debit_credit_flag,'DR',faadj.adjustment_amount,-1*faadj.adjustment_amount)))
2718: adjustment_amount,
2719: 'N' adj_rec_found,
2720: faadj.code_combination_id adj_ccid
2721: FROM fa_adjustments faadj, fa_distribution_history fadh
2722: where fadh.asset_id = RET.asset_id
2723: AND faadj.book_type_code = BK.dis_book
2724: AND faadj.asset_id = RET.asset_id
2725: and fadh.distribution_id = faadj.distribution_id

Line 2751: from fa_adjustments faadj

2747: (
2748: select adjustment_type,
2749: sum(decode(debit_credit_flag,'DR',adjustment_amount,-1*adjustment_amount )) adjustment_amount,
2750: faadj.code_combination_id adj_ccid
2751: from fa_adjustments faadj
2752: where faadj.asset_id = RET.asset_id
2753: and faadj.transaction_header_id = ret.th_id_in
2754: and faadj.book_type_code = ret.book
2755: and faadj.adjustment_type in ('COST', 'CIP COST')

Line 3114: FROM fa_adjustments faadj, fa_distribution_history fadh

3110: abs(sum(decode(faadj.debit_credit_flag,'DR',faadj.adjustment_amount,-1*faadj.adjustment_amount)))
3111: adjustment_amount,
3112: 'N' adj_rec_found,
3113: faadj.code_combination_id adj_ccid
3114: FROM fa_adjustments faadj, fa_distribution_history fadh
3115: where fadh.asset_id = RET.asset_id
3116: AND faadj.book_type_code = BK.dis_book
3117: AND faadj.asset_id = RET.asset_id
3118: and fadh.distribution_id = faadj.distribution_id

Line 3143: from fa_adjustments faadj

3139: (
3140: select adjustment_type,
3141: sum(decode(debit_credit_flag,'DR',adjustment_amount,-1*adjustment_amount )) adjustment_amount,
3142: faadj.code_combination_id adj_ccid
3143: from fa_adjustments faadj
3144: where ( (faadj.transaction_header_id = ret.th_id_in AND faadj.asset_id = h_asset_id)
3145: )
3146: and faadj.book_type_code = ret.book
3147: and faadj.adjustment_type in ('RESERVE', 'BONUS RESERVE', 'REVAL RESERVE', 'IMPAIR RESERVE')

Line 3164: from fa_adjustments faadj

3160: (
3161: select adjustment_type,
3162: sum(decode(debit_credit_flag,'DR',adjustment_amount,-1*adjustment_amount )) adjustment_amount,
3163: faadj.code_combination_id adj_ccid
3164: from fa_adjustments faadj
3165: where (
3166: (faadj.transaction_header_id = l_group_thid AND faadj.asset_id = bk.group_asset_id)
3167: )
3168: and faadj.book_type_code = ret.book

Line 3351: are inserted in fa_adjustments for a group when member asset

3347:
3348: /*
3349: Checks if retirement is a partial unit retirement and
3350: asset is not a member of group. Except COST, all entries
3351: are inserted in fa_adjustments for a group when member asset
3352: is retired
3353: */
3354: if p_log_level_rec.statement_level then
3355: fa_debug_pkg.add

Line 3554: FA_ADJUSTMENTS adj

3550: * expense_amount --Bug 6666666
3551: FROM
3552: FA_DISTRIBUTION_HISTORY dh,
3553: FA_ASSET_HISTORY ah,
3554: FA_ADJUSTMENTS adj
3555: WHERE dh.asset_id = RET.asset_id
3556: AND dh.book_type_code = BK.dis_book
3557: AND dh.date_ineffective is null
3558: AND dh.distribution_id = adj.distribution_id(+)

Line 3575: ,FA_ADJUSTMENTS adj

3571: 0 -- Bug 6666666
3572: FROM FA_DISTRIBUTION_HISTORY dh
3573: ,FA_ASSET_HISTORY ah
3574: ,FA_TRANSACTION_HEADERS ret_th
3575: ,FA_ADJUSTMENTS adj
3576: ,FA_TRANSACTION_HEADERS exp_th
3577: WHERE dh.asset_id = RET.asset_id
3578: AND dh.book_type_code = BK.dis_book
3579: AND dh.date_ineffective is null

Line 3656: fa_adjustments faadj

3652: faadj.code_combination_id,
3653: - 1 * faadj.adjustment_amount
3654: FROM
3655: fa_distribution_history fadh,
3656: fa_adjustments faadj
3657: WHERE fadh.asset_id(+) = RET.asset_id
3658: AND fadh.book_type_code(+) = BK.dis_book
3659: AND fadh.date_ineffective(+) is null
3660: AND fadh.distribution_id(+) = faadj.distribution_id

Line 3701: fa_adjustments faadj

3697: NVL(faadj.adjustment_amount, 0),
3698: (ABS(fadh.transaction_units) / faret.units)
3699: * expense_amount -- Bug 6666666
3700: FROM FA_RETIREMENTS faret, fa_distribution_history fadh,
3701: fa_adjustments faadj
3702: WHERE fadh.asset_id = RET.asset_id
3703: AND fadh.book_type_code = BK.dis_book
3704: AND fadh.retirement_id = RET.retirement_id
3705: AND fadh.distribution_id = faadj.distribution_id(+)

Line 3747: FA_ADJUSTMENTS faadj

3743: - 1 * faadj.adjustment_amount
3744: FROM
3745: FA_RETIREMENTS faret,
3746: FA_DISTRIBUTION_HISTORY fadh,
3747: FA_ADJUSTMENTS faadj
3748: WHERE fadh.asset_id(+) = RET.asset_id
3749: AND fadh.book_type_code(+) = BK.dis_book
3750: AND fadh.retirement_id(+) = RET.retirement_id
3751: AND fadh.distribution_id(+) = faadj.distribution_id

Line 3821: --The following statement will insert rows into FA_ADJUSTMENTS for

3817: h_cost_frac := ret.cost_retired / bk.current_cost;
3818: end if;
3819:
3820:
3821: --The following statement will insert rows into FA_ADJUSTMENTS for
3822: -- each active current distribution. Notice, that we still need to insert
3823: -- records for which distribution-id is in FA_ADJUSTMENTS but not in
3824: -- active distributions (e.g: Transfer occured before retirement)
3825:

Line 3823: -- records for which distribution-id is in FA_ADJUSTMENTS but not in

3819:
3820:
3821: --The following statement will insert rows into FA_ADJUSTMENTS for
3822: -- each active current distribution. Notice, that we still need to insert
3823: -- records for which distribution-id is in FA_ADJUSTMENTS but not in
3824: -- active distributions (e.g: Transfer occured before retirement)
3825:
3826: adj_row.transaction_header_id := h_th_id_out;
3827: adj_row.asset_invoice_id := 0;

Line 4032: -- Inserting to FA_ADJUSTMENTS which dist-id is NOT active distributions

4028: else
4029: CLOSE MRC_DIST_DEPRN1;
4030: end if;
4031:
4032: -- Inserting to FA_ADJUSTMENTS which dist-id is NOT active distributions
4033:
4034: if p_log_level_rec.statement_level then
4035: fa_debug_pkg.add
4036: (fname => l_calling_fn,

Line 4288: | The formula is dpcldr - ADJ in FA_ADJUSTMENTS. |

4284: /*========================================================================*
4285: | NAME fagidn |
4286: | |
4287: | FUNCTION Adjust the depreciation we took at the time of the retirement.|
4288: | The formula is dpcldr - ADJ in FA_ADJUSTMENTS. |
4289: | |
4290: | History Jacob John 1/29/97 Created
4291: |=========================================================================*/
4292:

Line 4551: FROM fa_adjustments faadj

4547: -1 * faadj.adjustment_amount,
4548: faadj.adjustment_amount),
4549: faadj.adjustment_amount))
4550: INTO h_tot_deprn_adj
4551: FROM fa_adjustments faadj
4552: WHERE faadj.asset_id = RET.asset_id
4553: AND faadj.book_type_code = RET.book
4554: AND faadj.source_type_code = 'RETIREMENT'
4555: AND faadj.adjustment_type in ('RESERVE', 'EXPENSE', 'REVAL EXPENSE')

Line 4601: FROM fa_adjustments faadj

4597: -1 * faadj.adjustment_amount,
4598: faadj.adjustment_amount),
4599: faadj.adjustment_amount))
4600: INTO h_tot_bonus_deprn_adj
4601: FROM fa_adjustments faadj
4602: WHERE faadj.asset_id = RET.asset_id
4603: AND faadj.book_type_code = RET.book
4604: AND faadj.source_type_code = 'RETIREMENT'
4605: AND faadj.adjustment_type in ('BONUS RESERVE', 'BONUS EXPENSE')

Line 4651: FROM fa_adjustments faadj

4647: -1 * faadj.adjustment_amount,
4648: faadj.adjustment_amount),
4649: faadj.adjustment_amount))
4650: INTO h_tot_impairment_adj
4651: FROM fa_adjustments faadj
4652: WHERE faadj.asset_id = RET.asset_id
4653: AND faadj.book_type_code = RET.book
4654: AND faadj.source_type_code = 'RETIREMENT'
4655: AND faadj.adjustment_type in ('IMPAIR RESERVE', 'IMPAIR EXPENSE')

Line 4701: FROM fa_adjustments faadj

4697: -1 * faadj.adjustment_amount,
4698: faadj.adjustment_amount),
4699: -1 * faadj.adjustment_amount))
4700: INTO h_tot_reval_adj
4701: FROM fa_adjustments faadj
4702: WHERE faadj.asset_id = RET.asset_id
4703: AND faadj.book_type_code = RET.book
4704: AND faadj.source_type_code = decode(RET.wip_asset,1,'CIP RETIREMENT','RETIREMENT')
4705: AND faadj.adjustment_type in ('REVAL RESERVE', 'REVAL AMORT')

Line 4877: FROM FA_ADJUSTMENTS

4873: h_ccid,
4874: h_adj_type,
4875: h_source_type_code,
4876: h_th_id
4877: FROM FA_ADJUSTMENTS
4878: WHERE ASSET_ID = RET.ASSET_id
4879: and book_type_code = ret.book
4880: and distribution_id = h_dist_id
4881: AND adjustment_type in ('COST', 'CIP COST')

Line 5329: from fa_adjustments

5325:
5326: IF (ret.mrc_sob_type_code <> 'R') THEN
5327: select sum(decode(debit_credit_flag, 'CR', -1, 1) * adjustment_amount)
5328: into l_reserve_ret
5329: from fa_adjustments
5330: where asset_id = ret.asset_id
5331: and book_type_code = ret.book
5332: and source_type_code = 'RETIREMENT'
5333: and adjustment_type = 'RESERVE'

Line 5351: from fa_adjustments

5347: -- Bug # 7184690,7199183 added below sql
5348: IF (ret.mrc_sob_type_code <> 'R') THEN
5349: select nvl(sum(decode(debit_credit_flag, 'DR', adjustment_amount, -adjustment_amount)), 0)
5350: into l_exp_ret
5351: from fa_adjustments
5352: where asset_id = ret.asset_id
5353: and book_type_code = ret.book
5354: and source_type_code = 'RETIREMENT'
5355: and adjustment_type = 'EXPENSE'

Line 5900: l_old_cost fa_adjustments.adjustment_amount%type;

5896: end if;
5897:
5898: declare
5899: bln_create_rec boolean;
5900: l_old_cost fa_adjustments.adjustment_amount%type;
5901: l_new_cost fa_adjustments.adjustment_amount%type;
5902: l_dr_cr_bal VARCHAR2(2);
5903: l_rev_dr_cr_bal VARCHAR2(2);
5904: begin

Line 5901: l_new_cost fa_adjustments.adjustment_amount%type;

5897:
5898: declare
5899: bln_create_rec boolean;
5900: l_old_cost fa_adjustments.adjustment_amount%type;
5901: l_new_cost fa_adjustments.adjustment_amount%type;
5902: l_dr_cr_bal VARCHAR2(2);
5903: l_rev_dr_cr_bal VARCHAR2(2);
5904: begin
5905: l_old_cost := 0;

Line 6117: l_adj_type_total fa_adjustments.adjustment_amount%type :=0 ;

6113:
6114: for i in 1..p_tbl_cost_ret.count
6115: loop
6116: declare
6117: l_adj_type_total fa_adjustments.adjustment_amount%type :=0 ;
6118: begin
6119: if (p_log_level_rec.statement_level) then
6120: fa_debug_pkg.add
6121: (fname => l_calling_fn,