diff --git a/app/controllers/ad_compliances_controller.rb b/app/controllers/ad_compliances_controller.rb index 98da743..0afaab0 100644 --- a/app/controllers/ad_compliances_controller.rb +++ b/app/controllers/ad_compliances_controller.rb @@ -7,7 +7,8 @@ class AdCompliancesController < ApplicationController 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.current_hours, - not_applicable: params[:not_applicable] == "1") + compliance_method: params[:not_applicable] == "1" ? "not_applicable" : "inspection") + @compliance.apply_method @compliance.compliance_notes = "Not applicable: " if @compliance.not_applicable? @compliance.fill_next_due end @@ -46,7 +47,8 @@ class AdCompliancesController < ApplicationController def compliance_params p = params.require(:ad_compliance).permit( :airworthiness_directive_id, :date_complied, :compliance_notes, :permanent, :next_due_at_time, - :aircraft_hours_at_compliance, :logbook_entry_id, :inspection_record_id, :component_id, :not_applicable + :aircraft_hours_at_compliance, :logbook_entry_id, :inspection_record_id, :component_id, + :compliance_method, :ad_revision ) p[:airworthiness_directive_id] = scoped_id(@aircraft.applicable_ads, p[:airworthiness_directive_id]) p[:logbook_entry_id] = scoped_id(@aircraft.logbook_entries, p[:logbook_entry_id]) diff --git a/app/controllers/logbook_entries_controller.rb b/app/controllers/logbook_entries_controller.rb index d7c989a..2b046da 100644 --- a/app/controllers/logbook_entries_controller.rb +++ b/app/controllers/logbook_entries_controller.rb @@ -50,7 +50,8 @@ class LogbookEntriesController < ApplicationController def entry_params p = params.require(:logbook_entry).permit(:log_type, :entry_type, :date, :text, :signoff_person, - :signoff_location, :aircraft_hours_at_entry, :document_id, :page_number) + :signoff_location, :aircraft_hours_at_entry, :document_id, :page_number, + :signoff_certificate_type, :signoff_certificate_number, :inspection_result) p[:document_id] = scoped_id(@aircraft.documents, p[:document_id]) p end diff --git a/app/controllers/maintenance_reports_controller.rb b/app/controllers/maintenance_reports_controller.rb new file mode 100644 index 0000000..c8a2bb4 --- /dev/null +++ b/app/controllers/maintenance_reports_controller.rb @@ -0,0 +1,10 @@ +# Printable maintenance status report (Print / Save as PDF in the browser). +class MaintenanceReportsController < ApplicationController + include AircraftScoped + + def show + @report = MaintenanceReport.new(@aircraft) + log_event("aircraft", "Maintenance status report viewed") if params[:print] + render layout: "report" + end +end diff --git a/app/controllers/shared_controller.rb b/app/controllers/shared_controller.rb index d7608d0..0558483 100644 --- a/app/controllers/shared_controller.rb +++ b/app/controllers/shared_controller.rb @@ -5,6 +5,15 @@ class SharedController < ApplicationController skip_before_action :redirect_to_setup layout "public" + # The maintenance status report, for "Maintenance Detail" links (mechanics, + # inspectors, buyers). + def report + @share = ShareToken.find_active(params[:token]) or raise ActiveRecord::RecordNotFound + raise ActiveRecord::RecordNotFound unless @share.maintenance? + @report = MaintenanceReport.new(@share.aircraft) + render "maintenance_reports/show", layout: "report" + end + def show @share = ShareToken.find_active(params[:token]) or raise ActiveRecord::RecordNotFound @aircraft = @share.aircraft diff --git a/app/javascript/application.js b/app/javascript/application.js index 7dd46de..344b302 100644 --- a/app/javascript/application.js +++ b/app/javascript/application.js @@ -56,3 +56,7 @@ document.addEventListener("click", (event) => { document.addEventListener("change", (event) => { if (event.target.matches?.("[data-submit-on-change]")) event.target.form?.requestSubmit() }) + +document.addEventListener("click", (event) => { + if (event.target.closest?.("[data-print]")) window.print() +}) diff --git a/app/javascript/controllers/next_due_controller.js b/app/javascript/controllers/next_due_controller.js index fc2f0f8..111f808 100644 --- a/app/javascript/controllers/next_due_controller.js +++ b/app/javascript/controllers/next_due_controller.js @@ -60,6 +60,7 @@ export default class extends Controller { } get isPermanent() { - return this.permanentTargets.some((el) => el.checked) + // A checkbox ticked, or the method select on terminating action / N/A. + return this.permanentTargets.some((el) => el.tagName === "SELECT" ? [ "terminating", "not_applicable" ].includes(el.value) : el.checked) } } diff --git a/app/jobs/logbook_transcription_job.rb b/app/jobs/logbook_transcription_job.rb index 0aa147a..707f8a8 100644 --- a/app/jobs/logbook_transcription_job.rb +++ b/app/jobs/logbook_transcription_job.rb @@ -121,6 +121,8 @@ class LogbookTranscriptionJob < ApplicationJob date: date, text: text, log_type: log_type, entry_type: LogbookEntry::ENTRY_TYPES.key?(entry["entry_type"]) ? entry["entry_type"] : "OTHER", signoff_person: entry["signoff_person"].presence, signoff_location: entry["signoff_location"].presence, + signoff_certificate_type: LogbookEntry::CERTIFICATE_TYPES.key?(entry["signoff_certificate_type"]) ? entry["signoff_certificate_type"] : nil, + signoff_certificate_number: entry["signoff_certificate_number"].to_s.strip.first(40).presence, aircraft_hours_at_entry: entry["aircraft_hours"].is_a?(Numeric) && entry["aircraft_hours"] >= 0 ? entry["aircraft_hours"] : nil, document: @document, page_number: page_number ) diff --git a/app/models/ad_compliance.rb b/app/models/ad_compliance.rb index a185b69..21e5ae4 100644 --- a/app/models/ad_compliance.rb +++ b/app/models/ad_compliance.rb @@ -1,4 +1,12 @@ class AdCompliance < ApplicationRecord + # Method of compliance, recorded per 91.417(a)(2)(v). + METHODS = { + "inspection" => "Inspection", + "terminating" => "Terminating action (no further action)", + "amoc" => "Alternative method of compliance (AMOC)", + "not_applicable" => "Not applicable to this aircraft" + }.freeze + belongs_to :airworthiness_directive belongs_to :aircraft, optional: true belongs_to :component, optional: true @@ -6,6 +14,9 @@ class AdCompliance < ApplicationRecord belongs_to :inspection_record, optional: true validates :date_complied, :compliance_notes, presence: true + validates :compliance_method, inclusion: { in: METHODS.keys } + before_validation :apply_method + before_validation :fill_revision validate { errors.add(:base, "Must belong to an aircraft or component") unless aircraft_id || component_id } validate :next_due_is_a_future_reading before_validation :fill_next_due, if: -> { next_due_at_time.to_d.zero? } @@ -21,6 +32,23 @@ class AdCompliance < ApplicationRecord self.next_due_at_time = due[:hours] if due[:hours] end + def method_label = METHODS[compliance_method] + + # The method decides the closing flags (kept for archives shared with the + # original app): terminating action is permanent, N/A is not applicable. + def apply_method + self.compliance_method ||= not_applicable? ? "not_applicable" : (permanent? ? "terminating" : "inspection") + self.not_applicable = compliance_method == "not_applicable" + self.permanent = true if compliance_method == "terminating" + end + + # The AD number and revision date complied with, from the AD if left blank. + def fill_revision + return if ad_revision.present? || airworthiness_directive.nil? + ad = airworthiness_directive + self.ad_revision = [ ad.name, ("effective #{ad.effective_date.iso8601}" if ad.effective_date) ].compact.join(", ") + end + # Permanent compliance or a not-applicable determination: never due again. def closed? = permanent? || not_applicable? @@ -30,14 +58,14 @@ class AdCompliance < ApplicationRecord private - # next_due_at_time is an absolute tach reading, not an interval. Catch the + # next_due_at_time is an absolute clock reading, not an interval. Catch the # easy mistake of entering "100" for "every 100 hours". 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&.current_hours return unless base && due <= base - errors.add(:next_due_at_time, "must be a tach reading after the compliance hours (#{base}). " \ + errors.add(:next_due_at_time, "must be a #{aircraft&.time_basis || 'tach'} reading after the compliance hours (#{base}). " \ "For “every 100 hours” enter #{base + 100}, not 100") end end diff --git a/app/models/logbook_entry.rb b/app/models/logbook_entry.rb index 1aa494c..113bb37 100644 --- a/app/models/logbook_entry.rb +++ b/app/models/logbook_entry.rb @@ -5,6 +5,20 @@ class LogbookEntry < ApplicationRecord "HOURS_UPDATE" => "Hours Update", "OTHER" => "Other" }.freeze + # Kind of certificate of the person approving return to service (43.9(a)(4)). + CERTIFICATE_TYPES = { + "AP" => "A&P mechanic", "IA" => "A&P with Inspection Authorization", "A" => "Mechanic, airframe only", + "P" => "Mechanic, powerplant only", "REPAIR_STATION" => "Repair station", "REPAIRMAN" => "Repairman", + "PILOT" => "Pilot (preventive maintenance)", "OTHER" => "Other" + }.freeze + # An inspection entry ends with one of these (43.11(a)(5)). + INSPECTION_RESULTS = { + "approved" => "Airworthy, approved for return to service", + "discrepancies" => "Not approved: discrepancy list given to the owner" + }.freeze + # Entries that 43.9 / 43.11 set requirements for. + RECORD_TYPES = %w[MAINTENANCE INSPECTION].freeze + belongs_to :aircraft belongs_to :document, optional: true has_many :inspection_records, dependent: :nullify @@ -13,6 +27,9 @@ class LogbookEntry < ApplicationRecord validates :date, :text, presence: true validates :log_type, inclusion: { in: LOG_TYPES.keys } validates :entry_type, inclusion: { in: ENTRY_TYPES.keys } + validates :signoff_certificate_type, inclusion: { in: CERTIFICATE_TYPES.keys }, allow_blank: true + validates :inspection_result, inclusion: { in: INSPECTION_RESULTS.keys }, allow_blank: true + normalizes :signoff_certificate_type, :inspection_result, :signoff_certificate_number, with: ->(v) { v.strip.presence } scope :recent_first, -> { order(date: :desc, created_at: :desc) } @@ -23,4 +40,23 @@ class LogbookEntry < ApplicationRecord end def to_s = "#{date} — #{LOG_TYPES[log_type]}" + def certificate_label = CERTIFICATE_TYPES[signoff_certificate_type] + def inspection_result_label = INSPECTION_RESULTS[inspection_result] + + # What a maintenance (43.9) or inspection (43.11) entry is missing. Not + # enforced: older and transcribed entries often lack these, and the signed + # logbook is the record of truth. Shown so gaps can be filled in. + def missing_record_items + return [] unless RECORD_TYPES.include?(entry_type) + missing = [] + missing << "description of the work" if text.blank? + missing << "signer's name" if signoff_person.blank? + missing << "kind of certificate" if signoff_certificate_type.blank? + missing << "certificate number" if signoff_certificate_number.blank? + if entry_type == "INSPECTION" + missing << "aircraft time in service" if aircraft_hours_at_entry.blank? + missing << "airworthiness result" if inspection_result.blank? + end + missing + end end diff --git a/app/services/aircraft_archive/exporter.rb b/app/services/aircraft_archive/exporter.rb index 23051dc..5c1a521 100644 --- a/app/services/aircraft_archive/exporter.rb +++ b/app/services/aircraft_archive/exporter.rb @@ -66,6 +66,7 @@ module AircraftArchive ads: ads.map { ad_hash(_1, component_ids) }, ad_compliances: a.ad_compliances.map do |c| { id: id(c), ad_id: id(c.airworthiness_directive_id), date_complied: c.date_complied&.iso8601, compliance_notes: c.compliance_notes, + compliance_method: c.compliance_method, ad_revision: c.ad_revision, permanent: c.permanent, next_due_at_time: dec(c.next_due_at_time), aircraft_hours_at_compliance: dec(c.aircraft_hours_at_compliance), logbook_entry_id: id(c.logbook_entry_id), inspection_record_id: id(c.inspection_record_id), aircraft_id: id(a), component_id: id(c.component_id), not_applicable: c.not_applicable } @@ -136,7 +137,9 @@ module AircraftArchive def logbook_hash(e) { id: id(e), aircraft_id: id(e.aircraft_id), log_type: e.log_type, date: e.date&.iso8601, text: e.text, - signoff_person: e.signoff_person, signoff_location: e.signoff_location, log_image_id: id(e.document_id), + signoff_person: e.signoff_person, signoff_location: e.signoff_location, + signoff_certificate_type: e.signoff_certificate_type, signoff_certificate_number: e.signoff_certificate_number, + inspection_result: e.inspection_result, log_image_id: id(e.document_id), aircraft_hours_at_entry: dec(e.aircraft_hours_at_entry), component_hours: {}, entry_type: e.entry_type, page_number: e.page_number, components: [], related_documents: [] } end diff --git a/app/services/aircraft_archive/importer.rb b/app/services/aircraft_archive/importer.rb index e934a4e..cf7a062 100644 --- a/app/services/aircraft_archive/importer.rb +++ b/app/services/aircraft_archive/importer.rb @@ -223,6 +223,9 @@ module AircraftArchive entry_type: LogbookEntry::ENTRY_TYPES.key?(data["entry_type"]) ? data["entry_type"] : LogbookEntry::ENTRY_TYPES.keys.first, date: date(data["date"]) || Date.new(1900, 1, 1), text: data["text"].to_s.presence || "—", signoff_person: data["signoff_person"], signoff_location: data["signoff_location"], + signoff_certificate_type: LogbookEntry::CERTIFICATE_TYPES.key?(data["signoff_certificate_type"]) ? data["signoff_certificate_type"] : nil, + signoff_certificate_number: data["signoff_certificate_number"].to_s.presence, + inspection_result: LogbookEntry::INSPECTION_RESULTS.key?(data["inspection_result"]) ? data["inspection_result"] : nil, aircraft_hours_at_entry: num(data["aircraft_hours_at_entry"]), page_number: data["page_number"], document_id: @map[:document][data["log_image_id"].to_s] ) @@ -318,11 +321,14 @@ module AircraftArchive c = @aircraft.ad_compliances.new( airworthiness_directive_id: ad_id, date_complied: date(data["date_complied"]) || Date.new(1900, 1, 1), compliance_notes: data["compliance_notes"].to_s, permanent: data["permanent"] == true, + compliance_method: AdCompliance::METHODS.key?(data["compliance_method"]) ? data["compliance_method"] : nil, + ad_revision: data["ad_revision"].to_s.presence, next_due_at_time: num(data["next_due_at_time"]) || 0, aircraft_hours_at_compliance: num(data["aircraft_hours_at_compliance"]), logbook_entry_id: @map[:logbook][data["logbook_entry_id"].to_s], inspection_record_id: @map[:inspection_record][data["inspection_record_id"].to_s], component_id: @map[:component][data["component_id"].to_s], not_applicable: data["not_applicable"] == true ) + c.apply_method # older archives have only the permanent / not-applicable flags c.save!(validate: false) tick("ad_compliances") end diff --git a/app/services/logbook_transcriber/prompt.txt b/app/services/logbook_transcriber/prompt.txt index 11ba8de..603e487 100644 --- a/app/services/logbook_transcriber/prompt.txt +++ b/app/services/logbook_transcriber/prompt.txt @@ -26,7 +26,11 @@ Fields: - log_type: AC (airframe), ENG (engine), PROP (propeller), or OTHER - text: the entry text verbatim, or a close paraphrase where wording is unclear; write [?] for illegible words - aircraft_hours: the tach/total time the entry records (a number), or null if none is written -- signoff_person / signoff_location: a string, or null +- signoff_person / signoff_location: a string, or null (the person's name only; certificate details go below) +- signoff_certificate_type: the kind of certificate written with the signature: AP (A&P), IA (A&P with + Inspection Authorization), A (airframe only), P (powerplant only), REPAIR_STATION (repair station + number), REPAIRMAN, PILOT (pilot certificate, for owner preventive maintenance), OTHER, or null +- signoff_certificate_number: the certificate or repair station number exactly as written, or null - page_start / page_end: page indices within this request - confidence: high (clearly legible), medium (some guesswork), low (mostly illegible) - unparseable_pages: pages too illegible to extract anything from diff --git a/app/services/logbook_transcriber/schema.json b/app/services/logbook_transcriber/schema.json index 80098f0..e2f12a7 100644 --- a/app/services/logbook_transcriber/schema.json +++ b/app/services/logbook_transcriber/schema.json @@ -13,12 +13,14 @@ "aircraft_hours": { "type": ["number", "null"] }, "signoff_person": { "type": ["string", "null"] }, "signoff_location": { "type": ["string", "null"] }, + "signoff_certificate_type": { "type": ["string", "null"], "description": "AP, IA, A, P, REPAIR_STATION, REPAIRMAN, PILOT, OTHER, or null" }, + "signoff_certificate_number": { "type": ["string", "null"] }, "page_start": { "type": "integer" }, "page_end": { "type": "integer" }, "confidence": { "type": "string", "enum": ["high", "medium", "low"] } }, "required": ["date", "log_type", "entry_type", "text", "aircraft_hours", "signoff_person", "signoff_location", - "page_start", "page_end", "confidence"], + "signoff_certificate_type", "signoff_certificate_number", "page_start", "page_end", "confidence"], "additionalProperties": false } }, diff --git a/app/services/maintenance_report.rb b/app/services/maintenance_report.rb new file mode 100644 index 0000000..42eaa87 --- /dev/null +++ b/app/services/maintenance_report.rb @@ -0,0 +1,39 @@ +# The aircraft's maintenance status as 14 CFR 91.417(a)(2) lists it: +# total time in service (airframe, engines, propellers), life-limited parts, +# time since overhaul, inspection status, AD status and major alterations. +class MaintenanceReport + attr_reader :aircraft, :generated_at + + def initialize(aircraft) + @aircraft = aircraft + @generated_at = Time.current + end + + def time_in_service = aircraft.current_hours + + # Engines and propellers, by component type name. + def engines = major_components(/engine/i) + def propellers = major_components(/propell?er|\bprop\b/i) + + # Parts with a mandatory replacement time (life limits). + def life_limited + in_use.select { |c| c.replacement_critical? && (c.replacement_hours || c.replacement_days) } + end + + # Items overhauled on a time basis. + def overhaul_items + in_use.select { |c| c.tbo_hours || c.tbo_days } + end + + def inspections = @inspections ||= Compliance.inspection_rows(aircraft) + def ads = @ads ||= Compliance.ad_rows(aircraft) + def major_records = aircraft.major_records.recent_first.includes(:component, :form_337_document, :stc_document) + def open_squawks = aircraft.squawks.active.by_priority.includes(:component) + def airworthiness = aircraft.airworthiness + + private + + def in_use = @in_use ||= aircraft.components.in_use.includes(:component_type).order(:install_location).to_a + + def major_components(pattern) = in_use.select { |c| c.component_type&.name.to_s.match?(pattern) } +end diff --git a/app/views/ad_compliances/_form.html.erb b/app/views/ad_compliances/_form.html.erb index bb8dacc..b0cdf49 100644 --- a/app/views/ad_compliances/_form.html.erb +++ b/app/views/ad_compliances/_form.html.erb @@ -7,21 +7,26 @@ data: { next_due_target: "rule", action: "change->next-due#changed" } %>
A maintenance entry needs a description of the work, the date, and the name, signature, certificate number and kind of certificate of whoever approved the return to service (14 CFR 43.9). An inspection entry also needs the type and extent of the inspection, the aircraft's time in service, and the result (43.11).
++ Missing for <%= @entry.entry_type == "INSPECTION" ? "43.11" : "43.9" %>: <%= missing.to_sentence %>. + <%= link_to("Fill in", edit_aircraft_logbook_entry_path(@aircraft, @entry), class: "link") if owner? %> + (Check against the signed logbook.) +
+ <% end %> <% if @entry.document %>Scan: <%= link_to @entry.document.name, aircraft_document_path(@aircraft, @entry.document, page: @entry.page_number), class: "link" %><%= " (page #{@entry.page_number})" if @entry.page_number %>
<% end %> diff --git a/app/views/maintenance_reports/show.html.erb b/app/views/maintenance_reports/show.html.erb new file mode 100644 index 0000000..a5549cb --- /dev/null +++ b/app/views/maintenance_reports/show.html.erb @@ -0,0 +1,151 @@ +<% a = @report.aircraft %> +<% clock = a.time_basis_label.downcase %> +<% content_for :title, "#{a.tail_number} Maintenance Status" %> +<% section = "mt-6 break-inside-avoid-page" %> +<% th = "border-b border-slate-300 py-1 pr-3 text-left text-[11px] font-semibold uppercase tracking-wide text-slate-500" %> +<% td = "border-b border-slate-100 py-1 pr-3 align-top" %> + +Maintenance status · 14 CFR 91.417(a)(2)
+Serial number <%= a.serial_number.presence || "—" %>
+| Item | Make / model | Serial | Total time | Since overhaul | Overhauled |
|---|---|---|---|---|---|
| <%= c %> | <%= [ c.manufacturer, c.model ].compact_blank.join(" ") %> | <%= c.serial_number.presence || "—" %> | +<%= hours(c.hours_in_service) %> | <%= hours(c.hours_since_overhaul) %> | <%= c.overhaul_date || "—" %> |
No engines or propellers recorded as components.
<% end %> +| Part | Serial | Limit | Used | Remaining | Status |
|---|---|---|---|---|---|
| <%= c %> <%= c.model %> | <%= c.serial_number.presence || "—" %> | +<%= [ (c.replacement_hours && "#{hours(c.replacement_hours)} hrs"), (c.replacement_days && "#{c.replacement_days} days") ].compact.join(" / ") %> | +<%= hours(c.hours_since_overhaul) %> hrs | +<%= [ (c.hours_to_replacement && "#{hours(c.hours_to_replacement)} hrs"), (c.next_replacement_date && "by #{c.next_replacement_date}") ].compact.join(", ") %> | +<%= life_badge(c.life_status) %> |
None recorded.
<% end %> +| Item | Serial | Overhaul interval | Since overhaul | Remaining | Tracked as |
|---|---|---|---|---|---|
| <%= c %> <%= c.model %> | <%= c.serial_number.presence || "—" %> | +<%= [ (c.tbo_hours && "#{hours(c.tbo_hours)} hrs"), (c.tbo_days && "#{c.tbo_days} days") ].compact.join(" / ") %> | +<%= hours(c.hours_since_overhaul) %> hrs | +<%= c.on_condition? ? "On condition" : (c.hours_to_tbo ? "#{hours(c.hours_to_tbo)} hrs" : "—") %> | +<%= c.tbo_critical? ? "Hard limit" : "Recommended" %> |
None recorded.
<% end %> +| Inspection | Interval | Last done | Since | Next due | Status |
|---|---|---|---|---|---|
| <%= row.type.name %><% if row.type.satisfies %> Also counts as <%= row.type.satisfies.name %> <% end %> |
+ <%= row.type.interval_description %> | +<%= last ? "#{last.date}#{" @ #{hours(last.hours_at_inspection)}" if last.hours_at_inspection}" : "Never" %><%= " (#{last.inspection_type.name})" if last && last.inspection_type != row.type %> | +<%= last&.hours_at_inspection ? "#{hours(@report.time_in_service - last.hours_at_inspection)} hrs" : "—" %> | +<%= [ row.next_due_date&.to_s, row.next_due_hours && "#{hours(row.next_due_hours)} hrs" ].compact.join(" / ").presence || "—" %> | +<%= compliance_badge(row.status) %> |
No inspections tracked.
<% end %> +| AD | Revision complied with | Method of compliance | Complied | Recurring / next due | Status |
|---|---|---|---|---|---|
| <%= row.ad.name %> <%= row.ad.short_description.to_s.truncate(70) %> |
+ <%= c&.ad_revision.presence || "—" %> | +<%= c ? c.method_label : "—" %><% if c&.compliance_notes.present? %> <%= c.compliance_notes.truncate(90) %> <% end %> |
+ <%= c ? "#{c.date_complied}#{" @ #{hours(c.aircraft_hours_at_compliance)}" if c.aircraft_hours_at_compliance}" : "—" %> | +<%= if c&.closed? then "No further action" + elsif row.ad.recurring? then [ row.next_due_date&.to_s, row.next_due_hours && "#{hours(row.next_due_hours)} hrs" ].compact.join(" / ").presence || "Recurring" + else "One-time" end %> | +<%= compliance_badge(row.status) %> |
No ADs tracked.
<% end %> +| Date | Type | Description | STC | Form 337 |
|---|---|---|---|---|
| <%= m.date_performed %> | <%= m.type_label %> | +<%= m.title %><%= " · #{m.component}" if m.component %> | +<%= [ m.stc_number, m.stc_holder ].compact_blank.join(", ").presence || "—" %> | +<%= m.form_337_document ? "On file" : "—" %> |
None recorded.
<% end %> +None open.
<% end %> +Nothing overdue or due soon.
<% else %>