From 9344a8f07e71023990500ebe579a3fc89fe52d41 Mon Sep 17 00:00:00 2001 From: Rick Falkvinge Date: Tue, 5 Mar 2019 18:00:28 +0100 Subject: [PATCH] Mandatory forex gain/loss accounts when presentation currency isn't bch --- Logic/Structure/Organization.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Logic/Structure/Organization.cs b/Logic/Structure/Organization.cs index 84edf897..9b24fa1b 100644 --- a/Logic/Structure/Organization.cs +++ b/Logic/Structure/Organization.cs @@ -594,6 +594,19 @@ namespace Swarmops.Logic.Structure OptionalData.SetOptionalDataString (ObjectOptionalDataType.OrgCurrency, currency.Code); + // If presentation currency is something else than bitcoin cash, then we also + // need forex gain/loss accounts to account for (at least) the hotwallet + + if (!currency.IsBitcoinCash) + { + this.FinancialAccounts.IncomeCurrencyFluctuations = + FinancialAccount.Create(this, "[LOC]Income_ForexGains", + FinancialAccountType.Income, null); + this.FinancialAccounts.CostsCurrencyFluctuations = + FinancialAccount.Create(this, "[LOC]Cost_ForexLosses", + FinancialAccountType.Cost, null); + } + // Set current year to first fiscal year OptionalData.SetOptionalDataInt (ObjectOptionalDataType.OrgFirstFiscalYear, DateTime.Today.Year);