From 626d0fa85f919f6a3035d2789182f12d8ca52b71 Mon Sep 17 00:00:00 2001 From: Rick Falkvinge Date: Mon, 25 Sep 2017 19:22:10 +0200 Subject: [PATCH] Two more dumbfixes --- Site/Automation/FinancialFunctions.aspx.cs | 1 + Site/Controls/v5/Financial/CurrencyTextBox.ascx | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Site/Automation/FinancialFunctions.aspx.cs b/Site/Automation/FinancialFunctions.aspx.cs index 1547f012..0b8e26bb 100644 --- a/Site/Automation/FinancialFunctions.aspx.cs +++ b/Site/Automation/FinancialFunctions.aspx.cs @@ -112,6 +112,7 @@ namespace Swarmops.Frontend.Automation return new InterpretedCurrencyResult { Success = true, + EnteredAmount = amountDouble.ToString("N2"), CurrencyCode = money.Currency.Code, DisplayAmount = (money.ToCurrency(authData.CurrentOrganization.Currency).Cents/100.0).ToString("N2") }; diff --git a/Site/Controls/v5/Financial/CurrencyTextBox.ascx b/Site/Controls/v5/Financial/CurrencyTextBox.ascx index 7c990e2c..2711aec4 100644 --- a/Site/Controls/v5/Financial/CurrencyTextBox.ascx +++ b/Site/Controls/v5/Financial/CurrencyTextBox.ascx @@ -40,13 +40,13 @@ if (currencyText.trim().indexOf(' ') >= 0) { // the text contains at least one space, so try to interpret it and convert it to presentation currency - SwarmopsJS.ajaxCall('/Automation/FinancialFunctions.aspx/InterpretCurrency', - jsonData, - function(data) { - if (data.Success) { - alert("PresentationAmount:" + data.DisplayAmount + "\r\nUsed Currency:" + data.CurrencyCode + "\r\nEntered Amount:" + data.EnteredAmount); - } - }); + SwarmopsJS.ajaxCall('/Automation/FinancialFunctions.aspx/InterpretCurrency', + jsonData, + function(data) { + if (data.Success) { + alert("PresentationAmount:" + data.DisplayAmount + "\r\nUsed Currency:" + data.CurrencyCode + "\r\nEntered Amount:" + data.EnteredAmount); + } + }); } else { // the text does NOT contain at least one space, so we should format it for presentation currency $('#<%=this.ClientID%>_TextInput').blur(function() { @@ -54,7 +54,7 @@ jsonData, function(data) { if (data.Success) { - $('#<%=this.ClientID%>_TextInput').val(data.Result); + $('#<%=this.ClientID%>_TextInput').val(data.NewValue); } }); });