Filter out opening balances. #839

This commit is contained in:
James Cole 2017-09-14 10:39:24 +02:00
parent 6d69832711
commit 4b5f500dc1
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E

View File

@ -204,7 +204,8 @@ class CategoryController extends Controller
/** @var JournalCollectorInterface $collector */
$collector = app(JournalCollectorInterface::class);
$collector->setAllAssetAccounts()->setRange($start, $end)->setLimit($pageSize)->setPage($page)->withoutCategory()->withOpposingAccount();
$collector->setAllAssetAccounts()->setRange($start, $end)->setLimit($pageSize)->setPage($page)->withoutCategory()->withOpposingAccount()
->setTypes([TransactionType::WITHDRAWAL,TransactionType::DEPOSIT, TransactionType::TRANSFER]);
$collector->removeFilter(InternalTransferFilter::class);
$journals = $collector->getPaginatedJournals();
$journals->setPath(route('categories.no-category'));
@ -358,11 +359,11 @@ class CategoryController extends Controller
$end = Navigation::startOfPeriod($end, $range);
$currentEnd = Navigation::endOfPeriod($end, $range);
// count journals without budget in this period:
// count journals without category in this period:
/** @var JournalCollectorInterface $collector */
$collector = app(JournalCollectorInterface::class);
$collector->setAllAssetAccounts()->setRange($end, $currentEnd)->withoutCategory()
->withOpposingAccount();
->withOpposingAccount()->setTypes([TransactionType::WITHDRAWAL,TransactionType::DEPOSIT, TransactionType::TRANSFER]);
$collector->removeFilter(InternalTransferFilter::class);
$count = $collector->getJournals()->count();