JSON format bugfix

This commit is contained in:
Falkvinge
2017-10-28 13:33:40 +02:00
parent 83bfaf53dd
commit 37231663b5
@@ -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();
}