From c9c86bbd1d054915c2ee6414dc7858192df07892 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B4nio=20Franco?= <13881523+antoniomrfranco@users.noreply.github.com> Date: Fri, 22 Nov 2024 13:52:33 -0300 Subject: [PATCH] fix: set dest foreign_amount and foreign_currency_id for foreign transfers --- app/Services/Internal/Update/JournalUpdateService.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Services/Internal/Update/JournalUpdateService.php b/app/Services/Internal/Update/JournalUpdateService.php index 0fd902aa58..5b009dc792 100644 --- a/app/Services/Internal/Update/JournalUpdateService.php +++ b/app/Services/Internal/Update/JournalUpdateService.php @@ -721,6 +721,8 @@ class JournalUpdateService Log::debug('Switch amounts, store in amount and not foreign_amount'); $dest->transaction_currency_id = $foreignCurrency->id; $dest->amount = app('steam')->positive($foreignAmount); + $dest->foreign_amount = app('steam')->positive($source->amount); + $dest->foreign_currency_id = $source->transaction_currency_id; } if (TransactionType::TRANSFER !== $this->transactionJournal->transactionType->type) { $dest->foreign_currency_id = $foreignCurrency->id;