Files
firefly-iii/app/Http/Controllers/Transaction/SingleController.php

491 lines
20 KiB
PHP
Raw Normal View History

2016-10-21 19:20:03 +02:00
<?php
/**
* SingleController.php
2017-10-21 08:40:00 +02:00
* Copyright (c) 2017 thegrumpydictator@gmail.com
2016-10-21 19:20:03 +02:00
*
2017-10-21 08:40:00 +02:00
* This file is part of Firefly III.
2016-10-21 19:20:03 +02:00
*
2017-10-21 08:40:00 +02:00
* Firefly III is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Firefly III is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
2017-12-17 14:44:05 +01:00
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
2016-10-21 19:20:03 +02:00
*/
declare(strict_types=1);
2016-10-21 19:20:03 +02:00
namespace FireflyIII\Http\Controllers\Transaction;
2017-08-21 17:11:18 +02:00
use Carbon\Carbon;
2016-10-21 19:20:03 +02:00
use ExpandedForm;
2016-10-22 09:31:27 +02:00
use FireflyIII\Events\StoredTransactionJournal;
use FireflyIII\Events\UpdatedTransactionJournal;
2016-10-21 19:20:03 +02:00
use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Http\Requests\JournalFormRequest;
2017-09-03 10:51:02 +02:00
use FireflyIII\Models\Account;
2016-10-21 19:20:03 +02:00
use FireflyIII\Models\AccountType;
2017-10-06 15:41:21 +02:00
use FireflyIII\Models\Note;
2017-07-07 17:51:14 +02:00
use FireflyIII\Models\Transaction;
2016-10-21 19:20:03 +02:00
use FireflyIII\Models\TransactionJournal;
use FireflyIII\Models\TransactionType;
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
2016-10-21 19:20:03 +02:00
use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface;
2017-11-24 17:33:05 +01:00
use Illuminate\Http\Request;
2016-10-21 19:20:03 +02:00
use Log;
use Preferences;
use Session;
use View;
/**
2017-11-15 12:25:49 +01:00
* Class SingleController.
2016-10-21 19:20:03 +02:00
*/
class SingleController extends Controller
{
2017-11-15 12:25:49 +01:00
/** @var AccountRepositoryInterface */
2016-10-21 19:20:03 +02:00
private $accounts;
/** @var AttachmentHelperInterface */
private $attachments;
2017-11-15 12:25:49 +01:00
/** @var BudgetRepositoryInterface */
2016-10-21 19:20:03 +02:00
private $budgets;
2017-11-15 12:25:49 +01:00
/** @var CurrencyRepositoryInterface */
private $currency;
2017-11-15 12:25:49 +01:00
/** @var PiggyBankRepositoryInterface */
2016-10-21 19:20:03 +02:00
private $piggyBanks;
2017-11-15 12:25:49 +01:00
/** @var JournalRepositoryInterface */
2017-07-04 16:31:16 +02:00
private $repository;
2016-10-21 19:20:03 +02:00
/**
*
*/
public function __construct()
{
parent::__construct();
2017-11-25 20:54:42 +01:00
$maxFileSize = app('steam')->phpBytes(ini_get('upload_max_filesize'));
$maxPostSize = app('steam')->phpBytes(ini_get('post_max_size'));
2016-10-21 19:20:03 +02:00
$uploadSize = min($maxFileSize, $maxPostSize);
View::share('uploadSize', $uploadSize);
// some useful repositories:
$this->middleware(
function ($request, $next) {
$this->accounts = app(AccountRepositoryInterface::class);
$this->budgets = app(BudgetRepositoryInterface::class);
$this->piggyBanks = app(PiggyBankRepositoryInterface::class);
$this->attachments = app(AttachmentHelperInterface::class);
$this->currency = app(CurrencyRepositoryInterface::class);
2017-07-04 16:31:16 +02:00
$this->repository = app(JournalRepositoryInterface::class);
2016-10-21 19:20:03 +02:00
2017-12-16 19:46:36 +01:00
app('view')->share('title', trans('firefly.transactions'));
app('view')->share('mainTitleIcon', 'fa-repeat');
2016-10-29 07:44:46 +02:00
2016-10-21 19:20:03 +02:00
return $next($request);
}
);
}
2017-12-17 14:30:53 +01:00
/**
* @param TransactionJournal $journal
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function cloneTransaction(TransactionJournal $journal)
{
2017-07-07 17:51:14 +02:00
$source = $journal->sourceAccountList()->first();
$destination = $journal->destinationAccountList()->first();
$budget = $journal->budgets()->first();
2017-11-15 12:25:49 +01:00
$budgetId = null === $budget ? 0 : $budget->id;
2017-07-07 17:51:14 +02:00
$category = $journal->categories()->first();
2017-11-15 12:25:49 +01:00
$categoryName = null === $category ? '' : $category->name;
2017-07-07 17:51:14 +02:00
$tags = join(',', $journal->tags()->get()->pluck('tag')->toArray());
/** @var Transaction $transaction */
2017-06-12 17:21:31 +02:00
$transaction = $journal->transactions()->first();
2017-11-25 20:54:42 +01:00
$amount = app('steam')->positive($transaction->amount);
$foreignAmount = null === $transaction->foreign_amount ? null : app('steam')->positive($transaction->foreign_amount);
$preFilled = [
2017-07-07 17:51:14 +02:00
'description' => $journal->description,
'source_account_id' => $source->id,
'source_account_name' => $source->name,
'destination_account_id' => $destination->id,
'destination_account_name' => $destination->name,
'amount' => $amount,
'source_amount' => $amount,
'destination_amount' => $foreignAmount,
'foreign_amount' => $foreignAmount,
2017-07-08 06:09:17 +02:00
'native_amount' => $foreignAmount,
2017-07-07 17:51:14 +02:00
'amount_currency_id_amount' => $transaction->foreign_currency_id ?? 0,
2017-08-21 17:11:18 +02:00
'date' => (new Carbon())->format('Y-m-d'),
2017-07-07 17:51:14 +02:00
'budget_id' => $budgetId,
'category' => $categoryName,
'tags' => $tags,
'interest_date' => $journal->getMeta('interest_date'),
'book_date' => $journal->getMeta('book_date'),
'process_date' => $journal->getMeta('process_date'),
'due_date' => $journal->getMeta('due_date'),
'payment_date' => $journal->getMeta('payment_date'),
'invoice_date' => $journal->getMeta('invoice_date'),
'internal_reference' => $journal->getMeta('internal_reference'),
2017-10-06 15:41:21 +02:00
'notes' => '',
];
2017-10-06 15:41:21 +02:00
/** @var Note $note */
2017-12-23 17:42:07 +01:00
$note = $this->repository->getNote($journal);
2017-11-15 12:25:49 +01:00
if (null !== $note) {
2017-10-06 15:41:21 +02:00
$preFilled['notes'] = $note->text;
}
Session::flash('preFilled', $preFilled);
return redirect(route('transactions.create', [strtolower($journal->transactionType->type)]));
}
2016-10-21 19:20:03 +02:00
/**
2017-12-17 14:30:53 +01:00
* @param Request $request
* @param string $what
2016-10-21 19:20:03 +02:00
*
* @return View
*/
2017-11-24 17:33:05 +01:00
public function create(Request $request, string $what = TransactionType::DEPOSIT)
2016-10-21 19:20:03 +02:00
{
$what = strtolower($what);
2017-11-24 17:33:05 +01:00
$what = $request->old('what') ?? $what;
2017-09-03 16:06:37 +02:00
$assetAccounts = $this->groupedActiveAccountList();
2016-10-21 19:20:03 +02:00
$budgets = ExpandedForm::makeSelectListWithEmpty($this->budgets->getActiveBudgets());
$piggyBanks = $this->piggyBanks->getPiggyBanksWithAmount();
$piggies = ExpandedForm::makeSelectListWithEmpty($piggyBanks);
$preFilled = Session::has('preFilled') ? session('preFilled') : [];
$subTitle = trans('form.add_new_' . $what);
$subTitleIcon = 'fa-plus';
$optionalFields = Preferences::get('transaction_journal_optional_fields', [])->data;
Session::put('preFilled', $preFilled);
// put previous url in session if not redirect from store (not "create another").
2017-11-15 12:25:49 +01:00
if (true !== session('transactions.create.fromStore')) {
2017-02-05 08:26:54 +01:00
$this->rememberPreviousUri('transactions.create.uri');
2016-10-21 19:20:03 +02:00
}
Session::forget('transactions.create.fromStore');
asort($piggies);
return view(
'transactions.single.create',
2017-11-25 20:54:42 +01:00
compact('assetAccounts', 'subTitleIcon', 'budgets', 'what', 'piggies', 'subTitle', 'optionalFields', 'preFilled')
);
2016-10-21 19:20:03 +02:00
}
/**
* Shows the form that allows a user to delete a transaction journal.
*
* @param TransactionJournal $journal
*
2017-07-23 08:16:11 +02:00
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|View
2016-10-21 19:20:03 +02:00
*/
public function delete(TransactionJournal $journal)
{
2017-03-03 18:19:25 +01:00
// Covered by another controller's tests
// @codeCoverageIgnoreStart
2016-11-22 19:10:17 +01:00
if ($this->isOpeningBalance($journal)) {
return $this->redirectToAccount($journal);
}
2017-03-03 18:19:25 +01:00
// @codeCoverageIgnoreEnd
2016-11-22 19:10:17 +01:00
2016-10-21 19:20:03 +02:00
$what = strtolower($journal->transaction_type_type ?? $journal->transactionType->type);
$subTitle = trans('firefly.delete_' . $what, ['description' => $journal->description]);
// put previous url in session
2017-02-05 08:26:54 +01:00
$this->rememberPreviousUri('transactions.delete.uri');
2016-10-21 19:20:03 +02:00
return view('transactions.single.delete', compact('journal', 'subTitle', 'what'));
2016-10-21 19:20:03 +02:00
}
/**
2017-08-11 05:42:15 +02:00
* @param TransactionJournal $transactionJournal
2016-10-21 19:20:03 +02:00
*
* @return \Illuminate\Http\RedirectResponse
2017-11-15 12:25:49 +01:00
*
2017-08-11 05:42:15 +02:00
* @internal param JournalRepositoryInterface $repository
2016-10-21 19:20:03 +02:00
*/
2017-07-04 16:31:16 +02:00
public function destroy(TransactionJournal $transactionJournal)
2016-10-21 19:20:03 +02:00
{
2017-03-03 18:19:25 +01:00
// @codeCoverageIgnoreStart
2016-11-22 19:10:17 +01:00
if ($this->isOpeningBalance($transactionJournal)) {
return $this->redirectToAccount($transactionJournal);
}
2017-03-03 18:19:25 +01:00
// @codeCoverageIgnoreEnd
$type = $transactionJournal->transactionTypeStr();
2017-10-19 18:08:50 +02:00
Session::flash('success', strval(trans('firefly.deleted_' . strtolower($type), ['description' => $transactionJournal->description])));
2016-10-21 19:20:03 +02:00
2018-02-18 10:31:15 +01:00
$this->repository->destroy($transactionJournal);
2016-10-21 19:20:03 +02:00
Preferences::mark();
2017-02-05 08:26:54 +01:00
return redirect($this->getPreviousUri('transactions.delete.uri'));
2016-10-21 19:20:03 +02:00
}
/**
* @param TransactionJournal $journal
*
* @return mixed
*/
public function edit(TransactionJournal $journal, JournalRepositoryInterface $repository)
2016-10-21 19:20:03 +02:00
{
$transactionType = $repository->getTransactionType($journal);
// redirect to account:
if ($transactionType === TransactionType::OPENING_BALANCE) {
2016-11-22 19:10:17 +01:00
return $this->redirectToAccount($journal);
}
// redirect to reconcile edit:
if ($transactionType === TransactionType::RECONCILIATION) {
return redirect(route('accounts.reconcile.edit', [$journal->id]));
}
// redirect to split edit:
2017-07-04 16:31:16 +02:00
if ($this->isSplitJournal($journal)) {
2016-12-06 08:59:08 +01:00
return redirect(route('transactions.split.edit', [$journal->id]));
2016-10-21 19:20:03 +02:00
}
$what = strtolower($transactionType);
2017-09-03 10:51:02 +02:00
$assetAccounts = $this->groupedAccountList();
2016-12-12 19:39:54 +01:00
$budgetList = ExpandedForm::makeSelectListWithEmpty($this->budgets->getBudgets());
2016-10-21 19:20:03 +02:00
// view related code
$subTitle = trans('breadcrumbs.edit_journal', ['description' => $journal->description]);
2016-11-22 19:10:17 +01:00
2016-10-21 19:20:03 +02:00
// journal related code
$sourceAccounts = $repository->getJournalSourceAccounts($journal);
$destinationAccounts = $repository->getJournalDestinationAccounts($journal);
2016-10-21 19:20:03 +02:00
$optionalFields = Preferences::get('transaction_journal_optional_fields', [])->data;
$pTransaction = $repository->getFirstPosTransaction($journal);
2017-11-15 12:25:49 +01:00
$foreignCurrency = null !== $pTransaction->foreignCurrency ? $pTransaction->foreignCurrency : $pTransaction->transactionCurrency;
2016-10-21 19:20:03 +02:00
$preFilled = [
'date' => $repository->getJournalDate($journal, null), // $journal->dateAsString()
'interest_date' => $repository->getJournalDate($journal, 'interest_date'),
'book_date' => $repository->getJournalDate($journal, 'book_date'),
'process_date' => $repository->getJournalDate($journal, 'process_date'),
'category' => $repository->getJournalCategoryName($journal),
'budget_id' => $repository->getJournalBudgetId($journal),
'tags' => join(',', $repository->getTags($journal)),
2016-10-21 19:20:03 +02:00
'source_account_id' => $sourceAccounts->first()->id,
'source_account_name' => $sourceAccounts->first()->edit_name,
2016-10-21 19:20:03 +02:00
'destination_account_id' => $destinationAccounts->first()->id,
'destination_account_name' => $destinationAccounts->first()->edit_name,
2016-10-21 19:20:03 +02:00
// new custom fields:
'due_date' => $repository->getJournalDate($journal, 'due_date'),
'payment_date' => $repository->getJournalDate($journal, 'payment_date'),
'invoice_date' => $repository->getJournalDate($journal, 'invoice_date'),
'interal_reference' => $repository->getMetaField($journal, 'internal_reference'),
'notes' => $repository->getNoteText($journal),
// amount fields
'amount' => $pTransaction->amount,
'source_amount' => $pTransaction->amount,
'native_amount' => $pTransaction->amount,
'destination_amount' => $pTransaction->foreign_amount,
'currency' => $pTransaction->transactionCurrency,
'source_currency' => $pTransaction->transactionCurrency,
'native_currency' => $pTransaction->transactionCurrency,
2017-07-04 16:31:16 +02:00
'foreign_currency' => $foreignCurrency,
'destination_currency' => $foreignCurrency,
2016-10-21 19:20:03 +02:00
];
// amounts for withdrawals and deposits:
2017-06-05 11:12:50 +02:00
// amount, native_amount, source_amount, destination_amount
2017-11-15 12:25:49 +01:00
if (($journal->isWithdrawal() || $journal->isDeposit()) && null !== $pTransaction->foreign_amount) {
$preFilled['amount'] = $pTransaction->foreign_amount;
$preFilled['currency'] = $pTransaction->foreignCurrency;
}
2016-10-21 19:20:03 +02:00
Session::flash('preFilled', $preFilled);
// put previous url in session if not redirect from store (not "return_to_edit").
2017-11-15 12:25:49 +01:00
if (true !== session('transactions.edit.fromUpdate')) {
2017-02-05 08:26:54 +01:00
$this->rememberPreviousUri('transactions.edit.uri');
2016-10-21 19:20:03 +02:00
}
Session::forget('transactions.edit.fromUpdate');
return view(
'transactions.single.edit',
2016-11-04 16:04:36 +01:00
compact('journal', 'optionalFields', 'assetAccounts', 'what', 'budgetList', 'subTitle')
2016-10-21 19:20:03 +02:00
)->with('data', $preFilled);
}
/**
* @param JournalFormRequest $request
* @param JournalRepositoryInterface $repository
*
* @return \Illuminate\Http\RedirectResponse
*/
public function store(JournalFormRequest $request, JournalRepositoryInterface $repository)
{
$doSplit = 1 === intval($request->get('split_journal'));
$createAnother = 1 === intval($request->get('create_another'));
$data = $request->getJournalData();
$journal = $repository->store($data);
2017-11-15 12:25:49 +01:00
if (null === $journal->id) {
2016-10-21 19:20:03 +02:00
// error!
Log::error('Could not store transaction journal: ', $journal->getErrors()->toArray());
Session::flash('error', $journal->getErrors()->first());
return redirect(route('transactions.create', [$request->input('what')]))->withInput();
}
2017-01-14 19:43:33 +01:00
/** @var array $files */
2016-12-28 13:02:56 +01:00
$files = $request->hasFile('attachments') ? $request->file('attachments') : null;
$this->attachments->saveAttachmentsForModel($journal, $files);
2016-10-21 19:20:03 +02:00
// store the journal only, flash the rest.
2017-10-27 12:59:43 +02:00
Log::debug(sprintf('Count of error messages is %d', $this->attachments->getErrors()->count()));
2016-10-21 19:20:03 +02:00
if (count($this->attachments->getErrors()->get('attachments')) > 0) {
Session::flash('error', $this->attachments->getErrors()->get('attachments'));
}
// flash messages
if (count($this->attachments->getMessages()->get('attachments')) > 0) {
Session::flash('info', $this->attachments->getMessages()->get('attachments'));
}
2016-10-22 09:31:27 +02:00
event(new StoredTransactionJournal($journal, $data['piggy_bank_id']));
2016-10-21 19:20:03 +02:00
2017-10-19 18:08:50 +02:00
Session::flash('success', strval(trans('firefly.stored_journal', ['description' => $journal->description])));
2016-10-21 19:20:03 +02:00
Preferences::mark();
2017-03-03 18:19:25 +01:00
// @codeCoverageIgnoreStart
2017-11-15 12:25:49 +01:00
if (true === $createAnother) {
2016-10-21 19:20:03 +02:00
Session::put('transactions.create.fromStore', true);
return redirect(route('transactions.create', [$request->input('what')]))->withInput();
}
2017-11-15 12:25:49 +01:00
if (true === $doSplit) {
2016-12-06 08:59:08 +01:00
return redirect(route('transactions.split.edit', [$journal->id]));
2016-10-21 19:20:03 +02:00
}
2017-03-03 18:19:25 +01:00
// @codeCoverageIgnoreEnd
2016-10-21 19:20:03 +02:00
2017-02-05 08:26:54 +01:00
return redirect($this->getPreviousUri('transactions.create.uri'));
2016-10-21 19:20:03 +02:00
}
/**
2017-06-07 08:18:42 +02:00
* @param JournalFormRequest $request
* @param JournalRepositoryInterface $repository
* @param TransactionJournal $journal
2016-10-21 19:20:03 +02:00
*
2016-10-22 09:39:31 +02:00
* @return $this|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
2016-10-21 19:20:03 +02:00
*/
2017-06-07 08:18:42 +02:00
public function update(JournalFormRequest $request, JournalRepositoryInterface $repository, TransactionJournal $journal)
2016-10-21 19:20:03 +02:00
{
2017-03-03 18:19:25 +01:00
// @codeCoverageIgnoreStart
2016-11-22 19:10:17 +01:00
if ($this->isOpeningBalance($journal)) {
return $this->redirectToAccount($journal);
}
2017-03-03 18:19:25 +01:00
// @codeCoverageIgnoreEnd
2016-11-22 19:10:17 +01:00
$data = $request->getJournalData();
2017-06-07 08:18:42 +02:00
$journal = $repository->update($journal, $data);
2017-01-14 19:43:33 +01:00
/** @var array $files */
$files = $request->hasFile('attachments') ? $request->file('attachments') : null;
2016-12-28 13:02:56 +01:00
$this->attachments->saveAttachmentsForModel($journal, $files);
2016-10-21 19:20:03 +02:00
2017-03-03 18:19:25 +01:00
// @codeCoverageIgnoreStart
2016-10-21 19:20:03 +02:00
if (count($this->attachments->getErrors()->get('attachments')) > 0) {
Session::flash('error', $this->attachments->getErrors()->get('attachments'));
}
if (count($this->attachments->getMessages()->get('attachments')) > 0) {
Session::flash('info', $this->attachments->getMessages()->get('attachments'));
}
2017-03-03 18:19:25 +01:00
// @codeCoverageIgnoreEnd
2016-10-21 19:20:03 +02:00
2016-10-22 09:31:27 +02:00
event(new UpdatedTransactionJournal($journal));
2016-10-21 19:20:03 +02:00
// update, get events by date and sort DESC
$type = strtolower($journal->transactionTypeStr());
2017-10-19 18:08:50 +02:00
Session::flash('success', strval(trans('firefly.updated_' . $type, ['description' => $data['description']])));
2016-10-21 19:20:03 +02:00
Preferences::mark();
2017-03-03 18:19:25 +01:00
// @codeCoverageIgnoreStart
2017-11-15 12:25:49 +01:00
if (1 === intval($request->get('return_to_edit'))) {
2016-10-21 19:20:03 +02:00
Session::put('transactions.edit.fromUpdate', true);
return redirect(route('transactions.edit', [$journal->id]))->withInput(['return_to_edit' => 1]);
}
2017-03-03 18:19:25 +01:00
// @codeCoverageIgnoreEnd
2016-10-21 19:20:03 +02:00
// redirect to previous URL.
2017-02-05 08:26:54 +01:00
return redirect($this->getPreviousUri('transactions.edit.uri'));
2016-10-21 19:20:03 +02:00
}
2017-07-04 16:31:16 +02:00
2017-09-03 10:51:02 +02:00
/**
* @return array
*/
2017-09-09 06:41:45 +02:00
private function groupedAccountList(): array
2017-09-03 10:51:02 +02:00
{
2017-09-09 06:41:45 +02:00
$accounts = $this->accounts->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET]);
2017-09-03 10:51:02 +02:00
$return = [];
/** @var Account $account */
foreach ($accounts as $account) {
$type = $account->getMeta('accountRole');
2017-11-15 12:25:49 +01:00
if (0 === strlen($type)) {
2017-12-23 22:02:54 +01:00
$type = 'no_account_type'; // @codeCoverageIgnore
2017-09-03 10:51:02 +02:00
}
$key = strval(trans('firefly.opt_group_' . $type));
$return[$key][$account->id] = $account->name;
}
return $return;
}
2017-09-03 16:06:37 +02:00
/**
* @return array
*/
2017-09-09 06:41:45 +02:00
private function groupedActiveAccountList(): array
2017-09-03 16:06:37 +02:00
{
2017-09-09 06:41:45 +02:00
$accounts = $this->accounts->getActiveAccountsByType([AccountType::DEFAULT, AccountType::ASSET]);
2017-09-03 16:06:37 +02:00
$return = [];
/** @var Account $account */
foreach ($accounts as $account) {
$type = $account->getMeta('accountRole');
2017-11-15 12:25:49 +01:00
if (0 === strlen($type)) {
2017-12-23 22:02:54 +01:00
$type = 'no_account_type'; // @codeCoverageIgnore
2017-09-03 16:06:37 +02:00
}
$key = strval(trans('firefly.opt_group_' . $type));
$return[$key][$account->id] = $account->name;
}
return $return;
}
2017-07-04 16:31:16 +02:00
/**
* @param TransactionJournal $journal
*
* @return bool
*/
private function isSplitJournal(TransactionJournal $journal): bool
{
$count = $this->repository->countTransactions($journal);
if ($count > 2) {
2017-12-23 22:02:54 +01:00
return true; // @codeCoverageIgnore
2017-07-04 16:31:16 +02:00
}
return false;
}
2016-10-23 12:42:44 +02:00
}