mirror of
https://github.com/rickbarrette/redmine_qbo_vehicles.git
synced 2026-02-13 17:43:58 -05:00
Added flash notification for deleted customers.
This commit is contained in:
@@ -64,6 +64,7 @@ class VehiclesController < ApplicationController
|
|||||||
@vin = @vehicle.vin.scan(/.{1,9}/) if @vehicle.vin
|
@vin = @vehicle.vin.scan(/.{1,9}/) if @vehicle.vin
|
||||||
@issues = @vehicle.issues.order(id: :desc)
|
@issues = @vehicle.issues.order(id: :desc)
|
||||||
@closed_issues = (@issues - @issues.open)
|
@closed_issues = (@issues - @issues.open)
|
||||||
|
flash[:error] = t :alert_no_customer if @vehicle.customer.nil?
|
||||||
rescue
|
rescue
|
||||||
flash[:error] = t :alert_vehicle_not_found
|
flash[:error] = t :alert_vehicle_not_found
|
||||||
render_404
|
render_404
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<th><%= t(:field_customer)%></th>
|
<th><%= t(:field_customer)%></th>
|
||||||
<td><%= link_to(vehicle.customer.name, customer_path(vehicle.customer)) if vehicle.customer %></td>
|
<td><%= vehicle.customer ? link_to(vehicle.customer.name, customer_path(vehicle.customer)) : t(:no_customer) %></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@@ -31,3 +31,6 @@ en:
|
|||||||
alert_vehicle_not_deleted: "Vehicle could not be deleted."
|
alert_vehicle_not_deleted: "Vehicle could not be deleted."
|
||||||
alert_vehicle_not_created: "Vehicle could not be created."
|
alert_vehicle_not_created: "Vehicle could not be created."
|
||||||
alert_vehicle_not_updated: "Vehicle could not be updated."
|
alert_vehicle_not_updated: "Vehicle could not be updated."
|
||||||
|
no_customer: "Customer no longer exists"
|
||||||
|
alert_no_customer: "Customer no longer exists, check for merged customers or deleted customers in Quick Books Online."
|
||||||
|
|
||||||
Reference in New Issue
Block a user