DBA Data[Home] [Help]

APPS.FA_INS_ADJUST_PKG SQL Statements

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

Line: 53

         SELECT asset_category_id
           INTO h_cat_id
           FROM fa_additions_b
          WHERE asset_id=h_asset_id;
Line: 285

   SELECT cost
     INTO h_cost
     FROM FA_BOOKS
    WHERE asset_id = h_asset_id
      AND book_type_code = h_book
      AND date_ineffective is null;
Line: 314

                 X_last_update_date  date default sysdate,
                 X_last_updated_by   number default -1,
                 X_last_update_login number default -1,
                 p_log_level_rec  in fa_api_types.log_level_rec_type
) return boolean is

   h_max_cache_rows    number :=  FA_ADJUST_TYPE_PKG.MAX_ADJ_CACHE_ROWS;
Line: 321

   h_last_updated_by   number;
Line: 322

   h_last_update_login number;
Line: 331

   h_last_updated_by   := X_last_updated_by;
Line: 332

   h_last_update_login := X_last_update_login;
Line: 346

         h_mesg_name := 'FA_INS_ADJ_CANT_INSERT';
Line: 357

               INSERT INTO FA_MC_ADJUSTMENTS
                      (set_of_books_id,
                       transaction_header_id,
                       asset_invoice_id,
                       source_type_code,
                       adjustment_type,
                       debit_credit_flag,
                       code_combination_id,
                       book_type_code,
                       period_counter_created,
                       asset_id,
                       adjustment_amount,
                       period_counter_adjusted,
                       distribution_id,
                       annualized_adjustment,
                       deprn_override_flag,
                       last_update_date,
                       last_updated_by,
                       last_update_login,
                       track_member_flag,
                       adjustment_line_id,
                       source_dest_code,
                       source_line_id,
                       converted_flag,
		       insertion_order)
               VALUES (adj_table(h_i).set_of_books_id,
                       adj_table(h_i).transaction_header_id,
                       adj_table(h_i).asset_invoice_id,
                       adj_table(h_i).source_type_code,
                       adj_table(h_i).adjustment_type,
                       adj_table(h_i).debit_credit_flag,
                       adj_table(h_i).code_combination_id,
                       adj_table(h_i).book_type_code,
                       adj_table(h_i).period_counter_created,
                       adj_table(h_i).asset_id,
                       adj_table(h_i).adjustment_amount,
                       adj_table(h_i).period_counter_adjusted,
                       adj_table(h_i).distribution_id,
                       adj_table(h_i).annualized_adjustment,
                       adj_table(h_i).deprn_override_flag,
                       adj_table(h_i).last_update_date,
                       h_last_updated_by,
                       h_last_update_login,
                       adj_table(h_i).track_member_flag,
                       fa_adjustments_s.nextval, --adjustment_line_id
                       adj_table(h_i).source_dest_code,
                       adj_table(h_i).source_line_id,
                       'C',
		       adj_table(h_i).insertion_order);
Line: 410

               INSERT INTO FA_ADJUSTMENTS
                      (transaction_header_id,
                       asset_invoice_id,
                       source_type_code,
                       adjustment_type,
                       debit_credit_flag,
                       code_combination_id,
                       book_type_code,
                       period_counter_created,
                       asset_id,
                       adjustment_amount,
                       period_counter_adjusted,
                       distribution_id,
                       annualized_adjustment,
                       deprn_override_flag,
                       last_update_date,
                       last_updated_by,
                       last_update_login,
                       track_member_flag,
                       adjustment_line_id,
                       source_dest_code,
                       source_line_id,
		       insertion_order)
               VALUES (adj_table(h_i).transaction_header_id,
                       adj_table(h_i).asset_invoice_id,
                       adj_table(h_i).source_type_code,
                       adj_table(h_i).adjustment_type,
                       adj_table(h_i).debit_credit_flag,
                       adj_table(h_i).code_combination_id,
                       adj_table(h_i).book_type_code,
                       adj_table(h_i).period_counter_created,
                       adj_table(h_i).asset_id,
                       adj_table(h_i).adjustment_amount,
                       adj_table(h_i).period_counter_adjusted,
                       adj_table(h_i).distribution_id,
                       adj_table(h_i).annualized_adjustment,
                       adj_table(h_i).deprn_override_flag,
                       adj_table(h_i).last_update_date,
                       h_last_updated_by,
                       h_last_update_login,
                       adj_table(h_i).track_member_flag,
                       fa_adjustments_s.nextval, --adjustment_line_id
                       adj_table(h_i).source_dest_code,
                       adj_table(h_i).source_line_id,
		       adj_table(h_i).insertion_order);
Line: 526

      adj_table(h_cache_index).last_update_date :=
               adj_ptr.last_update_date;
Line: 534

      adj_table(h_cache_index).insertion_order :=
               adj_ptr.insertion_order;
Line: 591

      h_mesg_name := 'FA_INS_ADJ_CANT_INSERT';
Line: 595

                   element => 'Rows in CACHE-INSERT IN TRUE',
                   value   => h_num_rows,
                   p_log_level_rec => p_log_level_rec);
Line: 608

            INSERT INTO FA_MC_ADJUSTMENTS
                   (set_of_books_id,
                    transaction_header_id,
                    asset_invoice_id,
                    source_type_code,
                    adjustment_type,
                    debit_credit_flag,
                    code_combination_id,
                    book_type_code,
                    period_counter_created,
                    asset_id,
                    adjustment_amount,
                    period_counter_adjusted,
                    distribution_id,
                    annualized_adjustment,
                    deprn_override_flag,
                    last_update_date,
                    last_updated_by,
                    last_update_login,
                    track_member_flag,
                    adjustment_line_id,
                    source_dest_code,
                    source_line_id,
                    converted_flag,
		    insertion_order)
            VALUES (adj_table(h_i).set_of_books_id,
                    adj_table(h_i).transaction_header_id,
                    adj_table(h_i).asset_invoice_id,
                    adj_table(h_i).source_type_code,
                    adj_table(h_i).adjustment_type,
                    adj_table(h_i).debit_credit_flag,
                    adj_table(h_i).code_combination_id,
                    adj_table(h_i).book_type_code,
                    adj_table(h_i).period_counter_created,
                    adj_table(h_i).asset_id,
                    adj_table(h_i).adjustment_amount,
                    adj_table(h_i).period_counter_adjusted,
                    adj_table(h_i).distribution_id,
                    adj_table(h_i).annualized_adjustment,
                    adj_table(h_i).deprn_override_flag,
                    adj_table(h_i).last_update_date,
                    h_last_updated_by,
                    h_last_update_login,
                    adj_table(h_i).track_member_flag,
                    fa_adjustments_s.nextval, -- adjustment_line_id,
                    adj_table(h_i).source_dest_code,
                    adj_table(h_i).source_line_id,
                    'C',
		    adj_table(h_i).insertion_order);
Line: 661

            INSERT INTO FA_ADJUSTMENTS
                   (transaction_header_id,
                    asset_invoice_id,
                    source_type_code,
                    adjustment_type,
                    debit_credit_flag,
                    code_combination_id,
                    book_type_code,
                    period_counter_created,
                    asset_id,
                    adjustment_amount,
                    period_counter_adjusted,
                    distribution_id,
                    annualized_adjustment,
                    deprn_override_flag,
                    last_update_date,
                    last_updated_by,
                    last_update_login,
                    track_member_flag,
                    adjustment_line_id,
                    source_dest_code,
                    source_line_id,
		    insertion_order)
            VALUES (adj_table(h_i).transaction_header_id,
                    adj_table(h_i).asset_invoice_id,
                    adj_table(h_i).source_type_code,
                    adj_table(h_i).adjustment_type,
                    adj_table(h_i).debit_credit_flag,
                    adj_table(h_i).code_combination_id,
                    adj_table(h_i).book_type_code,
                    adj_table(h_i).period_counter_created,
                    adj_table(h_i).asset_id,
                    adj_table(h_i).adjustment_amount,
                    adj_table(h_i).period_counter_adjusted,
                    adj_table(h_i).distribution_id,
                    adj_table(h_i).annualized_adjustment,
                    adj_table(h_i).deprn_override_flag,
                    adj_table(h_i).last_update_date,
                    h_last_updated_by,
                    h_last_update_login,
                    adj_table(h_i).track_member_flag,
                    fa_adjustments_s.nextval, -- adjustment_line_id,
                    adj_table(h_i).source_dest_code,
                    adj_table(h_i).source_line_id,
		    adj_table(h_i).insertion_order);
Line: 735

FUNCTION fadoact(X_last_update_date  date   default sysdate,
                 X_last_updated_by   number default -1,
                 X_last_update_login number default -1,
                 p_log_level_rec  in fa_api_types.log_level_rec_type)
         return boolean is

   h_dist_book          varchar2(30);
Line: 753

   h_amount_to_insert   number :=0;
Line: 772

 SELECT DISTRIBUTION_ID,
        CODE_COMBINATION_ID,
        UNITS_ASSIGNED
   FROM FA_DISTRIBUTION_HISTORY
  WHERE ASSET_ID = h_asset_id
    AND BOOK_TYPE_CODE = h_dist_book
    AND (
          (adj_ptr.selection_mode <> FA_ADJUST_TYPE_PKG.FA_AJ_ACTIVE_PARTIAL
           AND date_ineffective is null
          )
          OR
          (adj_ptr.selection_mode = FA_ADJUST_TYPE_PKG.FA_AJ_ACTIVE_PARTIAL
           AND transaction_header_id_in=adj_ptr.selection_thid
          )
        )
  ORDER BY DISTRIBUTION_ID;
Line: 814

              X_last_update_date  => X_last_update_date,
              X_last_updated_by   => X_last_updated_by,
              X_last_update_login => X_last_update_login,
              p_log_level_rec     => p_log_level_rec)) then
      FA_SRVR_MSG.ADD_MESSAGE
           (CALLING_FN => 'FA_INS_ADJUST_PKG.fadoact',
            p_log_level_rec => p_log_level_rec);
Line: 853

         select nvl(sum(decode(debit_credit_flag,
	                       'DR', adjustment_amount,
 	                             adjustment_amount * -1)), 0)
 	   into h_tot_cost
 	   from FA_MC_ADJUSTMENTS
 	  where asset_id = adj_ptr.asset_id
 	    and book_type_code = adj_ptr.book_type_code
 	    and adjustment_type = 'COST'
	    and set_of_books_id = h_set_of_books_id
 	    and distribution_id in (select distribution_id from fa_distribution_history where asset_id  = adj_ptr.asset_id and book_type_code =  adj_ptr.book_type_code and date_ineffective is null);
Line: 864

 	  select PERIOD_COUNTER_FULLY_RESERVED,cost,group_asset_id
 	    into h_pd_fully_rsv,h_books_cost,h_group_asset_id
 	    from fa_mc_books
 	   where  asset_id = adj_ptr.asset_id
 	     and book_type_code = adj_ptr.book_type_code
	     and set_of_books_id = h_set_of_books_id
 	     and date_ineffective is null;
Line: 872

 	 select nvl(sum(decode(debit_credit_flag,
 	                       'DR', adjustment_amount,
 	                             adjustment_amount * -1)), 0),count(*)
 	   into h_tot_cost,h_adj_no_rows
 	   from fa_adjustments
 	  where asset_id = adj_ptr.asset_id
 	    and book_type_code = adj_ptr.book_type_code
 	    and adjustment_type = 'COST'
 	    and distribution_id in (select distribution_id from fa_distribution_history where asset_id  = adj_ptr.asset_id and book_type_code =  adj_ptr.book_type_code and date_ineffective is null);
Line: 882

 	 select PERIOD_COUNTER_FULLY_RESERVED, cost, group_asset_id
 	   into h_pd_fully_rsv,h_books_cost,h_group_asset_id
 	   from fa_books
 	  where  asset_id = adj_ptr.asset_id
 	    and book_type_code = adj_ptr.book_type_code
 	    and date_ineffective is null;
Line: 936

   if (adj_ptr.selection_mode <> FA_ADJUST_TYPE_PKG.FA_AJ_ACTIVE_PARTIAL) then

     SELECT COUNT(*)
       INTO h_distribution_lines
       FROM FA_DISTRIBUTION_HISTORY
      WHERE ASSET_ID=h_asset_id
        AND book_type_code=h_dist_book
        AND DATE_INEFFECTIVE IS NULL;
Line: 948

     SELECT COUNT(*)
       INTO h_distribution_lines
       FROM FA_DISTRIBUTION_HISTORY
      WHERE ASSET_ID=h_asset_id
        AND book_type_code=h_dist_book
        AND transaction_header_id_in=adj_ptr.selection_thid;
Line: 1033

                         select count(*)
                         into h_dd_count
                         from fa_deprn_detail_mrc_v
                         where asset_id = adj_ptr.asset_id
                             and book_type_code = adj_ptr.book_type_code
                             and deprn_source_code = 'D';
Line: 1040

                             select addition_cost_to_clear--, nvl(deprn_reserve,0)
                             into h_dpr_row.cost--, h_dpr_row.deprn_rsv
                             from fa_deprn_detail_mrc_v
                             where asset_id = adj_ptr.asset_id
                                 and book_type_code = adj_ptr.book_type_code
                                 and deprn_source_code = 'B'
                                 and distribution_id = h_distribution_id;
Line: 1050

                         select count(*)
                         into h_dd_count
                         from fa_deprn_detail
                         where asset_id = adj_ptr.asset_id
                             and book_type_code = adj_ptr.book_type_code
                             and deprn_source_code = 'D';
Line: 1057

                             select addition_cost_to_clear--, nvl(deprn_reserve,0)
                             into h_dpr_row.cost--, h_dpr_row.deprn_rsv
                             from fa_deprn_detail
                             where asset_id = adj_ptr.asset_id
                                 and book_type_code = adj_ptr.book_type_code
                                 and deprn_source_code = 'B'
                                 and distribution_id = h_distribution_id;
Line: 1097

                  h_amount_to_insert := (h_new_dist_rsv - h_dist_rsv) - h_adj_dd_amount ;
Line: 1099

	          h_amount_to_insert := (h_total_amount * (h_units_assigned/adj_ptr.current_units) ) - h_adj_dd_amount;
Line: 1102

                    FA_DEBUG_PKG.ADD (fname   => 'FA_INS_ADJUST_PKG.fadoact',element => '+++ h_amount_to_insert ',value   => h_amount_to_insert,p_log_level_rec => p_log_level_rec);
Line: 1109

             h_amount_to_insert := (h_total_amount * (h_units_assigned/adj_ptr.current_units) ) - h_adj_dd_amount;
Line: 1125

             and adj_ptr.selection_mode <> FA_ADJUST_TYPE_PKG.FA_AJ_ACTIVE_REVAL) then

             --DIST ALLOC
            if((adj_ptr.adjustment_type like '%RESERVE%') OR
              (adj_ptr.adjustment_type like '%EXPENSE%'))
              and (nvl(h_pd_fully_rsv,-1) = -1 )
                 then
                 h_amount_to_insert := h_total_amount - h_amount_so_far ;
Line: 1136

                     FA_DEBUG_PKG.ADD (fname   => 'FA_INS_ADJUST_PKG.fadoact',element => '+++ h_amount_to_insert ',value   => h_amount_to_insert,p_log_level_rec => p_log_level_rec);
Line: 1139

                h_amount_to_insert := h_total_amount - h_amount_so_far;
Line: 1173

                 h_amount_to_insert := (h_new_dist_rsv - h_dist_rsv) - h_adj_dd_amount ;
Line: 1175

                 h_amount_to_insert := h_adjustment_amount - h_amount_so_far;
Line: 1178

                  FA_DEBUG_PKG.ADD (fname   => 'FA_INS_ADJUST_PKG.fadoact',element => '+++ h_amount_to_insert ',value   => h_amount_to_insert,p_log_level_rec => p_log_level_rec);
Line: 1185

               h_amount_to_insert := h_adjustment_amount - h_amount_so_far;
Line: 1205

               element => 'h_amount_to_insert',
               value   => h_amount_to_insert,
               p_log_level_rec => p_log_level_rec);
Line: 1211

      IF (NOT FA_UTILS_PKG.faxrnd(X_amount => h_amount_to_insert,
                                  X_book   => adj_ptr.book_type_code,
                                  X_set_of_books_id => adj_ptr.set_of_books_id,
                                  p_log_level_rec => p_log_level_rec)) THEN
         FA_SRVR_MSG.add_message
           (CALLING_FN => 'FA_INS_ADJUST_PKG.fadoact',
            p_log_level_rec => p_log_level_rec);
Line: 1223

      h_amount_so_far:=h_amount_so_far+h_amount_to_insert;
Line: 1236

                 element => 'Amount so far-amount inserted ',
                 value   => h_amount_so_far,
                 p_log_level_rec => p_log_level_rec);
Line: 1251

                X_cat_id           => adj_ptr.selection_retid,
                X_distribution_id  => h_distribution_id,
                X_source_type_code => adj_ptr.source_type_code,
                p_log_level_rec    => p_log_level_rec)) then
         FA_SRVR_MSG.ADD_MESSAGE
             (CALLING_FN => 'FA_GCCID_PKG.fadoact',
              NAME       => h_mesg_name,
              p_log_level_rec => p_log_level_rec);
Line: 1274

                 value   => h_amount_to_insert,
                 p_log_level_rec => p_log_level_rec);
Line: 1280

      adj_ptr.adjustment_amount := h_amount_to_insert;
Line: 1285

                 X_last_update_date  => X_last_update_date,
                 X_last_updated_by   => X_last_updated_by,
                 X_last_update_login => X_last_update_login,
                 p_log_level_rec     => p_log_level_rec)) then
         FA_SRVR_MSG.ADD_MESSAGE
           (CALLING_FN => 'FA_INS_ADJUST_PKG.fadoact',
            p_log_level_rec => p_log_level_rec);
Line: 1296

   adj_ptr.amount_inserted := h_amount_so_far;
Line: 1310

FUNCTION fadoclr(X_last_update_date  date default sysdate,
                 X_last_updated_by   number default -1,
                 X_last_update_login number default -1,
                 p_log_level_rec  in fa_api_types.log_level_rec_type
) return boolean is

   h_row_ctr          number :=0;
Line: 1319

   h_selection_thid   number;
Line: 1327

   h_amount_to_insert number :=0;
Line: 1336

   SELECT distribution_id,
          code_combination_id,
          units_assigned,
          transaction_header_id_in
     FROM FA_DISTRIBUTION_HISTORY
    WHERE asset_id = h_asset_id
      AND book_type_code=h_dist_book
      AND (
            (adj_ptr.selection_mode <> FA_ADJUST_TYPE_PKG.FA_AJ_CLEAR_PARTIAL
             AND (date_ineffective is null
                  OR transaction_header_id_out=adj_ptr.selection_thid
                 )
            )
           OR
            (adj_ptr.selection_mode = FA_ADJUST_TYPE_PKG.FA_AJ_CLEAR_PARTIAL
             AND transaction_header_id_out=adj_ptr.selection_thid
            )
          )
    ORDER BY distribution_id;
Line: 1359

   h_selection_thid := adj_ptr.selection_thid;
Line: 1366

              X_last_update_date  => X_last_update_date,
              X_last_updated_by   => X_last_updated_by,
              X_last_update_login => X_last_update_login,
              p_log_level_rec     => p_log_level_rec)) then
      FA_SRVR_MSG.ADD_MESSAGE
           (NAME       => 'FA_GET_CAT_ID',
            CALLING_FN => 'FA_INS_ADJUST_PKG.fadoclr',
            p_log_level_rec => p_log_level_rec);
Line: 1397

      if (h_thid_in <> adj_ptr.selection_thid) then
         -- Call the Query Fin Info function in detail mode to figure
         -- out how much to clear for this distribution
         H_DPR_ROW.asset_id   := adj_ptr.asset_id;
Line: 1428

         h_amount_to_insert := h_adj_dd_amount;
Line: 1443

                element => 'amount to insert-after FACDAMT',
                value   => h_amount_to_insert,
                p_log_level_rec => p_log_level_rec);
Line: 1450

         IF (NOT FA_UTILS_PKG.faxrnd(X_amount => h_amount_to_insert,
                                     X_book   => adj_ptr.book_type_code,
                                     X_set_of_books_id => adj_ptr.set_of_books_id,
                                     p_log_level_rec => p_log_level_rec))  THEN
            FA_SRVR_MSG.add_message(
                 CALLING_FN => 'FA_INS_ADJUST_PKG.fadoclr',
                 p_log_level_rec => p_log_level_rec);
Line: 1460

         adj_ptr.adjustment_amount := h_amount_to_insert;
Line: 1461

         h_amount_so_far := h_amount_so_far + h_amount_to_insert;
Line: 1466

                 element => 'amount to insert-AFTER ROUNDING',
                 value   => h_amount_to_insert,
                 p_log_level_rec => p_log_level_rec);
Line: 1486

                   X_cat_id           => adj_ptr.selection_retid,
                   X_distribution_id  => h_distribution_id,
                   X_source_type_code => adj_ptr.source_type_code,
                   p_log_level_rec    => p_log_level_rec)) then
            FA_SRVR_MSG.ADD_MESSAGE
                (CALLING_FN => 'FA_GCCID_PKG.fadoclr',
                 NAME       => h_mesg_name,
                 p_log_level_rec => p_log_level_rec);
Line: 1512

                   X_last_update_date  => X_last_update_date,
                   X_last_updated_by   => X_last_updated_by,
                   X_last_update_login => X_last_update_login,
                   p_log_level_rec     => p_log_level_rec)) then
            FA_SRVR_MSG.ADD_MESSAGE
                 (NAME       => 'FA_GET_CAT_ID',
                  CALLING_FN => 'FA_INS_ADJUST_PKG.fadoclr',
                  p_log_level_rec => p_log_level_rec);
Line: 1522

      end if;   -- thid<>adj_ptr.selection_thid
Line: 1525

   adj_ptr.amount_inserted := h_amount_so_far;
Line: 1530

           element => 'AMOUNT INSERTED ',
           value   => adj_ptr.amount_inserted,
           p_log_level_rec => p_log_level_rec);
Line: 1552

FUNCTION fadosglf(X_last_update_date  date default sysdate,
                  X_last_updated_by   number default -1,
                  X_last_update_login number default -1,
                  p_log_level_rec  in fa_api_types.log_level_rec_type
) return boolean is

   h_calculated_ccid   number;
Line: 1566

               X_last_update_date  => X_last_update_date,
               X_last_updated_by   => X_last_updated_by,
               X_last_update_login => X_last_update_login,
               p_log_level_rec     => p_log_level_rec)) then
      FA_SRVR_MSG.ADD_MESSAGE
        (CALLING_FN => 'FA_INS_ADJUST_PKG.fadosglf',
         p_log_level_rec => p_log_level_rec);
Line: 1587

            X_cat_id           => adj_ptr.selection_retid,
            X_distribution_id  => adj_ptr.distribution_id,
            X_source_type_code => adj_ptr.source_type_code,
            p_log_level_rec    => p_log_level_rec)) then
      FA_SRVR_MSG.ADD_MESSAGE
         (CALLING_FN =>'FA_GCCID_PKG.fadosglf',
          p_log_level_rec => p_log_level_rec);
Line: 1622

             X_last_update_date  => X_last_update_date,
             X_last_updated_by   => X_last_updated_by,
             X_last_update_login => X_last_update_login,
             p_log_level_rec     => p_log_level_rec)) then
      FA_SRVR_MSG.ADD_MESSAGE
        (CALLING_FN => 'FA_INS_ADJUST_PKG.fadosglf',
         p_log_level_rec => p_log_level_rec);
Line: 1632

   adj_ptr.amount_inserted:=adj_ptr.adjustment_amount;
Line: 1635

                        element => 'Amt Inserted-before return',
                        value   => adj_ptr.amount_inserted,
                        p_log_level_rec => p_log_level_rec);
Line: 1652

FUNCTION fadosgl(X_last_update_date  date default sysdate,
                 X_last_updated_by   number default -1,
                 X_last_update_login number default -1,
                 p_log_level_rec  in fa_api_types.log_level_rec_type
) return boolean is

   h_calculated_ccid   number;
Line: 1675

             X_cat_id           => adj_ptr.selection_retid,
             X_distribution_id  => adj_ptr.distribution_id,
             X_source_type_code => adj_ptr.source_type_code,
             p_log_level_rec    => p_log_level_rec)) then
      FA_SRVR_MSG.ADD_MESSAGE
        (CALLING_FN =>'FA_GCCID_PKG.fadosgl',
         p_log_level_rec => p_log_level_rec);
Line: 1712

               X_last_update_date  => X_last_update_date,
               X_last_updated_by   => X_last_updated_by,
               X_last_update_login => X_last_update_login,
               p_log_level_rec     => p_log_level_rec)) then
      FA_SRVR_MSG.ADD_MESSAGE
        (CALLING_FN => 'FA_INS_ADJUST_PKG.fadosgl',
         p_log_level_rec => p_log_level_rec);
Line: 1722

   adj_ptr.amount_inserted:=adj_ptr.adjustment_amount;
Line: 1735

FUNCTION fadoret(X_last_update_date  date default sysdate,
                 X_last_updated_by   number default -1,
                 X_last_update_login number default -1,
                 p_log_level_rec  in fa_api_types.log_level_rec_type
) return boolean is

   h_dist_book          varchar2(30);
Line: 1755

   h_amount_to_insert   number:=0;
Line: 1761

    SELECT DISTRIBUTION_ID,
           CODE_COMBINATION_ID,
           TRANSACTION_UNITS
      FROM FA_DISTRIBUTION_HISTORY
     WHERE ASSET_ID       = h_asset_id
       AND BOOK_TYPE_CODE = h_dist_book
       AND RETIREMENT_ID  = h_ret_id
     ORDER BY DISTRIBUTION_ID;
Line: 1783

             X_last_update_date  => X_last_update_date,
             X_last_updated_by   => X_last_updated_by,
             X_last_update_login => X_last_update_login,
             p_log_level_rec     => p_log_level_rec)) then
      FA_SRVR_MSG.ADD_MESSAGE
        (CALLING_FN => 'FA_INS_ADJUST_PKG.fadoret',
         p_log_level_rec => p_log_level_rec);
Line: 1794

   h_ret_id             := adj_ptr.selection_retid;
Line: 1824

   SELECT COUNT(*)
     INTO h_distribution_lines
     FROM FA_DISTRIBUTION_HISTORY
    WHERE ASSET_ID       = h_asset_id
      AND book_type_code = h_dist_book
      AND RETIREMENT_ID  = h_ret_id;
Line: 1885

         h_amount_to_insert := (h_total_amount * abs(h_trans_units)/adj_ptr.units_retired)
                                - h_adj_dd_amount;
Line: 1889

         h_amount_to_insert :=h_adjustment_amount - h_amount_so_far;
Line: 1892

      IF (NOT FA_UTILS_PKG.faxrnd(X_amount => h_amount_to_insert,
                                  X_book  => adj_ptr.book_type_code,
                                  X_set_of_books_id => adj_ptr.set_of_books_id,
                                  p_log_level_rec => p_log_level_rec)) THEN
         FA_SRVR_MSG.add_message
           (CALLING_FN => 'FA_INS_ADJUST_PKG.fadoret',
            p_log_level_rec => p_log_level_rec);
Line: 1902

      h_amount_so_far:=h_amount_so_far+h_amount_to_insert;
Line: 1920

                 X_cat_id           => adj_ptr.selection_retid,
                 X_distribution_id  => h_distribution_id,
                 X_source_type_code => adj_ptr.source_type_code,
                 p_log_level_rec    => p_log_level_rec)) then
         FA_SRVR_MSG.ADD_MESSAGE
              (CALLING_FN => 'FA_GCCID_PKG.fadoact',
               NAME=>h_mesg_name,
               p_log_level_rec => p_log_level_rec);
Line: 1939

      adj_ptr.adjustment_amount   := h_amount_to_insert;
Line: 1945

                 X_last_update_date  => X_last_update_date,
                 X_last_updated_by   => X_last_updated_by,
                 X_last_update_login => X_last_update_login,
                 p_log_level_rec     => p_log_level_rec)) then
         FA_SRVR_MSG.ADD_MESSAGE
           (CALLING_FN => 'FA_INS_ADJUST_PKG.fadoret',
            p_log_level_rec => p_log_level_rec);
Line: 1956

   adj_ptr.amount_inserted := h_amount_so_far;
Line: 1977

                 X_last_update_date  date   default sysdate,
                 X_last_updated_by   number default -1,
                 X_last_update_login number default -1,
                 p_log_level_rec  in fa_api_types.log_level_rec_type
) return boolean is

BEGIN <>

   -- Assign the passed values from adj_ptr_passed to adj_ptr.
   adj_ptr := adj_ptr_passed;
Line: 2010

                X_last_update_date  => X_last_update_date,
                X_last_updated_by   => X_last_updated_by,
                X_last_update_login => X_last_update_login,
                p_log_level_rec     => p_log_level_rec)) then
         adj_table.delete;
Line: 2028

         adj_table.delete;
Line: 2037

      if (adj_ptr.selection_mode in (FA_ADJUST_TYPE_PKG.FA_AJ_ACTIVE , FA_ADJUST_TYPE_PKG.FA_AJ_ACTIVE_PARTIAL)) then
         if (not fadoact
                  (X_last_update_date  => X_last_update_date,
                   X_last_updated_by   => X_last_updated_by,
                   X_last_update_login => X_last_update_login,
                   p_log_level_rec     => p_log_level_rec)) then
            adj_table.delete;
Line: 2051

      elsif (adj_ptr.selection_mode=FA_ADJUST_TYPE_PKG.FA_AJ_ACTIVE_REVAL) then -- YYOON
         if (not fadoact
                  (X_last_update_date  => X_last_update_date,
                   X_last_updated_by   => X_last_updated_by,
                   X_last_update_login => X_last_update_login,
                   p_log_level_rec     => p_log_level_rec)) then
            adj_table.delete;
Line: 2065

      elsif (adj_ptr.selection_mode=FA_ADJUST_TYPE_PKG.FA_AJ_SINGLE) then
         if (not fadosgl
                  (X_last_update_date  => X_last_update_date,
                   X_last_updated_by   => X_last_updated_by,
                   X_last_update_login => X_last_update_login,
                   p_log_level_rec     => p_log_level_rec)) then
            adj_table.delete;
Line: 2079

      elsif (adj_ptr.selection_mode=FA_ADJUST_TYPE_PKG.FA_AJ_TRANSFER_SINGLE) then
         if (not fadosglf
                  (X_last_update_date  => X_last_update_date,
                   X_last_updated_by   => X_last_updated_by,
                   X_last_update_login => X_last_update_login,
                   p_log_level_rec     => p_log_level_rec)) then
            adj_table.delete;
Line: 2093

      elsif (adj_ptr.selection_mode in (FA_ADJUST_TYPE_PKG.FA_AJ_CLEAR, FA_ADJUST_TYPE_PKG.FA_AJ_CLEAR_PARTIAL)) then
         if (not fadoclr
                  (X_last_update_date  => X_last_update_date,
                   X_last_updated_by   => X_last_updated_by,
                   X_last_update_login => X_last_update_login,
                   p_log_level_rec     => p_log_level_rec)) then
            adj_table.delete;
Line: 2107

      elsif (adj_ptr.selection_mode=FA_ADJUST_TYPE_PKG.FA_AJ_RETIRE) then
         if (not fadoret
                  (X_last_update_date  => X_last_update_date,
                   X_last_updated_by   => X_last_updated_by,
                   X_last_update_login => X_last_update_login,
                   p_log_level_rec     => p_log_level_rec)) then
            adj_table.delete;
Line: 2123

         adj_table.delete;
Line: 2131

      end if;     -- of adj_ptr.selection_mode
Line: 2140

                X_last_update_date  => X_last_update_date,
                X_last_updated_by   => X_last_updated_by,
                X_last_update_login => X_last_update_login,
                p_log_level_rec     => p_log_level_rec)) then
         adj_table.delete;
Line: 2154

   adj_ptr_passed.amount_inserted := adj_ptr.amount_inserted;
Line: 2159

             element => 'adj inserted - BEFORE RETURN',
             value   => adj_ptr_passed.amount_inserted,
             p_log_level_rec => p_log_level_rec);
Line: 2187

                   X_last_update_date        in date default sysdate,
                   X_account                 in varchar2,
                   X_account_type            in varchar2,
                   X_current_units           in number,
                   X_selection_mode          in varchar2,
                   X_flush_adj_flag          in varchar2,
                   X_gen_ccid_flag           in varchar2,
                   X_leveling_flag           in varchar2,
                   X_asset_invoice_id        in number,
                   X_amount_inserted        out nocopy number,
                   X_last_updated_by            number default -1,
                   X_last_update_login          number default -1,
                   X_init_message_flag          varchar2 default 'NO',
                   p_log_level_rec           in fa_api_types.log_level_rec_type
) return boolean is

   adj_ptr_local           FA_ADJUST_TYPE_PKG.fa_adj_row_struct;
Line: 2227

   adj_ptr_local.last_update_date        := X_last_update_date;
Line: 2240

   if (X_selection_mode='ACTIVE') then
      adj_ptr_local.selection_mode := FA_ADJUST_TYPE_PKG.FA_AJ_ACTIVE;
Line: 2242

   elsif (X_selection_mode='SINGLE') then
      adj_ptr_local.selection_mode := FA_ADJUST_TYPE_PKG.FA_AJ_SINGLE;
Line: 2287

              X_last_update_date,
              X_last_updated_by,
              X_last_update_login,
              p_log_level_rec => p_log_level_rec)) then
      FA_SRVR_MSG.ADD_MESSAGE
        (CALLING_FN => 'FA_INS_ADJUST_PKG.faxinadj',
         p_log_level_rec => p_log_level_rec);
Line: 2298

   X_amount_inserted := adj_ptr_local.amount_inserted;