a0bdd2b5b4
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>
166 lines
11 KiB
Plaintext
166 lines
11 KiB
Plaintext
@model PowderCoating.Application.DTOs.Accounting.EditAccountDto
|
|
|
|
@{
|
|
ViewData["Title"] = "Edit Account";
|
|
ViewData["PageIcon"] = "bi-pencil-square";
|
|
ViewData["PageHelpTitle"] = "Edit Account";
|
|
ViewData["PageHelpContent"] = "You can change number, name, type, sub-type, parent, and opening balance. Changing the account type or sub-type on an account that already has transactions is allowed but use caution — it changes how balances are reported going forward. Inactive accounts are hidden from pickers but preserved in history.";
|
|
}
|
|
|
|
<div class="d-flex justify-content-start mb-4">
|
|
<a asp-action="Index" class="btn btn-sm btn-outline-secondary"><i class="bi bi-arrow-left"></i></a>
|
|
</div>
|
|
|
|
<div class="row justify-content-center">
|
|
<div class="col-lg-7">
|
|
<div class="card shadow-sm">
|
|
<div class="card-body">
|
|
<form asp-action="Edit" method="post">
|
|
@Html.AntiForgeryToken()
|
|
<input asp-for="Id" type="hidden" />
|
|
<div asp-validation-summary="ModelOnly" class="alert alert-danger alert-permanent mb-3"></div>
|
|
|
|
<div class="row g-3">
|
|
<div class="col-sm-4">
|
|
<div class="d-flex align-items-center gap-1 mb-1">
|
|
<label asp-for="AccountNumber" class="form-label fw-medium mb-0">Account Number <span class="text-danger">*</span></label>
|
|
<a tabindex="0" class="help-icon" role="button"
|
|
data-bs-toggle="popover" data-bs-placement="right" data-bs-trigger="focus"
|
|
data-bs-title="Account Number"
|
|
data-bs-content="A numeric code for sorting and organizing accounts. Convention: 1000–1999 Assets, 2000–2999 Liabilities, 3000–3999 Equity, 4000–4999 Revenue, 5000–5999 Cost of Goods, 6000–9999 Expenses. Must be unique.">
|
|
<i class="bi bi-question-circle"></i>
|
|
</a>
|
|
</div>
|
|
<input asp-for="AccountNumber" class="form-control" />
|
|
<span asp-validation-for="AccountNumber" class="text-danger small"></span>
|
|
</div>
|
|
<div class="col-sm-8">
|
|
<label asp-for="Name" class="form-label fw-medium">Account Name <span class="text-danger">*</span></label>
|
|
<input asp-for="Name" class="form-control" />
|
|
<span asp-validation-for="Name" class="text-danger small"></span>
|
|
</div>
|
|
|
|
<div class="col-sm-6">
|
|
<div class="d-flex align-items-center gap-1 mb-1">
|
|
<label asp-for="AccountType" class="form-label fw-medium mb-0">Account Type <span class="text-danger">*</span></label>
|
|
<a tabindex="0" class="help-icon" role="button"
|
|
data-bs-toggle="popover" data-bs-placement="right" data-bs-trigger="focus"
|
|
data-bs-title="Account Type"
|
|
data-bs-content="Asset: things you own. Liability: things you owe. Equity: owner's investment and retained earnings. Revenue: income from sales. Cost of Goods Sold: direct production costs. Expense: operating overhead. Changing this on an account with existing transactions affects how it appears in financial reports.">
|
|
<i class="bi bi-question-circle"></i>
|
|
</a>
|
|
</div>
|
|
<select asp-for="AccountType" asp-items="ViewBag.AccountTypes" class="form-select" id="accountTypeSelect"></select>
|
|
<span asp-validation-for="AccountType" class="text-danger small"></span>
|
|
</div>
|
|
<div class="col-sm-6">
|
|
<div class="d-flex align-items-center gap-1 mb-1">
|
|
<label asp-for="AccountSubType" class="form-label fw-medium mb-0">Sub-Type <span class="text-danger">*</span></label>
|
|
<a tabindex="0" class="help-icon" role="button"
|
|
data-bs-toggle="popover" data-bs-placement="right" data-bs-trigger="focus"
|
|
data-bs-title="Account Sub-Type"
|
|
data-bs-content="A finer classification that determines where the account appears in pickers. For example, only Checking and Savings sub-types appear in the 'Paid From' selector on expenses. Choosing a sub-type also auto-sets the Account Type.">
|
|
<i class="bi bi-question-circle"></i>
|
|
</a>
|
|
</div>
|
|
<select asp-for="AccountSubType" asp-items="ViewBag.AccountSubTypes" class="form-select" id="accountSubTypeSelect"></select>
|
|
<span asp-validation-for="AccountSubType" class="text-danger small"></span>
|
|
<div class="form-text text-primary" id="typeAutoSetHint" style="display:none">
|
|
<i class="bi bi-magic me-1"></i>Account type auto-set based on sub-type.
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-12">
|
|
<label asp-for="Description" class="form-label fw-medium">Description</label>
|
|
<textarea asp-for="Description" class="form-control" rows="2"></textarea>
|
|
</div>
|
|
|
|
<div class="col-12">
|
|
<div class="d-flex align-items-center gap-1 mb-1">
|
|
<label asp-for="ParentAccountId" class="form-label fw-medium mb-0">Parent Account</label>
|
|
<a tabindex="0" class="help-icon" role="button"
|
|
data-bs-toggle="popover" data-bs-placement="right" data-bs-trigger="focus"
|
|
data-bs-title="Parent Account"
|
|
data-bs-content="Nest this account under a parent to create a hierarchy — e.g. 'Powder Costs' under 'Cost of Goods Sold'. Sub-accounts roll up into their parent on financial reports. Most accounts work fine without a parent.">
|
|
<i class="bi bi-question-circle"></i>
|
|
</a>
|
|
</div>
|
|
<select asp-for="ParentAccountId" asp-items="ViewBag.ParentAccounts" class="form-select">
|
|
<option value="">— None —</option>
|
|
</select>
|
|
</div>
|
|
|
|
<div class="col-12">
|
|
<hr class="my-1" />
|
|
<p class="text-muted small mb-2">
|
|
<i class="bi bi-info-circle me-1"></i>
|
|
Opening balance represents the account's value before transactions were recorded in this system.
|
|
</p>
|
|
</div>
|
|
<div class="col-sm-6">
|
|
<div class="d-flex align-items-center gap-1 mb-1">
|
|
<label asp-for="OpeningBalance" class="form-label fw-medium mb-0">Opening Balance</label>
|
|
<a tabindex="0" class="help-icon" role="button"
|
|
data-bs-toggle="popover" data-bs-placement="right" data-bs-trigger="focus"
|
|
data-bs-title="Opening Balance"
|
|
data-bs-content="The account's balance before transactions were recorded in this system. Changing this retroactively adjusts the running balance across all historical ledger entries. Set the As of Date to indicate when this balance was accurate.">
|
|
<i class="bi bi-question-circle"></i>
|
|
</a>
|
|
</div>
|
|
<div class="input-group">
|
|
<span class="input-group-text">$</span>
|
|
<input asp-for="OpeningBalance" class="form-control" type="number" step="0.01" min="0" placeholder="0.00" />
|
|
</div>
|
|
<span asp-validation-for="OpeningBalance" class="text-danger small"></span>
|
|
</div>
|
|
<div class="col-sm-6">
|
|
<label asp-for="OpeningBalanceDate" class="form-label fw-medium">As of Date</label>
|
|
<input asp-for="OpeningBalanceDate" class="form-control" type="date" />
|
|
<div class="form-text">Leave blank to apply before all transactions.</div>
|
|
</div>
|
|
|
|
<div class="col-12">
|
|
<div class="form-check form-switch">
|
|
<input asp-for="IsActive" class="form-check-input" type="checkbox" />
|
|
<label asp-for="IsActive" class="form-check-label">Active</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="d-flex gap-2 mt-4">
|
|
<button type="submit" class="btn btn-primary">
|
|
<i class="bi bi-check-lg me-1"></i>Save Changes
|
|
</button>
|
|
<a asp-action="Index" class="btn btn-outline-secondary">Cancel</a>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
@section Scripts {
|
|
@{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
|
|
<script>
|
|
// Auto-set AccountType when SubType is changed
|
|
const subTypeToAccountType = {
|
|
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
|
|
40: 5, // CostOfGoods
|
|
50: 6, 51: 6, 52: 6, 53: 6, 54: 6, 55: 6, 56: 6,
|
|
57: 6, 58: 6, 59: 6, 60: 6, 61: 6, 62: 6, 63: 6, 99: 6 // Expense
|
|
};
|
|
document.getElementById('accountSubTypeSelect').addEventListener('change', function () {
|
|
const mapped = subTypeToAccountType[parseInt(this.value)];
|
|
if (mapped) {
|
|
document.getElementById('accountTypeSelect').value = mapped;
|
|
document.getElementById('typeAutoSetHint').style.display = '';
|
|
} else {
|
|
document.getElementById('typeAutoSetHint').style.display = 'none';
|
|
}
|
|
});
|
|
</script>
|
|
}
|