DBA Data[Home] [Help]

APPS.FA_CALC_DEPRN_BASIS2_PKG SQL Statements

The following lines contain the word 'select', 'insert', 'update' or 'delete':

Line: 60

         fa_cache_pkg.fazcdrd_record.period_update_flag = 'Y') and   -- ENERGY
         (px_rule_in.event_type <> 'AMORT_ADJ3') then                -- ENERGY
     --                                                              -- ENERGY
     -- There should be no EXPENSED ADJUSTMENT for now and CURRRENT  -- ENERGY
     -- period amortized adjustment is only allowed.                 -- ENERGY
     --                                                              -- ENERGY
     if px_rule_in.recoverable_cost = 0 then
        px_rule_out.new_adjusted_cost := 0;
Line: 118

     fa_debug_pkg.add('NSF', 'fa_cache_pkg.fazcdrd_record.period_update_flag', fa_cache_pkg.fazcdrd_record.period_update_flag, p_log_level_rec => p_log_level_rec);
Line: 157

        SELECT rate_in_use
        INTO l_rate_in_use
        FROM fa_books
        WHERE asset_id = px_rule_in.asset_id
        AND book_type_code = px_rule_in.book_type_code
        AND date_ineffective is null;
Line: 264

   select nvl(deprn_reserve,0), nvl(ytd_deprn,0)
     from fa_deprn_summary
    where asset_id = px_rule_in.asset_id
      and period_counter = l_amort_period;
Line: 270

   select nvl(deprn_reserve,0), nvl(ytd_deprn,0)
     from fa_mc_deprn_summary
    where asset_id = px_rule_in.asset_id
      and period_counter = l_amort_period
      and set_of_books_id = px_rule_in.set_of_books_id;
Line: 284

          select nvl(bk.recoverable_cost,0),
                 nvl(bk.adjusted_cost,0),
                 nvl(bk.salvage_value,0),
                 bk.deprn_method_code,
                 dm.deprn_basis_rule,
                 dm.rate_source_rule,
          -----------------------------------------
          -- Added following two columns
          -- to fix bug 2303276
          -----------------------------------------
                 nvl(bk.adjusted_recoverable_cost,0),
                 nvl(bk.cost,0),
		 nvl(bk.deprn_limit_type,'X'),  -- Bug 12833731
		 nvl(bk.allowed_deprn_limit_amount,0) -- Bug 12833731
          from   FA_BOOKS bk, FA_METHODS dm
          where  bk.deprn_method_code = dm.method_code
          and    nvl(bk.life_in_months, 0) = nvl(dm.life_in_months,0)
          and    bk.asset_id = px_rule_in.asset_id
          and    bk.book_type_code = px_rule_in.book_type_code
	  and	 NVL (bk.transaction_header_id_out, -99999) = DECODE (px_rule_in.adj_transaction_header_id,px_rule_in.transaction_header_id ,
	                                                              -99999,px_rule_in.adj_transaction_header_id);
Line: 308

          select nvl(bk.recoverable_cost,0),
                 nvl(bk.adjusted_cost,0),
                 nvl(bk.salvage_value,0),
                 bk.deprn_method_code,
                 dm.deprn_basis_rule,
                 dm.rate_source_rule,
                 nvl(bk.adjusted_recoverable_cost,0),
                 nvl(bk.cost,0),
		 nvl(bk.deprn_limit_type,'X'),    -- Bug 12833731
		 nvl(bk.allowed_deprn_limit_amount,0) -- Bug 12833731
          from   FA_MC_BOOKS bk, FA_METHODS dm
          where  bk.deprn_method_code = dm.method_code
          and    nvl(bk.life_in_months, 0) = nvl(dm.life_in_months,0)
          and    bk.asset_id = px_rule_in.asset_id
          and    bk.book_type_code = px_rule_in.book_type_code
          and    bk.transaction_header_id_out is null
	  and	 NVL (bk.transaction_header_id_out, -99999) = DECODE (px_rule_in.adj_transaction_header_id,px_rule_in.transaction_header_id ,
	                                                              -99999,px_rule_in.adj_transaction_header_id);
Line: 329

          select nvl(bk.recoverable_cost,0),
	         nvl(bk.adjusted_cost,0),
	         nvl(bk.salvage_value,0),
		 bk.deprn_method_code,
		 dm.deprn_basis_rule,
		 dm.rate_source_rule,
		 nvl(bk.adjusted_recoverable_cost,0),
		 nvl(bk.cost,0),
		 nvl(bk.deprn_limit_type,'X'),
		 nvl(bk.allowed_deprn_limit_amount,0)
	  from	 FA_BOOKS bk, FA_METHODS dm
	  where	 bk.deprn_method_code = dm.method_code
	  and	 nvl(bk.life_in_months, 0) = nvl(dm.life_in_months,0)
	  and	 bk.asset_id = px_rule_in.asset_id
	  and	 bk.book_type_code = px_rule_in.book_type_code
	  and	 bk.transaction_header_id_in = px_rule_in.adj_transaction_header_id;
Line: 348

          select nvl(bk.recoverable_cost,0),
	         nvl(bk.adjusted_cost,0),
	         nvl(bk.salvage_value,0),
		 bk.deprn_method_code,
		 dm.deprn_basis_rule,
		 dm.rate_source_rule,
		 nvl(bk.adjusted_recoverable_cost,0),
		 nvl(bk.cost,0),
		 nvl(bk.deprn_limit_type,'X'),
		 nvl(bk.allowed_deprn_limit_amount,0)
	  from	 FA_MC_BOOKS bk, FA_METHODS dm
	  where	 bk.deprn_method_code = dm.method_code
	  and	 nvl(bk.life_in_months, 0) = nvl(dm.life_in_months,0)
	  and	 bk.asset_id = px_rule_in.asset_id
	  and	 bk.book_type_code = px_rule_in.book_type_code
	  and	 bk.transaction_header_id_in = px_rule_in.adj_transaction_header_id;
Line: 369

  select ap.period_counter
    from fa_deprn_periods ap
   where ap.book_type_code = px_rule_in.book_type_code
    and  ap.calendar_period_open_date
                        <= trunc(px_rule_in.amortization_start_date)
    and nvl(ap.calendar_period_close_date,sysdate)
                        >= trunc(px_rule_in.amortization_start_date);
Line: 380

  select nvl(h.amortization_start_date,h.transaction_date_entered),
         nvl(bk.cost,0)
  from fa_transaction_headers   h,
       fa_books                 bk
  where h.transaction_header_id =
          (select max(transaction_header_id_out)
           from fa_books        b,
                fa_methods      m
          where b.book_type_code = px_rule_in.book_type_code
            and b.asset_id = px_rule_in.asset_id
            and b.deprn_method_code = m.method_code
            and m.deprn_basis_rule = 'NBV')
   and bk.book_type_code = px_rule_in.book_type_code
   and bk.asset_id = px_rule_in.asset_id
   and bk.transaction_header_id_in = h.transaction_header_id;
Line: 398

  select nvl(h.amortization_start_date,h.transaction_date_entered),
         nvl(bk.cost,0)
  from fa_transaction_headers   h,
       fa_mc_books                 bk
  where h.transaction_header_id =
          (select max(transaction_header_id_out)
           from fa_mc_books  b,
                fa_methods      m
          where b.book_type_code = px_rule_in.book_type_code
            and b.asset_id = px_rule_in.asset_id
            and b.deprn_method_code = m.method_code
            and b.set_of_books_id = px_rule_in.set_of_books_id
            and m.deprn_basis_rule = 'NBV')
   and bk.book_type_code = px_rule_in.book_type_code
   and bk.asset_id = px_rule_in.asset_id
   and bk.transaction_header_id_in = h.transaction_header_id
   and bk.set_of_books_id = px_rule_in.set_of_books_id;
Line: 419

  select nvl(deprn_reserve,0) - nvl(ytd_deprn,0)
    from fa_deprn_summary
   where book_type_code = px_rule_in.book_type_code
     and asset_id = px_rule_in.asset_id
     and period_counter =
                (select period_counter
                   from fa_deprn_periods
                  where book_type_code = px_rule_in.book_type_code
                    and calendar_period_open_date <= p_method_change_date
                    and nvl(calendar_period_close_date,sysdate) >= p_method_change_date);
Line: 432

  select nvl(deprn_reserve,0) - nvl(ytd_deprn,0)
    from fa_deprn_summary
   where book_type_code = px_rule_in.book_type_code
     and asset_id = px_rule_in.asset_id
     and period_counter =
                (select period_counter
                   from fa_deprn_periods
                  where book_type_code = px_rule_in.book_type_code
                    and calendar_period_open_date <= p_method_change_date
                    and nvl(calendar_period_close_date,sysdate) >= p_method_change_date);
Line: 448

    select exclude_fully_rsv_flag
    from   FA_BOOKS BK
    where  BK.ASSET_ID = px_rule_in.asset_id
    and    BK.BOOK_TYPE_CODE = px_rule_in.book_type_code
    and    BK.TRANSACTION_HEADER_ID_OUT is null;
Line: 456

    select exclude_fully_rsv_flag
    from   FA_MC_BOOKS BK
    where  BK.ASSET_ID = px_rule_in.asset_id
    and    BK.BOOK_TYPE_CODE = px_rule_in.book_type_code
    and    BK.TRANSACTION_HEADER_ID_OUT is null
    and    BK.set_of_books_id = px_rule_in.set_of_books_id ;
Line: 465

    select nvl(sum(TRC.adjusted_cost),0)     fully_rsv_adjusted_cost,
           nvl(sum(TRC.salvage_value),0)     fully_rsv_salvage_value,
           nvl(sum(TRC.recoverable_cost),0)  fully_rsv_recoverable_cost,
           nvl(sum(TRC.deprn_reserve),0)     fully_rsv_deprn_reserve
    from   FA_TRACK_MEMBERS TRC
    where  TRC.GROUP_ASSET_ID = px_rule_in.asset_id
    and    TRC.PERIOD_COUNTER <= p_period_counter
    and    TRC.FULLY_RESERVED_FLAG='Y'
    and    nvl(TRC.SET_OF_BOOKS_ID,-99) = nvl(h_set_of_books_id,-99) /*Bug# 7462260 Added filter conition for MRC */
    and    TRC.MEMBER_ASSET_ID is not null;
Line: 478

    select nvl(sum(TRC.adjusted_cost),0)     fully_rsv_adjusted_cost,
           nvl(sum(TRC.salvage_value),0)     fully_rsv_salvage_value,
           nvl(sum(TRC.recoverable_cost),0)  fully_rsv_recoverable_cost,
           nvl(sum(TRC.deprn_reserve),0)     fully_rsv_deprn_reserve
    from   FA_TRACK_MEMBERS TRC
    where  TRC.GROUP_ASSET_ID = px_rule_in.asset_id
    and    TRC.PERIOD_COUNTER = p_period_counter
    and    TRC.FULLY_RESERVED_FLAG='Y'
    and    nvl(TRC.SET_OF_BOOKS_ID,-99) = nvl(h_set_of_books_id,-99) /*Bug# 7462260 Added filter conition for MRC */
    and    TRC.MEMBER_ASSET_ID is not null;
Line: 491

    select min(TRC.period_counter)
    from   FA_TRACK_MEMBERS TRC
    where  TRC.GROUP_ASSET_ID = px_rule_in.asset_id
    and    TRC.MEMBER_ASSET_ID is not null
    and    nvl(TRC.SET_OF_BOOKS_ID,-99) = nvl(h_set_of_books_id,-99); /*Bug# 7462260 Added filter conition for MRC */
Line: 499

    select nvl(sum(BK.adjusted_cost),0)     fully_rsv_adjusted_cost,
           nvl(sum(BK.salvage_value),0)     fully_rsv_salvage_value,
           nvl(sum(BK.recoverable_cost),0)  fully_rsv_recoverable_cost,
           nvl(sum(DS.deprn_reserve),0)     fully_rsv_deprn_reserve
    from   FA_BOOKS BK,
           FA_DEPRN_SUMMARY DS
    where  BK.ASSET_ID = DS.ASSET_ID
    and    BK.BOOK_TYPE_CODE = DS.BOOK_TYPE_CODE
    and    BK.PERIOD_COUNTER_FULLY_RESERVED = DS.PERIOD_COUNTER
    and    BK.GROUP_ASSET_ID = px_rule_in.asset_id
    and    BK.BOOK_TYPE_CODE = px_rule_in.book_type_code
    and    nvl(BK.PERIOD_COUNTER_FULLY_RESERVED,p_period_counter)
                                                < p_period_counter
    and    BK.PERIOD_COUNTER_FULLY_RETIRED is null
    and    BK.DATE_INEFFECTIVE is null;
Line: 517

    select nvl(sum(BK.adjusted_cost),0)     fully_rsv_adjusted_cost,
           nvl(sum(BK.salvage_value),0)     fully_rsv_salvage_value,
           nvl(sum(BK.recoverable_cost),0)  fully_rsv_recoverable_cost,
           nvl(sum(DS.deprn_reserve),0)     fully_rsv_deprn_reserve
    from   FA_MC_BOOKS BK,
           FA_MC_DEPRN_SUMMARY DS
    where  BK.ASSET_ID = DS.ASSET_ID
    and    BK.BOOK_TYPE_CODE = DS.BOOK_TYPE_CODE
    and    BK.PERIOD_COUNTER_FULLY_RESERVED = DS.PERIOD_COUNTER
    and    BK.GROUP_ASSET_ID = px_rule_in.asset_id
    and    BK.BOOK_TYPE_CODE = px_rule_in.book_type_code
    and    BK.set_of_books_id = px_rule_in.set_of_books_id
    and    DS.set_of_books_id = px_rule_in.set_of_books_id
    and    nvl(BK.PERIOD_COUNTER_FULLY_RESERVED,p_period_counter)
                                                < p_period_counter
    and    BK.PERIOD_COUNTER_FULLY_RETIRED is null
    and    BK.DATE_INEFFECTIVE is null;
Line: 537

    select nvl(sum(BK.adjusted_cost),0)     fully_rsv_adjusted_cost,
           nvl(sum(BK.salvage_value),0)     fully_rsv_salvage_value,
           nvl(sum(BK.recoverable_cost),0)  fully_rsv_recoverable_cost
    from   FA_BOOKS BK
    where  BK.GROUP_ASSET_ID = px_rule_in.asset_id
    and    BK.BOOK_TYPE_CODE = px_rule_in.book_type_code
    and    BK.PERIOD_COUNTER_FULLY_RESERVED = p_period_counter
    and    BK.DATE_INEFFECTIVE is null;
Line: 548

    select nvl(sum(BK.adjusted_cost),0)     fully_rsv_adjusted_cost,
           nvl(sum(BK.salvage_value),0)     fully_rsv_salvage_value,
           nvl(sum(BK.recoverable_cost),0)  fully_rsv_recoverable_cost
    from   FA_MC_BOOKS BK
    where  BK.GROUP_ASSET_ID = px_rule_in.asset_id
    and    BK.BOOK_TYPE_CODE = px_rule_in.book_type_code
    and    BK.PERIOD_COUNTER_FULLY_RESERVED = p_period_counter
    and    BK.DATE_INEFFECTIVE is null
    and    BK.set_of_books_id = px_rule_in.set_of_books_id;
Line: 560

    select nvl(sum(BK.adjusted_cost),0)     fully_rsv_adjusted_cost,
           nvl(sum(BK.salvage_value),0)     fully_rsv_salvage_value,
           nvl(sum(BK.recoverable_cost),0)  fully_rsv_recoverable_cost
    from   FA_BOOKS BK
    where  BK.GROUP_ASSET_ID = px_rule_in.asset_id
    and    BK.BOOK_TYPE_CODE = px_rule_in.book_type_code
    and    BK.PERIOD_COUNTER_FULLY_RESERVED <= p_period_counter
    and    BK.DATE_INEFFECTIVE is null;
Line: 571

    select nvl(sum(BK.adjusted_cost),0)     fully_rsv_adjusted_cost,
           nvl(sum(BK.salvage_value),0)     fully_rsv_salvage_value,
           nvl(sum(BK.recoverable_cost),0)  fully_rsv_recoverable_cost
    from   FA_MC_BOOKS BK
    where  BK.GROUP_ASSET_ID = px_rule_in.asset_id
    and    BK.BOOK_TYPE_CODE = px_rule_in.book_type_code
    and    BK.PERIOD_COUNTER_FULLY_RESERVED <= p_period_counter
    and    BK.DATE_INEFFECTIVE is null
    and    BK.set_of_books_id = px_rule_in.set_of_books_id ;
Line: 584

    select nvl(BK1.ADJUSTED_COST,0) - nvl(BK2.ADJUSTED_COST,0)
    from   FA_BOOKS BK1,
           FA_BOOKS BK2
    where  BK1.TRANSACTION_HEADER_ID_OUT = px_rule_in.member_transaction_header_id
    and    BK1.GROUP_ASSET_ID is not null
    and    BK2.TRANSACTION_HEADER_ID_IN = px_rule_in.member_transaction_header_id
    and    BK2.GROUP_ASSET_ID is not null;
Line: 595

    select nvl(BK1.ADJUSTED_COST,0) - nvl(BK2.ADJUSTED_COST,0)
    from   FA_MC_BOOKS BK1,
           FA_MC_BOOKS BK2
    where  BK1.TRANSACTION_HEADER_ID_OUT = px_rule_in.member_transaction_header_id
    and    BK1.GROUP_ASSET_ID is not null
    and    BK2.TRANSACTION_HEADER_ID_IN = px_rule_in.member_transaction_header_id
    and    BK2.GROUP_ASSET_ID is not null
    and    BK1.set_of_books_id = px_rule_in.set_of_books_id
    and    BK2.set_of_books_id = px_rule_in.set_of_books_id;
Line: 1028

        else -- period update

           px_rule_out.new_adjusted_cost :=px_rule_in.old_adjusted_cost;
Line: 1347

    select nvl(sum(DECODE(ADJ.ADJUSTMENT_TYPE,
                           'RESERVE',
                           decode(adj.debit_credit_flag,
                           'DR',adj.adjustment_amount,
                           'CR',-adj.adjustment_amount))),0) current_period_reserve
    from   fa_adjustments adj
    where  adj.asset_id = px_rule_in.asset_id
    and    adj.book_type_code = px_rule_in.book_type_code
    and    adj.period_counter_created = px_rule_in.period_counter
    ;
Line: 1359

    select nvl(sum(DECODE(ADJ.ADJUSTMENT_TYPE,
                           'RESERVE',
                           decode(adj.debit_credit_flag,
                           'DR',adj.adjustment_amount,
                           'CR',-adj.adjustment_amount))),0) current_period_reserve
    from   fa_mc_adjustments adj
    where  adj.asset_id = px_rule_in.asset_id
    and    adj.book_type_code = px_rule_in.book_type_code
    and    adj.period_counter_created = px_rule_in.period_counter
    and    adj.set_of_books_id = px_rule_in.set_of_books_id;
Line: 1372

    select nvl(sum(DECODE(ADJ.ADJUSTMENT_TYPE,
                           'RESERVE',
                          decode(adj.debit_credit_flag,
                           'DR',adj.adjustment_amount,
                           'CR',-adj.adjustment_amount))),0) current_period_reserve
    from   fa_adjustments adj,
           fa_transaction_headers th1,
           fa_transaction_headers th2
    where  adj.asset_id = px_rule_in.asset_id
    and    adj.book_type_code = px_rule_in.book_type_code
    and    adj.period_counter_created = px_rule_in.period_counter
    and    adj.transaction_header_id = th1.transaction_header_id
    and    th1.member_transaction_header_id (+) = th2.transaction_header_id
    and    (th1.transaction_type_code <>'GROUP ADJUSTMENT'
            and th1.trx_reference_id is null)
    and    exists (select th2.asset_id
                   from FA_BOOKS bk
                   where th2.asset_id = bk.asset_id
                   and    bk.book_type_code = px_rule_in.book_type_code
                   and    bk.group_asset_id= px_rule_in.asset_id
                   and    bk.date_ineffective is null);
Line: 1395

    select nvl(sum(DECODE(ADJ.ADJUSTMENT_TYPE,
                           'RESERVE',
                           decode(adj.debit_credit_flag,
                           'DR',adj.adjustment_amount,
                           'CR',-adj.adjustment_amount))),0) current_period_reserve
    from   fa_mc_adjustments adj,
           fa_transaction_headers th1,
           fa_transaction_headers th2
    where  adj.asset_id = px_rule_in.asset_id
    and    adj.book_type_code = px_rule_in.book_type_code
    and    adj.period_counter_created = px_rule_in.period_counter
    and    adj.transaction_header_id = th1.transaction_header_id
    and    adj.set_of_books_id = px_rule_in.set_of_books_id
    and    th1.member_transaction_header_id (+) = th2.transaction_header_id
    and    (th1.transaction_type_code <>'GROUP ADJUSTMENT'
            and th1.trx_reference_id is null)
    and    exists (select th2.asset_id
                   from   FA_MC_BOOKS bk
                   where th2.asset_id = bk.asset_id
                    and  bk.book_type_code = px_rule_in.book_type_code
                    and  bk.group_asset_id= px_rule_in.asset_id
                    and  bk.date_ineffective is null
                    and  bk.set_of_books_id = px_rule_in.set_of_books_id);
Line: 1421

    select nvl(sum(DECODE(ADJ.ADJUSTMENT_TYPE,
                           'EXPENSE',
                           decode(adj.debit_credit_flag,
                           'DR',adj.adjustment_amount,
                           'CR',-adj.adjustment_amount))),0) current_period_expense
    from   fa_adjustments         adj,
           fa_transaction_headers th,
           fa_deprn_periods       dp
    where  adj.asset_id = px_rule_in.asset_id
    and    adj.book_type_code = px_rule_in.book_type_code
    and    dp.book_type_code = px_rule_in.book_type_code
    and    adj.transaction_header_id = th.transaction_header_id
    and    th.transaction_date_entered
               between dp.calendar_period_open_date and dp.calendar_period_close_date
    and    dp.period_counter = px_rule_in.period_counter
    ;
Line: 1439

    select nvl(sum(DECODE(ADJ.ADJUSTMENT_TYPE,
                           'EXPENSE',
                           decode(adj.debit_credit_flag,
                           'DR',adj.adjustment_amount,
                           'CR',-adj.adjustment_amount))),0) current_period_expense
    from   fa_mc_adjustments         adj,
           fa_transaction_headers       th,
           fa_mc_deprn_periods       dp
    where  adj.asset_id = px_rule_in.asset_id
    and    adj.book_type_code = px_rule_in.book_type_code
    and    dp.book_type_code = px_rule_in.book_type_code
    and    adj.transaction_header_id = th.transaction_header_id
    and    adj.set_of_books_id = px_rule_in.set_of_books_id
    and    th.transaction_date_entered
               between dp.calendar_period_open_date and dp.calendar_period_close_date
    and    dp.period_counter = px_rule_in.period_counter
    and    dp.set_of_books_id = px_rule_in.set_of_books_id;
Line: 1677

                         element=>'updated eop_salvage_value',
                         value=> px_rule_in.eop_salvage_value, p_log_level_rec => p_log_level_rec);
Line: 1777

    select nvl(sum(RET.EOFY_RESERVE),0)
    from   FA_RETIREMENTS         RET,
           FA_TRANSACTION_HEADERS TH,
           FA_DEPRN_PERIODS       DP,
           FA_FISCAL_YEAR         FY,
           FA_BOOK_CONTROLS       BC
    where  RET.ASSET_ID= px_rule_in.asset_id
    and    RET.BOOK_TYPE_CODE = px_rule_in.book_type_code
    and    DP.BOOK_TYPE_CODE  = px_rule_in.book_type_code
    and    BC.BOOK_TYPE_CODE  = px_rule_in.book_type_code
    and    RET.TRANSACTION_HEADER_ID_IN = TH.TRANSACTION_HEADER_ID
    and    BC.FISCAL_YEAR_NAME = FY.FISCAL_YEAR_NAME
    and    FY.FISCAL_YEAR = px_rule_in.fiscal_year
    and    DP.PERIOD_COUNTER = px_rule_in.period_counter
    and    TH.TRANSACTION_DATE_ENTERED between
              FY.START_DATE and DP.CALENDAR_PERIOD_CLOSE_DATE
    and    RET.STATUS in ('PROCESSED','PENDING')
  ;
Line: 1797

    select nvl(sum(RET.EOFY_RESERVE),0)
    from   FA_MC_RETIREMENTS   RET,
           FA_TRANSACTION_HEADERS TH,
           FA_MC_DEPRN_PERIODS DP,
           FA_FISCAL_YEAR         FY,
           FA_MC_BOOK_CONTROLS    MBC,
           FA_BOOK_CONTROLS    BC
    where  RET.ASSET_ID= px_rule_in.asset_id
    and    RET.BOOK_TYPE_CODE = px_rule_in.book_type_code
    and    RET.SET_OF_BOOKS_ID = px_rule_in.set_of_books_id
    and    DP.BOOK_TYPE_CODE  = px_rule_in.book_type_code
    and    DP.SET_OF_BOOKS_ID = px_rule_in.set_of_books_id
    and    BC.BOOK_TYPE_CODE  = px_rule_in.book_type_code
    and    MBC.BOOK_TYPE_CODE  = px_rule_in.book_type_code
    and    MBC.SET_OF_BOOKS_ID = px_rule_in.set_of_books_id
    and    RET.TRANSACTION_HEADER_ID_IN = TH.TRANSACTION_HEADER_ID
    and    BC.FISCAL_YEAR_NAME = FY.FISCAL_YEAR_NAME
    and    FY.FISCAL_YEAR = px_rule_in.fiscal_year
    and    DP.PERIOD_COUNTER = px_rule_in.period_counter
    and    TH.TRANSACTION_DATE_ENTERED between
              FY.START_DATE and DP.CALENDAR_PERIOD_CLOSE_DATE
    and    RET.STATUS in ('PROCESSED','PENDING')
  ;
Line: 1822

    select nvl(sum(RET.EOFY_RESERVE),0)
    from   FA_RETIREMENTS         RET,
           FA_TRANSACTION_HEADERS TH,
           FA_DEPRN_PERIODS       DP,
           FA_FISCAL_YEAR         FY,
           FA_BOOK_CONTROLS       BC
    where  TH.ASSET_ID= px_rule_in.asset_id
    and    TH.BOOK_TYPE_CODE  = px_rule_in.book_type_code
    and    DP.BOOK_TYPE_CODE  = px_rule_in.book_type_code
    and    BC.BOOK_TYPE_CODE  = px_rule_in.book_type_code
    and    RET.TRANSACTION_HEADER_ID_IN = TH.MEMBER_TRANSACTION_HEADER_ID (+)
    and    BC.FISCAL_YEAR_NAME = FY.FISCAL_YEAR_NAME
    and    FY.FISCAL_YEAR = px_rule_in.fiscal_year
    and    DP.PERIOD_COUNTER = px_rule_in.period_counter
    and    TH.TRANSACTION_DATE_ENTERED between
              FY.START_DATE and DP.CALENDAR_PERIOD_CLOSE_DATE
    and    RET.STATUS in ('PROCESSED','PENDING')
    and    exists (select RET.ASSET_ID
                   from FA_BOOKS BK
                   where RET.ASSET_ID = BK.ASSET_ID
                     and BK.BOOK_TYPE_CODE = px_rule_in.book_type_code
                     and    BK.GROUP_ASSET_ID = px_rule_in.asset_id
                     and    BK.DATE_INEFFECTIVE is null)
         ;
Line: 1848

    select nvl(sum(RET.EOFY_RESERVE),0)
    from   FA_MC_RETIREMENTS   RET,
           FA_TRANSACTION_HEADERS TH,
           FA_MC_DEPRN_PERIODS DP,
           FA_FISCAL_YEAR         FY,
           FA_MC_BOOK_CONTROLS  MBC,
           FA_BOOK_CONTROLS     BC
    where  TH.ASSET_ID= px_rule_in.asset_id
    and    TH.BOOK_TYPE_CODE  = px_rule_in.book_type_code
    and    DP.BOOK_TYPE_CODE  = px_rule_in.book_type_code
    and    DP.SET_OF_BOOKS_ID = px_rule_in.set_of_books_id
    and    BC.BOOK_TYPE_CODE  = px_rule_in.book_type_code
    and    MBC.BOOK_TYPE_CODE  = px_rule_in.book_type_code
    and    MBC.SET_OF_BOOKS_ID = px_rule_in.set_of_books_id
    and    RET.TRANSACTION_HEADER_ID_IN = TH.MEMBER_TRANSACTION_HEADER_ID (+)
    and    RET.SET_OF_BOOKS_ID = px_rule_in.set_of_books_id
    and    BC.FISCAL_YEAR_NAME = FY.FISCAL_YEAR_NAME
    and    FY.FISCAL_YEAR = px_rule_in.fiscal_year
    and    DP.PERIOD_COUNTER = px_rule_in.period_counter
    and    TH.TRANSACTION_DATE_ENTERED between
              FY.START_DATE and DP.CALENDAR_PERIOD_CLOSE_DATE
    and    RET.STATUS in ('PROCESSED','PENDING')
    and    exists (select RET.ASSET_ID
                   from FA_MC_BOOKS BK
                   where RET.ASSET_ID = BK.ASSET_ID
                     and BK.BOOK_TYPE_CODE = px_rule_in.book_type_code
                     and BK.GROUP_ASSET_ID = px_rule_in.asset_id
                     and BK.DATE_INEFFECTIVE is null
                     and BK.SET_OF_BOOKS_ID = px_rule_in.set_of_books_id)
  ;
Line: 1881

    select nvl(sum(RET.EOFY_RESERVE),0)
    from   FA_RETIREMENTS         RET
    where  RET.TRANSACTION_HEADER_ID_IN = px_rule_in.adj_mem_transaction_header_id
    ;
Line: 1887

    select nvl(sum(RET.EOFY_RESERVE),0)
    from   FA_MC_RETIREMENTS   RET
    where  RET.TRANSACTION_HEADER_ID_IN = px_rule_in.adj_mem_transaction_header_id
    and    RET.SET_OF_BOOKS_ID = px_rule_in.set_of_books_id
    ;
Line: 2123

                         element=>'updated eop_salvage_value',
                         value=> px_rule_in.eofy_salvage_value, p_log_level_rec => p_log_level_rec);
Line: 2212

  select EXCLUDE_PROCEEDS_FROM_BASIS,
         MEMBER_ROLLUP_FLAG
  from   FA_BOOKS
  where  ASSET_ID = p_asset_id
  and    BOOK_TYPE_CODE = px_rule_in.book_type_code
  and    date_ineffective is null;
Line: 2222

  select EXCLUDE_PROCEEDS_FROM_BASIS,
         MEMBER_ROLLUP_FLAG
  from   FA_MC_BOOKS
  where  ASSET_ID = p_asset_id
  and    BOOK_TYPE_CODE = px_rule_in.book_type_code
  and    date_ineffective is null
  and    SET_OF_BOOKS_ID = px_rule_in.set_of_books_id ;
Line: 2233

  select sum(nvl(EOFY_RESERVE,0))
  from   FA_BOOKS
  where  GROUP_ASSET_ID = px_rule_in.asset_id
  and    BOOK_TYPE_CODE = px_rule_in.book_type_code
  and    DATE_INEFFECTIVE is null;
Line: 2242

  select sum(nvl(EOFY_RESERVE,0))
  from   FA_MC_BOOKS
  where  GROUP_ASSET_ID = px_rule_in.asset_id
  and    BOOK_TYPE_CODE = px_rule_in.book_type_code
  and    DATE_INEFFECTIVE is null
  and    SET_OF_BOOKS_ID = px_rule_in.set_of_books_id;
Line: 2251

  select (bk.adjusted_cost-bk.recoverable_cost) adj_cost_diff, th.amortization_start_date,th.transaction_header_id
  from   fa_books bk, fa_transaction_headers th
  where  bk.asset_id = th.asset_id
  and    bk.book_type_code = px_rule_in.book_type_code
  and    bk.asset_id = px_rule_in.asset_id
  and    th.transaction_header_id = bk.transaction_header_id_in
  and    th.transaction_key = 'BA'
  order by th.transaction_header_id desc;
Line: 2261

  select (bk.adjusted_cost-bk.recoverable_cost) adj_cost_diff, th.amortization_start_date,th.transaction_header_id
  from   fa_mc_books bk, fa_transaction_headers th
  where  bk.asset_id = th.asset_id
  and    bk.book_type_code = px_rule_in.book_type_code
  and    bk.asset_id = px_rule_in.asset_id
  and    th.transaction_header_id = bk.transaction_header_id_in
  and    th.transaction_key = 'BA'
  and    bk.set_of_books_id = px_rule_in.set_of_books_id
  order by th.transaction_header_id desc;
Line: 2273

  select min(amortization_start_date)
  from   fa_transaction_headers th
  where  th.book_type_code = px_rule_in.book_type_code
  and    th.asset_id = px_rule_in.asset_id
  and    th.transaction_header_id > p_adjcost_thid
  and    nvl(th.transaction_key,'zz') <> 'BA';
Line: 2928

    select nvl(sum(decode(adj.debit_credit_flag,
                           'DR',adj.adjustment_amount,
                           'CR',-adj.adjustment_amount)),0) beginning_period_expense
    from   fa_adjustments adj
    where  adj.asset_id = px_rule_in.asset_id
    and    adj.book_type_code = px_rule_in.book_type_code
    and    adj.period_counter_created = px_rule_in.period_counter
    and    adj.source_type_code ='DEPRECIATION'
    and    adj.adjustment_type ='EXPENSE';
Line: 2939

    select nvl(sum(decode(adj.debit_credit_flag,
                           'DR',adj.adjustment_amount,
                           'CR',-adj.adjustment_amount)),0) beginning_period_expense
    from   fa_mc_adjustments adj
    where  adj.asset_id = px_rule_in.asset_id
    and    adj.book_type_code = px_rule_in.book_type_code
    and    adj.period_counter_created = px_rule_in.period_counter
    and    adj.source_type_code ='DEPRECIATION'
    and    adj.adjustment_type ='EXPENSE'
    and    adj.set_of_books_id = px_rule_in.set_of_books_id ;
Line: 3037

                             element=>'updated eop_salvage_value',
                             value=> px_rule_in.eop_salvage_value, p_log_level_rec => p_log_level_rec);