From 37231663b512525b054c78a87460a318b6f28905 Mon Sep 17 00:00:00 2001 From: Falkvinge Date: Sat, 28 Oct 2017 13:33:40 +0200 Subject: [PATCH] JSON format bugfix --- Site/Pages/v5/Ledgers/Json-VatReportData.aspx.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Site/Pages/v5/Ledgers/Json-VatReportData.aspx.cs b/Site/Pages/v5/Ledgers/Json-VatReportData.aspx.cs index 5451d225..201d63a1 100644 --- a/Site/Pages/v5/Ledgers/Json-VatReportData.aspx.cs +++ b/Site/Pages/v5/Ledgers/Json-VatReportData.aspx.cs @@ -87,14 +87,14 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers JsonSanitize(Resources.Pages.Ledgers.ViewVatReports_EmptyReport))); } - Response.Write("{\"rows\":[" + String.Join(",", lines.ToArray()) + "],"); + Response.Write("{\"rows\":[" + String.Join(",", lines.ToArray()) + "]"); - Response.Write(String.Format("\"footer\":[\"id\":\"0\",\"description\":\"{0}\",\"turnover\":\"{1:N2}\",\"inbound\":\"{2:N2}\",\"outbound\":\"{3:N2}\"]", + Response.Write(",\"footer\":[{"); // needs to be on separate line to not trigger a String.Format warning + + Response.Write(String.Format("\"id\":\"0\",\"description\":\"{0}\",\"turnover\":\"{1:N2}\",\"inbound\":\"{2:N2}\",\"outbound\":\"{3:N2}\"", JsonSanitize(Resources.Pages.Ledgers.ViewVatReports_Footer_Total.ToUpperInvariant()), turnoverCentsTotal / 100.0, inboundCentsTotal / 100.0, outboundCentsTotal / 100.0)); - Response.Write("}"); // needs to be separate to not trigger String.Format warning - - // TODO: FOOTER + Response.Write("}]"); // needs to be separate to not trigger String.Format warning Response.End(); }