4ec55e7290
The HTML entity sweep script had a bug where it wrote empty files for any
view that contained no target Unicode characters, zeroing out 215 view files.
All views restored from the pre-sweep commit (cefdf3e).
Bulk gift certificate feature:
- BulkCreateGiftCertificateDto with Quantity (1-500), Amount, Reason, Expiry, Notes
- GenerateBulkGiftCertificatePdfAsync on IPdfService / PdfService: one Letter page
per cert, reusing the same purple/gold branded ComposeGiftCertificateContent helper
- GiftCertificatesController: BulkCreate GET/POST, BulkResult GET, BulkDownloadPdf POST
- Views: BulkCreate.cshtml (form with live total preview), BulkResult.cshtml (table +
Download All PDF button that POSTs cert IDs to avoid URL length limits)
- gift-certificate-bulk.js: live preview + spinner/disable on submit
- Index.cshtml: Bulk Create button added alongside New Certificate
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
146 lines
8.5 KiB
Plaintext
146 lines
8.5 KiB
Plaintext
@model PowderCoating.Web.Controllers.FixedAssetVm
|
|
|
|
@{
|
|
ViewData["Title"] = "Edit Fixed Asset";
|
|
ViewData["PageIcon"] = "bi-pencil";
|
|
}
|
|
|
|
<div class="row justify-content-center">
|
|
<div class="col-lg-8">
|
|
|
|
<div class="mb-4">
|
|
<a asp-action="Details" asp-route-id="@Model.Id" class="btn btn-outline-secondary">
|
|
<i class="bi bi-arrow-left me-1"></i>Back to Asset
|
|
</a>
|
|
</div>
|
|
|
|
<div class="card border-0 shadow-sm">
|
|
<div class="card-header bg-white border-0 py-3">
|
|
<h5 class="mb-0 fw-semibold"><i class="bi bi-pencil me-2 text-primary"></i>Edit @Model.Name</h5>
|
|
</div>
|
|
<div class="card-body">
|
|
<form asp-action="Edit" asp-route-id="@Model.Id" method="post">
|
|
@Html.AntiForgeryToken()
|
|
<input type="hidden" asp-for="Id" />
|
|
|
|
<!-- Asset Info -->
|
|
<h6 class="border-bottom pb-2 mb-3 text-muted">Asset Information</h6>
|
|
<div class="row g-3 mb-4">
|
|
<div class="col-12">
|
|
<label asp-for="Name" class="form-label">Asset Name <span class="text-danger">*</span></label>
|
|
<input asp-for="Name" class="form-control" maxlength="200" required />
|
|
<span asp-validation-for="Name" class="text-danger"></span>
|
|
</div>
|
|
<div class="col-12">
|
|
<label asp-for="Description" class="form-label">Description</label>
|
|
<input asp-for="Description" class="form-control" maxlength="1000" />
|
|
</div>
|
|
<div class="col-md-4">
|
|
<label asp-for="PurchaseDate" class="form-label">Purchase Date <span class="text-danger">*</span></label>
|
|
<input asp-for="PurchaseDate" type="date" class="form-control" required />
|
|
<span asp-validation-for="PurchaseDate" class="text-danger"></span>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<label asp-for="PurchaseCost" class="form-label">Purchase Cost <span class="text-danger">*</span></label>
|
|
<div class="input-group">
|
|
<span class="input-group-text">$</span>
|
|
<input asp-for="PurchaseCost" type="number" step="0.01" min="0.01" class="form-control" />
|
|
</div>
|
|
<span asp-validation-for="PurchaseCost" class="text-danger"></span>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<label asp-for="SalvageValue" class="form-label">Salvage Value</label>
|
|
<div class="input-group">
|
|
<span class="input-group-text">$</span>
|
|
<input asp-for="SalvageValue" type="number" step="0.01" min="0" class="form-control" />
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<label asp-for="UsefulLifeMonths" class="form-label">Useful Life (months) <span class="text-danger">*</span></label>
|
|
<input asp-for="UsefulLifeMonths" type="number" min="1" max="600" class="form-control" />
|
|
<span asp-validation-for="UsefulLifeMonths" class="text-danger"></span>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<label asp-for="AccumulatedDepreciation" class="form-label">Accumulated Depreciation</label>
|
|
<div class="input-group">
|
|
<span class="input-group-text">$</span>
|
|
<input asp-for="AccumulatedDepreciation" type="number" step="0.01" min="0" class="form-control" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- GL Accounts -->
|
|
<h6 class="border-bottom pb-2 mb-3 text-muted">GL Account Mapping</h6>
|
|
<div class="row g-3 mb-4">
|
|
<div class="col-md-4">
|
|
<label asp-for="AssetAccountId" class="form-label">Asset Account</label>
|
|
<select asp-for="AssetAccountId" class="form-select">
|
|
<option value="">— None —</option>
|
|
@if (ViewBag.AssetAccounts != null)
|
|
{
|
|
@foreach (var item in (IEnumerable<Microsoft.AspNetCore.Mvc.Rendering.SelectListItem>)ViewBag.AssetAccounts)
|
|
{
|
|
<option value="@item.Value" selected="@(item.Value == Model.AssetAccountId?.ToString() ? "selected" : null)">@item.Text</option>
|
|
}
|
|
}
|
|
</select>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<label asp-for="DepreciationExpenseAccountId" class="form-label">Depreciation Expense Account</label>
|
|
<select asp-for="DepreciationExpenseAccountId" class="form-select">
|
|
<option value="">— None —</option>
|
|
@if (ViewBag.ExpenseAccounts != null)
|
|
{
|
|
@foreach (var item in (IEnumerable<Microsoft.AspNetCore.Mvc.Rendering.SelectListItem>)ViewBag.ExpenseAccounts)
|
|
{
|
|
<option value="@item.Value" selected="@(item.Value == Model.DepreciationExpenseAccountId?.ToString() ? "selected" : null)">@item.Text</option>
|
|
}
|
|
}
|
|
</select>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<label asp-for="AccumDepreciationAccountId" class="form-label">Accumulated Depreciation Account</label>
|
|
<select asp-for="AccumDepreciationAccountId" class="form-select">
|
|
<option value="">— None —</option>
|
|
@if (ViewBag.AccumDeprecAccounts != null)
|
|
{
|
|
@foreach (var item in (IEnumerable<Microsoft.AspNetCore.Mvc.Rendering.SelectListItem>)ViewBag.AccumDeprecAccounts)
|
|
{
|
|
<option value="@item.Value" selected="@(item.Value == Model.AccumDepreciationAccountId?.ToString() ? "selected" : null)">@item.Text</option>
|
|
}
|
|
}
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Disposal -->
|
|
<h6 class="border-bottom pb-2 mb-3 text-muted">Disposal</h6>
|
|
<div class="row g-3 mb-4">
|
|
<div class="col-md-4">
|
|
<div class="form-check form-switch mt-2">
|
|
<input asp-for="IsDisposed" class="form-check-input" type="checkbox" id="isDisposed" />
|
|
<label asp-for="IsDisposed" class="form-check-label">Mark as Disposed</label>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4" id="disposalDateField" style="@(Model.IsDisposed ? "" : "display:none")">
|
|
<label asp-for="DisposalDate" class="form-label">Disposal Date</label>
|
|
<input asp-for="DisposalDate" type="date" class="form-control" />
|
|
</div>
|
|
</div>
|
|
|
|
<div class="d-flex gap-2">
|
|
<button type="submit" class="btn btn-primary">
|
|
<i class="bi bi-check-lg me-2"></i>Save Changes
|
|
</button>
|
|
<a asp-action="Details" asp-route-id="@Model.Id" class="btn btn-outline-secondary">Cancel</a>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
@section Scripts {
|
|
<script src="~/js/fixed-asset-edit.js" asp-append-version="true"></script>
|
|
}
|