2017-09-13 08:47:34 +02:00
|
|
|
@model InvoicesModel
|
|
|
|
@{
|
2017-10-27 10:53:04 +02:00
|
|
|
ViewData["Title"] = "Invoices";
|
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">
|
|
|
|
@Html.Partial("_StatusMessage", Model.StatusMessage)
|
|
|
|
</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">
|
|
|
|
<p>You can search for invoice Id, deposit address, price, order id, store id, any buyer information and any product information.</br>
|
|
|
|
You can also apply filters to your search by searching for `filtername:value`, here is a list of supported filters</p>
|
|
|
|
<ul>
|
2017-12-03 15:42:10 +01:00
|
|
|
<li><b>storeid:id</b> for filtering a specific store</li>
|
2017-12-03 15:35:52 +01:00
|
|
|
<li><b>status:(expired|invalid|complete|confirmed|paid|new)</b> for filtering a specific status</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
2017-10-27 10:53:04 +02:00
|
|
|
<div class="form-group">
|
|
|
|
<form asp-action="SearchInvoice" method="post">
|
|
|
|
<input asp-for="SearchTerm" class="form-control" />
|
|
|
|
<input type="hidden" asp-for="Count" />
|
|
|
|
<span asp-validation-for="SearchTerm" class="text-danger"></span>
|
2017-11-12 16:27:16 +01:00
|
|
|
<button type="submit" class="btn btn-default" title="Search invoice">
|
2017-10-27 10:53:04 +02:00
|
|
|
<span class="glyphicon glyphicon-search"></span> Search
|
|
|
|
</button>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2017-09-13 08:47:34 +02:00
|
|
|
|
2017-10-27 10:53:04 +02:00
|
|
|
<div class="row">
|
|
|
|
<a asp-action="CreateInvoice" class="btn btn-success" role="button"><span class="glyphicon glyphicon-plus"></span> Create a new invoice</a>
|
|
|
|
<table class="table">
|
|
|
|
<thead class="thead-inverse">
|
|
|
|
<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>
|
|
|
|
<th>Amount</th>
|
|
|
|
<th>Actions</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
2017-12-03 15:35:52 +01:00
|
|
|
@foreach(var invoice in Model.Invoices)
|
2017-10-27 10:53:04 +02:00
|
|
|
{
|
|
|
|
<tr>
|
|
|
|
<td>@invoice.Date</td>
|
2018-02-28 11:03:23 +01:00
|
|
|
<td>@invoice.OrderId</td>
|
2017-10-27 10:53:04 +02:00
|
|
|
<td>@invoice.InvoiceId</td>
|
2017-12-03 15:35:52 +01: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
|
|
|
|
{
|
|
|
|
<td>@invoice.Status</td>
|
|
|
|
}
|
2017-10-27 10:53:04 +02:00
|
|
|
<td>@invoice.AmountCurrency</td>
|
|
|
|
<td><a asp-action="Checkout" asp-route-invoiceId="@invoice.InvoiceId">Checkout</a> - <a asp-action="Invoice" asp-route-invoiceId="@invoice.InvoiceId">Details</a></td>
|
|
|
|
</tr>
|
|
|
|
}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<span>
|
2017-12-03 15:35:52 +01: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>
|
|
|
|
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|