Added footer to VAT report data
This commit is contained in:
+18
@@ -2032,6 +2032,15 @@ namespace Resources.Pages {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to -- nothing to report --.
|
||||
/// </summary>
|
||||
internal static string ViewVatReports_EmptyReport {
|
||||
get {
|
||||
return ResourceManager.GetString("ViewVatReports_EmptyReport", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Report Totals.
|
||||
/// </summary>
|
||||
@@ -2113,6 +2122,15 @@ namespace Resources.Pages {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Totals for this report.
|
||||
/// </summary>
|
||||
internal static string ViewVatReports_ReportTotals {
|
||||
get {
|
||||
return ResourceManager.GetString("ViewVatReports_ReportTotals", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to View.
|
||||
/// </summary>
|
||||
|
||||
@@ -906,4 +906,12 @@
|
||||
<value>View</value>
|
||||
<comment>This is the word or words before the name of the displayed VAT report.</comment>
|
||||
</data>
|
||||
<data name="ViewVatReports_EmptyReport" xml:space="preserve">
|
||||
<value>-- nothing to report --</value>
|
||||
<comment>This is displayed when there are no items at all in a VAT report.</comment>
|
||||
</data>
|
||||
<data name="ViewVatReports_ReportTotals" xml:space="preserve">
|
||||
<value>Totals for this report</value>
|
||||
<comment>Displayed as description of footer</comment>
|
||||
</data>
|
||||
</root>
|
||||
@@ -81,7 +81,18 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers
|
||||
lines.Add("{" + element + "}");
|
||||
}
|
||||
|
||||
Response.Write("[" + String.Join(",", lines.ToArray()) + "]");
|
||||
if (lines.Count == 0) // add empty report line
|
||||
{
|
||||
lines.Add(String.Format("\"id\":\"0\",\"description\":\"{0}\"",
|
||||
JsonSanitize(Resources.Pages.Ledgers.ViewVatReports_EmptyReport)));
|
||||
}
|
||||
|
||||
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}\"]",
|
||||
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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user