Ad-hoc quote email, accounting improvements, AI lookup fix, and misc service updates

- Quotes: ad-hoc email modal on Quote Details lets staff send to an address not on file;
  QuotesController passes overrideEmail through to NotificationService
- Quotes/Details view: SMS consent display, email/SMS send button state based on consent
- Accounting module: AccountingDisplayHelpers for consistent ledger formatting;
  AccountsController + Accounts views improvements; AccountingEnums additions
- Bills/Expenses: AI account categorization fixes in BillsController and ExpensesController
- InventoryAiLookupService: TDS cure fallback no longer fires on AiAugmentFromUrl path
  (LookupByUrlAsync already has it built in — was double-fetching)
- PdfService: quote/invoice PDF updates
- PricingCalculationService: minor pricing logic fix
- QuoteProfile: mapping updates for new quote fields
- ApplicationDbContextModelSnapshot: catches up to all 4 migrations in this branch

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-08 20:48:00 -04:00
parent 0d980e651a
commit 9a52e7fae5
19 changed files with 480 additions and 63 deletions
@@ -154,7 +154,7 @@
(function () {
// SubType enum values → AccountType enum values (mirrors server-side mapping)
const subTypeToAccountType = {
1: 1, 2: 1, 3: 1, 4: 1, 5: 1, 6: 1, 7: 1, // Assets
8: 1, 1: 1, 2: 1, 3: 1, 4: 1, 5: 1, 6: 1, 7: 1, // Assets
10: 2, 11: 2, 12: 2, 13: 2, // Liabilities
20: 3, 21: 3, // Equity
30: 4, 31: 4, 32: 4, // Revenue
@@ -144,7 +144,7 @@
<script>
// Auto-set AccountType when SubType is changed
const subTypeToAccountType = {
1: 1, 2: 1, 3: 1, 4: 1, 5: 1, 6: 1, 7: 1, // Asset
8: 1, 1: 1, 2: 1, 3: 1, 4: 1, 5: 1, 6: 1, 7: 1, // Asset
10: 2, 11: 2, 12: 2, 13: 2, // Liability
20: 3, 21: 3, // Equity
30: 4, 31: 4, 32: 4, // Revenue
@@ -156,7 +156,7 @@
<span class="badge bg-secondary ms-1" title="System account — cannot be deleted">sys</span>
}
</td>
<td><span class="text-muted small">@acct.AccountSubType</span></td>
<td><span class="text-muted small">@acct.AccountSubType.ToDisplayName()</span></td>
<td>
@if (!string.IsNullOrEmpty(acct.ParentAccountName))
{
@@ -29,10 +29,11 @@
_ => "bi-journal"
};
string typeLabel = Model.AccountType == AccountType.CostOfGoods ? "Cost of Goods Sold" : Model.AccountType.ToString();
string typeLabel = Model.AccountType.ToDisplayName();
// Derive from AccountSubType (more reliable than AccountType which users can misconfigure)
bool normalDebitBalance =
Model.AccountSubType == AccountSubType.Cash ||
Model.AccountSubType == AccountSubType.Checking ||
Model.AccountSubType == AccountSubType.Savings ||
Model.AccountSubType == AccountSubType.AccountsReceivable ||
@@ -71,7 +72,7 @@
<div>
<p class="text-muted mb-0">
<span class="badge bg-@typeColor bg-opacity-75 me-1">@typeLabel</span>
<span class="text-muted small">@Model.AccountSubType · @balanceLabel</span>
<span class="text-muted small">@Model.AccountSubType.ToDisplayName() · @balanceLabel</span>
</p>
</div>
<div class="ms-auto">