2020-03-02 02:46:05 +01:00
|
|
|
@model (InvoiceDetailsModel Invoice, bool ShowAddress)
|
|
|
|
@{ var invoice = Model.Invoice; }
|
2019-08-24 16:10:13 +02:00
|
|
|
@inject PaymentMethodHandlerDictionary PaymentMethodHandlerDictionary
|
2019-04-30 05:45:33 +02:00
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-12 invoice-payments">
|
2020-02-28 23:30:57 +01:00
|
|
|
<h3>Paid summary</h3>
|
2019-04-30 05:45:33 +02:00
|
|
|
<table class="table table-sm table-responsive-md">
|
|
|
|
<thead class="thead-inverse">
|
2019-08-24 16:10:13 +02:00
|
|
|
<tr>
|
|
|
|
<th>Payment method</th>
|
2020-03-02 02:46:05 +01:00
|
|
|
@if (Model.ShowAddress)
|
|
|
|
{
|
2020-02-28 23:30:57 +01:00
|
|
|
<th>Address</th>
|
2020-03-02 02:46:05 +01:00
|
|
|
}
|
2019-08-24 16:10:13 +02: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)
|
2019-08-24 16:10:13 +02:00
|
|
|
{
|
|
|
|
<th class="text-right">Overpaid</th>
|
|
|
|
}
|
2019-09-03 13:11:36 +02:00
|
|
|
</tr>
|
2019-08-24 16:10:13 +02:00
|
|
|
</thead>
|
|
|
|
<tbody>
|
2020-03-02 02:46:05 +01:00
|
|
|
@foreach (var payment in invoice.CryptoPayments)
|
2019-08-24 16:10:13 +02:00
|
|
|
{
|
2019-04-30 05:45:33 +02:00
|
|
|
<tr>
|
2019-08-24 16:10:13 +02:00
|
|
|
<td>@payment.PaymentMethod</td>
|
2020-03-02 02:46:05 +01:00
|
|
|
@if (Model.ShowAddress)
|
|
|
|
{
|
2020-02-28 23:30:57 +01:00
|
|
|
<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
|
|
|
}
|
2019-08-24 16:10:13 +02: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)
|
2019-04-30 05:45:33 +02:00
|
|
|
{
|
2019-08-24 16:10:13 +02:00
|
|
|
<td class="text-right">@payment.Overpaid</td>
|
2019-04-30 05:45:33 +02:00
|
|
|
}
|
|
|
|
</tr>
|
2019-08-24 16:10:13 +02:00
|
|
|
}
|
2019-04-30 05:45:33 +02:00
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
2019-08-24 16:10:13 +02:00
|
|
|
@{
|
2020-03-02 02:46:05 +01:00
|
|
|
var grouped = invoice.Payments.GroupBy(payment => payment.GetPaymentMethodId().PaymentType);
|
2019-04-30 05:45:33 +02:00
|
|
|
}
|
2019-08-24 16:10:13 +02:00
|
|
|
@foreach (var paymentGroup in grouped)
|
2019-04-30 05:45:33 +02:00
|
|
|
{
|
2019-08-24 16:10:13 +02:00
|
|
|
<partial name="@paymentGroup.Key.InvoiceViewPaymentPartialName" model="@paymentGroup.ToList()" />
|
2019-04-30 05:45:33 +02:00
|
|
|
}
|