btcpayserver/BTCPayServer/Views/UIInvoice/ListInvoicesPaymentsPartial.cshtml

60 lines
2.1 KiB
Text
Raw Normal View History

2020-11-06 20:42:26 +09:00
@using BTCPayServer.Client.Models
2020-07-24 12:46:46 +02:00
@model (InvoiceDetailsModel Invoice, bool ShowAddress)
2020-03-01 19:46:05 -06:00
@{ var invoice = Model.Invoice; }
<div class="invoice-payments table-responsive-xl mb-4">
<h3 class="mb-0">Invoice Summary</h3>
<table class="table table-hover">
<thead class="thead-inverse">
<tr>
<th>Payment method</th>
@if (Model.ShowAddress)
{
<th>Address</th>
}
<th class="text-end">Rate</th>
<th class="text-end">Paid</th>
<th class="text-end">Due</th>
@if (invoice.StatusException == InvoiceExceptionStatus.PaidOver)
{
<th class="text-end">Overpaid</th>
}
</tr>
</thead>
<tbody>
@foreach (var payment in invoice.CryptoPayments)
{
<tr>
<td>@payment.PaymentMethod</td>
2020-03-01 19:46:05 -06:00
@if (Model.ShowAddress)
{
2022-06-03 17:33:22 +02:00
<td class="text-break">@payment.Address</td>
2020-03-01 19:46:05 -06:00
}
<td class="text-end">@payment.Rate</td>
2022-06-03 17:33:22 +02:00
<td class="text-end text-nowrap">@payment.Paid</td>
<td class="text-end text-nowrap">@payment.Due</td>
2020-03-01 19:46:05 -06:00
@if (invoice.StatusException == InvoiceExceptionStatus.PaidOver)
{
<td class="text-end">@payment.Overpaid</td>
}
</tr>
var details = payment.PaymentMethodRaw.GetPaymentMethodDetails();
var name = details.GetAdditionalDataPartialName();
if (!string.IsNullOrEmpty(name))
{
<partial name="@name" model="@details" />
}
}
</tbody>
</table>
</div>
@{
var grouped = invoice.Payments.GroupBy(payment => payment.GetPaymentMethodId()?.PaymentType).Where(entities => entities.Key!= null);
}
@foreach (var paymentGroup in grouped)
{
2022-06-03 17:33:22 +02:00
<div class="invoice-payments table-responsive-xl mb-4">
<partial name="@paymentGroup.Key.InvoiceViewPaymentPartialName" model="@paymentGroup.ToList()" />
</div>
}