Skip empty foreign currency

This commit is contained in:
James Cole 2022-07-25 05:50:02 +02:00
parent b03a36b87f
commit 38b505d036
No known key found for this signature in database
GPG Key ID: B49A324B7EAD6D80

View File

@ -151,7 +151,7 @@ class ShowController extends Controller
];
}
$amounts[$symbol]['amount'] = bcadd($amounts[$symbol]['amount'], $transaction['amount']);
if (null !== $transaction['foreign_amount'] && '' !== $transaction['foreign_amount']) {
if (null !== $transaction['foreign_amount'] && '' !== $transaction['foreign_amount'] && bccomp('0', $transaction['foreign_amount']) !== 0) {
// same for foreign currency:
$foreignSymbol = $transaction['foreign_currency_symbol'];
Log::debug(sprintf('Foreign currency symbol is "%s"', $foreignSymbol));