<%=t(:label_details)%>:

<%= t(:field_customer)%> <%= vehicle.customer ? link_to(vehicle.customer.name, customer_path(vehicle.customer)) : t(:no_customer) %>
<%= t(:field_vehicle) %> <%= vehicle.to_s %>
<%= t(:field_vin) %>
<%= @vin[0] if @vin %><%=@vin[1] if @vin%>
<%= t(:label_trim) %> <%= vehicle.doors %> <%=t(:label_door) if vehicle.doors? %> <%= vehicle.trim %>

<%=t(:field_notes)%>:

          <%= vehicle.notes %>
        
<% last = vehicle.issues.last %> <% if last %> <% mileage = last.custom_values.find_by(custom_field_id: CustomField.find_by_name("Mileage").id) %> <% if mileage %>

<%=t(:label_last_service) %> <%= last&.closed_on&.to_date || l(:label_unknown) %> at <%= mileage.value %> <%=t(:label_miles) %>

<% end %> <% end %>
<%= button_to t(:label_edit), edit_vehicle_path(vehicle), method: :get%> <%= button_to t(:label_delete), vehicle, method: :delete, data: {confirm: t(:warn_ru_sure)} %>