<commit_before>%ul.nav.nav-tabs
  %li.active
    %a{:href => '#required', :data =>{:toggle => 'tab'}}
      Required Fields
  %li
    %a{:href => '#recommended', :data =>{:toggle => 'tab'}}
      Recommended Fields

= simple_form_for(@asset,
  :as => :asset,
  :url => inventory_index_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|

  .tab-content.form-section
    .tab-pane.fade.in.active#required
      .col-sm-6
        
        %h2.form-section-header
          Organization

        = f.association :organization, collection: TransitOperator.where(id: @asset.organization_id)

        
        %h2.form-section-header
          Service Status

        = f.simple_fields_for :service_status_updates, @asset.service_status_updates.build do |update_event|
          = update_event.input :service_status_type_id, collection: ServiceStatusType.active, label: 'Service Status'

        
        %h2.form-section-header
          Identification & Classification

        = f.input :description

        = f.input :asset_tag, label: 'Asset ID'

        = f.input :fta_asset_category_id, as: :hidden, input_html: {value: @asset.fta_asset_class.fta_asset_category_id}
        = f.association :fta_asset_class, collection: FtaAssetClass.where(id: @asset.fta_asset_class_id), label: 'Class'
        
        = f.input :global_fta_type, :collection => FtaVehicleType.all.map{|f| [ f.to_s, f.to_global_id ]}, label: 'Type', required: true
        
        = f.association :asset_subtype, label: 'Subtype'

        = f.input :quantity

      .col-sm-6

        %h2.form-section-header
          Characteristics
        
        = f.association :manufacturer, collection: Manufacturer.where(filter: 'Vehicle').active

        = f.association :manufacturer_model, collection: ManufacturerModel.where(organization_id: @asset.organization_id).or(ManufacturerModel.where(organization_id: nil)).active, label: 'Model'

        = f.input :manufacture_year, label: 'Year of Manufacture'

        %h2.form-section-header
          Funding

        %h2.form-section-header
          Funding

        = f.simple_fields_for :purchase_cost do |update_event|
          = update_event.input :purchase, :wrapper => :vertical_prepend, label: 'Cost (Purchase)' do
            %span.input-group-addon
              %i.fa.fa-usd
            = update_event.input_field :purchase_cost, :class => 'form-control', required: true, :value => 0, :label => false

        .form-group.required.radio-buttons-inline
          %label.required.control-label
            %abbr{title: 'required'} *
            = " Direct Capital Responsibility"
          %span.radio
            %label
              = radio_button_tag :direct_capital_responsibility, 'yes', @asset.direct_capital_responsibility
              Yes
          %span.radio
            %label
              = radio_button_tag :direct_capital_responsibility, 'no', !@asset.direct_capital_responsibility
              No

        %h2.form-section-header
          Operations

        = f.input :in_service_date, :wrapper => :vertical_append, :label => "In Service Date" do
          = f.input_field :in_service_date, :as => :string, :class => 'form-control datepicker', :value => format_as_date(f.object.in_service_date)
          %span.input-group-addon
            %i.fa.fa-calendar

        %h2.form-section-header
          Procurement & Purchase

        = f.input :purchased_new, as: :radio_buttons, required: true, :wrapper_class => 'form-group radio-buttons-inline'

  %hr

  
  = f.input :asset_tag
  = f.input :external_id
  = f.input :fta_asset_category_id, as: :hidden, input_html: {value: @asset.fta_asset_class.fta_asset_category_id}
  = f.association :fta_asset_class
  = f.input :global_fta_type, :collection => FtaEquipmentType.all.map{|f| [ f.to_s, f.to_global_id ]}
  = f.association :asset_subtype

  = f.input :quantity
  = f.input :quantity_unit
  = f.association :serial_numbers

  = f.input :other_manufacturer
  = f.input :other_manufacturer_model
  = f.input :manufacture_year

  =# render :partial => "assets/accounting_asset_form", :locals => {:f => f}

  = f.input :purchase_cost
  = f.input :pcnt_capital_responsibility

  = f.input :purchased_new
  = f.input :purchase_date
  = f.input :contract_num
  = f.association :contract_type
  = f.association :vendor
  = f.input :other_vendor
  = f.input :has_warranty
  = f.input :warranty_date

  = f.input :in_service_date

  = f.input :title_number
  = f.association :title_ownership_organization
  = f.input :other_title_ownership_organization
  = f.association :lienholder
  = f.input :other_lienholder

  - view_component = 'app_characteristics_form'
  - if lookup_context.template_exists?(view_component, 'transit_assets', true)
    = render :partial => "transit_assets/#{view_component}", :locals => {:f => f}

  = #Recommended fields
  = f.simple_fields_for :condition_updates, @asset.condition_updates.build do |update_event|
    = update_event.input :assessed_rating
  = f.simple_fields_for :service_status_updates, @asset.service_status_updates.build do |update_event|
    = update_event.input :service_status_type_id, collection: ServiceStatusType.active

  = f.simple_fields_for :location_updates, @asset.location_updates.build do |update_event|
    = update_event.input :parent_key, :as => :hidden, input_html: {id: 'location_key'}
    = update_event.input :parent_name, :input_html => {:autocomplete => 'off', :class => 'form-control', :placeholder => 'Enter search text', :id => 'location_name', :data => {:url => filter_inventory_index_path(search_params: {organization_id: @asset.organization_id})}}

  = f.simple_fields_for :rehabilitation_updates, @asset.rehabilitation_updates.build do |update_event|
    = update_event.input :total_cost, :wrapper => :vertical_prepend, label: 'Total Cost' do
      %span.input-group-addon
        %i.fa.fa-usd
      = update_event.input_field :total_cost, :class => 'form-control', :required => true, :value => 0, :label => false
    = update_event.input :extended_useful_life_months
    = update_event.input :event_date, :label => 'Date of Report', :wrapper => :vertical_append do
      = update_event.input_field :event_date, :as => :string, :class => 'form-control datepicker'
      %span.input-group-addon
        %i.fa.fa-calendar

  = f.button :submit, :class => 'btn btn-primary'<commit_msg>recommended fields for captial equipment<commit_after>%ul.nav.nav-tabs
  %li.active
    %a{:href => '#required', :data =>{:toggle => 'tab'}}
      Required Fields
  %li
    %a{:href => '#recommended', :data =>{:toggle => 'tab'}}
      Recommended Fields

= simple_form_for(@asset,
  :as => :asset,
  :url => inventory_index_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|

  .tab-content.form-section
    .tab-pane.fade.in.active#required
      .col-sm-6
        
        %h2.form-section-header
          Organization

        = f.association :organization, collection: TransitOperator.where(id: @asset.organization_id)

        
        %h2.form-section-header
          Service Status

        = f.simple_fields_for :service_status_updates, @asset.service_status_updates.build do |update_event|
          = update_event.input :service_status_type_id, collection: ServiceStatusType.active, label: 'Service Status'

        
        %h2.form-section-header
          Identification & Classification

        = f.input :description

        = f.input :asset_tag, label: 'Asset ID'

        = f.input :fta_asset_category_id, as: :hidden, input_html: {value: @asset.fta_asset_class.fta_asset_category_id}
        = f.association :fta_asset_class, collection: FtaAssetClass.where(id: @asset.fta_asset_class_id), label: 'Class'
        
        = f.input :global_fta_type, :collection => FtaVehicleType.all.map{|f| [ f.to_s, f.to_global_id ]}, label: 'Type', required: true
        
        = f.association :asset_subtype, label: 'Subtype'

        = f.input :quantity

      .col-sm-6

        %h2.form-section-header
          Characteristics
        
        = f.association :manufacturer, collection: Manufacturer.where(filter: 'Vehicle').active

        = f.association :manufacturer_model, collection: ManufacturerModel.where(organization_id: @asset.organization_id).or(ManufacturerModel.where(organization_id: nil)).active, label: 'Model'

        = f.input :manufacture_year, label: 'Year of Manufacture'

        %h2.form-section-header
          Funding

        %h2.form-section-header
          Funding

        = f.simple_fields_for :purchase_cost do |update_event|
          = update_event.input :purchase, :wrapper => :vertical_prepend, label: 'Cost (Purchase)' do
            %span.input-group-addon
              %i.fa.fa-usd
            = update_event.input_field :purchase_cost, :class => 'form-control', required: true, :value => 0, :label => false

        .form-group.required.radio-buttons-inline
          %label.required.control-label
            %abbr{title: 'required'} *
            = " Direct Capital Responsibility"
          %span.radio
            %label
              = radio_button_tag :direct_capital_responsibility, 'yes', @asset.direct_capital_responsibility
              Yes
          %span.radio
            %label
              = radio_button_tag :direct_capital_responsibility, 'no', !@asset.direct_capital_responsibility
              No

        %h2.form-section-header
          Operations

        = f.input :in_service_date, :wrapper => :vertical_append, :label => "In Service Date" do
          = f.input_field :in_service_date, :as => :string, :class => 'form-control datepicker', :value => format_as_date(f.object.in_service_date)
          %span.input-group-addon
            %i.fa.fa-calendar

        %h2.form-section-header
          Procurement & Purchase

        = f.input :purchased_new, as: :radio_buttons, required: true, :wrapper_class => 'form-group radio-buttons-inline'


    .tab-pane.fade.in#recommended
      .col-sm-6

        %h2.form-section-header
          Condition

        = f.simple_fields_for :condition_updates, @asset.condition_updates.build do |update_event|
          = update_event.input :assessed_rating, label: 'TERM Condition'

      .col-sm-6

        %h2.form-section-header
          Rebuild/Rehabilitation

        = f.simple_fields_for :rehabilitation_updates, @asset.rehabilitation_updates.build do |update_event|
          = update_event.input :total_cost, :wrapper => :vertical_prepend, label: 'Cost of Rebuild / Rehabilitation' do
            %span.input-group-addon
              %i.fa.fa-usd
            = update_event.input_field :total_cost, :class => 'form-control', :required => true, :value => 0, :label => false
          = update_event.input :extended_useful_life_months, label: 'Extend Useful Life by Months'
          = update_event.input :event_date, :label => 'Date of Rebuild/Rehabilitation', required: false, :wrapper => :vertical_append do
            = update_event.input_field :event_date, :as => :string, :class => 'form-control datepicker', :value => format_as_date(update_event.object.event_date)
            %span.input-group-addon
              %i.fa.fa-calendar


  .form-actions.form-section
    = f.button :submit, '+ Add Asset & Go to New Record', :class => 'btn btn-primary'

  
{'fraction_non_alphanumeric': 0.12309525836383757, 'fraction_numerical': 0.002383587298884822, 'mean_word_length': 3.0440619621342515, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 95, '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': '676989', 'n_tokens_mistral': 3852, 'n_tokens_neox': 3695, 'n_words': 691}