Files
btcpayserver/BTCPayServer/Views/UIInvoice/InvoiceReceiptPrint.cshtml
d11n 2fb72d5aa6 Payment Request: Improve public view (#5413)
* Payment Request: Improve public view

Closes #4450.

* Test fix

* Extract Vue utils

* Improve payment history

* Fix amount display

* Unify receipt and payment request tables

* Re-add text confirmation for copying to clipboard

* Minor print optimizations

* Wording: Rename Description to Memo

* Open view links in new window

* View updates
2023-11-20 10:45:43 +09:00

73 lines
2.2 KiB
Plaintext

@model BTCPayServer.Models.InvoicingModels.InvoiceReceiptViewModel
@using BTCPayServer.Client.Models
@using BTCPayServer.Components.QRCode
@using BTCPayServer.Services
@using Microsoft.AspNetCore.Mvc.TagHelpers
@using BTCPayServer.Abstractions.TagHelpers
@inject DisplayFormatter DisplayFormatter
@{
Layout = null;
ViewData["Title"] = $"Receipt from {Model.StoreName}";
var isProcessing = Model.Status == InvoiceStatus.Processing;
var isSettled = Model.Status == InvoiceStatus.Settled;
}
<link href="~/main/bootstrap/bootstrap.css" asp-append-version="true" rel="stylesheet" />
<link href="~/main/site.css" asp-append-version="true" rel="stylesheet" />
<p class="text-center">@Model.StoreName</p>
<p class="text-center">@Model.Timestamp.ToBrowserDate()</p>
<p>&nbsp;</p>
@if (isProcessing)
{
<div class="lead text-center p-4 fw-semibold" id="invoice-processing">
The invoice has detected a payment but is still waiting to be settled.
</div>
}
else if (!isSettled)
{
<div class="lead text-center p-4 fw-semibold" id="invoice-unsettled">
The invoice is not settled.
</div>
}
else
{
<h3 class="text-center">
<strong>@DisplayFormatter.Currency(Model.Amount, Model.Currency, DisplayFormatter.CurrencyFormat.Symbol)</strong>
</h3>
@if (Model.Payments?.Any() is true)
{
<p>&nbsp;</p>
<p class="text-center"><strong>Payments</strong></p>
@foreach (var payment in Model.Payments)
{
<p>&nbsp;</p>
<p class="text-center">@payment.AmountFormatted <span class="text-nowrap">@payment.PaymentMethod</span></p>
<p class="text-center">Rate: @payment.RateFormatted</p>
<p class="text-center">= @payment.PaidFormatted</p>
}
}
if (Model.AdditionalData?.Any() is true)
{
<p>&nbsp;</p>
<p class="text-center"><strong>Additional Data</strong></p>
<partial name="PosData" model="(Model.AdditionalData, 1)"/>
}
@if (!string.IsNullOrEmpty(Model.OrderId))
{
<p>&nbsp;</p>
<p class="text-break">Order ID: @Model.OrderId</p>
}
}
@if (Model.ReceiptOptions.ShowQR is true)
{
<vc:qr-code data="@Context.Request.GetCurrentUrl()"></vc:qr-code>
}
<script>window.print();</script>