DBA Data[Home] [Help]

APPS.FA_WHATIF_DEPRN2_PKG SQL Statements

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

Line: 78

    select 'GL_CODE_COMBINATIONS' , c.table_id, g.application_column_name,
g.segment_num,	s.concatenated_segment_delimiter
    from fnd_columns c, fnd_id_flex_segments g, fnd_id_flex_structures s
    where g.application_id = 101
	  and g.id_flex_code = 'GL#'
	  and g.id_flex_num = (
		  select accounting_flex_structure
		  from fa_book_controls where book_type_code = X_book)
	  and g.enabled_flag = 'Y'
	  and c.application_id = g.application_id
	  and c.table_id = (select table_id
			    from fnd_tables
			    where table_name = 'GL_CODE_COMBINATIONS'
			    and application_id = 101)
	  and c.column_name = g.application_column_name
	  and s.application_id = g.application_id
       	  and s.id_flex_code = g.id_flex_code
          and s.id_flex_num = g.id_flex_num
    union -- asset key
    select 'FA_ASSET_KEYWORDS', c.table_id,g.application_column_name, g.segment_num, s.concatenated_segment_delimiter
    from fnd_columns c, fnd_id_flex_segments g, fnd_id_flex_structures s
    where g.application_id = 140
	  and g.id_flex_code = 'KEY#'
	  and g.id_flex_num = ( select asset_key_flex_structure
				from fa_system_controls)
	  and g.enabled_flag = 'Y'
	  and c.application_id = 140
	  and c.table_id = (select table_id
			    from fnd_tables
			    where table_name = 'FA_ASSET_KEYWORDS'
			    and application_id = 140)
	  and c.column_name = g.application_column_name
	  and s.application_id = g.application_id
       	  and s.id_flex_code = g.id_flex_code
          and s.id_flex_num = g.id_flex_num
     union -- location
     select 'FA_LOCATIONS', c.table_id, g.application_column_name, g.segment_num, s.concatenated_segment_delimiter
    from fnd_columns c, fnd_id_flex_segments g, fnd_id_flex_structures s
     where g.application_id = 140
	  and g.id_flex_code = 'LOC#'
	  and g.id_flex_num =  ( select location_flex_structure
				 from fa_system_controls)
	  and g.enabled_flag = 'Y'
	  and c.application_id = 140
	  and c.table_id = (select table_id
			    from fnd_tables
			    where table_name = 'FA_LOCATIONS'
			    and application_id = 140)
	  AND c.column_name = g.application_column_name
	  and s.application_id = g.application_id
       	  and s.id_flex_code = g.id_flex_code
          and s.id_flex_num = g.id_flex_num
     union -- category
     select 'FA_CATEGORIES_B', c.table_id, g.application_column_name, g.segment_num, s.concatenated_segment_delimiter
    from fnd_columns c, fnd_id_flex_segments g, fnd_id_flex_structures s
     where g.application_id = 140
	  and g.id_flex_code = 'CAT#'
	  and g.id_flex_num =   (select category_flex_structure
				 from fa_system_controls)
	  and g.enabled_flag = 'Y'
	  and c.application_id = 140
	  and c.table_id = (select table_id
			    from fnd_tables
			    where table_name = 'FA_CATEGORIES_B'
			    and application_id = 140)
	  and c.column_name = g.application_column_name
	  and s.application_id = g.application_id
       	  and s.id_flex_code = g.id_flex_code
          and s.id_flex_num = g.id_flex_num
	ORDER BY 1, 4;
Line: 152

	  select to_char(fb.date_placed_in_service) dtin_srv,fb.book_type_code,
		  fb.asset_id,fb.deprn_method_code,fb.adjusted_cost,fb.cost,fb.life_in_months,fb.rate_in_use,
		  fb.allowed_deprn_limit_amount
      from fa_books fb,
           fa_methods fam
      where fb.deprn_method_code = fam.method_code
        and NVL(fam.guarantee_rate_method_flag,'NO') = 'YES'
	and fb.date_ineffective is null
	and period_counter_fully_reserved is null
	and fb.book_type_code = x_book_type
	and fb.asset_id = x_asset_id;
Line: 166

	  select fb.book_type_code,
		  fb.asset_id
          from fa_books fb
          where fb.date_ineffective is null
          and fb.book_type_code = x_book_type
	  and fb.asset_id = x_asset_id
	  AND   FB.deprn_method_code <> 'JP-STL-EXTND'
          AND   FB.allowed_deprn_limit_amount > 1;
Line: 184

  fa_whatif_deprn_pkg.t_request_id.delete;
Line: 185

  fa_whatif_deprn_pkg.t_book_type_code.delete;
Line: 186

  fa_whatif_deprn_pkg.t_asset_id.delete;
Line: 187

  fa_whatif_deprn_pkg.t_asset_number.delete;
Line: 188

  fa_whatif_deprn_pkg.t_description.delete;
Line: 189

  fa_whatif_deprn_pkg.t_tag_number.delete;
Line: 190

  fa_whatif_deprn_pkg.t_serial_number.delete;
Line: 191

  fa_whatif_deprn_pkg.t_period_name.delete;
Line: 192

  fa_whatif_deprn_pkg.t_fiscal_year.delete;
Line: 193

  fa_whatif_deprn_pkg.t_expense_acct.delete;
Line: 194

  fa_whatif_deprn_pkg.t_location.delete;
Line: 195

  fa_whatif_deprn_pkg.t_units.delete;
Line: 196

  fa_whatif_deprn_pkg.t_employee_name.delete;
Line: 197

  fa_whatif_deprn_pkg.t_employee_number.delete;
Line: 198

  fa_whatif_deprn_pkg.t_asset_key.delete;
Line: 199

  fa_whatif_deprn_pkg.t_current_cost.delete;
Line: 200

  fa_whatif_deprn_pkg.t_current_prorate_conv.delete;
Line: 201

  fa_whatif_deprn_pkg.t_current_method.delete;
Line: 202

  fa_whatif_deprn_pkg.t_current_life.delete;
Line: 203

  fa_whatif_deprn_pkg.t_current_basic_rate.delete;
Line: 204

  fa_whatif_deprn_pkg.t_current_adjusted_rate.delete;
Line: 205

  fa_whatif_deprn_pkg.t_current_salvage_value.delete;
Line: 206

  fa_whatif_deprn_pkg.t_depreciation.delete;
Line: 207

  fa_whatif_deprn_pkg.t_new_depreciation.delete;
Line: 208

  fa_whatif_deprn_pkg.t_created_by.delete;
Line: 209

  fa_whatif_deprn_pkg.t_creation_date.delete;
Line: 210

  fa_whatif_deprn_pkg.t_last_update_date.delete;
Line: 211

  fa_whatif_deprn_pkg.t_last_updated_by.delete;
Line: 212

  fa_whatif_deprn_pkg.t_last_update_login.delete;
Line: 213

  fa_whatif_deprn_pkg.t_date_placed_in_service.delete;
Line: 214

  fa_whatif_deprn_pkg.t_category.delete;
Line: 215

  fa_whatif_deprn_pkg.t_accumulated_deprn.delete;
Line: 216

  fa_whatif_deprn_pkg.t_bonus_depreciation.delete;
Line: 217

  fa_whatif_deprn_pkg.t_new_bonus_depreciation.delete;
Line: 218

  fa_whatif_deprn_pkg.t_current_bonus_rule.delete;
Line: 219

  fa_whatif_deprn_pkg.t_period_num.delete;
Line: 220

  fa_whatif_deprn_pkg.t_currency_code.delete;
Line: 230

    select amortize_flag into h_check from fa_book_controls
    where book_type_code = X_book;
Line: 250

  select location_flex_structure, category_flex_structure,
	asset_key_flex_structure
  into h_loc_struct, h_cat_struct, h_key_struct
  from fa_system_controls;
Line: 257

  select accounting_flex_structure into h_acct_struct
  from fa_book_controls where book_type_code = X_book;
Line: 263

  select cur.precision into h_precision
  from fa_book_controls bc, gl_sets_of_books sob, fnd_currencies cur
  where bc.book_type_code = X_book
  --and sob.set_of_books_id = bc.set_of_books_id
  and sob.set_of_books_id = FARX_C_WD.sob_id -- Enhancement bug 3037321
  and sob.currency_code = cur.currency_code;
Line: 271

    select fcr.last_update_login into h_login_id
    from fnd_concurrent_requests fcr
    where fcr.request_id = X_request_id;
Line: 298

	       fa_rx_shared_pkg.g_seg_table.delete;
Line: 384

	fa_whatif_deprn_pkg.g_deprn.delete;
Line: 445

         fa_whatif_deprn_pkg.g_deprn.delete;
Line: 460

    ret := fa_whatif_deprn_pkg.whatif_insert_itf (
	X_asset_id => X_assets(h_count),
	X_book	=> X_book,
	X_request_id => X_request_id,
	X_num_pers => X_num_per,
	X_acct_struct => h_acct_struct,
	X_key_struct => h_key_struct,
	X_cat_struct => h_cat_struct,
	X_loc_struct => h_loc_struct,
	X_precision =>  h_precision,
	X_user_id => X_user_id,
	X_login_id  =>  h_login_id,
        X_last_asset => (h_count = (X_num_assets - 1)),
	x_return_status => x_return_status);
Line: 479

	fa_whatif_deprn_pkg.g_deprn.delete;
Line: 584

	fa_whatif_deprn_pkg.g_deprn.delete;
Line: 593

        select r.basic_rate
        into   h_basic_rate
        from   fa_methods m, fa_flat_rates r
        where  m.method_code = X_method
        and    m.method_id = r.method_id
        and    r.adjusted_rate = X_adjusted_rate and rownum < 2;
Line: 603

      select currency_code
      into h_currency
      from gl_sets_of_books
      where set_of_books_id = FARX_C_WD.sob_id;
Line: 621

	-- insert the Currency_code - for Enhancement bug 3037321
      insert into fa_whatif_itf (
        request_id, asset_id, asset_number, description, tag_number,
        serial_number, period_name, fiscal_year, expense_acct,
        depreciation, new_depreciation, location, units, employee_name,
        employee_number, asset_key,
        current_cost, current_prorate_conv, current_method, current_life,
        current_basic_rate, current_adjusted_rate, current_salvage_value,
	bonus_depreciation, new_bonus_depreciation,
        created_by, creation_date, last_update_date,
        last_updated_by, last_update_login,category,date_placed_in_service,
        accumulated_deprn,currency_code
        ) values (
        X_request_id, NULL, NULL, NULL, NULL, NULL,
        fa_whatif_deprn_pkg.g_deprn(h_count).period_name,
        fa_whatif_deprn_pkg.g_deprn(h_count).fiscal_year, NULL,
        fa_whatif_deprn_pkg.g_deprn(h_count).deprn,
	fa_whatif_deprn_pkg.g_deprn(h_count).new_deprn,
        NULL, NULL, NULL, NULL,
        NULL, X_cost, X_prorate_conv, X_method,
        X_life, h_basic_rate, X_adjusted_rate, h_sal,
	fa_whatif_deprn_pkg.g_deprn(h_count).bonus_deprn,
	fa_whatif_deprn_pkg.g_deprn(h_count).new_bonus_deprn,
        X_user_id, sysdate, sysdate, X_user_id, h_login_id,
        h_concat_str, X_dpis,
	fa_whatif_deprn_pkg.g_deprn(h_count).new_rsv,h_currency);
Line: 653

  fa_whatif_deprn_pkg.g_deprn.delete;
Line: 664

	fa_whatif_deprn_pkg.g_deprn.delete;
Line: 708

  select bk.asset_id, bk.deprn_method_code, ad.asset_number
  from fa_books bk, fa_additions ad, fa_methods mt
  where ad.asset_category_id = nvl(X_category_id,ad.asset_category_id)
  and ad.description like nvl(X_description,ad.description)
  and ad.asset_number >= nvl(X_begin_asset,ad.asset_number)
  and ad.asset_number <= nvl(X_end_asset,ad.asset_number)
  and ad.asset_type in ('CAPITALIZED', 'GROUP')
  and bk.asset_id = ad.asset_id
  and mt.method_code = bk.deprn_method_code
  and nvl(mt.life_in_months,-99) = nvl(bk.life_in_months,-99)
  and bk.asset_id >= nvl(X_start_range,bk.asset_id)
  and bk.asset_id <= nvl(X_end_range,bk.asset_id)
  and bk.book_type_code = X_book
  and mt.rate_source_rule <> 'PRODUCTION'
  and bk.depreciate_flag = 'YES'
  and bk.transaction_header_id_out is null
  and bk.period_counter_fully_retired is null
  and bk.date_placed_in_service >=
	nvl(X_begin_dpis,bk.date_placed_in_service)
  and bk.date_placed_in_service <=
	nvl(X_end_dpis,bk.date_placed_in_service)
  and nvl(BK.Period_Counter_Fully_Reserved, -1)
	= decode(X_rsv_flag, 'YES',
		nvl(BK.Period_Counter_Fully_Reserved, -1),-1)
  and bk.group_asset_id is null;
Line: 736

    select 1
    from   fa_transaction_headers
    where  asset_id = c_asset_id
    and    book_type_code = c_book_type_code
    and    transaction_subtype = 'AMORTIZED';
Line: 801

       select count(*) into h_check
       from fa_deprn_detail
       where asset_id = h_asset_id
       and book_type_code = X_book
       and deprn_source_code = 'B'
       and not exists (select 1
                       from fa_deprn_detail dd1
                       where asset_id = h_asset_id
                       and book_type_code = X_book
                       and deprn_source_code = 'D'
                       and deprn_amount <> 0 );  -- bugfix 2223451 commented  deprn_amount > 0;