Bug catching in form.

This commit is contained in:
James Cole
2019-05-24 05:47:26 +02:00
parent 8f1928c933
commit 47e0f6ed89
6 changed files with 143 additions and 16 deletions

View File

@@ -135,7 +135,9 @@ class TransactionFactory
$two->reconciled = $data['reconciled'] ?? false;
// add foreign currency info to $one and $two if necessary.
if (null !== $foreignCurrency && null !== $foreignAmount) {
if (null !== $foreignCurrency && null !== $foreignAmount
&& $foreignCurrency->id !== $currency->id
) {
$one->foreign_currency_id = $foreignCurrency->id;
$two->foreign_currency_id = $foreignCurrency->id;
$one->foreign_amount = app('steam')->negative($foreignAmount);