From 890f797dd86fb066ba76f80afc4cd92c04448750 Mon Sep 17 00:00:00 2001 From: Rick Falkvinge Date: Sat, 28 Apr 2018 21:18:45 +0200 Subject: [PATCH] Minor fixes --- Logic/Financial/FinancialAccount.cs | 2 +- Site/Pages/v5/Ledgers/AccountPlan.aspx.cs | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Logic/Financial/FinancialAccount.cs b/Logic/Financial/FinancialAccount.cs index 839383a3..2ba156fe 100644 --- a/Logic/Financial/FinancialAccount.cs +++ b/Logic/Financial/FinancialAccount.cs @@ -126,7 +126,7 @@ namespace Swarmops.Logic.Financial } set { - OptionalData.SetOptionalDataInt (ObjectOptionalDataType.FinancialAccountNativeCurrency, value.Identity); + OptionalData.SetOptionalDataInt (ObjectOptionalDataType.FinancialAccountNativeCurrency, (value == null? 0: value.Identity)); } } diff --git a/Site/Pages/v5/Ledgers/AccountPlan.aspx.cs b/Site/Pages/v5/Ledgers/AccountPlan.aspx.cs index 52792a2a..388a5d1d 100644 --- a/Site/Pages/v5/Ledgers/AccountPlan.aspx.cs +++ b/Site/Pages/v5/Ledgers/AccountPlan.aspx.cs @@ -496,6 +496,15 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers result.Data.NonPresentationCurrency = (result.Data.Profile.CurrencyId != authData.CurrentOrganization.Currency.Identity); + if (result.Data.NonPresentationCurrency) + { + account.ForeignCurrency = Currency.FromCode(result.Data.AutomationCurrencyCode); + } + else + { + account.ForeignCurrency = null; + } + return result; }