Fix tests.

This commit is contained in:
James Cole
2018-04-14 21:21:20 +02:00
parent 15a22f0bfc
commit 62b68c6a21
6 changed files with 74 additions and 105 deletions

View File

@@ -344,29 +344,6 @@ class BillRepository implements BillRepositoryInterface
return $set;
}
/**
* @param Bill $bill
*
* @return Collection
*/
public function getPossiblyRelatedJournals(Bill $bill): Collection
{
$set = new Collection(
DB::table('transactions')->where('amount', '>', 0)->where('amount', '>=', $bill->amount_min)->where('amount', '<=', $bill->amount_max)
->get(['transaction_journal_id'])
);
$ids = $set->pluck('transaction_journal_id')->toArray();
$journals = new Collection;
if (count($ids) > 0) {
$journals = $this->user->transactionJournals()->transactionTypes([TransactionType::WITHDRAWAL])->whereIn('transaction_journals.id', $ids)->get(
['transaction_journals.*']
);
}
return $journals;
}
/**
* Return all rules for one bill
*