From 7377b6d1ef766e5d2f43e3c6b66316b9ea7db383 Mon Sep 17 00:00:00 2001 From: Rick Falkvinge Date: Mon, 5 Jul 2021 11:44:36 +0200 Subject: [PATCH] Converted VAT reports to new loc --- .../v5/Ledgers/Json-VatReportData.aspx.cs | 7 +++--- Site/Pages/v5/Ledgers/ViewVatReports.aspx.cs | 25 ++++++++++--------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/Site/Pages/v5/Ledgers/Json-VatReportData.aspx.cs b/Site/Pages/v5/Ledgers/Json-VatReportData.aspx.cs index d47fdc26..84e1d735 100644 --- a/Site/Pages/v5/Ledgers/Json-VatReportData.aspx.cs +++ b/Site/Pages/v5/Ledgers/Json-VatReportData.aspx.cs @@ -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 diff --git a/Site/Pages/v5/Ledgers/ViewVatReports.aspx.cs b/Site/Pages/v5/Ledgers/ViewVatReports.aspx.cs index 37da6d1f..22697221 100644 --- a/Site/Pages/v5/Ledgers/ViewVatReports.aspx.cs +++ b/Site/Pages/v5/Ledgers/ViewVatReports.aspx.cs @@ -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(); @@ -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; }