mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-18 10:16:49 +00:00
This loops.
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
<?php namespace FireflyIII\Providers;
|
<?php namespace FireflyIII\Providers;
|
||||||
|
|
||||||
use App;
|
use App;
|
||||||
use Auth;
|
|
||||||
use FireflyIII\Models\Account;
|
use FireflyIII\Models\Account;
|
||||||
use FireflyIII\Models\Bill;
|
use FireflyIII\Models\Bill;
|
||||||
use FireflyIII\Models\BudgetLimit;
|
use FireflyIII\Models\BudgetLimit;
|
||||||
@@ -14,6 +13,7 @@ use FireflyIII\Support\Facades\Navigation;
|
|||||||
use Illuminate\Contracts\Events\Dispatcher as DispatcherContract;
|
use Illuminate\Contracts\Events\Dispatcher as DispatcherContract;
|
||||||
use Illuminate\Database\QueryException;
|
use Illuminate\Database\QueryException;
|
||||||
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
|
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
|
||||||
|
use Log;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class EventServiceProvider
|
* Class EventServiceProvider
|
||||||
@@ -59,19 +59,26 @@ class EventServiceProvider extends ServiceProvider
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
TransactionJournal::saved(
|
// TransactionJournal::saved(
|
||||||
function (TransactionJournal $journal) {
|
// function (TransactionJournal $journal) {
|
||||||
|
//
|
||||||
/** @var \FireflyIII\Repositories\Bill\BillRepositoryInterface $repository */
|
// Log::debug('Triggered saved event for journal #' . $journal->id . ' (' . $journal->description . ')');
|
||||||
$repository = App::make('FireflyIII\Repositories\Bill\BillRepositoryInterface');
|
//
|
||||||
|
// /** @var \FireflyIII\Repositories\Bill\BillRepositoryInterface $repository */
|
||||||
$list = $journal->user->bills()->where('active', 1)->where('automatch', 1)->get();
|
// $repository = App::make('FireflyIII\Repositories\Bill\BillRepositoryInterface');
|
||||||
/** @var Bill $bill */
|
// $list = $journal->user->bills()->where('active', 1)->where('automatch', 1)->get();
|
||||||
foreach ($list as $bill) {
|
//
|
||||||
$repository->scan($bill, $journal);
|
// Log::debug('Found ' . $list->count() . ' bills to check.');
|
||||||
}
|
//
|
||||||
}
|
// /** @var Bill $bill */
|
||||||
);
|
// foreach ($list as $bill) {
|
||||||
|
// Log::debug('Now calling bill #' . $bill->id . ' (' . $bill->name . ')');
|
||||||
|
// $repository->scan($bill, $journal);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// Log::debug('Done!');
|
||||||
|
// }
|
||||||
|
// );
|
||||||
|
|
||||||
|
|
||||||
Account::deleted(
|
Account::deleted(
|
||||||
|
Reference in New Issue
Block a user