0c921ba180
Audit finding #4: Sales Tax Payable was credited on every invoice but never relieved (no remittance flow), so the liability grew forever. Adds a dedicated "Record Sales Tax Payment" action that posts a balanced journal entry — DR Sales Tax Payable (2200) / CR the chosen bank account — honoring the period lock. Implemented in JournalEntriesController (reuses its posting + numbering + period- lock infrastructure): a GET form showing the current 2200 liability and a bank picker, and a POST that creates the posted JE and updates balances. Reachable via a "Record Payment" button on the Sales Tax report. No reporting changes needed — posted JE lines are already accounted for across the trial balance / balance sheet / ledger. Build clean; 284 unit tests pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
73 lines
3.7 KiB
Plaintext
73 lines
3.7 KiB
Plaintext
@{
|
|
ViewData["Title"] = "Record Sales Tax Payment";
|
|
ViewData["PageIcon"] = "bi-cash-stack";
|
|
var taxLiability = (decimal)(ViewBag.TaxLiability ?? 0m);
|
|
var taxFound = (bool)(ViewBag.TaxAccountFound ?? false);
|
|
var banks = ViewBag.BankAccounts as List<Microsoft.AspNetCore.Mvc.Rendering.SelectListItem> ?? new List<Microsoft.AspNetCore.Mvc.Rendering.SelectListItem>();
|
|
}
|
|
|
|
<div class="d-flex align-items-center gap-2 mb-3">
|
|
<a asp-action="Index" class="btn btn-sm btn-outline-secondary"><i class="bi bi-arrow-left"></i></a>
|
|
<h5 class="mb-0">Record Sales Tax Payment</h5>
|
|
</div>
|
|
|
|
@if (!taxFound)
|
|
{
|
|
<div class="alert alert-warning">
|
|
No active <strong>Sales Tax Payable (2200)</strong> account was found in your chart of accounts. Add one first.
|
|
</div>
|
|
}
|
|
else
|
|
{
|
|
<div class="row">
|
|
<div class="col-lg-7">
|
|
<div class="card shadow-sm mb-3">
|
|
<div class="card-body d-flex justify-content-between align-items-center">
|
|
<div>
|
|
<span class="text-muted d-block">Current Sales Tax Payable</span>
|
|
<span class="text-muted small">Tax collected on invoices and owed to the authority.</span>
|
|
</div>
|
|
<span class="h4 mb-0 @(taxLiability > 0 ? "text-danger" : "text-success")">@taxLiability.ToString("C")</span>
|
|
</div>
|
|
</div>
|
|
|
|
<form asp-action="SalesTaxPayment" method="post" class="card shadow-sm">
|
|
@Html.AntiForgeryToken()
|
|
<div class="card-body">
|
|
<div class="mb-3">
|
|
<label class="form-label">Amount paid</label>
|
|
<div class="input-group">
|
|
<span class="input-group-text">$</span>
|
|
<input type="number" step="0.01" min="0.01" name="amount" class="form-control"
|
|
value="@(taxLiability > 0 ? taxLiability.ToString("0.00") : "")" required />
|
|
</div>
|
|
<div class="form-text">Defaults to the full balance — edit if you're paying a partial period.</div>
|
|
</div>
|
|
<div class="mb-3">
|
|
<label class="form-label">Payment date</label>
|
|
<input type="date" name="paymentDate" class="form-control" value="@DateTime.Today.ToString("yyyy-MM-dd")" required />
|
|
</div>
|
|
<div class="mb-3">
|
|
<label class="form-label">Paid from (bank account)</label>
|
|
<select name="bankAccountId" class="form-select" required>
|
|
<option value="">Select an account…</option>
|
|
@foreach (var b in banks)
|
|
{
|
|
<option value="@b.Value">@b.Text</option>
|
|
}
|
|
</select>
|
|
</div>
|
|
<div class="mb-3">
|
|
<label class="form-label">Reference / period <span class="text-muted">(optional)</span></label>
|
|
<input type="text" name="reference" class="form-control" placeholder="e.g. Q2 2026 sales tax" />
|
|
</div>
|
|
<div class="alert alert-light border small mb-3">
|
|
Posts a journal entry: <strong>DR</strong> Sales Tax Payable / <strong>CR</strong> the chosen bank account.
|
|
</div>
|
|
<button type="submit" class="btn btn-primary"><i class="bi bi-check-lg me-1"></i>Record payment</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
}
|