@model PowderCoating.Application.DTOs.GiftCertificate.GiftCertificateDto @using PowderCoating.Core.Enums @{ ViewData["Title"] = $"Gift Certificate {Model.CertificateCode}"; ViewData["PageIcon"] = "bi-gift"; var isActive = Model.Status == GiftCertificateStatus.Active || Model.Status == GiftCertificateStatus.PartiallyRedeemed; var (statusClass, statusLabel) = Model.Status switch { GiftCertificateStatus.Active => ("success", "Active"), GiftCertificateStatus.PartiallyRedeemed => ("info", "Partially Redeemed"), GiftCertificateStatus.FullyRedeemed => ("secondary", "Fully Redeemed"), GiftCertificateStatus.Expired => ("warning", "Expired"), GiftCertificateStatus.Voided => ("danger", "Voided"), _ => ("secondary", Model.Status.ToString()) }; }
Download PDF Back to List
@statusLabel @if (isActive) { @Model.RemainingBalance.ToString("C") remaining of @Model.OriginalAmount.ToString("C") face value } @if (Model.ExpiryDate.HasValue) { · Expires @Model.ExpiryDate.Value.Tz(ViewBag.CompanyTimeZone as string).ToString("MMMM d, yyyy") }
Certificate Information

@Model.CertificateCode

@Model.OriginalAmount.ToString("C")

@Model.IssuedReason

@Model.IssueDate.Tz(ViewBag.CompanyTimeZone as string).ToString("MMMM d, yyyy")

@(Model.ExpiryDate.HasValue ? Model.ExpiryDate.Value.Tz(ViewBag.CompanyTimeZone as string).ToString("MMMM d, yyyy") : "No expiry")

@if (!string.IsNullOrEmpty(Model.IssuedByName)) {

@Model.IssuedByName

} @if (Model.PurchasePrice.HasValue) {

@Model.PurchasePrice.Value.ToString("C")

} @if (!string.IsNullOrEmpty(Model.PurchasingCustomerName)) {

@Model.PurchasingCustomerName

} @if (!string.IsNullOrEmpty(Model.Notes)) {

@Model.Notes

}
Recipient
@if (!string.IsNullOrEmpty(Model.RecipientName) || Model.RecipientCustomerId.HasValue) {

@Model.RecipientName

@if (!string.IsNullOrEmpty(Model.RecipientEmail)) { } @if (Model.RecipientCustomerId.HasValue) { }
} else {

No specific recipient assigned.

}
Redemption History
@if (Model.Redemptions.Any()) {
@foreach (var r in Model.Redemptions) { }
Date Invoice Amount Redeemed
@r.RedeemedDate.Tz(ViewBag.CompanyTimeZone as string).ToString("MM/dd/yyyy") @if (!string.IsNullOrEmpty(r.InvoiceNumber)) { @r.InvoiceNumber } else { Invoice #@r.InvoiceId } @r.AmountRedeemed.ToString("C")
} else {

No redemptions recorded yet.

}
Balance

@Model.OriginalAmount.ToString("C")

@if (Model.RedeemedAmount > 0) {

(@Model.RedeemedAmount.ToString("C"))

}

@Model.RemainingBalance.ToString("C")

@if (isActive && User.IsInRole("SuperAdmin") || User.IsInRole("Administrator") || User.IsInRole("Manager")) {
Actions
@if (isActive && (User.IsInRole("SuperAdmin") || User.IsInRole("Administrator"))) {
@Html.AntiForgeryToken()
}
}