Sweep all .cshtml files for encoding corruption; add pre-commit guard

Replace all corruption variants with HTML entities across 226 view files:
- 3-char UTF-8-as-Win1252 sequences (ae-corruption)
- Standalone smart/curly quotes that break C# Razor expressions
- Partially re-corrupted variants where the 3rd byte was normalised to ASCII

tools/Fix-Encoding.ps1: re-runnable sweep; uses [char] code points so the
script itself never contains a literal non-ASCII character; supports -DryRun

.githooks/pre-commit: blocks commits containing the ae-corruption byte
signature (xc3xa2xe2x82xac); git core.hooksPath = .githooks so the
hook is repo-committed and active for all future work on this machine.

Build clean; 225 unit tests pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-20 21:37:10 -04:00
parent 21b39161a3
commit a0bdd2b5b4
252 changed files with 1785 additions and 1633 deletions
+48 -48
View File
@@ -21,7 +21,7 @@
</h2>
<p>
The Reports section gives you financial summaries, operational insights, and AI-powered analysis
of your business. Reports are organized on the landing page by category Financial, Operations,
of your business. Reports are organized on the landing page by category &mdash; Financial, Operations,
and AI-Powered. Most reports are read-only views of live data and support PDF export.
</p>
<p>
@@ -44,7 +44,7 @@
<h3 class="h6 fw-semibold mt-3 mb-2">KPI Dashboard</h3>
<p>
A high-level scorecard showing your most important metrics at a glance open jobs, pending
A high-level scorecard showing your most important metrics at a glance &mdash; open jobs, pending
quotes, outstanding invoices, and recent revenue. Good for a quick daily check-in.
</p>
@@ -53,15 +53,15 @@
Detailed charts and KPI cards for the selected date range:
</p>
<ul class="mb-3">
<li class="mb-1"><strong>Total Invoiced</strong> total value of all invoices created in the period.</li>
<li class="mb-1"><strong>Total Collected</strong> total payments actually received.</li>
<li class="mb-1"><strong>Outstanding AR</strong> current total of all unpaid invoices (always reflects today's balance, not filtered by date).</li>
<li class="mb-1"><strong>Overdue Balance</strong> portion of AR where the due date has passed.</li>
<li class="mb-1"><strong>Monthly Invoiced vs. Collected chart</strong> side-by-side bar chart by month; shows if collections are lagging behind invoicing.</li>
<li class="mb-1"><strong>Total Invoiced</strong> &mdash; total value of all invoices created in the period.</li>
<li class="mb-1"><strong>Total Collected</strong> &mdash; total payments actually received.</li>
<li class="mb-1"><strong>Outstanding AR</strong> &mdash; current total of all unpaid invoices (always reflects today's balance, not filtered by date).</li>
<li class="mb-1"><strong>Overdue Balance</strong> &mdash; portion of AR where the due date has passed.</li>
<li class="mb-1"><strong>Monthly Invoiced vs. Collected chart</strong> &mdash; side-by-side bar chart by month; shows if collections are lagging behind invoicing.</li>
</ul>
<p>
The <strong>AI Financial Summary</strong> button in this view generates a plain-English narrative
of your financial performance using AI useful for a quick briefing before a meeting. See the
of your financial performance using AI &mdash; useful for a quick briefing before a meeting. See the
<a href="#ai-reports">AI-Powered Reports</a> section below.
</p>
@@ -80,13 +80,13 @@
<h3 class="h6 fw-semibold mt-3 mb-2">AR Aging</h3>
<p>
Breaks down all outstanding invoices by how long they have been overdue:
<strong>Current</strong> (not yet due), <strong>130 days</strong>,
<strong>3160 days</strong>, <strong>6190 days</strong>, and <strong>90+ days</strong>.
Focus collection efforts on the 6190 and 90+ columns first.
<strong>Current</strong> (not yet due), <strong>1&ndash;30 days</strong>,
<strong>31&ndash;60 days</strong>, <strong>61&ndash;90 days</strong>, and <strong>90+ days</strong>.
Focus collection efforts on the 61&ndash;90 and 90+ columns first.
</p>
<p>
The AR Aging page also has an <strong>AI AR Follow-Up</strong> button that drafts a
collection email for any overdue invoice the tone automatically scales with how overdue
collection email for any overdue invoice &mdash; the tone automatically scales with how overdue
the invoice is (gentle reminder at 7 days, firmer at 30+).
</p>
@@ -98,21 +98,21 @@
<h3 class="h6 fw-semibold mt-3 mb-2">Sales Tax Report</h3>
<p>
An invoice-basis Sales Tax Liability report shows what you collected in tax during the
An invoice-basis Sales Tax Liability report &mdash; shows what you collected in tax during the
period and breaks it down so you can file accurately. Key figures:
</p>
<ul class="mb-3">
<li class="mb-1"><strong>Total Tax Billed</strong> sum of all tax charged on invoices in the period.</li>
<li class="mb-1"><strong>Taxable Sales</strong> subtotals of invoices where tax was charged.</li>
<li class="mb-1"><strong>Non-Taxable Sales</strong> subtotals of tax-exempt invoices (e.g. tax-exempt customers).</li>
<li class="mb-1"><strong>Effective Tax Rate</strong> overall average rate across all taxable invoices.</li>
<li class="mb-1"><strong>By Tax Account</strong> breakdown by GL account (useful if you have multiple tax jurisdictions or rates).</li>
<li class="mb-1"><strong>By Month</strong> month-by-month chart and table of taxable sales and tax billed.</li>
<li class="mb-1"><strong>Invoice Detail</strong> every invoice in the period with its tax %, tax amount, and tax account. Non-taxable invoices appear shaded grey so they are easy to distinguish.</li>
<li class="mb-1"><strong>Total Tax Billed</strong> &mdash; sum of all tax charged on invoices in the period.</li>
<li class="mb-1"><strong>Taxable Sales</strong> &mdash; subtotals of invoices where tax was charged.</li>
<li class="mb-1"><strong>Non-Taxable Sales</strong> &mdash; subtotals of tax-exempt invoices (e.g. tax-exempt customers).</li>
<li class="mb-1"><strong>Effective Tax Rate</strong> &mdash; overall average rate across all taxable invoices.</li>
<li class="mb-1"><strong>By Tax Account</strong> &mdash; breakdown by GL account (useful if you have multiple tax jurisdictions or rates).</li>
<li class="mb-1"><strong>By Month</strong> &mdash; month-by-month chart and table of taxable sales and tax billed.</li>
<li class="mb-1"><strong>Invoice Detail</strong> &mdash; every invoice in the period with its tax %, tax amount, and tax account. Non-taxable invoices appear shaded grey so they are easy to distinguish.</li>
</ul>
<p>
This report supports both <strong>PDF export</strong> and <strong>CSV export</strong>.
The CSV is formatted for handing to your accountant or importing into tax-filing software
The CSV is formatted for handing to your accountant or importing into tax-filing software &mdash;
one row per invoice with all relevant columns. Use the quick preset buttons (This Month,
Last Month, YTD, Last Year) to jump to common filing periods without manually entering dates.
</p>
@@ -149,10 +149,10 @@
period. Key metrics include:
</p>
<ul class="mb-3">
<li class="mb-1"><strong>Job counts by status</strong> how many jobs are in each stage. A high count in one status can indicate a bottleneck.</li>
<li class="mb-1"><strong>Open, Completed, On Hold, and Overdue counts</strong> KPI cards for the overall health of your job queue.</li>
<li class="mb-1"><strong>Job counts by priority</strong> how many jobs are at each level (Low/Normal/High/Urgent/Rush).</li>
<li class="mb-1"><strong>Average completion time</strong> average days from job creation to Completed status. Use as a baseline for quoting lead times.</li>
<li class="mb-1"><strong>Job counts by status</strong> &mdash; how many jobs are in each stage. A high count in one status can indicate a bottleneck.</li>
<li class="mb-1"><strong>Open, Completed, On Hold, and Overdue counts</strong> &mdash; KPI cards for the overall health of your job queue.</li>
<li class="mb-1"><strong>Job counts by priority</strong> &mdash; how many jobs are at each level (Low/Normal/High/Urgent/Rush).</li>
<li class="mb-1"><strong>Average completion time</strong> &mdash; average days from job creation to Completed status. Use as a baseline for quoting lead times.</li>
</ul>
<h3 class="h6 fw-semibold mt-3 mb-2">Customer Overview</h3>
@@ -164,7 +164,7 @@
<h3 class="h6 fw-semibold mt-3 mb-2">Job Cycle Time Report</h3>
<p>
Shows how long jobs spend in each status on average. Use this to identify where jobs tend
to slow down for example, if jobs spend an unusually long time in Sandblasting, that
to slow down &mdash; for example, if jobs spend an unusually long time in Sandblasting, that
stage may need more capacity.
</p>
@@ -177,17 +177,17 @@
<h3 class="h6 fw-semibold mt-3 mb-2">Inventory Snapshot</h3>
<p>Key inventory metrics including:</p>
<ul class="mb-3">
<li class="mb-1"><strong>Total inventory value</strong> on-hand quantity × unit cost for all items.</li>
<li class="mb-1"><strong>Items below reorder point</strong> items currently flagged as low stock.</li>
<li class="mb-1"><strong>Recent transaction summary</strong> log of recent stock movements.</li>
<li class="mb-1"><strong>Total inventory value</strong> &mdash; on-hand quantity × unit cost for all items.</li>
<li class="mb-1"><strong>Items below reorder point</strong> &mdash; items currently flagged as low stock.</li>
<li class="mb-1"><strong>Recent transaction summary</strong> &mdash; log of recent stock movements.</li>
</ul>
<h3 class="h6 fw-semibold mt-3 mb-2">Equipment &amp; Maintenance Report</h3>
<p>Equipment health overview for maintenance supervisors:</p>
<ul class="mb-3">
<li class="mb-1"><strong>Equipment status distribution</strong> how many machines are Operational, Needs Maintenance, Under Maintenance, etc.</li>
<li class="mb-1"><strong>Upcoming maintenance tasks</strong> scheduled tasks due soon.</li>
<li class="mb-1"><strong>Overdue maintenance tasks</strong> tasks past their scheduled date that are not yet complete.</li>
<li class="mb-1"><strong>Equipment status distribution</strong> &mdash; how many machines are Operational, Needs Maintenance, Under Maintenance, etc.</li>
<li class="mb-1"><strong>Upcoming maintenance tasks</strong> &mdash; scheduled tasks due soon.</li>
<li class="mb-1"><strong>Overdue maintenance tasks</strong> &mdash; tasks past their scheduled date that are not yet complete.</li>
</ul>
<div class="alert alert-permanent alert-info d-flex gap-2 mb-0" role="alert">
@@ -211,7 +211,7 @@
<h3 class="h6 fw-semibold mt-3 mb-2">AI Financial Summary</h3>
<p>
Generates a plain-English narrative of your financial performance revenue trends, collection
Generates a plain-English narrative of your financial performance &mdash; revenue trends, collection
rate, outstanding AR, and notable patterns. Accessible from the <strong>Full Analytics</strong>
view via the "Generate AI Summary" button. Useful for summarizing performance before a meeting
or for stakeholders who prefer prose over tables.
@@ -227,8 +227,8 @@
<li class="mb-1">Active job pipeline (potential future revenue)</li>
</ul>
<p>
The forecast includes an <strong>outlook badge</strong> Strong, Moderate, Tight, or
Concerning based on the projected net cash position at each interval.
The forecast includes an <strong>outlook badge</strong> &mdash; Strong, Moderate, Tight, or
Concerning &mdash; based on the projected net cash position at each interval.
</p>
<h3 class="h6 fw-semibold mt-3 mb-2">Anomaly Detection</h3>
@@ -236,10 +236,10 @@
Scans the last 90 days of bills for unusual patterns and flags them for review:
</p>
<ul class="mb-3">
<li class="mb-1"><strong>Duplicate bills</strong> same vendor, similar amount, close dates.</li>
<li class="mb-1"><strong>Amount spikes</strong> a vendor bill significantly higher than their usual amounts.</li>
<li class="mb-1"><strong>Unusual vendors</strong> vendors you have not used before or rarely use.</li>
<li class="mb-1"><strong>Account overruns</strong> expense accounts with spending well above their typical level.</li>
<li class="mb-1"><strong>Duplicate bills</strong> &mdash; same vendor, similar amount, close dates.</li>
<li class="mb-1"><strong>Amount spikes</strong> &mdash; a vendor bill significantly higher than their usual amounts.</li>
<li class="mb-1"><strong>Unusual vendors</strong> &mdash; vendors you have not used before or rarely use.</li>
<li class="mb-1"><strong>Account overruns</strong> &mdash; expense accounts with spending well above their typical level.</li>
</ul>
<p>Flags are sorted by severity. Review and dismiss any that are expected or already explained.</p>
@@ -247,7 +247,7 @@
<p>
Drafts a collection email for overdue invoices directly from the <strong>AR Aging</strong> report.
Click the envelope icon next to any overdue invoice to generate a draft. The tone scales with
how many days overdue the invoice is a gentle nudge at 7 days, a firmer reminder at 30+.
how many days overdue the invoice is &mdash; a gentle nudge at 7 days, a firmer reminder at 30+.
You can edit the draft before sending.
</p>
@@ -258,13 +258,13 @@
each open AR customer and assign a risk level:
</p>
<ul class="mb-3">
<li class="mb-1"><strong>High</strong> customer has a history of late payment and is already overdue; prioritize a phone call today.</li>
<li class="mb-1"><strong>Medium</strong> overdue but reasonable history, or current but spotty past performance.</li>
<li class="mb-1"><strong>Low</strong> typically pays on time; no immediate follow-up needed.</li>
<li class="mb-1"><strong>High</strong> &mdash; customer has a history of late payment and is already overdue; prioritize a phone call today.</li>
<li class="mb-1"><strong>Medium</strong> &mdash; overdue but reasonable history, or current but spotty past performance.</li>
<li class="mb-1"><strong>Low</strong> &mdash; typically pays on time; no immediate follow-up needed.</li>
</ul>
<p>
Each prediction includes an estimated number of additional days to collection and a one-sentence
explanation of the scoring. Use this to triage your collection calls start with High-risk
explanation of the scoring. Use this to triage your collection calls &mdash; start with High-risk
customers first.
</p>
@@ -283,7 +283,7 @@
<p>
Each answer includes <strong>supporting facts</strong> pulled directly from your data so you can
verify the figures, and a <strong>follow-up suggestion</strong> for what to ask next. Claude
will not invent numbers if the data is not available in the snapshot, it says so. The page
will not invent numbers &mdash; if the data is not available in the snapshot, it says so. The page
also shows clickable example chips and remembers your last 5 questions during the session.
</p>
@@ -292,13 +292,13 @@
Inside <strong>Bank Reconciliation</strong> (<a asp-controller="BankReconciliations" asp-action="Index">/BankReconciliations</a>),
the <strong>Reconcile</strong> working view includes an <strong>AI Auto-Match</strong> panel.
Click <strong>"Suggest Matches"</strong> and Claude analyzes all uncleared transactions against
your statement ending balance, then suggests which items to mark as cleared sorted by
your statement ending balance, then suggests which items to mark as cleared &mdash; sorted by
confidence score with a one-sentence reason for each.
</p>
<p>
Click <strong>"Apply All Suggestions"</strong> to accept them in bulk; the checkboxes are marked
and persisted automatically. Review the highlighted rows (shown in blue) before applying if you
want to verify each one individually. Auto-match does not complete the reconciliation you
want to verify each one individually. Auto-match does not complete the reconciliation &mdash; you
still click "Complete Reconciliation" yourself once the difference reaches $0.00.
</p>
@@ -337,7 +337,7 @@
Total, Amount Paid, Balance Due, Tax Account.
</p>
<p>
All PDF and CSV exports respect the same date range you have selected in the report what
All PDF and CSV exports respect the same date range you have selected in the report &mdash; what
you see on screen is exactly what gets exported.
</p>
</section>