btcpayserver/BTCPayServer/Views/Invoice/ListInvoicesPaymentsPartial.cshtml

57 lines
2.1 KiB
Plaintext
Raw Normal View History

2020-07-24 12:46:46 +02:00
@using BTCPayServer.Client.Models
@model (InvoiceDetailsModel Invoice, bool ShowAddress)
2020-03-02 02:46:05 +01:00
@{ var invoice = Model.Invoice; }
@inject PaymentMethodHandlerDictionary PaymentMethodHandlerDictionary
<div class="row">
<div class="col-md-12 invoice-payments">
2020-03-26 12:50:08 +01:00
<h3>Invoice Summary</h3>
<table class="table table-sm table-responsive-md">
<thead class="thead-inverse">
<tr>
<th>Payment method</th>
2020-03-02 02:46:05 +01:00
@if (Model.ShowAddress)
{
<th>Address</th>
2020-03-02 02:46:05 +01:00
}
<th class="text-right">Rate</th>
<th class="text-right">Paid</th>
<th class="text-right">Due</th>
2020-03-02 02:46:05 +01:00
@if (invoice.StatusException == InvoiceExceptionStatus.PaidOver)
{
<th class="text-right">Overpaid</th>
}
</tr>
</thead>
<tbody>
2020-03-02 02:46:05 +01:00
@foreach (var payment in invoice.CryptoPayments)
{
<tr>
<td>@payment.PaymentMethod</td>
2020-03-02 02:46:05 +01:00
@if (Model.ShowAddress)
{
<td title="@payment.Address">
<span class="text-truncate d-block" style="max-width: 400px">@payment.Address</span>
</td>
2020-03-02 02:46:05 +01:00
}
<td class="text-right">@payment.Rate</td>
<td class="text-right">@payment.Paid</td>
<td class="text-right">@payment.Due</td>
2020-03-02 02:46:05 +01:00
@if (invoice.StatusException == InvoiceExceptionStatus.PaidOver)
{
<td class="text-right">@payment.Overpaid</td>
}
</tr>
}
</tbody>
</table>
</div>
</div>
@{
var grouped = invoice.Payments.GroupBy(payment => payment.GetPaymentMethodId()?.PaymentType).Where(entities => entities.Key!= null);
}
@foreach (var paymentGroup in grouped)
{
<partial name="@paymentGroup.Key.InvoiceViewPaymentPartialName" model="@paymentGroup.ToList()" />
}