mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-26 13:36:15 +00:00
Code for #3554
This commit is contained in:
@@ -78,6 +78,7 @@ class AccountTransformer extends AbstractTransformer
|
||||
[$openingBalance, $openingBalanceDate] = $this->getOpeningBalance($account, $accountType, $decimalPlaces);
|
||||
[$interest, $interestPeriod] = $this->getInterest($account, $accountType);
|
||||
|
||||
$openingBalance = number_format((float) $openingBalance, $decimalPlaces, '.', '');
|
||||
$liabilityAmount = null;
|
||||
$liabilityStart = null;
|
||||
if (null !== $liabilityType) {
|
||||
@@ -94,7 +95,6 @@ class AccountTransformer extends AbstractTransformer
|
||||
$latitude = $location->latitude;
|
||||
$zoomLevel = $location->zoom_level;
|
||||
}
|
||||
|
||||
return [
|
||||
'id' => (int)$account->id,
|
||||
'created_at' => $account->created_at->toAtomString(),
|
||||
@@ -107,7 +107,7 @@ class AccountTransformer extends AbstractTransformer
|
||||
'currency_code' => $currencyCode,
|
||||
'currency_symbol' => $currencySymbol,
|
||||
'currency_decimal_places' => $decimalPlaces,
|
||||
'current_balance' => (string) round(app('steam')->balance($account, $date), $decimalPlaces),
|
||||
'current_balance' => number_format((float) app('steam')->balance($account, $date), $decimalPlaces, '.', ''),
|
||||
'current_balance_date' => $date->format('Y-m-d'),
|
||||
'notes' => $this->repository->getNoteText($account),
|
||||
'monthly_payment_date' => $monthlyPaymentDate,
|
||||
@@ -115,7 +115,7 @@ class AccountTransformer extends AbstractTransformer
|
||||
'account_number' => $this->repository->getMetaValue($account, 'account_number'),
|
||||
'iban' => '' === $account->iban ? null : $account->iban,
|
||||
'bic' => $this->repository->getMetaValue($account, 'BIC'),
|
||||
'virtual_balance' => round($account->virtual_balance, $decimalPlaces),
|
||||
'virtual_balance' => number_format((float) $account->virtual_balance, $decimalPlaces, '.', ''),
|
||||
'opening_balance' => $openingBalance,
|
||||
'opening_balance_date' => $openingBalanceDate,
|
||||
'liability_type' => $liabilityType,
|
||||
@@ -240,7 +240,7 @@ class AccountTransformer extends AbstractTransformer
|
||||
$openingBalanceDate = null;
|
||||
if (in_array($accountType, ['asset', 'liabilities'], true)) {
|
||||
$amount = $this->repository->getOpeningBalanceAmount($account);
|
||||
$openingBalance = null === $amount ? null : round($amount, $decimalPlaces);
|
||||
$openingBalance = $amount;
|
||||
$openingBalanceDate = $this->repository->getOpeningBalanceDate($account);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user