mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-10 12:24:50 +00:00
Make sure integers are converted to strings because sqlite sucks.
This commit is contained in:
@@ -65,7 +65,7 @@ class Amount
|
||||
// Log::debug(sprintf('Overruled, amount is now %s', $amount));
|
||||
}
|
||||
|
||||
return $amount;
|
||||
return (string) $amount;
|
||||
}
|
||||
|
||||
public function convertToNative(?User $user = null): bool
|
||||
|
||||
@@ -198,8 +198,10 @@ class FrontpageChartGenerator
|
||||
}
|
||||
$useNative = $this->convertToNative && $this->default->id !== $limit->transaction_currency_id;
|
||||
$amount = $limit->amount;
|
||||
if ($useNative) {
|
||||
Log::debug(sprintf('Amount is "%s".', $amount));
|
||||
if ($useNative && $limit->transaction_currency_id !== $this->default->id) {
|
||||
$amount = $limit->native_amount;
|
||||
Log::debug(sprintf('Amount is now "%s".', $amount));
|
||||
}
|
||||
|
||||
|
||||
@@ -208,7 +210,6 @@ class FrontpageChartGenerator
|
||||
$data[1]['entries'][$title] ??= '0';
|
||||
$data[2]['entries'][$title] ??= '0';
|
||||
|
||||
|
||||
$data[0]['entries'][$title] = bcadd($data[0]['entries'][$title], 1 === bccomp($sumSpent, $amount) ? $amount : $sumSpent); // spent
|
||||
$data[1]['entries'][$title] = bcadd($data[1]['entries'][$title], 1 === bccomp($amount, $sumSpent) ? bcadd($entry['sum'], $amount) : '0'); // left to spent
|
||||
$data[2]['entries'][$title] = bcadd($data[2]['entries'][$title], 1 === bccomp($amount, $sumSpent) ? '0' : bcmul(bcadd($entry['sum'], $amount), '-1')); // overspent
|
||||
|
||||
Reference in New Issue
Block a user