mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-29 18:20:01 +00:00
Fix negative budget limits
This commit is contained in:
@@ -160,6 +160,9 @@ class BudgetLimitController extends Controller
|
||||
if ((int) $amount > 268435456) {
|
||||
$amount = '268435456';
|
||||
}
|
||||
if((float) $amount < 0.0) {
|
||||
$amount = bcmul($amount, '-1');
|
||||
}
|
||||
|
||||
if (null !== $limit) {
|
||||
$limit->amount = $amount;
|
||||
@@ -226,6 +229,9 @@ class BudgetLimitController extends Controller
|
||||
if ((int) $amount > 268435456) { // 268 million
|
||||
$amount = '268435456';
|
||||
}
|
||||
if((float) $amount < 0.0) {
|
||||
$amount = bcmul($amount, '-1');
|
||||
}
|
||||
|
||||
$limit = $this->blRepository->update($budgetLimit, ['amount' => $amount]);
|
||||
$array = $limit->toArray();
|
||||
|
@@ -93,6 +93,7 @@ class InstallController extends Controller
|
||||
'firefly-iii:create-link-types' => [],
|
||||
'firefly-iii:create-access-tokens' => [],
|
||||
'firefly-iii:remove-bills' => [],
|
||||
'firefly-iii:fix-negative-limits' => [],
|
||||
'firefly-iii:enable-currencies' => [],
|
||||
'firefly-iii:fix-transfer-budgets' => [],
|
||||
'firefly-iii:fix-uneven-amount' => [],
|
||||
|
Reference in New Issue
Block a user