Record keeping: 43.9/43.11 sign-off fields, AD method, status report

- Logbook entries record the signer's kind of certificate and number and
  an inspection's result; maintenance and inspection entries list what
  43.9 / 43.11 needs that's missing (flagged, not enforced). Transcription
  reads the certificate details too
- AD compliance records the method (inspection, terminating action, AMOC,
  not applicable) and the AD revision complied with, filled in from the AD
  when blank; the method sets the permanent / N/A flags
- Maintenance status report (91.417(a)(2)): total times, life-limited
  parts, time since overhaul, inspection and AD status, major alterations,
  open discrepancies; print or save as PDF; on maintenance share links too
- Archives carry the new fields

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rickyandClaude Opus 5.5 committed 2026-11-07 10:14:21 -05:00
1 parent a4b72cf2c1
commit a4ec7a691e
30 files changed
+515 -26

No files matched your search

+12 -7
View File
@@ -7,21 +7,26 @@
data: { next_due_target: "rule", action: "change->next-due#changed" } %>
<div class="grid gap-4 sm:grid-cols-2">
<%= f.field :date_complied, as: :date, data: { next_due_target: "date", action: "change->next-due#changed" } %>
<%= f.field :aircraft_hours_at_compliance, as: :number, step: 0.1, label: "Aircraft hours (tach)",
<%= f.field :aircraft_hours_at_compliance, as: :number, step: 0.1, label: "Aircraft hours (#{aircraft.time_basis_label.downcase})",
data: { next_due_target: "hours", action: "input->next-due#changed" } %>
<%= f.field :next_due_at_time, as: :number, step: 0.1, label: "Next due at tach reading",
<%= f.field :next_due_at_time, as: :number, step: 0.1, label: "Next due at #{aircraft.time_basis_label.downcase} reading",
hint: "Calculated from the AD's recurrence; you can override it. Leave 0 if not hour-based.",
data: { next_due_target: "dueHours", action: "input->next-due#markManual" } %>
<%= f.field :component_id, as: :select, label: "Component", collection: component_options(aircraft) %>
<%= f.field :logbook_entry_id, as: :select, label: "Logbook entry", collection: logbook_options(aircraft) %>
</div>
<p class="rounded-md bg-sky-50 px-3 py-2 text-sm text-sky-900 ring-1 ring-sky-200" data-next-due-target="preview" hidden></p>
<%= f.field :permanent, as: :checkbox, label: "Permanently complied (terminating action)",
<div class="grid gap-4 sm:grid-cols-2">
<%= f.field :compliance_method, as: :select, label: "Method of compliance", collection: AdCompliance::METHODS.invert,
data: { next_due_target: "permanent", action: "change->next-due#changed" } %>
<%= f.field :ad_revision, label: "AD revision complied with", placeholder: "e.g. 2011-10-09 R1, effective 2011-06-01",
hint: "AD number and revision or effective date (91.417(a)(2)(v)). Left blank, it's taken from the AD." %>
</div>
<%= f.field :permanent, as: :checkbox, label: "No further action required (ends the recurring requirement)",
hint: "Set automatically for terminating action; tick it for an AMOC that ends the recurrence.",
data: { next_due_target: "permanent", action: "change->next-due#changed" } %>
<%= f.field :not_applicable, as: :checkbox, label: "Not applicable to this aircraft",
hint: "E.g. serial number outside the affected range, or the equipment isn't installed. Record why below.",
data: { next_due_target: "permanent", action: "change->next-due#changed" } %>
<%= f.field :compliance_notes, as: :textarea, label: "Method of compliance / reason", rows: 3, required: true %>
<%= f.field :compliance_notes, as: :textarea, label: "Details", rows: 3, required: true,
hint: "What was done and per which paragraph of the AD; for not applicable, why (e.g. serial number outside the affected range, equipment not installed)." %>
<div class="flex gap-2"><%= f.submit "Save" %><%= link_to "Cancel", aircraft_airworthiness_directives_path(aircraft), class: "btn-secondary" %></div>
<% end %>
<% if compliance.persisted? %><div class="mt-4"><%= delete_button "Delete record", aircraft_ad_compliance_path(aircraft, compliance) %></div><% end %>
+4 -1
View File
@@ -6,7 +6,10 @@
<section class="card">
<div class="card-header">
<h2 class="card-title">Airworthiness</h2>
<%= airworthiness_badge(@airworthiness, large: true) %>
<div class="flex items-center gap-2">
<%= link_to "Status report", aircraft_report_path(@aircraft), class: "btn-secondary btn-sm", title: "Printable maintenance status (91.417)" %>
<%= airworthiness_badge(@airworthiness, large: true) %>
</div>
</div>
<div class="card-body">
<% if @airworthiness.issues.empty? %>
@@ -69,6 +69,7 @@
<td class="text-right"><%= hours(c.aircraft_hours_at_compliance) %></td>
<td><%= c.not_applicable? ? "N/A" : c.permanent? ? "Permanent" : (c.next_due_at_time.to_f > 0 ? hours(c.next_due_at_time) : "—") %></td>
<td class="max-w-md text-xs">
<div class="font-medium text-slate-700"><%= c.method_label %><%= " · #{c.ad_revision}" if c.ad_revision.present? %></div>
<%= c.compliance_notes %>
<% if c.logbook_entry || c.inspection_record %>
<div class="mt-1 flex flex-wrap gap-x-3">
+2 -1
View File
@@ -31,7 +31,8 @@
<%= f.field :tbo_hours, as: :number, label: "TBO (hrs)" %>
<%= f.field :tbo_days, as: :number, label: "TBO (days)" %>
<div class="space-y-2">
<%= f.field :tbo_critical, as: :checkbox, label: "TBO critical" %>
<%= f.field :tbo_critical, as: :checkbox, label: "Treat TBO as a hard limit",
hint: "Under Part 91, TBO is usually the manufacturer's recommendation, unless an AD or the Airworthiness Limitations make it mandatory." %>
<%= f.field :on_condition, as: :checkbox, label: "On condition (Part 91)" %>
</div>
<%= f.field :inspection_hours, as: :number, label: "Inspect every (hrs)" %>
+20
View File
@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html class="bg-white" data-theme="light">
<head>
<title><%= [content_for(:title), "Simple Aircraft Manager"].compact.join(" · ") %></title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="robots" content="noindex, nofollow">
<%= csrf_meta_tags %>
<%= csp_meta_tag %>
<link rel="icon" href="/favicon.svg" type="image/svg+xml">
<%= stylesheet_link_tag :app, "data-turbo-track": "reload" %>
<%= javascript_importmap_tags %>
<style>
html, body { background: #fff; }
@page { margin: 0.5in; }
</style>
</head>
<body class="bg-white text-slate-900 report">
<main class="mx-auto max-w-5xl px-4 py-6 print:max-w-none print:p-0"><%= yield %></main>
</body>
</html>
+9 -1
View File
@@ -7,8 +7,16 @@
<%= f.field :aircraft_hours_at_entry, as: :number, step: 0.1, label: "Aircraft hours" %>
</div>
<%= f.field :text, as: :textarea, label: "Entry text", rows: 8 %>
<p class="hint !mt-1">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).</p>
<div class="grid gap-4 sm:grid-cols-3">
<%= f.field :signoff_person, label: "Signed off by", placeholder: "Name" %>
<%= f.field :signoff_certificate_type, as: :select, label: "Kind of certificate", include_blank: "—",
collection: LogbookEntry::CERTIFICATE_TYPES.invert %>
<%= f.field :signoff_certificate_number, label: "Certificate number", placeholder: "e.g. 1234567" %>
</div>
<div class="grid gap-4 sm:grid-cols-2">
<%= f.field :signoff_person, label: "Signed off by", placeholder: "Name, A&P/IA #" %>
<%= f.field :inspection_result, as: :select, label: "Inspection result", include_blank: "— Not an inspection —",
collection: LogbookEntry::INSPECTION_RESULTS.invert, hint: "For inspection entries (43.11)." %>
<%= f.field :signoff_location, label: "Location / shop" %>
<%= f.field :document_id, as: :select, label: "Scanned page document", collection: document_options(aircraft) %>
<%= f.field :page_number, as: :number, label: "Page # in document" %>
+2 -1
View File
@@ -24,7 +24,8 @@
<td class="text-xs"><%= LogbookEntry::ENTRY_TYPES[e.entry_type] %></td>
<td class="text-right tabular-nums"><%= hours(e.aircraft_hours_at_entry) %></td>
<td class="max-w-xl"><%= e.text.truncate(220) %> <%= "📄" if e.document %></td>
<td class="text-xs text-slate-500"><%= e.signoff_person %><% if e.signoff_location.present? %><br><%= e.signoff_location %><% end %></td>
<td class="text-xs text-slate-500"><%= e.signoff_person %><%= " ##{e.signoff_certificate_number}" if e.signoff_certificate_number %><% if e.signoff_location.present? %><br><%= e.signoff_location %><% end %>
<% if (missing = e.missing_record_items).any? %><br><span class="badge-orange" title="Missing: <%= missing.to_sentence %>">Incomplete</span><% end %></td>
</tr>
<% end %>
</tbody>
+13 -1
View File
@@ -10,7 +10,19 @@
<span>Aircraft hours: <%= hours(@entry.aircraft_hours_at_entry) %></span>
</div>
<div class="whitespace-pre-wrap rounded bg-slate-50 p-3 font-mono text-sm"><%= @entry.text %></div>
<div class="text-sm text-slate-600">Signed off: <%= @entry.signoff_person.presence || "—" %> <%= "(#{@entry.signoff_location})" if @entry.signoff_location.present? %></div>
<div class="text-sm text-slate-600">
Signed off: <%= @entry.signoff_person.presence || "—" %>
<%= ", #{@entry.certificate_label}" if @entry.certificate_label %><%= " ##{@entry.signoff_certificate_number}" if @entry.signoff_certificate_number %>
<%= "(#{@entry.signoff_location})" if @entry.signoff_location.present? %>
</div>
<% if @entry.inspection_result %><div class="text-sm text-slate-600">Result: <%= @entry.inspection_result_label %></div><% end %>
<% if (missing = @entry.missing_record_items).any? %>
<p class="rounded-md bg-amber-50 px-3 py-2 text-sm text-amber-900 ring-1 ring-amber-200">
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.)
</p>
<% end %>
<% if @entry.document %>
<p class="text-sm">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 %></p>
<% end %>
+151
View File
@@ -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" %>
<div class="mb-4 flex flex-wrap items-center justify-between gap-2 print:hidden">
<% back = @share ? shared_path(@share.token) : aircraft_path(a) %>
<%= link_to "← Back", back, class: "link text-sm" %>
<button type="button" class="btn-primary" data-print>Print or save as PDF</button>
</div>
<header class="flex flex-wrap items-end justify-between gap-4 border-b-2 border-slate-800 pb-3">
<div>
<p class="text-xs uppercase tracking-wide text-slate-500">Maintenance status · 14 CFR 91.417(a)(2)</p>
<h1 class="text-2xl font-bold"><%= a.tail_number %> <span class="text-lg font-normal text-slate-600"><%= [ a.make, a.model ].compact_blank.join(" ") %></span></h1>
<p class="text-sm text-slate-600">Serial number <%= a.serial_number.presence || "—" %></p>
</div>
<dl class="grid grid-cols-2 gap-x-6 text-sm">
<dt class="text-slate-500">Prepared</dt><dd><%= l(@report.generated_at.to_date, format: :long) %></dd>
<dt class="text-slate-500">Airframe time in service</dt><dd class="font-semibold"><%= hours(@report.time_in_service) %> hrs (<%= clock %>)</dd>
<dt class="text-slate-500">Tach / Hobbs</dt><dd><%= hours(a.tach_time) %> / <%= hours(a.hobbs_time) %></dd>
<dt class="text-slate-500">Status</dt><dd><%= airworthiness_badge(@report.airworthiness) %></dd>
</dl>
</header>
<section class="<%= section %>">
<h2 class="text-base font-semibold">Total time in service: engines and propellers</h2>
<% majors = @report.engines + @report.propellers %>
<% if majors.any? %>
<table class="mt-2 w-full text-sm">
<thead><tr><th class="<%= th %>">Item</th><th class="<%= th %>">Make / model</th><th class="<%= th %>">Serial</th><th class="<%= th %> text-right">Total time</th><th class="<%= th %> text-right">Since overhaul</th><th class="<%= th %>">Overhauled</th></tr></thead>
<tbody>
<% majors.each do |c| %>
<tr><td class="<%= td %>"><%= c %></td><td class="<%= td %>"><%= [ c.manufacturer, c.model ].compact_blank.join(" ") %></td><td class="<%= td %>"><%= c.serial_number.presence || "—" %></td>
<td class="<%= td %> text-right tabular-nums"><%= hours(c.hours_in_service) %></td><td class="<%= td %> text-right tabular-nums"><%= hours(c.hours_since_overhaul) %></td><td class="<%= td %>"><%= c.overhaul_date || "—" %></td></tr>
<% end %>
</tbody>
</table>
<% else %><p class="mt-1 text-sm text-slate-500">No engines or propellers recorded as components.</p><% end %>
</section>
<section class="<%= section %>">
<h2 class="text-base font-semibold">Life-limited parts</h2>
<% if @report.life_limited.any? %>
<table class="mt-2 w-full text-sm">
<thead><tr><th class="<%= th %>">Part</th><th class="<%= th %>">Serial</th><th class="<%= th %>">Limit</th><th class="<%= th %> text-right">Used</th><th class="<%= th %>">Remaining</th><th class="<%= th %>">Status</th></tr></thead>
<tbody>
<% @report.life_limited.each do |c| %>
<tr><td class="<%= td %>"><%= c %> <span class="text-slate-500"><%= c.model %></span></td><td class="<%= td %>"><%= c.serial_number.presence || "—" %></td>
<td class="<%= td %>"><%= [ (c.replacement_hours && "#{hours(c.replacement_hours)} hrs"), (c.replacement_days && "#{c.replacement_days} days") ].compact.join(" / ") %></td>
<td class="<%= td %> text-right tabular-nums"><%= hours(c.hours_since_overhaul) %> hrs</td>
<td class="<%= td %>"><%= [ (c.hours_to_replacement && "#{hours(c.hours_to_replacement)} hrs"), (c.next_replacement_date && "by #{c.next_replacement_date}") ].compact.join(", ") %></td>
<td class="<%= td %>"><%= life_badge(c.life_status) %></td></tr>
<% end %>
</tbody>
</table>
<% else %><p class="mt-1 text-sm text-slate-500">None recorded.</p><% end %>
</section>
<section class="<%= section %>">
<h2 class="text-base font-semibold">Time since overhaul</h2>
<% if @report.overhaul_items.any? %>
<table class="mt-2 w-full text-sm">
<thead><tr><th class="<%= th %>">Item</th><th class="<%= th %>">Serial</th><th class="<%= th %>">Overhaul interval</th><th class="<%= th %> text-right">Since overhaul</th><th class="<%= th %>">Remaining</th><th class="<%= th %>">Tracked as</th></tr></thead>
<tbody>
<% @report.overhaul_items.each do |c| %>
<tr><td class="<%= td %>"><%= c %> <span class="text-slate-500"><%= c.model %></span></td><td class="<%= td %>"><%= c.serial_number.presence || "—" %></td>
<td class="<%= td %>"><%= [ (c.tbo_hours && "#{hours(c.tbo_hours)} hrs"), (c.tbo_days && "#{c.tbo_days} days") ].compact.join(" / ") %></td>
<td class="<%= td %> text-right tabular-nums"><%= hours(c.hours_since_overhaul) %> hrs</td>
<td class="<%= td %>"><%= c.on_condition? ? "On condition" : (c.hours_to_tbo ? "#{hours(c.hours_to_tbo)} hrs" : "—") %></td>
<td class="<%= td %> text-xs"><%= c.tbo_critical? ? "Hard limit" : "Recommended" %></td></tr>
<% end %>
</tbody>
</table>
<% else %><p class="mt-1 text-sm text-slate-500">None recorded.</p><% end %>
</section>
<section class="<%= section %>">
<h2 class="text-base font-semibold">Inspection status</h2>
<% if @report.inspections.any? %>
<table class="mt-2 w-full text-sm">
<thead><tr><th class="<%= th %>">Inspection</th><th class="<%= th %>">Interval</th><th class="<%= th %>">Last done</th><th class="<%= th %> text-right">Since</th><th class="<%= th %>">Next due</th><th class="<%= th %>">Status</th></tr></thead>
<tbody>
<% @report.inspections.each do |row| %>
<% last = row.latest %>
<tr><td class="<%= td %>"><%= row.type.name %><% if row.type.satisfies %><div class="text-xs text-slate-500">Also counts as <%= row.type.satisfies.name %></div><% end %></td>
<td class="<%= td %> text-xs"><%= row.type.interval_description %></td>
<td class="<%= td %>"><%= 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 %></td>
<td class="<%= td %> text-right tabular-nums"><%= last&.hours_at_inspection ? "#{hours(@report.time_in_service - last.hours_at_inspection)} hrs" : "—" %></td>
<td class="<%= td %>"><%= [ row.next_due_date&.to_s, row.next_due_hours && "#{hours(row.next_due_hours)} hrs" ].compact.join(" / ").presence || "—" %></td>
<td class="<%= td %>"><%= compliance_badge(row.status) %></td></tr>
<% end %>
</tbody>
</table>
<% else %><p class="mt-1 text-sm text-slate-500">No inspections tracked.</p><% end %>
</section>
<section class="<%= section %>">
<h2 class="text-base font-semibold">Airworthiness directives</h2>
<% if @report.ads.any? %>
<table class="mt-2 w-full text-sm">
<thead><tr><th class="<%= th %>">AD</th><th class="<%= th %>">Revision complied with</th><th class="<%= th %>">Method of compliance</th><th class="<%= th %>">Complied</th><th class="<%= th %>">Recurring / next due</th><th class="<%= th %>">Status</th></tr></thead>
<tbody>
<% @report.ads.each do |row| %>
<% c = row.latest %>
<tr><td class="<%= td %>"><span class="font-medium"><%= row.ad.name %></span><div class="text-xs text-slate-500"><%= row.ad.short_description.to_s.truncate(70) %></div></td>
<td class="<%= td %> text-xs"><%= c&.ad_revision.presence || "—" %></td>
<td class="<%= td %> text-xs"><%= c ? c.method_label : "—" %><% if c&.compliance_notes.present? %><div class="text-slate-500"><%= c.compliance_notes.truncate(90) %></div><% end %></td>
<td class="<%= td %>"><%= c ? "#{c.date_complied}#{" @ #{hours(c.aircraft_hours_at_compliance)}" if c.aircraft_hours_at_compliance}" : "—" %></td>
<td class="<%= td %> text-xs"><%= 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 %></td>
<td class="<%= td %>"><%= compliance_badge(row.status) %></td></tr>
<% end %>
</tbody>
</table>
<% else %><p class="mt-1 text-sm text-slate-500">No ADs tracked.</p><% end %>
</section>
<section class="<%= section %>">
<h2 class="text-base font-semibold">Major repairs and alterations</h2>
<% if (majors = @report.major_records.to_a).any? %>
<table class="mt-2 w-full text-sm">
<thead><tr><th class="<%= th %>">Date</th><th class="<%= th %>">Type</th><th class="<%= th %>">Description</th><th class="<%= th %>">STC</th><th class="<%= th %>">Form 337</th></tr></thead>
<tbody>
<% majors.each do |m| %>
<tr><td class="<%= td %>"><%= m.date_performed %></td><td class="<%= td %> text-xs"><%= m.type_label %></td>
<td class="<%= td %>"><%= m.title %><%= " · #{m.component}" if m.component %></td>
<td class="<%= td %> text-xs"><%= [ m.stc_number, m.stc_holder ].compact_blank.join(", ").presence || "—" %></td>
<td class="<%= td %> text-xs"><%= m.form_337_document ? "On file" : "—" %></td></tr>
<% end %>
</tbody>
</table>
<% else %><p class="mt-1 text-sm text-slate-500">None recorded.</p><% end %>
</section>
<section class="<%= section %>">
<h2 class="text-base font-semibold">Open discrepancies</h2>
<% if (squawks = @report.open_squawks.to_a).any? %>
<ul class="mt-2 space-y-1 text-sm">
<% squawks.each do |s| %><li><%= squawk_priority_badge(s) %> <%= s.issue_reported %><%= " · #{s.component}" if s.component %> <span class="text-xs text-slate-500">(<%= s.created_at.to_date %>)</span></li><% end %>
</ul>
<% else %><p class="mt-1 text-sm text-slate-500">None open.</p><% end %>
</section>
<footer class="mt-8 border-t border-slate-300 pt-2 text-xs text-slate-500">
Prepared <%= l(@report.generated_at, format: :long) %> from the records kept in Simple Aircraft Manager. Times are in hours of <%= clock %> time.
This summary doesn't replace the aircraft's signed maintenance records. <%= Airworthiness::DISCLAIMER %>
</footer>
+2 -1
View File
@@ -15,7 +15,8 @@
<div class="space-y-5">
<section class="card">
<div class="card-header"><h2 class="card-title">Airworthiness</h2><%= airworthiness_badge(@airworthiness, large: true) %></div>
<div class="card-header"><h2 class="card-title">Airworthiness</h2>
<div class="flex items-center gap-2"><% if @share.maintenance? %><%= link_to "Status report", shared_report_path(@share.token), class: "btn-secondary btn-sm" %><% end %><%= airworthiness_badge(@airworthiness, large: true) %></div></div>
<div class="card-body">
<% if @airworthiness.issues.empty? %><p class="text-sm text-emerald-700">Nothing overdue or due soon.</p><% else %>
<ul class="space-y-1 text-sm"><% @airworthiness.issues.each do |i| %><li><span class="<%= issue_badge_class(i) %>"><%= i.category %></span> <%= i.title %> <span class="text-xs text-slate-500"><%= i.description %></span></li><% end %></ul>