mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-18 15:39:50 +00:00
Some generic code refactoring.
This commit is contained in:
@@ -461,7 +461,7 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
*/
|
||||
public function isLiability(Account $account): bool
|
||||
{
|
||||
return \in_array($account->accountType->type, [AccountType::CREDITCARD, AccountType::LOAN, AccountType::DEBT, AccountType::MORTGAGE], true);
|
||||
return in_array($account->accountType->type, [AccountType::CREDITCARD, AccountType::LOAN, AccountType::DEBT, AccountType::MORTGAGE], true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -305,7 +305,7 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface
|
||||
Log::debug(sprintf('Will add/remove %f to piggy bank #%d ("%s")', $amount, $piggyBank->id, $piggyBank->name));
|
||||
|
||||
// if piggy account matches source account, the amount is positive
|
||||
if (\in_array($piggyBank->account_id, $sources, true)) {
|
||||
if (in_array($piggyBank->account_id, $sources, true)) {
|
||||
$amount = bcmul($amount, '-1');
|
||||
Log::debug(sprintf('Account #%d is the source, so will remove amount from piggy bank.', $piggyBank->account_id));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user