mirror of
https://github.com/rickbarrette/redmine_qbo_vehicles.git
synced 2026-02-13 09:34:00 -05:00
Cleaned up pdf hook
This commit is contained in:
@@ -16,18 +16,12 @@ module Vehicles
|
|||||||
|
|
||||||
include IssuesHelper
|
include IssuesHelper
|
||||||
|
|
||||||
# Edit Issue Form
|
# Add vehicle information to the left column of the issue PDF
|
||||||
# Here we build the required form components before passing them to a partial view formatting.
|
|
||||||
def pdf_left(context={})
|
def pdf_left(context={})
|
||||||
issue = context[:issue]
|
|
||||||
output = []
|
output = []
|
||||||
v = issue.vehicle
|
output << [l(:field_vehicles), context[:issue].vehicle ? context[:issue].vehicle.to_s : nil]
|
||||||
vehicle = v ? v.to_s : nil
|
output << [l(:field_vin), context[:issue].vehicle ? context[:issue].vehicle.vin.gsub(/(.{9})/, '\1 ') : nil]
|
||||||
vin = v ? v.vin : nil
|
output << [l(:field_notes), context[:issue].vehicle ? context[:issue].vehicle.notes : nil]
|
||||||
notes = v ? v.notes : nil
|
|
||||||
output << [l(:field_vehicles), vehicle]
|
|
||||||
output << [l(:field_vin), vin ? vin.gsub(/(.{9})/, '\1 ') : nil]
|
|
||||||
output << [l(:field_notes), notes]
|
|
||||||
return output
|
return output
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user