Large commit to get rid of a lot of static methods.

This commit is contained in:
James Cole
2017-03-04 07:18:35 +01:00
parent 33c20c8dc4
commit d9aa074330
25 changed files with 144 additions and 169 deletions

View File

@@ -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);
/*