@model List> @using PowderCoating.Core.Enums @{ ViewData["Title"] = "Chart of Accounts"; ViewData["PageIcon"] = "bi-journal-bookmark"; ViewData["PageHelpTitle"] = "Chart of Accounts"; ViewData["PageHelpContent"] = "The master list of financial accounts grouped by type: Asset (what you own), Liability (what you owe), Equity (owner's stake), Revenue (income), Cost of Goods Sold (direct costs), Expense (overhead). Click any row to view its ledger. System accounts (sys badge) cannot be deleted. Recalculate Balances recomputes every account's balance from transaction history."; string TypeIcon(AccountType t) => t switch { AccountType.Asset => "bi-safe", AccountType.Liability => "bi-credit-card", AccountType.Equity => "bi-bar-chart-line", AccountType.Revenue => "bi-graph-up-arrow", AccountType.CostOfGoods => "bi-box-seam", AccountType.Expense => "bi-receipt-cutoff", _ => "bi-journal" }; string TypeColor(AccountType t) => t switch { AccountType.Asset => "success", AccountType.Liability => "danger", AccountType.Equity => "primary", AccountType.Revenue => "info", AccountType.CostOfGoods => "warning", AccountType.Expense => "secondary", _ => "secondary" }; string TypeLabel(AccountType t) => t switch { AccountType.CostOfGoods => "Cost of Goods Sold", _ => t.ToString() }; }
@Html.AntiForgeryToken()
@Html.AntiForgeryToken()
New Account
@* Bootstrap toast — confirmation before recalculating balances *@
@if (TempData["Success"] != null) { } @if (TempData["Error"] != null) { } @if (!Model.Any()) {
No accounts set up yet

Get started quickly by loading a standard chart of accounts
tailored for a powder coating business.

@Html.AntiForgeryToken() Add Manually
} @foreach (var group in Model) { var color = TypeColor(group.Key); var icon = TypeIcon(group.Key); var label = TypeLabel(group.Key);
@label
@group.Count() accounts
@foreach (var acct in group.OrderBy(a => a.AccountNumber)) { }
Number Name Sub-Type Parent Status Balance Actions
@acct.AccountNumber @acct.Name @if (acct.IsSystem) { sys } @acct.AccountSubType.ToDisplayName() @if (!string.IsNullOrEmpty(acct.ParentAccountName)) { @acct.ParentAccountName } @if (acct.IsActive) { Active } else { Inactive } @acct.CurrentBalance.ToString("C") @if (!acct.IsSystem) {
@Html.AntiForgeryToken()
}
} @if (!Model.Any()) {

No accounts found. Use the Seed Data page to generate default accounts.

} @section Scripts { }