mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Improve code quality.
This commit is contained in:
@@ -106,7 +106,14 @@ class LinkController extends Controller
|
||||
|
||||
return redirect(route('transactions.show', [$journal->id]));
|
||||
}
|
||||
$other = $this->journalRepository->findNull($linkInfo['transaction_journal_id']);
|
||||
$other = $this->journalRepository->findNull($linkInfo['transaction_journal_id']);
|
||||
|
||||
if (null === $other) {
|
||||
session()->flash('error', trans('firefly.invalid_link_selection'));
|
||||
|
||||
return redirect(route('transactions.show', [$journal->id]));
|
||||
}
|
||||
|
||||
$alreadyLinked = $this->repository->findLink($journal, $other);
|
||||
|
||||
if ($other->id === $journal->id) {
|
||||
|
@@ -35,6 +35,7 @@ use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
||||
use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
|
||||
use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
|
||||
use FireflyIII\Transformers\TransactionTransformer;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\View\View as IlluminateView;
|
||||
use Symfony\Component\HttpFoundation\ParameterBag;
|
||||
@@ -122,8 +123,11 @@ class MassController extends Controller
|
||||
*/
|
||||
public function edit(Collection $journals): IlluminateView
|
||||
{
|
||||
/** @var User $user */
|
||||
$user = auth()->user();
|
||||
$subTitle = trans('firefly.mass_edit_journals');
|
||||
|
||||
|
||||
/** @var AccountRepositoryInterface $repository */
|
||||
$repository = app(AccountRepositoryInterface::class);
|
||||
$accounts = $repository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET]);
|
||||
@@ -140,7 +144,7 @@ class MassController extends Controller
|
||||
$transformer = new TransactionTransformer(new ParameterBag);
|
||||
/** @var JournalCollectorInterface $collector */
|
||||
$collector = app(JournalCollectorInterface::class);
|
||||
$collector->setUser(auth()->user());
|
||||
$collector->setUser($user);
|
||||
$collector->withOpposingAccount()->withCategoryInformation()->withBudgetInformation();
|
||||
$collector->setJournals($journals);
|
||||
$collector->addFilter(TransactionViewFilter::class);
|
||||
@@ -220,11 +224,6 @@ class MassController extends Controller
|
||||
'foreign_amount' => $foreignAmount,
|
||||
'foreign_currency_id' => $foreignCurrencyId,
|
||||
'foreign_currency_code' => null,
|
||||
//'native_amount' => $amount,
|
||||
//'source_amount' => $amount,
|
||||
//'foreign_amount' => $foreignAmount,
|
||||
//'destination_amount' => $foreignAmount,
|
||||
//'amount' => $foreignAmount,
|
||||
]],
|
||||
'currency_id' => $foreignCurrencyId,
|
||||
'tags' => $tags,
|
||||
|
@@ -266,6 +266,7 @@ class SplitController extends Controller
|
||||
|
||||
foreach ($old as $index => $row) {
|
||||
if (isset($array[$index])) {
|
||||
/** @noinspection SlowArrayOperationsInLoopInspection */
|
||||
$array[$index] = array_merge($array[$index], $row);
|
||||
continue;
|
||||
}
|
||||
|
Reference in New Issue
Block a user