Yet more work on nonpresentation currency in database

This commit is contained in:
Rick Falkvinge
2018-05-05 14:26:07 +02:00
parent 2f60c98334
commit b3ffe701a2
@@ -613,6 +613,7 @@ namespace Swarmops.Site.Pages.Ledgers
ImportResults result = new ImportResults();
int count = 0;
int progressUpdateInterval = import.Records.Length/40;
Int64 importedCentsTotal = 0;
if (progressUpdateInterval > 100)
{
@@ -670,6 +671,7 @@ namespace Swarmops.Site.Pages.Ledgers
}
Int64 foreignCents = amountCents;
importedCentsTotal += amountCents;
if (accountCurrency.Identity != organizationCurrency.Identity)
{
@@ -787,15 +789,11 @@ namespace Swarmops.Site.Pages.Ledgers
if (autosetInitialBalance)
{
if (accountCurrency.Identity == organizationCurrency.Identity) // ordinary presentation currency
{
// assetAccount.
}
else
{
// non-presentation currency
}
Int64 newInitialBalanceCents = result.BalanceMismatchCents - importedCentsTotal;
assetAccount.InitialBalanceCents = new Money(newInitialBalanceCents, accountCurrency);
result.InitialBalanceCents = (newInitialBalanceCents/100.0).ToString("N2");
result.InitialBalanceCurrency = accountCurrency.DisplayCode;
}
}