Result display fixes (the backend seems fine)
This commit is contained in:
@@ -202,7 +202,7 @@ namespace Swarmops.Logic.Financial
|
||||
}
|
||||
|
||||
|
||||
public Money InitialBalanceCents
|
||||
public Money InitialBalance
|
||||
{
|
||||
set
|
||||
{
|
||||
|
||||
@@ -336,7 +336,7 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers
|
||||
|
||||
Int64 desiredInitialBalanceCents = Formatting.ParseDoubleStringAsCents(newInitialBalanceString);
|
||||
|
||||
account.InitialBalanceCents = new Money(desiredInitialBalanceCents, account.Organization.Currency); // only avaialable for presentation currencies
|
||||
account.InitialBalance = new Money(desiredInitialBalanceCents, account.Organization.Currency); // only avaialable for presentation currencies
|
||||
|
||||
return new ChangeAccountDataResult
|
||||
{
|
||||
|
||||
@@ -316,7 +316,7 @@ namespace Swarmops.Site.Pages.Ledgers
|
||||
String.Format(
|
||||
Resources.Pages.Ledgers.UploadBankFiles_ResultsInitialBalanceSetForeignCurrency,
|
||||
Currency.FromCode(resultDetail.CurrencyCode).DisplayCode,
|
||||
-resultDetail.BalanceMismatchCents);
|
||||
resultDetail.BalanceMismatchCents);
|
||||
}
|
||||
|
||||
html += ".</p>";
|
||||
@@ -813,10 +813,15 @@ namespace Swarmops.Site.Pages.Ledgers
|
||||
if (autosetInitialBalance)
|
||||
{
|
||||
Int64 newInitialBalanceCents = -result.BalanceMismatchCents;
|
||||
Money initialBalance = new Money(newInitialBalanceCents, accountCurrency);
|
||||
|
||||
assetAccount.InitialBalanceCents = new Money(newInitialBalanceCents, accountCurrency);
|
||||
assetAccount.InitialBalance = initialBalance;
|
||||
result.InitialBalanceCents = newInitialBalanceCents;
|
||||
result.InitialBalanceCurrencyCode = accountCurrency.Code;
|
||||
|
||||
// make an approximation of conversion rate set for initial balance in presentation to tell user
|
||||
initialBalance.ValuationDateTime = new DateTime(assetAccount.Organization.FirstFiscalYear, 1, 1);
|
||||
result.BalanceMismatchCents = initialBalance.ToCurrency(assetAccount.Organization.Currency).Cents;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user