DBA Data[Home] [Help]

APPS.FA_GAINLOSS_UND_PKG dependencies on FA_DISTRIBUTION_HISTORY

Line 22: FROM fa_distribution_history fadh

18: 0 BONUS_DEPRN_RSV,
19: 0 IMPAIRMENT_RSV,
20: 0 new_units,
21: fadh.code_combination_id adj_ccid
22: FROM fa_distribution_history fadh
23: where 1=0;
24:
25: cursor c_g_ret is
26: SELECT fadh.distribution_id,

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 1414: FROM fa_distribution_history fadh,

1410:
1411: --Select active distribution_ids
1412: CURSOR TRET IS
1413: SELECT fadh.distribution_id
1414: FROM fa_distribution_history fadh,
1415: fa_book_controls bc
1416: WHERE fadh.asset_id = h_asset_id
1417: AND fadh.book_type_code = bc.distribution_source_book
1418: AND bc.book_type_code = h_book

Line 1425: FROM fa_distribution_history dh,

1421:
1422: -- Select distribution_ids that were retired
1423: CURSOR PRET IS
1424: SELECT dh.distribution_id
1425: FROM fa_distribution_history dh,
1426: fa_book_controls bc,
1427: fa_retirements rt
1428: WHERE dh.asset_id = h_asset_id
1429: AND dh.book_type_code = bc.distribution_source_book

Line 1441: FROM fa_distribution_history dh_old,

1437: -- Bug 5149832, 5237765, 5251944
1438: CURSOR OLD_NEW_DIST IS
1439: SELECT dh_old.distribution_id,
1440: dh_new.distribution_id
1441: FROM fa_distribution_history dh_old,
1442: fa_distribution_history dh_new,
1443: fa_book_controls bc,
1444: fa_transaction_headers th
1445: WHERE th.transaction_header_id = h_rethdrout

Line 1442: fa_distribution_history dh_new,

1438: CURSOR OLD_NEW_DIST IS
1439: SELECT dh_old.distribution_id,
1440: dh_new.distribution_id
1441: FROM fa_distribution_history dh_old,
1442: fa_distribution_history dh_new,
1443: fa_book_controls bc,
1444: fa_transaction_headers th
1445: WHERE th.transaction_header_id = h_rethdrout
1446: and th.asset_id = h_asset_id

Line 1458: from fa_distribution_history dh_pret

1454: (dh_old.units_assigned + dh_old.transaction_units = 0 -- FULL RET in dh_old DH row
1455: OR
1456: exists
1457: (select 1 -- PARTIAL RET in dh_pret DH row
1458: from fa_distribution_history dh_pret
1459: where dh_pret.asset_id = dh_old.asset_id
1460: and dh_pret.book_type_code = dh_old.book_type_code
1461: and dh_pret.transaction_header_id_out = DH_OLD.transaction_header_id_in
1462: and DH_OLD.transaction_units is NULL

Line 1471: from fa_distribution_history fdh1

1467: )
1468: --Added for 8741598
1469: OR not exists
1470: (select 1
1471: from fa_distribution_history fdh1
1472: where fdh1.asset_id = dh_old.asset_id
1473: and fdh1.book_type_code = dh_old.book_type_code
1474: and fdh1.transaction_header_id_in < DH_OLD.transaction_header_id_in)
1475: --End of added for 8741598

Line 1488: FROM fa_distribution_history dh

1484: and dh_new.date_ineffective is null;
1485:
1486: CURSOR UPD_DIST IS
1487: SELECT dh.distribution_id
1488: FROM fa_distribution_history dh
1489: WHERE dh.book_type_code = h_book
1490: AND dh.asset_id = h_asset_id
1491: AND dh.transaction_header_id_out is null
1492: AND exists

Line 1495: FROM fa_distribution_history ret

1491: AND dh.transaction_header_id_out is null
1492: AND exists
1493: (
1494: SELECT 'x'
1495: FROM fa_distribution_history ret
1496: WHERE ret.book_type_code = h_book
1497: AND ret.asset_id = h_asset_id
1498: AND ret.retirement_id = h_ret_id
1499: AND ret.code_combination_id = dh.code_combination_id

Line 1507: FROM fa_distribution_history dh

1503:
1504: CURSOR CRET IS
1505: SELECT dh.distribution_id,
1506: dh.units_assigned
1507: FROM fa_distribution_history dh
1508: WHERE dh.book_type_code = h_book
1509: AND dh.asset_id = h_asset_id
1510: AND dh.transaction_header_id_out = h_rethdrout
1511: UNION

Line 1513: FROM fa_distribution_history r

1509: AND dh.asset_id = h_asset_id
1510: AND dh.transaction_header_id_out = h_rethdrout
1511: UNION
1512: SELECT r.distribution_id, 0 - nvl (r.transaction_units, 0)
1513: FROM fa_distribution_history r
1514: WHERE r.book_type_code = h_book
1515: AND r.asset_id = h_asset_id
1516: AND r.retirement_id = h_ret_id
1517: AND not exists

Line 1520: FROM fa_distribution_history d

1516: AND r.retirement_id = h_ret_id
1517: AND not exists
1518: (
1519: SELECT 'x'
1520: FROM fa_distribution_history d
1521: WHERE d.book_type_code = h_book
1522: AND d.asset_id = h_asset_id
1523: AND d.transaction_header_id_out = h_rethdrout
1524: AND r.code_combination_id = d.code_combination_id

Line 1535: from fa_distribution_history d1,

1531: * for all updates in the case of multi-distributed assets
1532: */
1533: CURSOR CHG_DIST IS
1534: select d1.distribution_id
1535: from fa_distribution_history d1,
1536: fa_distribution_history d2
1537: where d2.book_type_code = h_book
1538: and d2.asset_id = h_asset_id
1539: and d1.book_type_code = d2.book_type_code

Line 1536: fa_distribution_history d2

1532: */
1533: CURSOR CHG_DIST IS
1534: select d1.distribution_id
1535: from fa_distribution_history d1,
1536: fa_distribution_history d2
1537: where d2.book_type_code = h_book
1538: and d2.asset_id = h_asset_id
1539: and d1.book_type_code = d2.book_type_code
1540: and d1.asset_id = d2.asset_id

Line 1990: FROM FA_DISTRIBUTION_HISTORY fadh

1986: BEGIN
1987: SELECT distinct fadh.TRANSACTION_HEADER_ID_OUT,
1988: DECODE(fadh.TRANSACTION_HEADER_ID_OUT, null, 0, 1)
1989: INTO h_dist_hdrout, h_drflag
1990: FROM FA_DISTRIBUTION_HISTORY fadh
1991: WHERE fadh.retirement_id = h_ret_id;
1992: EXCEPTION
1993: WHEN NO_DATA_FOUND then
1994: NULL;

Line 2086: element => 'Update FA_DISTRIBUTION_HISTORY',

2082:
2083: if p_log_level_rec.statement_level then
2084: fa_debug_pkg.add
2085: (fname => l_calling_fn,
2086: element => 'Update FA_DISTRIBUTION_HISTORY',
2087: value => '', p_log_level_rec => p_log_level_rec);
2088: end if;
2089:
2090: -- bugfix for 991646.

Line 2096: -- fa_distribution_history is bypassed and it moves on to create new

2092: -- asset that are
2093: -- retired are reinstated, no need to terminate any distribution rows
2094: -- as in the case
2095: -- for all other partial retirement case. Hence the following update of
2096: -- fa_distribution_history is bypassed and it moves on to create new
2097: -- distribution rows with original units before the retirement
2098:
2099: -- Fix for Bug #1256872. Select the active distributions
2100: -- to be terminated. They will be the duplicates of the

Line 2126: from fa_distribution_history

2122: -- abs(transaction_units) = units_assigned.
2123:
2124: select count(*)
2125: into h_count
2126: from fa_distribution_history
2127: where transaction_header_id_out = h_dist_hdrout
2128: and book_type_code = h_book
2129: and asset_id = h_asset_id
2130: and retirement_id = h_ret_id;

Line 2153: -- UPDATING FA_DISTRIBUTION_HISTORY

2149: element => '+++ Step 4.6',
2150: value => '', p_log_level_rec => p_log_level_rec);
2151: end if;
2152:
2153: -- UPDATING FA_DISTRIBUTION_HISTORY
2154: -- if (h_mrc_primary_book_flag = 1) then
2155: if (ret.mrc_sob_type_code <> 'R') then
2156: UPDATE FA_DISTRIBUTION_HISTORY
2157: SET date_ineffective =

Line 2156: UPDATE FA_DISTRIBUTION_HISTORY

2152:
2153: -- UPDATING FA_DISTRIBUTION_HISTORY
2154: -- if (h_mrc_primary_book_flag = 1) then
2155: if (ret.mrc_sob_type_code <> 'R') then
2156: UPDATE FA_DISTRIBUTION_HISTORY
2157: SET date_ineffective =
2158: h_today, -- to_date(h_today,'DD/MM/YYYY hh24:mi:ss'),
2159: transaction_header_id_out = h_rethdrout,
2160: last_update_date =

Line 2165: -- END UPDATING FA_DISTRIBUTION_HISTORY

2161: h_today, -- to_date(h_today,'DD/MM/YYYY hh24:mi:ss'),
2162: last_updated_by = h_user_id
2163: WHERE distribution_id = h_rdistid;
2164: end if;
2165: -- END UPDATING FA_DISTRIBUTION_HISTORY
2166: upd_ctr := upd_ctr + 1;
2167:
2168: if p_log_level_rec.statement_level then
2169: fa_debug_pkg.add

Line 2278: element => 'Update FA_DISTRIBUTION_HISTORY (FULL RETIREMENT)',

2274:
2275: if p_log_level_rec.statement_level then
2276: fa_debug_pkg.add
2277: (fname => l_calling_fn,
2278: element => 'Update FA_DISTRIBUTION_HISTORY (FULL RETIREMENT)',
2279: value => '');
2280: end if;
2281:
2282: -- UPDATING FA_DISTRIBUTION_HISTORY

Line 2282: -- UPDATING FA_DISTRIBUTION_HISTORY

2278: element => 'Update FA_DISTRIBUTION_HISTORY (FULL RETIREMENT)',
2279: value => '');
2280: end if;
2281:
2282: -- UPDATING FA_DISTRIBUTION_HISTORY
2283: --if (h_mrc_primary_book_flag = 1) then
2284: if (ret.mrc_sob_type_code <> 'R') then
2285: UPDATE FA_DISTRIBUTION_HISTORY
2286: SET date_ineffective =

Line 2285: UPDATE FA_DISTRIBUTION_HISTORY

2281:
2282: -- UPDATING FA_DISTRIBUTION_HISTORY
2283: --if (h_mrc_primary_book_flag = 1) then
2284: if (ret.mrc_sob_type_code <> 'R') then
2285: UPDATE FA_DISTRIBUTION_HISTORY
2286: SET date_ineffective =
2287: today,
2288: transaction_header_id_out = h_rethdrout,
2289: last_update_date =

Line 2301: element => 'Update FA_DISTRIBUTION_HISTORY (new)',

2297:
2298: if p_log_level_rec.statement_level then
2299: fa_debug_pkg.add
2300: (fname => l_calling_fn,
2301: element => 'Update FA_DISTRIBUTION_HISTORY (new)',
2302: value => '');
2303: end if;
2304:
2305: -- Fix for Bug #1256872. Select the active distributions

Line 2319: Select FA_DISTRIBUTION_HISTORY_s.nextval

2315: FETCH CRET INTO h_rdistid, h_units_assigned;
2316: exit when CRET%notfound or CRET%notfound IS NULL;
2317:
2318: BEGIN
2319: Select FA_DISTRIBUTION_HISTORY_s.nextval
2320: into new_distid
2321: from dual;
2322: EXCEPTION
2323: when others then

Line 2342: FROM fa_distribution_history ret

2338:
2339: BEGIN
2340: SELECT 0 - nvl (ret.transaction_units, 0)
2341: INTO h_units_retired
2342: FROM fa_distribution_history ret
2343: WHERE ret.book_type_code = h_book
2344: AND ret.asset_id = h_asset_id
2345: AND ret.retirement_id = h_ret_id
2346: AND exists

Line 2349: FROM fa_distribution_history dh

2345: AND ret.retirement_id = h_ret_id
2346: AND exists
2347: (
2348: SELECT 'x'
2349: FROM fa_distribution_history dh
2350: WHERE dh.book_type_code = h_book
2351: AND dh.asset_id = h_asset_id
2352: AND dh.distribution_id = h_rdistid
2353: AND dh.distribution_id <> ret.distribution_id

Line 2363: -- INSERTING FA_DISTRIBUTION_HISTORY

2359: WHEN NO_DATA_FOUND then
2360: NULL;
2361: END;
2362:
2363: -- INSERTING FA_DISTRIBUTION_HISTORY
2364: --if (h_mrc_primary_book_flag = 1) then
2365: if (ret.mrc_sob_type_code <> 'R') then
2366: INSERT INTO FA_DISTRIBUTION_HISTORY
2367: (distribution_id, book_type_code, asset_id,

Line 2366: INSERT INTO FA_DISTRIBUTION_HISTORY

2362:
2363: -- INSERTING FA_DISTRIBUTION_HISTORY
2364: --if (h_mrc_primary_book_flag = 1) then
2365: if (ret.mrc_sob_type_code <> 'R') then
2366: INSERT INTO FA_DISTRIBUTION_HISTORY
2367: (distribution_id, book_type_code, asset_id,
2368: units_assigned, date_effective, date_ineffective,
2369: code_Combination_id,
2370: location_id, assigned_to, transaction_header_id_in,

Line 2379: FROM FA_DISTRIBUTION_HISTORY

2375: null, code_Combination_id,
2376: location_id, assigned_to, h_rethdrout,
2377: null, null, null, today,
2378: user_id
2379: FROM FA_DISTRIBUTION_HISTORY
2380: WHERE distribution_id = h_rdistid;
2381:
2382: end if;
2383:

Line 2401: FROM fa_distribution_history r

2397: WHERE TRANSACTION_HEADER_ID = h_rethdrout
2398: AND DISTRIBUTION_ID =
2399: (
2400: SELECT DISTINCT r.distribution_id
2401: FROM fa_distribution_history r
2402: WHERE r.book_type_code = h_book
2403: AND r.asset_id = h_asset_id
2404: AND r.retirement_id = h_ret_id
2405: AND exists

Line 2408: FROM fa_distribution_history d

2404: AND r.retirement_id = h_ret_id
2405: AND exists
2406: (
2407: SELECT 'x'
2408: FROM fa_distribution_history d
2409: WHERE d.book_type_code = h_book
2410: AND d.asset_id = h_asset_id
2411: AND d.distribution_id = h_rdistid
2412: AND r.code_combination_id = d.code_combination_id

Line 2437: FROM fa_distribution_history n

2433: "o.distribution_id = h_rdistid" were contradicting so splitted them. */
2434:
2435: Cursor C1 is
2436: SELECT DISTINCT n.distribution_id
2437: FROM fa_distribution_history n
2438: WHERE n.book_type_code = h_book
2439: AND n.asset_id = h_asset_id
2440: AND n.date_ineffective is null
2441: AND exists

Line 2444: FROM fa_distribution_history o

2440: AND n.date_ineffective is null
2441: AND exists
2442: (
2443: SELECT 'x'
2444: FROM fa_distribution_history o
2445: WHERE o.book_type_code = h_book
2446: AND o.asset_id = h_asset_id
2447: --AND o.retirement_id = h_ret_id
2448: AND o.distribution_id = h_rdistid -- added for bug 2775057

Line 2456: FROM fa_distribution_history o

2452: )
2453: AND exists
2454: (
2455: SELECT 'x'
2456: FROM fa_distribution_history o
2457: WHERE o.book_type_code = h_book
2458: AND o.asset_id = h_asset_id
2459: AND o.retirement_id = h_ret_id
2460: --AND o.distribution_id = h_rdistid -- added for bug 2775057

Line 2474: FROM fa_distribution_history r

2470: -- Fix for Bug #3678791. Break previous update statement
2471: -- into multiple smaller statements.
2472: SELECT DISTINCT r.distribution_id
2473: INTO l_temp_dist_id1
2474: FROM fa_distribution_history r
2475: WHERE r.book_type_code = h_book
2476: AND r.asset_id = h_asset_id
2477: AND r.retirement_id = h_ret_id
2478: AND exists

Line 2481: FROM fa_distribution_history d

2477: AND r.retirement_id = h_ret_id
2478: AND exists
2479: (
2480: SELECT 'x'
2481: FROM fa_distribution_history d
2482: WHERE d.book_type_code = h_book
2483: AND d.asset_id = h_asset_id
2484: AND d.distribution_id = h_rdistid
2485: AND r.code_combination_id = d.code_combination_id

Line 2508: from fa_distribution_history d1,

2504: if (h_drflag = 0) then -- if fully retired
2505: BEGIN
2506: select d1.distribution_id
2507: into h_adj_distid
2508: from fa_distribution_history d1,
2509: fa_distribution_history d2
2510: where d2.book_type_code = h_book
2511: and d2.asset_id = h_asset_id
2512: and d1.book_type_code = d2.book_type_code

Line 2509: fa_distribution_history d2

2505: BEGIN
2506: select d1.distribution_id
2507: into h_adj_distid
2508: from fa_distribution_history d1,
2509: fa_distribution_history d2
2510: where d2.book_type_code = h_book
2511: and d2.asset_id = h_asset_id
2512: and d1.book_type_code = d2.book_type_code
2513: and d1.asset_id = d2.asset_id

Line 2553: FROM fa_distribution_history r

2549: AND DISTRIBUTION_ID <> h_adj_distid
2550: AND DISTRIBUTION_ID =
2551: (
2552: SELECT DISTINCT r.distribution_id
2553: FROM fa_distribution_history r
2554: WHERE r.book_type_code = h_book
2555: AND r.asset_id = h_asset_id
2556: AND r.transaction_header_id_in =
2557: (

Line 2559: FROM fa_distribution_history

2555: AND r.asset_id = h_asset_id
2556: AND r.transaction_header_id_in =
2557: (
2558: SELECT DISTINCT transaction_header_id_out
2559: FROM fa_distribution_history
2560: WHERE book_type_code = h_book
2561: AND asset_id = h_asset_id
2562: AND retirement_id = h_ret_id
2563: )

Line 2567: FROM fa_distribution_history d

2563: )
2564: AND exists
2565: (
2566: SELECT 'x'
2567: FROM fa_distribution_history d
2568: WHERE d.book_type_code = h_book
2569: AND d.asset_id = h_asset_id
2570: AND d.distribution_id = h_rdistid
2571: AND r.code_combination_id = d.code_combination_id

Line 2579: FROM fa_distribution_history

2575: )
2576: AND not exists
2577: (
2578: SELECT 'x'
2579: FROM fa_distribution_history
2580: WHERE book_type_code = h_book
2581: AND asset_id = h_asset_id
2582: AND retirement_id = h_ret_id
2583: AND distribution_id = h_adj_distid

Line 2596: FROM fa_distribution_history r

2592: AND SET_OF_BOOKS_ID = ret.set_of_books_id
2593: AND DISTRIBUTION_ID =
2594: (
2595: SELECT DISTINCT r.distribution_id
2596: FROM fa_distribution_history r
2597: WHERE r.book_type_code = h_book
2598: AND r.asset_id = h_asset_id
2599: AND r.transaction_header_id_in =
2600: (

Line 2602: FROM fa_distribution_history

2598: AND r.asset_id = h_asset_id
2599: AND r.transaction_header_id_in =
2600: (
2601: SELECT DISTINCT transaction_header_id_out
2602: FROM fa_distribution_history
2603: WHERE book_type_code = h_book
2604: AND asset_id = h_asset_id
2605: AND retirement_id = h_ret_id
2606: )

Line 2610: FROM fa_distribution_history d

2606: )
2607: AND exists
2608: (
2609: SELECT 'x'
2610: FROM fa_distribution_history d
2611: WHERE d.book_type_code = h_book
2612: AND d.asset_id = h_asset_id
2613: AND d.distribution_id = h_rdistid
2614: AND r.code_combination_id = d.code_combination_id

Line 2622: FROM fa_distribution_history

2618: )
2619: AND not exists
2620: (
2621: SELECT 'x'
2622: FROM fa_distribution_history
2623: WHERE book_type_code = h_book
2624: AND asset_id = h_asset_id
2625: AND retirement_id = h_ret_id
2626: AND distribution_id = h_adj_distid

Line 2701: FROM fa_distribution_history fadh

2697: 0 BONUS_DEPRN_RSV,
2698: 0 IMPAIRMENT_RSV,
2699: 0 new_units,
2700: fadh.code_combination_id adj_ccid
2701: FROM fa_distribution_history fadh
2702: WHERE fadh.asset_id = RET.asset_id
2703: AND fadh.date_ineffective is null
2704: AND fadh.transaction_units is null
2705: order by distribution_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 2775: FROM fa_mc_adjustments faadj, fa_distribution_history fadh

2771: abs(sum(decode(faadj.debit_credit_flag,'DR',faadj.adjustment_amount,-1*faadj.adjustment_amount)))
2772: adjustment_amount,
2773: 'N' adj_rec_found,
2774: faadj.code_combination_id adj_ccid
2775: FROM fa_mc_adjustments faadj, fa_distribution_history fadh
2776: where fadh.asset_id = RET.asset_id
2777: AND faadj.book_type_code = BK.dis_book
2778: AND faadj.asset_id = RET.asset_id
2779: and fadh.distribution_id = faadj.distribution_id

Line 3044: FROM fa_distribution_history dh_old,

3040: SELECT dh_old.distribution_id,
3041: dh_new.distribution_id,
3042: dh_old.code_combination_id,
3043: dh_new.code_combination_id
3044: FROM fa_distribution_history dh_old,
3045: fa_distribution_history dh_new
3046: WHERE
3047: dh_old.retirement_id = h_retirement_id and
3048: dh_old.book_type_code = RET.book and

Line 3045: fa_distribution_history dh_new

3041: dh_new.distribution_id,
3042: dh_old.code_combination_id,
3043: dh_new.code_combination_id
3044: FROM fa_distribution_history dh_old,
3045: fa_distribution_history dh_new
3046: WHERE
3047: dh_old.retirement_id = h_retirement_id and
3048: dh_old.book_type_code = RET.book and
3049: dh_old.units_assigned + dh_old.transaction_units <> 0

Line 3073: FROM fa_distribution_history fadh

3069: 0 BONUS_DEPRN_RSV,
3070: 0 IMPAIRMENT_RSV,
3071: 0 new_units,
3072: fadh.code_combination_id adj_ccid
3073: FROM fa_distribution_history fadh
3074: WHERE fadh.asset_id = RET.asset_id
3075: AND fadh.date_ineffective is null
3076: AND fadh.transaction_units is null
3077: order by distribution_id;

Line 3092: FROM fa_distribution_history fadh

3088: 0 BONUS_DEPRN_RSV,
3089: 0 IMPAIRMENT_RSV,
3090: 0 new_units,
3091: fadh.code_combination_id adj_ccid
3092: FROM fa_distribution_history fadh
3093: WHERE fadh.asset_id = RET.asset_id
3094: AND fadh.TRANSACTION_HEADER_ID_OUT
3095: = (select rt.transaction_header_id_out
3096: from fa_retirements rt

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 3187: FROM fa_mc_adjustments faadj, fa_distribution_history fadh

3183: abs(sum(decode(faadj.debit_credit_flag,'DR',faadj.adjustment_amount,-1*faadj.adjustment_amount)))
3184: adjustment_amount,
3185: 'N' adj_rec_found,
3186: faadj.code_combination_id adj_ccid
3187: FROM fa_mc_adjustments faadj, fa_distribution_history fadh
3188: where fadh.asset_id = RET.asset_id
3189: AND faadj.book_type_code = BK.dis_book
3190: AND faadj.asset_id = RET.asset_id
3191: and fadh.distribution_id = faadj.distribution_id

Line 3552: FA_DISTRIBUTION_HISTORY dh,

3548: nvl(adj.adjustment_amount, 0),
3549: (dh.units_assigned / ah.units)
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

Line 3572: FROM FA_DISTRIBUTION_HISTORY dh

3568: SELECT dh.distribution_id,
3569: dh.code_combination_id,
3570: ((1/(1-h_cost_frac))-1) * nvl(adj.adjustment_amount, 0),
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

Line 3609: FA_DISTRIBUTION_HISTORY dh,

3605: nvl(adj.adjustment_amount, 0),
3606: (dh.units_assigned / ah.units)
3607: * expense_amount -- Bug 6666666
3608: FROM
3609: FA_DISTRIBUTION_HISTORY dh,
3610: FA_ASSET_HISTORY ah,
3611: FA_MC_ADJUSTMENTS adj
3612: WHERE dh.asset_id = RET.asset_id
3613: AND dh.book_type_code = BK.dis_book

Line 3631: FA_DISTRIBUTION_HISTORY dh,

3627: dh.code_combination_id,
3628: ((1/(1-h_cost_frac))-1) * nvl(adj.adjustment_amount, 0),
3629: 0 -- Bug 6666666
3630: FROM
3631: FA_DISTRIBUTION_HISTORY dh,
3632: FA_ASSET_HISTORY ah,
3633: FA_MC_ADJUSTMENTS adj -- bug#5094783 fix
3634: WHERE dh.asset_id = RET.asset_id
3635: AND dh.book_type_code = BK.dis_book

Line 3655: fa_distribution_history fadh,

3651: faadj.distribution_id,
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

Line 3675: fa_distribution_history fadh,

3671: faadj.distribution_id,
3672: faadj.code_combination_id,
3673: - 1 * faadj.adjustment_amount
3674: FROM
3675: fa_distribution_history fadh,
3676: fa_mc_adjustments faadj
3677: WHERE fadh.asset_id(+) = RET.asset_id
3678: AND fadh.book_type_code(+) = BK.dis_book
3679: AND fadh.date_ineffective(+) is null

Line 3700: FROM FA_RETIREMENTS faret, fa_distribution_history fadh,

3696: * expense_amount -
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

Line 3723: FROM FA_MC_RETIREMENTS faret, fa_distribution_history fadh,

3719: * expense_amount -
3720: NVL(faadj.adjustment_amount, 0),
3721: (ABS(fadh.transaction_units) / faret.units)
3722: * expense_amount -- Bug 6666666
3723: FROM FA_MC_RETIREMENTS faret, fa_distribution_history fadh,
3724: fa_mc_adjustments faadj
3725: WHERE fadh.asset_id = RET.asset_id
3726: AND fadh.book_type_code = BK.dis_book
3727: AND fadh.retirement_id = RET.retirement_id

Line 3746: FA_DISTRIBUTION_HISTORY fadh,

3742: faadj.code_combination_id,
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

Line 3768: FA_DISTRIBUTION_HISTORY fadh,

3764: faadj.code_combination_id,
3765: - 1 * faadj.adjustment_amount
3766: FROM
3767: FA_MC_RETIREMENTS faret,
3768: FA_DISTRIBUTION_HISTORY fadh,
3769: FA_MC_ADJUSTMENTS faadj
3770: WHERE fadh.asset_id(+) = RET.asset_id
3771: AND fadh.book_type_code(+) = BK.dis_book
3772: AND fadh.retirement_id(+) = RET.retirement_id

Line 4796: FROM fa_distribution_history

4792: fagict_adj_error EXCEPTION;
4793:
4794: CURSOR TERM_DIST IS
4795: SELECT distribution_id
4796: FROM fa_distribution_history
4797: WHERE book_type_code = ret.book
4798: and asset_id = ret.asset_id
4799: and transaction_header_id_out = h_th_id_out;
4800:

Line 5742: from fa_distribution_history

5738: cursor c_active_dist is
5739: select distribution_id,
5740: code_combination_id,
5741: units_assigned
5742: from fa_distribution_history
5743: where asset_id = l_asset_id
5744: and date_ineffective is null
5745: order by distribution_id;
5746:

Line 6201: FROM FA_DISTRIBUTION_HISTORY

6197: CURSOR C1 IS
6198: SELECT DISTRIBUTION_ID,
6199: CODE_COMBINATION_ID,
6200: TRANSACTION_UNITS
6201: FROM FA_DISTRIBUTION_HISTORY
6202: WHERE ASSET_ID = RET.asset_id
6203: AND BOOK_TYPE_CODE = h_dist_book
6204: AND RETIREMENT_ID = RET.retirement_id
6205: ORDER BY DISTRIBUTION_ID;