From 7889dbb3eacbb3d85d90071753dd826634b19537 Mon Sep 17 00:00:00 2001 From: Rick Falkvinge Date: Sat, 2 Dec 2017 13:26:18 +0100 Subject: [PATCH] Enforcing sorting of VAT report items --- Site/Pages/v5/Ledgers/Json-VatReportData.aspx.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Site/Pages/v5/Ledgers/Json-VatReportData.aspx.cs b/Site/Pages/v5/Ledgers/Json-VatReportData.aspx.cs index 1d915ee4..0359f160 100644 --- a/Site/Pages/v5/Ledgers/Json-VatReportData.aspx.cs +++ b/Site/Pages/v5/Ledgers/Json-VatReportData.aspx.cs @@ -50,6 +50,7 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers StringBuilder response = new StringBuilder(16384); VatReportItems items = report.Items; + items.Sort(VatItemSorterByDate); List lines = new List(); string hasDoxString = @@ -117,6 +118,9 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers Response.End(); } - + static public int VatItemSorterByDate(VatReportItem a, VatReportItem b) + { + return DateTime.Compare(a.Transaction.DateTime, b.Transaction.DateTime); + } } } \ No newline at end of file