From fbefd916ebf7d9f93789b75633a51f75321f6453 Mon Sep 17 00:00:00 2001 From: Rick Falkvinge Date: Thu, 3 Sep 2015 15:55:14 +0200 Subject: [PATCH] Added NBitcoin & more --- Backend/Backend.csproj | 8 ++++++++ Basic/Basic.csproj | 8 ++++++++ Common/Enums/ObjectOptionalDataType.cs | 17 ++++++++++++++++- Console/Console.csproj | 8 ++++++++ Logic/Financial/Salary.cs | 5 ++++- Logic/Logic.csproj | 10 +++++++--- Tests/Tests.csproj | 8 ++++++++ Utility/Utility.csproj | 8 ++++++++ 8 files changed, 67 insertions(+), 5 deletions(-) diff --git a/Backend/Backend.csproj b/Backend/Backend.csproj index 1cfdcd0c..8e080922 100644 --- a/Backend/Backend.csproj +++ b/Backend/Backend.csproj @@ -63,6 +63,14 @@ ..\External Libraries\mono.posix.dll + + ..\packages\NBitcoin.2.1.4.7\lib\net45\NBitcoin.dll + True + + + ..\packages\NBitcoin.2.1.4.7\lib\net45\NBitcoin.BouncyCastle.dll + True + ..\packages\Newtonsoft.Json.6.0.1\lib\net45\Newtonsoft.Json.dll True diff --git a/Basic/Basic.csproj b/Basic/Basic.csproj index 62518178..d1389874 100644 --- a/Basic/Basic.csproj +++ b/Basic/Basic.csproj @@ -49,6 +49,14 @@ false + + ..\packages\NBitcoin.2.1.4.7\lib\net45\NBitcoin.dll + True + + + ..\packages\NBitcoin.2.1.4.7\lib\net45\NBitcoin.BouncyCastle.dll + True + ..\packages\Newtonsoft.Json.6.0.1\lib\net45\Newtonsoft.Json.dll True diff --git a/Common/Enums/ObjectOptionalDataType.cs b/Common/Enums/ObjectOptionalDataType.cs index e025cb18..61b81a8c 100644 --- a/Common/Enums/ObjectOptionalDataType.cs +++ b/Common/Enums/ObjectOptionalDataType.cs @@ -324,6 +324,21 @@ namespace Swarmops.Common.Enums /// /// If bitcoin is preferred instead of banking details /// - BitcoinPayoutAddress + BitcoinPayoutAddress, + + /// + /// If there's a hotwallet, its private root key (encrypted with file and db keys) + /// + BudgetBitcoinPrivateRoot, + + /// + /// If there's another wallet, its public root key (encrypted with db key) + /// + BudgetBitcoinPublicRoot, + + /// + /// For cold wallets, we may prefer listing the public addresses directly + /// + BudgetBitcoinPublicAddress } } \ No newline at end of file diff --git a/Console/Console.csproj b/Console/Console.csproj index a8e062fe..b87fb475 100644 --- a/Console/Console.csproj +++ b/Console/Console.csproj @@ -56,6 +56,14 @@ Swarmops.BotConsole + + ..\packages\NBitcoin.2.1.4.7\lib\net45\NBitcoin.dll + True + + + ..\packages\NBitcoin.2.1.4.7\lib\net45\NBitcoin.BouncyCastle.dll + True + ..\packages\Newtonsoft.Json.6.0.1\lib\net45\Newtonsoft.Json.dll True diff --git a/Logic/Financial/Salary.cs b/Logic/Financial/Salary.cs index 7f87b5c8..6b88239c 100644 --- a/Logic/Financial/Salary.cs +++ b/Logic/Financial/Salary.cs @@ -269,7 +269,10 @@ namespace Swarmops.Logic.Financial salary.PayoutDate.ToString ("yyyy-MMM", CultureInfo.InvariantCulture)); transaction.AddRow (payrollItem.Budget, salary.CostTotalCents, null); transaction.AddRow (payrollItem.Organization.FinancialAccounts.DebtsSalary, -salary.NetSalaryCents, null); - transaction.AddRow (payrollItem.Organization.FinancialAccounts.DebtsTax, -salary.TaxTotalCents, null); + if (salary.TaxTotalCents != 0) + { + transaction.AddRow (payrollItem.Organization.FinancialAccounts.DebtsTax, -salary.TaxTotalCents, null); + } transaction.Dependency = salary; // Finally, check if net and/or tax are zero, and if so, mark them as already-paid (i.e. not due for payment) diff --git a/Logic/Logic.csproj b/Logic/Logic.csproj index 54d8cf34..80d4622d 100644 --- a/Logic/Logic.csproj +++ b/Logic/Logic.csproj @@ -64,9 +64,13 @@ False ..\External Libraries\MySql.Data.dll - - False - ..\External Dependencies\bin\NBitcoin.dll + + ..\packages\NBitcoin.2.1.4.7\lib\net45\NBitcoin.dll + True + + + ..\packages\NBitcoin.2.1.4.7\lib\net45\NBitcoin.BouncyCastle.dll + True ..\packages\Newtonsoft.Json.6.0.1\lib\net45\Newtonsoft.Json.dll diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj index e2e56c40..ef0ead99 100644 --- a/Tests/Tests.csproj +++ b/Tests/Tests.csproj @@ -32,6 +32,14 @@ 4 + + ..\packages\NBitcoin.2.1.4.7\lib\net45\NBitcoin.dll + True + + + ..\packages\NBitcoin.2.1.4.7\lib\net45\NBitcoin.BouncyCastle.dll + True + ..\packages\Newtonsoft.Json.6.0.1\lib\net45\Newtonsoft.Json.dll True diff --git a/Utility/Utility.csproj b/Utility/Utility.csproj index 35480632..2554f06a 100644 --- a/Utility/Utility.csproj +++ b/Utility/Utility.csproj @@ -51,6 +51,14 @@ + + ..\packages\NBitcoin.2.1.4.7\lib\net45\NBitcoin.dll + True + + + ..\packages\NBitcoin.2.1.4.7\lib\net45\NBitcoin.BouncyCastle.dll + True + ..\packages\Newtonsoft.Json.6.0.1\lib\net45\Newtonsoft.Json.dll True