2017-09-13 08:47:34 +02:00
|
|
|
@model InvoicesModel
|
|
|
|
@{
|
2017-10-27 10:53:04 +02:00
|
|
|
ViewData["Title"] = "Invoices";
|
2018-11-09 09:13:45 +01:00
|
|
|
var rootUrl = Context.Request.GetAbsoluteRoot();
|
|
|
|
}
|
|
|
|
|
|
|
|
@section HeadScripts {
|
|
|
|
<script src="~/modal/btcpay.js"></script>
|
2017-09-13 08:47:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
<section>
|
2017-10-27 10:53:04 +02:00
|
|
|
<div class="container">
|
2017-09-13 08:47:34 +02:00
|
|
|
|
2017-10-27 10:53:04 +02:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-lg-12 text-center">
|
2018-05-08 10:57:53 +02:00
|
|
|
<partial name="_StatusMessage" for="StatusMessage" />
|
2017-10-27 10:53:04 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
2017-09-13 08:47:34 +02:00
|
|
|
|
2017-10-27 10:53:04 +02:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-lg-12 text-center">
|
|
|
|
<h2 class="section-heading">@ViewData["Title"]</h2>
|
|
|
|
<hr class="primary">
|
2017-12-03 15:35:52 +01:00
|
|
|
<p>Create, search or pay an invoice. (<a href="#help" data-toggle="collapse">Help</a>)</p>
|
|
|
|
<div id="help" class="collapse text-left">
|
2018-04-09 10:53:43 +02:00
|
|
|
<p>
|
2018-05-03 18:46:52 +02:00
|
|
|
You can search for invoice Id, deposit address, price, order id, store id, any buyer information and any product information.<br />
|
2018-05-05 16:25:09 +02:00
|
|
|
You can also apply filters to your search by searching for <code>filtername:value</code>, here is a list of supported filters
|
2018-04-09 10:53:43 +02:00
|
|
|
</p>
|
2017-12-03 15:35:52 +01:00
|
|
|
<ul>
|
2018-05-05 16:25:09 +02:00
|
|
|
<li><code>storeid:id</code> for filtering a specific store</li>
|
|
|
|
<li><code>status:(expired|invalid|complete|confirmed|paid|new)</code> for filtering a specific status</li>
|
|
|
|
<li><code>exceptionstatus:(paidover|paidlate|paidpartial)</code> for filtering a specific exception state</li>
|
2018-05-06 06:16:39 +02:00
|
|
|
<li><code>unusual:(true|false)</code> for filtering invoices which might requires merchant attention (those invalid or with an exceptionstatus)</li>
|
2017-12-03 15:35:52 +01:00
|
|
|
</ul>
|
2018-04-26 04:01:59 +02:00
|
|
|
<p>
|
2018-05-06 17:24:23 +02:00
|
|
|
If you want all confirmed and complete invoices, you can duplicate a filter <code>status:confirmed status:complete</code>.
|
2018-04-26 04:01:59 +02:00
|
|
|
</p>
|
2017-12-03 15:35:52 +01:00
|
|
|
</div>
|
2018-10-12 03:09:13 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="row no-gutter" style="margin-bottom: 5px;">
|
2018-11-30 08:22:39 +01:00
|
|
|
<div class="col-lg-6">
|
2018-10-12 03:09:13 +02:00
|
|
|
<a asp-action="CreateInvoice" class="btn btn-primary" role="button"><span class="fa fa-plus"></span> Create a new invoice</a>
|
2018-11-30 08:22:39 +01:00
|
|
|
|
|
|
|
<a class="btn btn-primary dropdown-toggle" href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
|
|
|
Export
|
|
|
|
</a>
|
|
|
|
<div class="dropdown-menu" aria-labelledby="dropdownMenuLink">
|
|
|
|
<a asp-action="Export" asp-route-format="json" asp-route-searchTerm="@Model.SearchTerm" class="dropdown-item" target="_blank">CSV</a>
|
|
|
|
</div>
|
2018-10-12 03:09:13 +02:00
|
|
|
</div>
|
|
|
|
|
2018-11-30 08:22:39 +01:00
|
|
|
<div class="col-lg-6">
|
2017-10-27 10:53:04 +02:00
|
|
|
<div class="form-group">
|
2018-10-12 03:09:13 +02:00
|
|
|
<form asp-action="SearchInvoice" method="post" style="float:right;">
|
2018-04-09 10:53:43 +02:00
|
|
|
<div class="input-group">
|
2018-10-12 03:09:13 +02:00
|
|
|
<input asp-for="SearchTerm" class="form-control" style="width:300px;" />
|
2018-04-09 10:53:43 +02:00
|
|
|
<span class="input-group-btn">
|
|
|
|
<button type="submit" class="btn btn-primary" title="Search invoice">
|
|
|
|
<span class="fa fa-search"></span> Search
|
|
|
|
</button>
|
|
|
|
</span>
|
|
|
|
</div>
|
2017-10-27 10:53:04 +02:00
|
|
|
<input type="hidden" asp-for="Count" />
|
|
|
|
<span asp-validation-for="SearchTerm" class="text-danger"></span>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2017-09-13 08:47:34 +02:00
|
|
|
|
2017-10-27 10:53:04 +02:00
|
|
|
<div class="row">
|
2018-04-08 07:06:47 +02:00
|
|
|
<table class="table table-sm table-responsive-md">
|
2018-04-06 06:20:12 +02:00
|
|
|
<thead>
|
2017-10-27 10:53:04 +02:00
|
|
|
<tr>
|
|
|
|
<th>Date</th>
|
2018-02-28 11:03:23 +01:00
|
|
|
<th>OrderId</th>
|
2017-10-27 10:53:04 +02:00
|
|
|
<th>InvoiceId</th>
|
|
|
|
<th>Status</th>
|
2018-03-13 01:13:16 +01:00
|
|
|
<th style="text-align:right">Amount</th>
|
2018-03-13 07:28:39 +01:00
|
|
|
<th style="text-align:right">Actions</th>
|
2017-10-27 10:53:04 +02:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
2018-10-12 03:09:13 +02:00
|
|
|
@foreach (var invoice in Model.Invoices)
|
2017-10-27 10:53:04 +02:00
|
|
|
{
|
|
|
|
<tr>
|
2018-05-28 16:36:49 +02:00
|
|
|
<td>@invoice.Date.ToTimeAgo()</td>
|
2018-03-13 01:13:16 +01:00
|
|
|
<td>
|
2018-10-12 03:09:13 +02:00
|
|
|
@if (invoice.RedirectUrl != string.Empty)
|
2018-03-13 01:13:16 +01:00
|
|
|
{
|
|
|
|
<a href="@invoice.RedirectUrl">@invoice.OrderId</a>
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
<span>@invoice.OrderId</span>
|
|
|
|
}
|
|
|
|
</td>
|
2017-10-27 10:53:04 +02:00
|
|
|
<td>@invoice.InvoiceId</td>
|
2018-10-12 03:09:13 +02:00
|
|
|
@if (invoice.Status == "paid")
|
2017-11-06 04:15:52 +01:00
|
|
|
{
|
|
|
|
<td>
|
|
|
|
<div class="btn-group">
|
|
|
|
<a class="dropdown-toggle dropdown-toggle-split" style="cursor: pointer;" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
|
|
|
@invoice.Status <span class="sr-only">Toggle Dropdown</span>
|
|
|
|
</a>
|
|
|
|
<div class="dropdown-menu pull-right">
|
|
|
|
<button class="dropdown-item small" data-toggle="modal" data-target="#myModal" onclick="$('#invoiceId').val('@invoice.InvoiceId')">Make Invalid</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2018-04-09 10:53:43 +02:00
|
|
|
<td>@invoice.Status</td>
|
2017-11-06 04:15:52 +01:00
|
|
|
}
|
2018-03-13 01:13:16 +01:00
|
|
|
<td style="text-align:right">@invoice.AmountCurrency</td>
|
|
|
|
<td style="text-align:right">
|
2018-10-12 03:09:13 +02:00
|
|
|
@if (invoice.ShowCheckout)
|
2018-03-13 01:13:16 +01:00
|
|
|
{
|
2018-11-09 09:13:45 +01:00
|
|
|
<span>
|
|
|
|
<a asp-action="Checkout" asp-route-invoiceId="@invoice.InvoiceId">Checkout</a>
|
|
|
|
<a href="javascript:btcpay.showInvoice('@invoice.InvoiceId')">[^]</a>
|
|
|
|
-
|
|
|
|
</span>
|
|
|
|
}
|
|
|
|
<a asp-action="Invoice" asp-route-invoiceId="@invoice.InvoiceId">Details</a>
|
2018-03-13 01:13:16 +01:00
|
|
|
</td>
|
2017-10-27 10:53:04 +02:00
|
|
|
</tr>
|
|
|
|
}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<span>
|
2018-10-12 03:09:13 +02:00
|
|
|
@if (Model.Skip != 0)
|
2017-10-27 10:53:04 +02:00
|
|
|
{
|
|
|
|
<a href="@Url.Action("ListInvoices", new
|
2017-11-06 04:15:52 +01:00
|
|
|
{
|
|
|
|
searchTerm = Model.SearchTerm,
|
|
|
|
skip = Math.Max(0, Model.Skip - Model.Count),
|
|
|
|
count = Model.Count,
|
|
|
|
})"><<</a><span> - </span>
|
2017-10-27 10:53:04 +02:00
|
|
|
}
|
|
|
|
<a href="@Url.Action("ListInvoices", new
|
2017-11-06 04:15:52 +01:00
|
|
|
{
|
|
|
|
searchTerm = Model.SearchTerm,
|
|
|
|
skip = Model.Skip + Model.Count,
|
|
|
|
count = Model.Count,
|
|
|
|
})">>></a>
|
2017-10-27 10:53:04 +02:00
|
|
|
</span>
|
|
|
|
</div>
|
2017-09-13 08:47:34 +02:00
|
|
|
|
2017-10-27 10:53:04 +02:00
|
|
|
</div>
|
|
|
|
</section>
|
2017-11-06 04:15:52 +01:00
|
|
|
|
|
|
|
<!-- Modal -->
|
|
|
|
<div id="myModal" class="modal fade" role="dialog">
|
|
|
|
<form method="post" action="/invoices/invalidatepaid">
|
|
|
|
<input id="invoiceId" name="invoiceId" type="hidden" />
|
|
|
|
<div class="modal-dialog">
|
|
|
|
|
|
|
|
<!-- Modal content-->
|
|
|
|
<div class="modal-content">
|
|
|
|
<div class="modal-header">
|
|
|
|
<h4 class="modal-title">Set Invoice status to Invalid</h4>
|
|
|
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
|
|
|
</div>
|
|
|
|
<div class="modal-body">
|
|
|
|
<p>Are you sure you want to invalidate this transaction? This action is NOT undoable!</p>
|
|
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
|
|
|
<button type="submit" class="btn btn-danger">Yes, make invoice Invalid</button>
|
2018-04-08 06:49:36 +02:00
|
|
|
<button type="button" class="btn btn-primary" data-dismiss="modal">Cancel</button>
|
2017-11-06 04:15:52 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|