/**
  * @param BillRepositoryInterface $repository
  * @param Bill                    $bill
  *
  * @return \Illuminate\Http\RedirectResponse
  */
 public function rescan(BillRepositoryInterface $repository, Bill $bill)
 {
     if (intval($bill->active) == 0) {
         Session::flash('warning', 'Inactive bills cannot be scanned.');
         return redirect(URL::previous());
     }
     $journals = $repository->getPossiblyRelatedJournals($bill);
     /** @var TransactionJournal $journal */
     foreach ($journals as $journal) {
         $repository->scan($bill, $journal);
     }
     Session::flash('success', 'Rescanned everything.');
     Preferences::mark();
     return redirect(URL::previous());
 }
 /**
  * @param BillRepositoryInterface $repository
  * @param Bill                    $bill
  *
  * @return \Illuminate\Http\RedirectResponse
  */
 public function rescan(BillRepositoryInterface $repository, Bill $bill)
 {
     if (intval($bill->active) == 0) {
         Session::flash('warning', strval(trans('firefly.cannot_scan_inactive_bill')));
         return redirect(URL::previous());
     }
     $journals = $repository->getPossiblyRelatedJournals($bill);
     /** @var TransactionJournal $journal */
     foreach ($journals as $journal) {
         $repository->scan($bill, $journal);
     }
     Session::flash('success', strval(trans('firefly.rescanned_bill')));
     Preferences::mark();
     return redirect(URL::previous());
 }