mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Last minute fixes in test code and UI
This commit is contained in:
@@ -939,7 +939,7 @@ class GroupCollector implements GroupCollectorInterface
|
||||
$groups[$groudId]['sums'][$currencyId]['currency_decimal_places'] = $transaction['currency_decimal_places'];
|
||||
$groups[$groudId]['sums'][$currencyId]['amount'] = '0';
|
||||
}
|
||||
$groups[$groudId]['sums'][$currencyId]['amount'] = bcadd($groups[$groudId]['sums'][$currencyId]['amount'], $transaction['amount']);
|
||||
$groups[$groudId]['sums'][$currencyId]['amount'] = bcadd($groups[$groudId]['sums'][$currencyId]['amount'], $transaction['amount'] ?? '0');
|
||||
|
||||
if (null !== $transaction['foreign_amount'] && null !== $transaction['foreign_currency_id']) {
|
||||
$currencyId = (int)$transaction['foreign_currency_id'];
|
||||
@@ -952,7 +952,7 @@ class GroupCollector implements GroupCollectorInterface
|
||||
$groups[$groudId]['sums'][$currencyId]['currency_decimal_places'] = $transaction['foreign_currency_decimal_places'];
|
||||
$groups[$groudId]['sums'][$currencyId]['amount'] = '0';
|
||||
}
|
||||
$groups[$groudId]['sums'][$currencyId]['amount'] = bcadd($groups[$groudId]['sums'][$currencyId]['amount'], $transaction['foreign_amount']);
|
||||
$groups[$groudId]['sums'][$currencyId]['amount'] = bcadd($groups[$groudId]['sums'][$currencyId]['amount'], $transaction['foreign_amount'] ?? '0');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -94,7 +94,7 @@ class ImportArrayStorage
|
||||
|
||||
// get language of user.
|
||||
/** @var Preference $pref */
|
||||
$pref = app('preferences')->get('language', config('firefly.default_language', 'en_US'));
|
||||
$pref = app('preferences')->getForUser($importJob->user, 'language', config('firefly.default_language', 'en_US'));
|
||||
$this->language = $pref->data;
|
||||
|
||||
Log::debug('Constructed ImportArrayStorage()');
|
||||
|
@@ -326,7 +326,8 @@ class TagRepository implements TagRepositoryInterface
|
||||
|
||||
Log::debug(sprintf('Minimum is %s, maximum is %s, difference is %s', $min, $max, $diff));
|
||||
|
||||
if (0 !== bccomp($diff, '0')) {// for each full coin in tag, add so many points
|
||||
if (0 !== bccomp($diff, '0')) { // for each full coin in tag, add so many points
|
||||
// minus the smallest tag.
|
||||
$pointsPerCoin = bcdiv($maxPoints, $diff);
|
||||
}
|
||||
|
||||
@@ -335,7 +336,8 @@ class TagRepository implements TagRepositoryInterface
|
||||
foreach ($tags as $tag) {
|
||||
$amount = (string)$tag->amount_sum;
|
||||
$amount = '' === $amount ? '0' : $amount;
|
||||
$pointsForTag = bcmul($amount, $pointsPerCoin);
|
||||
$amountMin = bcsub($amount, $min);
|
||||
$pointsForTag = bcmul($amountMin, $pointsPerCoin);
|
||||
$fontSize = bcadd($minimumFont, $pointsForTag);
|
||||
Log::debug(sprintf('Tag "%s": Amount is %s, so points is %s', $tag->tag, $amount, $fontSize));
|
||||
|
||||
|
@@ -573,7 +573,7 @@ trait PeriodOverview
|
||||
'currency_decimal_places' => $journal['currency_decimal_places'],
|
||||
];
|
||||
}
|
||||
$return[$currencyId]['amount'] = bcadd($return[$currencyId]['amount'], $journal['amount']);
|
||||
$return[$currencyId]['amount'] = bcadd($return[$currencyId]['amount'], $journal['amount'] ?? '0');
|
||||
$return[$currencyId]['count']++;
|
||||
|
||||
|
||||
|
@@ -104,7 +104,10 @@ class Preferences
|
||||
/** @var User $user */
|
||||
$user = auth()->user();
|
||||
if (null === $user) {
|
||||
return $default;
|
||||
$preference = new Preference;
|
||||
$preference->data = $default;
|
||||
|
||||
return $preference;
|
||||
}
|
||||
|
||||
return $this->getForUser($user, $name, $default);
|
||||
|
Reference in New Issue
Block a user