<commit_before>= simple_form_for(@proxy,
:url => update_depreciation_inventory_path,
:method => 'post',
:html => {:class => 'form-vertical'},
:wrapper => :vertical_form,
:wrapper_mappings => {:check_boxes => :vertical_radio_and_checkboxes,
  :radio_buttons => :vertical_radio_and_checkboxes,
  :file => :vertical_file_input,
  :boolean => :vertical_boolean}) do |f|
  = f.input :object_key, :as => :hidden

  = dialog_tag('Depreciation', {:icon => 'fa fa-refresh', :class => "header-part"}) do

    - if @asset.depreciation_purchase_cost != @asset.book_value
      .row
        .col-xs-12
          .alert.alert-warning Asset has already been depreciated. Some fields cannot be changed.

    .row
      .col-xs-6
        = f.input :depreciable, :as => :radio_buttons, :label => "Asset is depreciable?", :disabled => @asset.depreciation_purchase_cost != @asset.book_value

    .row
      .col-xs-4
        = f.input :depreciation_start_date, :wrapper => :vertical_append, :label => "Depreciation Start Date" do
          = f.input_field :depreciation_start_date, :as => :string, :class => 'form-control datepicker', :data => {'date-container' => '#depreciation_dialog'}, :value => format_as_date(f.object.depreciation_start_date), :disabled => @asset.depreciation_purchase_cost != @asset.book_value
          %span.input-group-addon
            %i.fa.fa-calendar

      .col-xs-4
        = f.input :depreciation_purchase_cost, :wrapper=> :vertical_prepend, :label => "Depreciation Purchase Cost" do
          %span.input-group-addon
            %i.fa.fa-usd
          = f.input_field :depreciation_purchase_cost, :class => "form-control", :disabled => @asset.depreciation_purchase_cost != @asset.book_value

    .row
      .col-xs-4
        = f.input :depreciation_useful_life, :wrapper => :vertical_append, :label => "Depreciation Useful Life" do
          = f.input_field :depreciation_useful_life, :as => :string, :class => 'form-control', :value => f.object.depreciation_useful_life.nil? ? @asset.expected_useful_life : f.object.depreciation_useful_life
          %span.input-group-addon
            months

      .col-xs-4
        = f.input :salvage_value, :wrapper=> :vertical_prepend, :label => "Salvage Value" do
          %span.input-group-addon
            %i.fa.fa-usd
          = f.input_field :salvage_value, :class => "form-control"

    = f.button :submit, 'Update Depreciation', :class => 'btn btn-primary'
    = link_to "Cancel", :back, {:id => 'cancel-button', :class => "btn btn-default"}<commit_msg>TTPLAT-785 update label<commit_after>= simple_form_for(@proxy,
:url => update_depreciation_inventory_path,
:method => 'post',
:html => {:class => 'form-vertical'},
:wrapper => :vertical_form,
:wrapper_mappings => {:check_boxes => :vertical_radio_and_checkboxes,
  :radio_buttons => :vertical_radio_and_checkboxes,
  :file => :vertical_file_input,
  :boolean => :vertical_boolean}) do |f|
  = f.input :object_key, :as => :hidden

  = dialog_tag('Depreciation', {:icon => 'fa fa-refresh', :class => "header-part"}) do

    - if @asset.depreciation_purchase_cost != @asset.book_value
      .row
        .col-xs-12
          .alert.alert-warning Asset has already been depreciated. Some fields cannot be changed.

    .row
      .col-xs-6
        = f.input :depreciable, :as => :radio_buttons, :label => "Asset is depreciable?", :disabled => @asset.depreciation_purchase_cost != @asset.book_value

    .row
      .col-xs-4
        = f.input :depreciation_start_date, :wrapper => :vertical_append, :label => "Depreciation Start Date" do
          = f.input_field :depreciation_start_date, :as => :string, :class => 'form-control datepicker', :data => {'date-container' => '#depreciation_dialog'}, :value => format_as_date(f.object.depreciation_start_date), :disabled => @asset.depreciation_purchase_cost != @asset.book_value
          %span.input-group-addon
            %i.fa.fa-calendar

      .col-xs-4
        = f.input :depreciation_purchase_cost, :wrapper=> :vertical_prepend, :label => "Depreciation Cost (Purchase)" do
          %span.input-group-addon
            %i.fa.fa-usd
          = f.input_field :depreciation_purchase_cost, :class => "form-control", :disabled => @asset.depreciation_purchase_cost != @asset.book_value

    .row
      .col-xs-4
        = f.input :depreciation_useful_life, :wrapper => :vertical_append, :label => "Depreciation Useful Life" do
          = f.input_field :depreciation_useful_life, :as => :string, :class => 'form-control', :value => f.object.depreciation_useful_life.nil? ? @asset.expected_useful_life : f.object.depreciation_useful_life
          %span.input-group-addon
            months

      .col-xs-4
        = f.input :salvage_value, :wrapper=> :vertical_prepend, :label => "Salvage Value" do
          %span.input-group-addon
            %i.fa.fa-usd
          = f.input_field :salvage_value, :class => "form-control"

    = f.button :submit, 'Update Depreciation', :class => 'btn btn-primary'
    = link_to "Cancel", :back, {:id => 'cancel-button', :class => "btn btn-default"}
{'fraction_non_alphanumeric': 0.1483755942947702, 'fraction_numerical': 0.0033676703645007925, 'mean_word_length': 3.4211908931698773, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 81, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6336043', 'n_tokens_mistral': 1742, 'n_tokens_neox': 1666, 'n_words': 327}