Code cleanup [skip ci]

This commit is contained in:
James Cole
2018-06-06 21:23:00 +02:00
parent 20044427b4
commit 4a12d4d156
75 changed files with 319 additions and 341 deletions

View File

@@ -58,8 +58,8 @@ class LinkToBill implements ActionInterface
/** @var BillRepositoryInterface $repository */
$repository = app(BillRepositoryInterface::class);
$repository->setUser($this->action->rule->user);
$billName = (string)$this->action->action_value;
$bill = $repository->findByName($billName);
$billName = (string)$this->action->action_value;
$bill = $repository->findByName($billName);
if (null !== $bill && $journal->transactionType->type === TransactionType::WITHDRAWAL) {
$journal->bill()->associate($bill);

View File

@@ -101,8 +101,8 @@ class SetDestinationAccount implements ActionInterface
// update destination transaction with new destination account:
// get destination transaction:
$transaction = $journal->transactions()->where('amount', '>', 0)->first();
if(null === $transaction) {
$transaction = $journal->transactions()->where('amount', '>', 0)->first();
if (null === $transaction) {
return true;
}
$transaction->account_id = $this->newDestinationAccount->id;