Remove references to bill scanning.

This commit is contained in:
James Cole
2018-04-14 13:00:24 +02:00
parent d8a00f4314
commit 926c03986c
13 changed files with 1 additions and 217 deletions

View File

@@ -33,7 +33,6 @@ use FireflyIII\Models\Rule;
use FireflyIII\Models\TransactionJournal;
use FireflyIII\Models\TransactionJournalMeta;
use FireflyIII\Models\TransactionType;
use FireflyIII\Repositories\Bill\BillRepositoryInterface;
use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
use FireflyIII\TransactionRules\Processor;
use Illuminate\Database\Query\JoinClause;
@@ -45,10 +44,6 @@ use Log;
*/
trait ImportSupport
{
/** @var BillRepositoryInterface */
protected $billRepository;
/** @var Collection */
protected $bills;
/** @var int */
protected $defaultCurrencyId = 1;
/** @var ImportJob */
@@ -84,41 +79,6 @@ trait ImportSupport
return true;
}
/**
* @param TransactionJournal $journal
*
* @return bool
*/
protected function matchBills(TransactionJournal $journal): bool
{
if (null !== $journal->bill_id) {
Log::debug('Journal is already linked to a bill, will not scan.');
return true;
}
if ($this->bills->count() > 0) {
$this->bills->each(
function (Bill $bill) use ($journal) {
Log::debug(sprintf('Going to match bill #%d to journal %d.', $bill->id, $journal->id));
$this->billRepository->scan($bill, $journal);
}
);
}
return true;
}
/**
* @return Collection
*/
private function getBills(): Collection
{
$set = Bill::where('user_id', $this->job->user->id)->where('active', 1)->where('automatch', 1)->get(['bills.*']);
Log::debug(sprintf('Found %d user bills.', $set->count()));
return $set;
}
/**
* This method finds out what the import journal's currency should be. The account itself
* is favoured (and usually it stops there). If no preference is found, the journal has a say