2024-04-04 16:31:04 +09:00
|
|
|
@using BTCPayServer.Payments
|
|
|
|
@inject PaymentMethodViewProvider paymentMethodViewProvider
|
2022-06-12 18:47:26 -07:00
|
|
|
@model (InvoiceDetailsModel Invoice, bool ShowAddress)
|
2023-04-04 03:59:14 +02:00
|
|
|
@{
|
|
|
|
var invoice = Model.Invoice;
|
|
|
|
}
|
2019-04-29 22:45:33 -05:00
|
|
|
|
2023-10-10 05:28:00 +02:00
|
|
|
@if (invoice.Overpaid)
|
|
|
|
{
|
|
|
|
var usedPaymentMethods = invoice.CryptoPayments.Count(p => p.Paid != null);
|
2023-12-13 10:53:37 +01:00
|
|
|
<p class="info-note text-warning">
|
2023-10-10 05:28:00 +02:00
|
|
|
<vc:icon symbol="warning"/>
|
|
|
|
This invoice got overpaid.
|
|
|
|
@if (usedPaymentMethods > 1)
|
|
|
|
{
|
|
|
|
@("Each payment method shows the total excess amount.")
|
|
|
|
}
|
|
|
|
</p>
|
|
|
|
}
|
2023-04-04 03:59:14 +02:00
|
|
|
<div class="invoice-payments table-responsive mt-0">
|
|
|
|
<table class="table table-hover mb-0">
|
2023-10-10 05:28:00 +02:00
|
|
|
<thead>
|
2019-08-24 16:10:13 +02:00
|
|
|
<tr>
|
2023-04-04 03:59:14 +02:00
|
|
|
<th class="text-nowrap w-175px">Payment method</th>
|
2020-03-01 19:46:05 -06:00
|
|
|
@if (Model.ShowAddress)
|
|
|
|
{
|
2023-04-04 03:59:14 +02:00
|
|
|
<th>Destination</th>
|
2020-03-01 19:46:05 -06:00
|
|
|
}
|
2023-10-10 05:28:00 +02:00
|
|
|
@if (invoice.HasRates)
|
|
|
|
{
|
|
|
|
<th class="w-150px text-end">Rate</th>
|
|
|
|
}
|
|
|
|
<th class="w-150px text-end">Total due</th>
|
|
|
|
@if (invoice.StillDue)
|
|
|
|
{
|
|
|
|
<th class="w-150px text-end">Still due</th>
|
|
|
|
}
|
|
|
|
else if (invoice.Overpaid)
|
2019-08-24 16:10:13 +02:00
|
|
|
{
|
2023-04-04 03:59:14 +02:00
|
|
|
<th class="w-150px text-end">Overpaid</th>
|
2019-08-24 16:10:13 +02:00
|
|
|
}
|
2023-10-10 05:28:00 +02:00
|
|
|
<th class="w-150px text-end">Paid</th>
|
2019-09-03 13:11:36 +02:00
|
|
|
</tr>
|
2022-06-12 18:47:26 -07:00
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
@foreach (var payment in invoice.CryptoPayments)
|
2019-08-24 16:10:13 +02:00
|
|
|
{
|
2022-06-12 18:47:26 -07:00
|
|
|
<tr>
|
2023-03-26 13:44:05 +02:00
|
|
|
<td class="text-nowrap">@payment.PaymentMethod</td>
|
2022-06-12 18:47:26 -07:00
|
|
|
@if (Model.ShowAddress)
|
|
|
|
{
|
|
|
|
<td title="@payment.Address">
|
2023-04-04 03:59:14 +02:00
|
|
|
<vc:truncate-center text="@payment.Address" classes="truncate-center-id" />
|
2022-06-12 18:47:26 -07:00
|
|
|
</td>
|
|
|
|
}
|
2023-10-10 05:28:00 +02:00
|
|
|
@if (invoice.HasRates)
|
2022-06-12 18:47:26 -07:00
|
|
|
{
|
2023-10-10 05:28:00 +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.TotalDue</span>
|
|
|
|
</td>
|
|
|
|
@if (invoice.StillDue)
|
|
|
|
{
|
|
|
|
<td class="text-nowrap text-end">
|
|
|
|
@if (payment.Due != null)
|
|
|
|
{
|
|
|
|
<span data-sensitive>@payment.Due</span>
|
|
|
|
}
|
|
|
|
</td>
|
|
|
|
}
|
|
|
|
else if (invoice.Overpaid)
|
|
|
|
{
|
|
|
|
<td class="text-nowrap text-end">
|
|
|
|
@if (payment.Overpaid != null)
|
|
|
|
{
|
|
|
|
<span data-sensitive class="text-warning">@payment.Overpaid</span>
|
|
|
|
}
|
|
|
|
</td>
|
2022-06-12 18:47:26 -07:00
|
|
|
}
|
2023-10-10 05:28:00 +02:00
|
|
|
<td class="text-nowrap text-end">
|
|
|
|
@if (payment.Paid != null)
|
|
|
|
{
|
|
|
|
<span data-sensitive class="text-success">@payment.Paid</span>
|
|
|
|
}
|
|
|
|
</td>
|
2022-06-12 18:47:26 -07:00
|
|
|
</tr>
|
2024-04-04 16:31:04 +09:00
|
|
|
var vvm = paymentMethodViewProvider.TryGetViewViewModel(payment.PaymentMethodRaw, "AdditionalPaymentMethodDetails");;
|
|
|
|
if (vvm != null)
|
2022-06-12 18:47:26 -07:00
|
|
|
{
|
2024-04-04 16:31:04 +09:00
|
|
|
<partial name="@((string)vvm.View)" model="@vvm.ViewModel" />
|
2022-06-12 18:47:26 -07:00
|
|
|
}
|
2019-08-24 16:10:13 +02:00
|
|
|
}
|
2022-05-09 10:38:17 +02:00
|
|
|
</tbody>
|
|
|
|
</table>
|
2022-06-12 18:47:26 -07:00
|
|
|
</div>
|
2024-04-04 16:31:04 +09:00
|
|
|
|
|
|
|
<vc:ui-extension-point location="store-invoices-payments" model="@invoice.Payments" />
|