Sort attempt too

This commit is contained in:
Rick Falkvinge
2017-09-22 21:11:09 +02:00
parent f0207b8c6e
commit 4a2d7b74f3
@@ -21,6 +21,8 @@ public partial class Pages_v5_Finance_Json_ListInvoicesInbound : DataV5Base
this._attestationRights = GetAttestationRights();
this._invoices = InboundInvoices.ForOrganization(this.CurrentOrganization, true);
_invoices.Sort(SortInvoicesByDueDate);
// Format as JSON and return
Response.ContentType = "application/json";
@@ -29,6 +31,12 @@ public partial class Pages_v5_Finance_Json_ListInvoicesInbound : DataV5Base
Response.End();
}
private static int SortInvoicesByDueDate(InboundInvoice a, InboundInvoice b)
{
return DateTime.Compare(a.DueDate, b.DueDate);
}
private string FormatAsJson()
{
// Fields: item, dueDate, sender, budget, amount, progress, docs, action
@@ -78,8 +86,8 @@ public partial class Pages_v5_Finance_Json_ListInvoicesInbound : DataV5Base
private string _emptyTick = "<img src='/Images/Icons/iconshock-empty-tick-128x96px.png' height='12' width='16'>";
private string _greenTick = "<img src='/Images/Icons/iconshock-green-tick-128x96px.png' height='12' width='16'>";
private string _redCross = "<img src='/Images/Icons/iconshock-red-cross-128x96px.png' height='12' width='16'>";
private string _filler = "<img src='/Images/Icons/transparency-16px.png' height='12' width='16'>";
private string _redCross = "<img src='/Images/Icons/iconshock-red-cross-128x96px.png' height='20' width='20'>";
private string _fillerTwo = "<img src='/Images/Icons/transparency-16px.png' height='12' width='16'>";
private string GetProgressTicks(InboundInvoice invoice)