This commit is contained in:
James Cole
2018-03-26 19:19:11 +02:00
parent 5ca31ea3dd
commit 413c1bc2fe
11 changed files with 26 additions and 19 deletions

View File

@@ -70,6 +70,7 @@ class BulkController extends Controller
* @param Collection $journals
*
* @return View
* @throws \RuntimeException
*/
public function edit(Request $request, Collection $journals)
{
@@ -139,6 +140,7 @@ class BulkController extends Controller
* @param JournalRepositoryInterface $repository
*
* @return mixed
* @throws \RuntimeException
*/
public function update(BulkEditJournalRequest $request, JournalRepositoryInterface $repository)
{

View File

@@ -110,6 +110,13 @@ class LinkController extends Controller
}
$other = $this->journalRepository->find($linkInfo['transaction_journal_id']);
$alreadyLinked = $this->repository->findLink($journal, $other);
if($other->id === $journal->id) {
Session::flash('error', trans('firefly.journals_link_to_self'));
return redirect(route('transactions.show', [$journal->id]));
}
if ($alreadyLinked) {
Session::flash('error', trans('firefly.journals_error_linked'));

View File

@@ -102,7 +102,7 @@ class SingleController extends Controller
$budgetId = $this->repository->getJournalBudgetId($journal);
$categoryName = $this->repository->getJournalCategoryName($journal);
$tags = join(',', $this->repository->getTags($journal));
$tags = implode(',', $this->repository->getTags($journal));
/** @var Transaction $transaction */
$transaction = $journal->transactions()->first();
$amount = app('steam')->positive($transaction->amount);
@@ -280,7 +280,7 @@ class SingleController extends Controller
'process_date' => $repository->getJournalDate($journal, 'process_date'),
'category' => $repository->getJournalCategoryName($journal),
'budget_id' => $repository->getJournalBudgetId($journal),
'tags' => join(',', $repository->getTags($journal)),
'tags' => implode(',', $repository->getTags($journal)),
'source_account_id' => $sourceAccounts->first()->id,
'source_account_name' => $sourceAccounts->first()->edit_name,
'destination_account_id' => $destinationAccounts->first()->id,
@@ -441,10 +441,6 @@ class SingleController extends Controller
{
$count = $this->repository->countTransactions($journal);
if ($count > 2) {
return true; // @codeCoverageIgnore
}
return false;
return $count > 2;
}
}

View File

@@ -125,7 +125,7 @@ class SplitController extends Controller
return view(
'transactions.split.edit', compact(
'subTitleIcon', 'currencies', 'optionalFields', 'preFilled', 'subTitle', 'uploadSize', 'assetAccounts', 'budgets',
'subTitleIcon', 'currencies', 'optionalFields', 'preFilled', 'subTitle', 'uploadSize', 'budgets',
'journal', 'accountArray',
'previous'
)
@@ -197,7 +197,7 @@ class SplitController extends Controller
'destinationAccounts' => $destinationAccounts,
'what' => strtolower($this->repository->getTransactionType($journal)),
'date' => $request->old('date', $this->repository->getJournalDate($journal, null)),
'tags' => join(',', $journal->tags->pluck('tag')->toArray()),
'tags' => implode(',', $journal->tags->pluck('tag')->toArray()),
// all custom fields:
'interest_date' => $request->old('interest_date', $this->repository->getMetaField($journal, 'interest_date')),