mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Clean up code and comments.
This commit is contained in:
@@ -164,7 +164,6 @@ trait AccountServiceTrait
|
||||
* @param Account $account
|
||||
* @param string $note
|
||||
*
|
||||
|
||||
* @return bool
|
||||
*/
|
||||
public function updateNote(Account $account, string $note): bool
|
||||
|
@@ -331,7 +331,9 @@ class CreditRecalculateService
|
||||
// in any other case, remove amount from left of debt.
|
||||
if (in_array($type, [TransactionType::WITHDRAWAL, TransactionType::DEPOSIT, TransactionType::TRANSFER], true)) {
|
||||
$newLeftOfDebt = bcadd($leftOfDebt, bcmul($usedAmount, '-1'));
|
||||
Log::debug(sprintf('[5] Fallback: transaction is withdrawal/deposit/transfer, remove amount %s from left of debt, = %s.', $usedAmount, $newLeftOfDebt));
|
||||
Log::debug(
|
||||
sprintf('[5] Fallback: transaction is withdrawal/deposit/transfer, remove amount %s from left of debt, = %s.', $usedAmount, $newLeftOfDebt)
|
||||
);
|
||||
return $newLeftOfDebt;
|
||||
}
|
||||
|
||||
|
@@ -77,11 +77,11 @@ trait JournalServiceTrait
|
||||
$result = $this->findAccountByNumber($result, $data, $expectedTypes[$transactionType]);
|
||||
$numberResult = $result;
|
||||
$result = $this->findAccountByName($result, $data, $expectedTypes[$transactionType]);
|
||||
$nameResult =$result;
|
||||
$nameResult = $result;
|
||||
|
||||
// if $result (find by name) is NULL, but IBAN is set, any result of the search by NAME can't overrule
|
||||
// this account. In such a case, the name search must be retried with a new name.
|
||||
if (null !== $nameResult && null === $numberResult && null === $ibanResult && '' !== (string)$data['iban'] && '' !== (string) $nameResult->iban) {
|
||||
if (null !== $nameResult && null === $numberResult && null === $ibanResult && '' !== (string)$data['iban'] && '' !== (string)$nameResult->iban) {
|
||||
$data['name'] = sprintf('%s (%s)', $data['name'], $data['iban']);
|
||||
Log::debug(sprintf('Search again using the new name, "%s".', $data['name']));
|
||||
$result = $this->findAccountByName(null, $data, $expectedTypes[$transactionType]);
|
||||
|
@@ -23,7 +23,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Services\Internal\Support;
|
||||
|
||||
use Exception;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Factory\AccountFactory;
|
||||
use FireflyIII\Factory\BillFactory;
|
||||
|
Reference in New Issue
Block a user