mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-22 20:16:22 +00:00
Large commit to get rid of a lot of static methods.
This commit is contained in:
@@ -251,7 +251,7 @@ class BillRepository implements BillRepositoryInterface
|
||||
$count = strval($journals->count());
|
||||
/** @var TransactionJournal $journal */
|
||||
foreach ($journals as $journal) {
|
||||
$sum = bcadd($sum, TransactionJournal::amountPositive($journal));
|
||||
$sum = bcadd($sum, $journal->amountPositive());
|
||||
}
|
||||
$avg = '0';
|
||||
if ($journals->count() > 0) {
|
||||
@@ -370,7 +370,7 @@ class BillRepository implements BillRepositoryInterface
|
||||
$count = strval($journals->count());
|
||||
/** @var TransactionJournal $journal */
|
||||
foreach ($journals as $journal) {
|
||||
$sum = bcadd($sum, TransactionJournal::amountPositive($journal));
|
||||
$sum = bcadd($sum, $journal->amountPositive());
|
||||
}
|
||||
$avg = '0';
|
||||
if ($journals->count() > 0) {
|
||||
@@ -478,15 +478,15 @@ class BillRepository implements BillRepositoryInterface
|
||||
if (false === $journal->isWithdrawal()) {
|
||||
return false;
|
||||
}
|
||||
$destinationAccounts = TransactionJournal::destinationAccountList($journal);
|
||||
$sourceAccounts = TransactionJournal::sourceAccountList($journal);
|
||||
$destinationAccounts = $journal->destinationAccountList();
|
||||
$sourceAccounts = $journal->sourceAccountList();
|
||||
$matches = explode(',', $bill->match);
|
||||
$description = strtolower($journal->description) . ' ';
|
||||
$description .= strtolower(join(' ', $destinationAccounts->pluck('name')->toArray()));
|
||||
$description .= strtolower(join(' ', $sourceAccounts->pluck('name')->toArray()));
|
||||
|
||||
$wordMatch = $this->doWordMatch($matches, $description);
|
||||
$amountMatch = $this->doAmountMatch(TransactionJournal::amountPositive($journal), $bill->amount_min, $bill->amount_max);
|
||||
$amountMatch = $this->doAmountMatch($journal->amountPositive(), $bill->amount_min, $bill->amount_max);
|
||||
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user