Compare commits

..
5 Commits
4 changed files with 26 additions and 6 deletions
+12
View File
@@ -49,6 +49,18 @@
</div>
</div>
<% last = vehicle.issues.last %>
<% if last %>
<% mileage = last.custom_values.find_by(custom_field_id: CustomField.find_by_name("Mileage").id) %>
<% if mileage %>
<p>
<b><%=t(:label_last_service) %></b> <%= last&.closed_on&.to_date || l(:label_unknown) %>
at <%= mileage.value %>
<%=t(:label_miles) %>
</p>
<% end %>
<% end %>
<div style="float: right;">
<%= 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)} %>
+4
View File
@@ -24,11 +24,15 @@ en:
label_customer_vehicles: "Customer Vehicles"
label_edit: "Edit"
label_edit_customer_vehicle: "Edit Customer Vehicle"
label_last_service: "Last Serviced:"
label_make: "Make"
label_miles: "miles"
label_model: "Model"
label_new_vehicle: "New Customer Vehicle"
label_no_vehicles: "There are no vehicles containing the term(s)"
label_search_vehicles: "Search Vehicles"
label_unknown: "Unknown"
label_vehicle: "Vehicle"
label_year: "Year"
no_customer: "Customer no longer exists"
notice_decoding_vin: "Decoding VIN… this page will update automatically."
+1 -1
View File
@@ -14,7 +14,7 @@ Redmine::Plugin.register :redmine_qbo_vehicles do
name 'Redmine QBO Vehicles plugin'
author 'Rick Barrette'
description 'This is a plugin for Redmine to intergrate with the redmine_qbo plugin to provide vehicle data tracking'
version '2026.4.0'
version '2026.4.1'
url 'https://github.com/rickbarrette/redmine_qbo_vehicles'
author_url 'https://barrettefabrication.com'
requires_redmine version_or_higher: '6.1.0'
@@ -18,14 +18,18 @@ module Vehicles
def view_issues_form_details_bottom(context={})
# Load the customer's vehicles for selection in the issue form.
vehicles = context[:issue].customer&.vehicles || []
context[:controller].send(:render_to_string, {
partial: 'issues/form_hook_vehicles',
locals: {
vehicle: context[:form].select( :vehicle_id,
context[:issue].customer ? context[:issue].customer.vehicles.pluck(:name, :id) : [],
selected: context[:issue].vehicle ? context[:issue].vehicle.id : nil,
include_blank: true )
}
vehicle: context[:form].select(
:vehicle_id,
vehicles.map { |v| [v.name, v.id] },
selected: context[:issue].vehicle&.id,
include_blank: true
)
}
})
end