btcpayserver/BTCPayServer/Views/UIInvoice/ListInvoicesPaymentsPartial.cshtml

60 lines
2.3 KiB
Text
Raw Normal View History

@model (InvoiceDetailsModel Invoice, bool ShowAddress)
@{
var invoice = Model.Invoice;
var grouped = invoice.Payments
.GroupBy(payment => payment.GetPaymentMethodId()?.PaymentType)
.Where(entities => entities.Key != null);
}
<div class="invoice-payments table-responsive mt-0">
<table class="table table-hover mb-0">
<thead class="thead-inverse">
<tr>
<th class="text-nowrap w-175px">Payment method</th>
2020-03-01 19:46:05 -06:00
@if (Model.ShowAddress)
{
<th>Destination</th>
2020-03-01 19:46:05 -06:00
}
<th class="w-150px text-end">Rate</th>
<th class="w-150px text-end">Paid</th>
<th class="w-150px text-end">Due</th>
@if (invoice.Overpaid)
{
<th class="w-150px text-end">Overpaid</th>
}
</tr>
</thead>
<tbody>
@foreach (var payment in invoice.CryptoPayments)
{
<tr>
<td class="text-nowrap">@payment.PaymentMethod</td>
@if (Model.ShowAddress)
{
<td title="@payment.Address">
<vc:truncate-center text="@payment.Address" classes="truncate-center-id" />
</td>
}
2023-05-11 10:35:51 +02:00
<td class="text-nowrap text-end"><span data-sensitive>@payment.Rate</span></td>
<td class="text-nowrap text-end"><span data-sensitive>@payment.Paid</span></td>
<td class="text-nowrap text-end"><span data-sensitive>@payment.Due</span></td>
@if (invoice.Overpaid)
{
2023-05-11 10:35:51 +02:00
<td class="text-nowrap text-end"><span data-sensitive>@payment.Overpaid</span></td>
}
</tr>
var details = payment.PaymentMethodRaw.GetPaymentMethodDetails();
var name = details.GetAdditionalDataPartialName();
if (!string.IsNullOrEmpty(name))
{
<partial name="@name" model="@details" />
}
}
</tbody>
</table>
</div>
@foreach (var paymentGroup in grouped)
{
<partial name="@paymentGroup.Key.InvoiceViewPaymentPartialName" model="@paymentGroup.ToList()" />
}