mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Merge pull request #6855 from eps90/fix-bulk-validator-for-expenses
Do not validate currency if account has no currency configured
This commit is contained in:
commit
63a7aad44c
@ -67,8 +67,16 @@ trait ValidatesBulkTransactionQuery
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// must have same currency:
|
||||
if ($repository->getAccountCurrency($source)->id !== $repository->getAccountCurrency($dest)->id) {
|
||||
// some account types (like expenses) do not have currency, so they have to be omitted
|
||||
$sourceCurrency = $repository->getAccountCurrency($source);
|
||||
$destCurrency = $repository->getAccountCurrency($dest);
|
||||
if (
|
||||
$sourceCurrency !== null
|
||||
&& $destCurrency !== null
|
||||
&& $sourceCurrency->id !== $destCurrency->id
|
||||
) {
|
||||
$validator->errors()->add('query', (string)trans('validation.invalid_query_currency'));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user