diff --git a/app/controllers/ad_compliances_controller.rb b/app/controllers/ad_compliances_controller.rb index d786e08..98da743 100644 --- a/app/controllers/ad_compliances_controller.rb +++ b/app/controllers/ad_compliances_controller.rb @@ -6,7 +6,7 @@ class AdCompliancesController < ApplicationController def new ad = @aircraft.applicable_ads.find_by(id: params[:ad_id]) @compliance = AdCompliance.new(aircraft: @aircraft, airworthiness_directive: ad, date_complied: Date.current, - aircraft_hours_at_compliance: @aircraft.tach_time, + aircraft_hours_at_compliance: @aircraft.current_hours, not_applicable: params[:not_applicable] == "1") @compliance.compliance_notes = "Not applicable: " if @compliance.not_applicable? @compliance.fill_next_due diff --git a/app/controllers/aircraft_controller.rb b/app/controllers/aircraft_controller.rb index 01c0cfc..7f11c05 100644 --- a/app/controllers/aircraft_controller.rb +++ b/app/controllers/aircraft_controller.rb @@ -68,7 +68,7 @@ class AircraftController < ApplicationController params.require(:aircraft).permit( :tail_number, :make, :model, :serial_number, :description, :purchased, :status, :tach_time, :tach_time_offset, :hobbs_time, :hobbs_time_offset, - :airworthiness_enforcement, :picture, :icao_type + :airworthiness_enforcement, :picture, :icao_type, :time_basis ) end end diff --git a/app/controllers/inspection_records_controller.rb b/app/controllers/inspection_records_controller.rb index 0ee26fc..84f5e13 100644 --- a/app/controllers/inspection_records_controller.rb +++ b/app/controllers/inspection_records_controller.rb @@ -5,7 +5,7 @@ class InspectionRecordsController < ApplicationController def new @record = InspectionRecord.new(aircraft: @aircraft, date: Date.current, - aircraft_hours: @aircraft.tach_time, + aircraft_hours: @aircraft.current_hours, inspection_type_id: params[:inspection_type_id]) end diff --git a/app/controllers/inspection_types_controller.rb b/app/controllers/inspection_types_controller.rb index c7cc9c0..3da9afe 100644 --- a/app/controllers/inspection_types_controller.rb +++ b/app/controllers/inspection_types_controller.rb @@ -51,6 +51,9 @@ class InspectionTypesController < ApplicationController end def type_params - params.require(:inspection_type).permit(:name, :recurring, :required, :recurring_hours, :recurring_days, :recurring_months) + p = params.require(:inspection_type).permit(:name, :recurring, :effect, :hours_tolerance, :satisfies_id, + :recurring_hours, :recurring_days, :recurring_months) + p[:satisfies_id] = scoped_id(@aircraft.applicable_inspection_types, p[:satisfies_id]) if p.key?(:satisfies_id) + p end end diff --git a/app/controllers/logbook_entries_controller.rb b/app/controllers/logbook_entries_controller.rb index 2c5c46d..d7c989a 100644 --- a/app/controllers/logbook_entries_controller.rb +++ b/app/controllers/logbook_entries_controller.rb @@ -14,7 +14,7 @@ class LogbookEntriesController < ApplicationController def show; end def new - @entry = @aircraft.logbook_entries.new(date: Date.current, aircraft_hours_at_entry: @aircraft.tach_time) + @entry = @aircraft.logbook_entries.new(date: Date.current, aircraft_hours_at_entry: @aircraft.current_hours) end def create diff --git a/app/controllers/major_records_controller.rb b/app/controllers/major_records_controller.rb index 687e8ac..2e53270 100644 --- a/app/controllers/major_records_controller.rb +++ b/app/controllers/major_records_controller.rb @@ -11,7 +11,7 @@ class MajorRecordsController < ApplicationController def new @record = @aircraft.major_records.new(record_type: params[:type] || "repair", date_performed: Date.current, - aircraft_hours: @aircraft.tach_time) + aircraft_hours: @aircraft.current_hours) end def create diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 7226d7f..c36d80f 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -8,16 +8,25 @@ module ApplicationHelper value ? l(value.to_date, format: :long) : "—" end + AIRWORTHINESS_COLORS = { "RED" => "red", "LIMITED" => "blue", "ORANGE" => "orange", "GREEN" => "green" }.freeze + def airworthiness_badge(status, large: false) - color = { "RED" => "red", "ORANGE" => "orange", "GREEN" => "green" }[status.status] - tag.span(status.label, class: [ "badge-#{color}", ("text-sm px-3 py-1" if large) ]) + tag.span(status.label, class: [ "badge-#{AIRWORTHINESS_COLORS[status.status]}", ("text-sm px-3 py-1" if large) ], + title: Airworthiness::DISCLAIMER) end def airworthiness_dot(status) - color = { "RED" => "bg-red-500", "ORANGE" => "bg-amber-400", "GREEN" => "bg-emerald-500" }[status.status] + color = { "RED" => "bg-red-500", "LIMITED" => "bg-sky-500", "ORANGE" => "bg-amber-400", "GREEN" => "bg-emerald-500" }[status.status] tag.span(class: "inline-block h-3 w-3 rounded-full #{color}", title: status.label) end + # Badge class (or text class) for one airworthiness issue. + def issue_badge_class(issue) = "badge-#{AIRWORTHINESS_COLORS[issue.severity]}" + + def issue_text_class(issue) + { "RED" => "text-red-700", "LIMITED" => "text-sky-700" }.fetch(issue.severity, "text-amber-700") + end + COMPLIANCE_BADGES = { "compliant" => [ "green", "Compliant" ], "due_soon" => [ "orange", "Due Soon" ], "overdue" => [ "red", "Overdue" ], "no_compliance" => [ "red", "No Record" ], diff --git a/app/models/ad_compliance.rb b/app/models/ad_compliance.rb index cb572c2..a185b69 100644 --- a/app/models/ad_compliance.rb +++ b/app/models/ad_compliance.rb @@ -16,7 +16,7 @@ class AdCompliance < ApplicationRecord # + interval). Only fills a blank/zero value, so a typed-in reading wins. def fill_next_due return if closed? || airworthiness_directive.nil? - base = aircraft_hours_at_compliance || aircraft&.tach_time + base = aircraft_hours_at_compliance || aircraft&.current_hours due = Compliance.next_due(airworthiness_directive.due_rule, date: date_complied, hours: base) self.next_due_at_time = due[:hours] if due[:hours] end @@ -35,7 +35,7 @@ class AdCompliance < ApplicationRecord def next_due_is_a_future_reading due = next_due_at_time.to_d return if closed? || due <= 0 - base = aircraft_hours_at_compliance || aircraft&.tach_time + base = aircraft_hours_at_compliance || aircraft&.current_hours return unless base && due <= base errors.add(:next_due_at_time, "must be a tach reading after the compliance hours (#{base}). " \ "For “every 100 hours” enter #{base + 100}, not 100") diff --git a/app/models/aircraft.rb b/app/models/aircraft.rb index 039d6f1..edead76 100644 --- a/app/models/aircraft.rb +++ b/app/models/aircraft.rb @@ -28,7 +28,12 @@ class Aircraft < ApplicationRecord has_and_belongs_to_many :inspection_types has_and_belongs_to_many :airworthiness_directives + # Which clock counts as time in service for maintenance (14 CFR 1.1 defines + # it as takeoff to landing; many owners use tach, some Hobbs). + TIME_BASES = { "tach" => "Tach", "hobbs" => "Hobbs" }.freeze + validates :tail_number, presence: true + validates :time_basis, inclusion: { in: TIME_BASES.keys } validates :status, inclusion: { in: STATUSES.keys } validates :icao_type, format: { with: /\A[A-Z0-9]{1,4}\z/, message: "must be an ICAO type designator like C150" }, allow_blank: true normalizes :icao_type, with: ->(t) { t.strip.upcase.presence } @@ -40,11 +45,15 @@ class Aircraft < ApplicationRecord def status_label = STATUSES[status] - # Hours used for compliance calculations (tach minus offset, as in the original). + # Time in service used for maintenance: the chosen clock minus its offset + # (as in the original, offsets cover a replaced meter). def current_hours - tach_time - tach_time_offset + hobbs? ? hobbs_time - hobbs_time_offset : tach_time - tach_time_offset end + def hobbs? = time_basis == "hobbs" + def time_basis_label = TIME_BASES[time_basis] + def airworthiness @airworthiness ||= Airworthiness.new(self).call end diff --git a/app/models/inspection_type.rb b/app/models/inspection_type.rb index dcec00d..cf9d19e 100644 --- a/app/models/inspection_type.rb +++ b/app/models/inspection_type.rb @@ -1,9 +1,26 @@ class InspectionType < ApplicationRecord + # What it means for the aircraft when this inspection is overdue. + EFFECTS = { + "grounds" => "Grounds the aircraft", + "no_ifr" => "No IFR flight (e.g. pitot-static, 91.411)", + "no_transponder" => "Transponder can't be used (91.413)", + "advisory" => "Advisory only" + }.freeze + # Short form for the airworthiness status ("VFR only"). + LIMITATIONS = { "no_ifr" => "VFR only", "no_transponder" => "No transponder" }.freeze + has_and_belongs_to_many :aircraft has_and_belongs_to_many :components has_many :inspection_records, dependent: :destroy + belongs_to :satisfies, class_name: "InspectionType", optional: true + has_many :satisfied_by, class_name: "InspectionType", foreign_key: :satisfies_id, inverse_of: :satisfies, dependent: :nullify validates :name, presence: true + validates :effect, inclusion: { in: EFFECTS.keys } + validates :hours_tolerance, numericality: { greater_than_or_equal_to: 0, less_than_or_equal_to: 100 } + validate { errors.add(:satisfies, "can't be the inspection itself") if satisfies_id.present? && satisfies_id == id } + # `required` mirrors effect, for archives shared with the original app. + before_validation { self.required = effect != "advisory" } scope :ordered, -> { order(:name) } @@ -15,6 +32,17 @@ class InspectionType < ApplicationRecord end def to_s = name + def effect_label = EFFECTS[effect] + def limitation = LIMITATIONS[effect] + def advisory? = effect == "advisory" + + # Records that count for this inspection on the aircraft: its own, plus + # those of inspections that satisfy it (an annual for the 100-hour). + def records_for(aircraft) + InspectionRecord.for_aircraft(aircraft).where(inspection_type_id: [ id, *satisfied_by.ids ]) + end + + def latest_record_for(aircraft) = records_for(aircraft).recent_first.first def due_rule { hours: recurring_hours.to_f, months: recurring_months, days: recurring_days } if recurring? diff --git a/app/services/aircraft_archive/exporter.rb b/app/services/aircraft_archive/exporter.rb index 40c7f11..23051dc 100644 --- a/app/services/aircraft_archive/exporter.rb +++ b/app/services/aircraft_archive/exporter.rb @@ -119,7 +119,7 @@ module AircraftArchive def aircraft_hash(a) { id: id(a), tail_number: a.tail_number, make: a.make, model: a.model, serial_number: a.serial_number, - description: a.description, purchased: a.purchased&.iso8601, status: a.status, tach_time: dec(a.tach_time), + description: a.description, purchased: a.purchased&.iso8601, status: a.status, time_basis: a.time_basis, tach_time: dec(a.tach_time), tach_time_offset: dec(a.tach_time_offset), hobbs_time: dec(a.hobbs_time), hobbs_time_offset: dec(a.hobbs_time_offset), picture: file(a.picture, "aircraft_pictures"), icao_type: a.icao_type } end @@ -150,7 +150,8 @@ module AircraftArchive end def inspection_type_hash(t, component_ids) - { id: id(t), name: t.name, recurring: t.recurring, required: t.required, recurring_hours: dec(t.recurring_hours), + { id: id(t), name: t.name, recurring: t.recurring, required: t.required, effect: t.effect, + hours_tolerance: dec(t.hours_tolerance), satisfies: t.satisfies_id && id(t.satisfies), recurring_hours: dec(t.recurring_hours), recurring_days: t.recurring_days, recurring_months: t.recurring_months, applicable_aircraft: t.aircraft_ids.include?(@aircraft.id) ? [ id(@aircraft) ] : [], applicable_component: (t.component_ids & component_ids).map { id(_1) } } diff --git a/app/services/aircraft_archive/importer.rb b/app/services/aircraft_archive/importer.rb index 0564df7..e934a4e 100644 --- a/app/services/aircraft_archive/importer.rb +++ b/app/services/aircraft_archive/importer.rb @@ -139,6 +139,7 @@ module AircraftArchive tail_number: (@tail_number.presence || a["tail_number"]).to_s.strip.upcase, make: a["make"].to_s, model: a["model"].to_s, serial_number: a["serial_number"].to_s, description: a["description"].to_s, purchased: date(a["purchased"]), status: Aircraft::STATUSES.key?(a["status"]) ? a["status"] : "AVAILABLE", + time_basis: Aircraft::TIME_BASES.key?(a["time_basis"]) ? a["time_basis"] : "tach", tach_time: num(a["tach_time"] || a["flight_time"]) || 0, tach_time_offset: num(a["tach_time_offset"]) || 0, hobbs_time: num(a["hobbs_time"]) || 0, hobbs_time_offset: num(a["hobbs_time_offset"]) || 0, icao_type: a["icao_type"].to_s.upcase.presence&.then { _1.match?(/\A[A-Z0-9]{1,4}\z/) ? _1 : nil } @@ -256,7 +257,9 @@ module AircraftArchive if type warn("Inspection type “#{name}” already existed here and was reused.") if type.recurring != (data["recurring"] == true) else - type = InspectionType.new(name: name, recurring: data["recurring"] == true, required: data["required"] != false, + effect = InspectionType::EFFECTS.key?(data["effect"]) ? data["effect"] : (data["required"] == false ? "advisory" : "grounds") + type = InspectionType.new(name: name, recurring: data["recurring"] == true, effect: effect, + required: effect != "advisory", hours_tolerance: num(data["hours_tolerance"]) || 0, recurring_hours: num(data["recurring_hours"]), recurring_days: data["recurring_days"], recurring_months: data["recurring_months"]) type.save!(validate: false) @@ -265,6 +268,11 @@ module AircraftArchive type.aircraft << @aircraft if Array(data["applicable_aircraft"]).any? && !type.aircraft.include?(@aircraft) components(data["applicable_component"]).each { |c| type.components << c unless type.components.include?(c) } @map[:inspection_type][data["id"].to_s] = type.id + (@satisfies ||= []) << [ type, data["satisfies"].to_s ] if data["satisfies"].present? + end + Array(@satisfies).each do |type, ref| + target = @map[:inspection_type][ref] + type.update_column(:satisfies_id, target) if target && type.satisfies_id.nil? && target != type.id end m("inspection_records").each do |data| type_id = @map[:inspection_type][data["inspection_type_id"].to_s] diff --git a/app/services/airworthiness.rb b/app/services/airworthiness.rb index f30c343..ca53f02 100644 --- a/app/services/airworthiness.rb +++ b/app/services/airworthiness.rb @@ -1,22 +1,43 @@ -# Computes RED / ORANGE / GREEN airworthiness for an aircraft. Checks (in order): -# AD compliance, grounding squawks, inspection recurrency, component replacement. +# Summarizes an aircraft's records: AD compliance, grounding squawks, +# inspection recurrency and component replacement. +# +# RED something that grounds the aircraft is overdue +# LIMITED it may fly with limitations (pitot-static overdue: VFR only; +# transponder check overdue: no transponder) +# ORANGE something is due soon +# GREEN nothing overdue or due soon +# +# This reflects only what's recorded here. Before each flight the pilot in +# command decides whether the aircraft is airworthy (14 CFR 91.7). class Airworthiness HOURS_WARNING = BigDecimal("10") DAYS_WARNING = 30 RED = "RED" + LIMITED = "LIMITED" ORANGE = "ORANGE" GREEN = "GREEN" + DISCLAIMER = "Based on the records in this app. Before each flight the pilot in command decides whether the aircraft is airworthy (14 CFR 91.7)." - Issue = Struct.new(:category, :severity, :title, :description, :item, keyword_init: true) + Issue = Struct.new(:category, :severity, :title, :description, :item, :limitation, keyword_init: true) Status = Struct.new(:status, :issues, keyword_init: true) do def red? = status == RED + def limited? = status == LIMITED def orange? = status == ORANGE def green? = status == GREEN - def can_fly? = green? + def can_fly? = !red? def red_issues = issues.select { |i| i.severity == RED } - def label = { RED => "Not Airworthy", ORANGE => "Attention Needed", GREEN => "Airworthy" }[status] + def limitations = issues.filter_map(&:limitation).uniq + + def label + case status + when RED then "Grounded" + when LIMITED then limitations.join(" · ") + when ORANGE then "Due soon" + else "Current" + end + end end def initialize(aircraft, today: Date.current) @@ -34,6 +55,7 @@ class Airworthiness status = if @issues.any? { _1.severity == RED } then RED + elsif @issues.any? { _1.severity == LIMITED } then LIMITED elsif @issues.any? { _1.severity == ORANGE } then ORANGE else GREEN end @@ -42,8 +64,8 @@ class Airworthiness private - def add(category, severity, title, description, item) - @issues << Issue.new(category:, severity:, title:, description:, item:) + def add(category, severity, title, description, item, limitation: nil) + @issues << Issue.new(category:, severity:, title:, description:, item:, limitation:) end def check_ads @@ -68,15 +90,16 @@ class Airworthiness end def check_inspections - @aircraft.applicable_inspection_types.where(required: true).find_each do |type| - last = type.inspection_records.for_aircraft(@aircraft).recent_first.first - res = Compliance.inspection_status(type, last, @hours, @today) + @aircraft.applicable_inspection_types.where.not(effect: "advisory").includes(:satisfied_by).find_each do |type| + records = type.records_for(@aircraft).to_a + res = Compliance.inspection_status(type, records, @hours, @today) case res.rank when Compliance::OVERDUE - if last - add("INSPECTION", RED, "#{type.name} - Overdue", "Inspection overdue.", type) + title = "#{type.name} - #{records.any? ? 'Overdue' : 'Never Completed'}" + if (limitation = type.limitation) + add("INSPECTION", LIMITED, title, "#{limitation} until it's done.", type, limitation: limitation) else - add("INSPECTION", RED, "#{type.name} - Never Completed", "Required inspection has no completion record.", type) + add("INSPECTION", RED, title, overdue_description(type, records, res), type) end when Compliance::DUE_SOON add("INSPECTION", ORANGE, "#{type.name} - Due Soon", "Inspection due soon.", type) @@ -84,6 +107,19 @@ class Airworthiness end end + # The 100-hour may be overflown by up to its tolerance only to reach a + # place where it can be done (91.409(b)); say so while that's still open. + def overdue_description(type, records, res) + return "Required inspection has no completion record." if records.empty? + over = res.next_due_hours && @hours - res.next_due_hours + if over && type.hours_tolerance.positive? && over <= type.hours_tolerance + "Inspection overdue. It may be flown up to #{type.hours_tolerance.to_s.sub(/\.0\z/, '')} hrs past due only to reach " \ + "a place where it can be done; that time counts toward the next interval (91.409(b))." + else + "Inspection overdue." + end + end + def check_components @aircraft.components.in_use.where(replacement_critical: true).includes(:component_type).find_each do |c| overdue = false diff --git a/app/services/compliance.rb b/app/services/compliance.rb index e95f08c..70928c4 100644 --- a/app/services/compliance.rb +++ b/app/services/compliance.rb @@ -65,7 +65,15 @@ module Compliance result end - def inspection_status(type, last_record, current_hours, today = Date.current) + # `records` are those that count for the type (InspectionType#records_for). + # Calendar intervals run from the latest one's date. Hour intervals run from + # the hours at the latest one, except that an inspection done late, within + # the type's hours_tolerance, is counted from when it was due (91.409(b): + # the 100-hour's 10-hour allowance counts toward the next 100 hours). Done + # early, there's no credit: the next is counted from when it was done. + def inspection_status(type, records, current_hours, today = Date.current) + records = records.to_a + last_record = records.max_by { [ _1.date, _1.created_at || Time.at(0) ] } return Result.new(rank: OVERDUE) unless last_record return Result.new(rank: COMPLIANT) unless type.recurring? @@ -84,13 +92,11 @@ module Compliance end end - interval = type.recurring_hours.to_d - if interval > 0 && (hours_at = last_record.hours_at_inspection) - since = current_hours - hours_at - result.next_due_hours = hours_at + interval - if since >= interval + if (due_hours = next_due_hours(type, records)) + result.next_due_hours = due_hours + if current_hours >= due_hours rank = OVERDUE - elsif since + Airworthiness::HOURS_WARNING >= interval + elsif current_hours + Airworthiness::HOURS_WARNING >= due_hours rank = [ rank, DUE_SOON ].max end end @@ -99,6 +105,19 @@ module Compliance result end + def next_due_hours(type, records) + interval = type.recurring_hours.to_d + return unless interval.positive? + tolerance = type.hours_tolerance.to_d + due = nil + records.select(&:hours_at_inspection).sort_by { [ _1.date, _1.hours_at_inspection ] }.each do |r| + hours = r.hours_at_inspection.to_d + base = due && hours > due && hours - due <= tolerance ? due : hours + due = base + interval + end + due + end + # Rows for the ADs tab: every applicable AD with its latest compliance and status. AdRow = Struct.new(:ad, :latest, :status, :next_due_date, :next_due_hours, keyword_init: true) @@ -123,11 +142,12 @@ module Compliance def inspection_rows(aircraft) hours = aircraft.current_hours aircraft.applicable_inspection_types.ordered.map do |type| - latest = type.inspection_records.for_aircraft(aircraft).recent_first.first + records = type.records_for(aircraft).to_a + latest = records.max_by { [ _1.date, _1.created_at || Time.at(0) ] } if latest.nil? InspectionRow.new(type: type, latest: nil, status: "never_completed") else - res = inspection_status(type, latest, hours) + res = inspection_status(type, records, hours) InspectionRow.new(type: type, latest: latest, status: res.label, next_due_date: res.next_due_date, next_due_hours: res.next_due_hours) end diff --git a/app/services/hours_service.rb b/app/services/hours_service.rb index 188c1c8..e31b280 100644 --- a/app/services/hours_service.rb +++ b/app/services/hours_service.rb @@ -1,5 +1,6 @@ # Flight-activity writes: absolute hours updates and flight logs. Both cascade -# the tach delta to every IN-USE component. +# the time-in-service delta (tach or Hobbs, per the aircraft's maintenance +# clock) to every IN-USE component. class HoursService def initialize(aircraft, user: Current.user) @aircraft = aircraft @@ -17,19 +18,22 @@ class HoursService def update_hours!(tach_time:, hobbs_time: nil) enforce_airworthiness! tach = BigDecimal(tach_time.to_s) - delta = tach - @aircraft.tach_time + hobbs = BigDecimal(hobbs_time.to_s) if hobbs_time.present? old = @aircraft.tach_time + tach_delta = tach - old + # On Hobbs time, components follow the Hobbs change (when one is given). + delta = @aircraft.hobbs? && hobbs ? hobbs - @aircraft.hobbs_time : tach_delta Aircraft.transaction do @aircraft.tach_time = tach - @aircraft.hobbs_time = BigDecimal(hobbs_time.to_s) if hobbs_time.present? + @aircraft.hobbs_time = hobbs if hobbs @aircraft.save! cascade_to_components(delta, clamp: true) @aircraft.log_event!("hours", - "Hours #{delta >= 0 ? 'updated' : 'corrected'} to #{tach}", - user: @user, notes: "Previous: #{old}, delta: #{delta >= 0 ? '+' : ''}#{delta}") + "Hours #{tach_delta >= 0 ? 'updated' : 'corrected'} to #{tach}", + user: @user, notes: "Previous: #{old}, delta: #{tach_delta >= 0 ? '+' : ''}#{tach_delta}") end - delta + tach_delta end # Persist a flight log and apply its side effects atomically. @@ -43,7 +47,7 @@ class HoursService @aircraft.tach_time += flight.tach_time @aircraft.hobbs_time += flight.hobbs_time if flight.hobbs_time @aircraft.save! - cascade_to_components(flight.tach_time) + cascade_to_components(@aircraft.hobbs? && flight.hobbs_time ? flight.hobbs_time : flight.tach_time) { "oil" => [ flight.oil_added, flight.oil_level_after, flight.oil_added_type ], "fuel" => [ flight.fuel_added, flight.fuel_level_after, flight.fuel_added_type ] }.each do |type, (qty, level, kind)| diff --git a/app/views/ad_imports/show.html.erb b/app/views/ad_imports/show.html.erb index ff57b6a..a846a99 100644 --- a/app/views/ad_imports/show.html.erb +++ b/app/views/ad_imports/show.html.erb @@ -13,7 +13,7 @@ <% if rows.none?(&:url) %>
This file has no links to the AD documents. DRS's Excel export includes them; import that file instead (or afterwards) to get clickable AD numbers.
<% end %>Choose what to do with each AD. The suggestions are based on the FAA data and your aircraft's model (<%= @aircraft.model.presence || "not set" %>); you make the call.
To change hours use “Update Hours” on the overview, so component times stay in sync.
<% end %> <%= f.field :picture, as: :file, accept: "image/*" %> <%= f.field :airworthiness_enforcement, as: :checkbox, label: "Enforce airworthiness", - hint: "Block flight logs and hours updates while the aircraft is red." %> + hint: "Block flight logs and hours updates while the aircraft shows Grounded." %>No open issues. All tracked ADs, inspections, components and squawks are current.
+Nothing overdue or due soon. All tracked ADs, inspections, components and squawks are current.
<% else %>Airworthiness enforcement is on: flights and hours updates are blocked while the status is red.
+Airworthiness enforcement is on: flights and hours updates are blocked while the aircraft shows Grounded.
<% end %> +<%= Airworthiness::DISCLAIMER %>
This inspection type is shared with other aircraft; interval changes affect them too.
diff --git a/app/views/inspections/index.html.erb b/app/views/inspections/index.html.erb index f7de6cd..10cb6c0 100644 --- a/app/views/inspections/index.html.erb +++ b/app/views/inspections/index.html.erb @@ -10,7 +10,8 @@No open issues.
<% else %> -Nothing overdue or due soon.
<% else %> +<%= Airworthiness::DISCLAIMER %>