mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-24 12:47:00 +00:00
Make sure ff does not create accounts when balance is said to be 0.
This commit is contained in:
@@ -78,14 +78,16 @@ class NewUserController extends Controller
|
|||||||
$this->createAssetAccount($request, $repository);
|
$this->createAssetAccount($request, $repository);
|
||||||
|
|
||||||
// create savings account
|
// create savings account
|
||||||
if (strlen($request->get('savings_balance')) > 0) {
|
$savingBalance = strval($request->get('savings_balance')) === '' ? '0' : strval($request->get('savings_balance'));
|
||||||
|
if (bccomp($savingBalance, '0') !== 0) {
|
||||||
$this->createSavingsAccount($request, $repository);
|
$this->createSavingsAccount($request, $repository);
|
||||||
$count++;
|
$count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// create credit card.
|
// create credit card.
|
||||||
if (strlen($request->get('credit_card_limit')) > 0) {
|
$limit = strval($request->get('credit_card_limit')) === '' ? '0' : strval($request->get('credit_card_limit'));
|
||||||
|
if (bccomp($limit, '0') !== 0) {
|
||||||
$this->storeCreditCard($request, $repository);
|
$this->storeCreditCard($request, $repository);
|
||||||
$count++;
|
$count++;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user