Migrate actions

This commit is contained in:
James Cole
2022-10-02 06:23:31 +02:00
parent f2f3d69aa8
commit 10d2a91d99
26 changed files with 319 additions and 33 deletions

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\TransactionRules\Actions;
use DB;
use FireflyIII\Events\TriggeredAuditLog;
use FireflyIII\Models\Account;
use FireflyIII\Models\RuleAction;
use FireflyIII\Models\Transaction;
@@ -89,7 +90,7 @@ class SetDestinationAccount implements ActionInterface
return false;
}
// account must not be deleted (in the mean time):
// account must not be deleted (in the meantime):
if (null === $source->account) {
Log::error('Could not find source transaction account.');
@@ -114,6 +115,8 @@ class SetDestinationAccount implements ActionInterface
Log::debug(sprintf('New destination account is #%d ("%s").', $newAccount->id, $newAccount->name));
event(new TriggeredAuditLog($this->action->rule, $object, 'set_destination', null, $newAccount->name));
// update destination transaction with new destination account:
DB::table('transactions')
->where('transaction_journal_id', '=', $object->id)