This commit is contained in:
Rick Falkvinge
2018-03-13 20:45:17 +01:00
2 changed files with 14 additions and 3 deletions
@@ -206,7 +206,7 @@ namespace Swarmops.Logic.Financial
public FinancialAccount DebtsOther
{
get { return this[OrganizationFinancialAccountType.DebtsSalary]; }
get { return this[OrganizationFinancialAccountType.DebtsOther]; }
}
public FinancialAccount IncomeCurrencyFluctuations
@@ -75,8 +75,19 @@ namespace Swarmops.Logic.Support.BackendServices
string tx2Description = "Bitcoin echo test repayment";
FinancialTransaction ledgerTx2 = FinancialTransaction.Create(this.Organization,
DateTime.UtcNow, tx2Description);
ledgerTx2.AddRow(this.Organization.FinancialAccounts.DebtsOther, satoshisToReturn, this.Person);
ledgerTx2.AddRow(this.Organization.FinancialAccounts.AssetsBitcoinHot, -satoshisToReturn, this.Person);
if (this.Organization.Currency.IsBitcoinCash)
{
ledgerTx2.AddRow(this.Organization.FinancialAccounts.DebtsOther, satoshisToReturn, this.Person);
ledgerTx2.AddRow(this.Organization.FinancialAccounts.AssetsBitcoinHot, -satoshisToReturn, this.Person);
}
else
{
Int64 centsPresentation =
new Swarmops.Logic.Financial.Money(satoshisToReturn, Currency.BitcoinCash).ToCurrency(this.Organization.Currency).Cents;
ledgerTx2.AddRow(this.Organization.FinancialAccounts.DebtsOther, centsPresentation, this.Person);
ledgerTx2.AddRow(this.Organization.FinancialAccounts.AssetsBitcoinHot, -centsPresentation, this.Person);
}
ledgerTx2.BlockchainHash = tx.GetHash().ToString();
}