Converted VAT reports to new loc

This commit is contained in:
Rick Falkvinge
2021-07-05 11:44:36 +02:00
parent 30a0762dfd
commit 7377b6d1ef
2 changed files with 17 additions and 15 deletions
@@ -4,6 +4,7 @@ using System.Globalization;
using System.Text;
using Swarmops.Common.Enums;
using Swarmops.Database;
using Swarmops.Localization;
using Swarmops.Logic.Financial;
using Swarmops.Logic.Support;
@@ -94,7 +95,7 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers
if (documents.Count > 0)
{
element += String.Format(",\"dox\":\"" + hasDoxString + "\"", transaction.Identity, documents[0].Identity, CurrentOrganization.Name + " - " + report.Description + " - " + Resources.Global.Financial_TransactionIdShort + transaction.OrganizationSequenceId.ToString("N0"));
element += String.Format(",\"dox\":\"" + hasDoxString + "\"", transaction.Identity, documents[0].Identity, CurrentOrganization.Name + " - " + report.Description + " - " + LocalizedStrings.Get(LocDomain.Global, "Financial_TransactionIdShort") + transaction.OrganizationSequenceId.ToString("N0"));
}
if (include)
@@ -106,7 +107,7 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers
if (lines.Count == 0) // add empty report line
{
lines.Add("{" + String.Format("\"id\":\"0\",\"description\":\"{0}\"",
JsonSanitize(Resources.Pages.Ledgers.ViewVatReports_EmptyReport)) + "}");
JsonSanitize(LocalizedStrings.Get(LocDomain.PagesLedgers, "ViewVatReports_EmptyReport"))) + "}");
}
Response.Write("{\"rows\":[" + String.Join(",", lines.ToArray()) + "]");
@@ -114,7 +115,7 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers
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));
JsonSanitize(LocalizedStrings.Get(LocDomain.PagesLedgers, "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
+13 -12
View File
@@ -6,6 +6,7 @@ using System.Web;
using System.Web.DynamicData;
using System.Web.UI;
using System.Web.UI.WebControls;
using Swarmops.Localization;
using Swarmops.Logic.Financial;
using Swarmops.Logic.Security;
using Swarmops.Logic.Support;
@@ -22,8 +23,8 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers
return;
}
PageTitle = Resources.Pages.Ledgers.ViewVatReports_PageTitle;
InfoBoxLiteral = Resources.Pages.Ledgers.ViewVatReports_Info;
PageTitle = LocalizedStrings.Get(LocDomain.PagesLedgers, "ViewVatReports_PageTitle");
InfoBoxLiteral = LocalizedStrings.Get(LocDomain.PagesLedgers, "ViewVatReports_Info");
VatReportDocuments = new List<RepeatedDocument>();
@@ -135,18 +136,18 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers
private void Localize()
{
this.LabelContentHeader.Text = Resources.Pages.Ledgers.ViewVatReports_Title_View;
this.LabelContentHeader.Text = LocalizedStrings.Get(LocDomain.PagesLedgers, "ViewVatReports_Title_View");
this.LiteralHeaderTransactionId.Text = Resources.Global.Financial_TransactionIdShort;
this.LiteralHeaderDateTime.Text = Resources.Global.Global_Date;
this.LiteralHeaderDescription.Text = Resources.Pages.Ledgers.ViewVatReports_Header_Description;
this.LiteralHeaderTurnover.Text = Resources.Pages.Ledgers.ViewVatReports_Header_Turnover;
this.LiteralHeaderVatInbound.Text = Resources.Pages.Ledgers.ViewVatReports_Header_Inbound;
this.LiteralHeaderVatOutbound.Text = Resources.Pages.Ledgers.ViewVatReports_Header_Outbound;
this.LiteralHeaderDox.Text = Resources.Global.Global_Dox;
this.LiteralHeaderTransactionId.Text = LocalizedStrings.Get(LocDomain.Global, "Financial_TransactionIdShort");
this.LiteralHeaderDateTime.Text = LocalizedStrings.Get(LocDomain.Global, "Global_Date");
this.LiteralHeaderDescription.Text = LocalizedStrings.Get(LocDomain.PagesLedgers, "ViewVatReports_Header_Description");
this.LiteralHeaderTurnover.Text = LocalizedStrings.Get(LocDomain.PagesLedgers, "ViewVatReports_Header_Turnover");
this.LiteralHeaderVatInbound.Text = LocalizedStrings.Get(LocDomain.PagesLedgers, "ViewVatReports_Header_Inbound");
this.LiteralHeaderVatOutbound.Text = LocalizedStrings.Get(LocDomain.PagesLedgers, "ViewVatReports_Header_Outbound");
this.LiteralHeaderDox.Text = LocalizedStrings.Get(LocDomain.Global, "Global_Dox");
this.LabelHeaderNoVatReportsToDisplay.Text = Resources.Pages.Ledgers.ViewVatReports_Header_NoReports;
this.LabelNoVatReportsToDisplay.Text = Resources.Pages.Ledgers.ViewVatReports_NoReports;
this.LabelHeaderNoVatReportsToDisplay.Text = LocalizedStrings.Get(LocDomain.PagesLedgers, "ViewVatReports_Header_NoReports");
this.LabelNoVatReportsToDisplay.Text = LocalizedStrings.Get(LocDomain.PagesLedgers, "ViewVatReports_NoReports");
}
public int InitialReportId { get; private set; }