Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Do not validate currency if account has no currency configured
Kuba Turek9191ae5054a6
diff --git a/app/Validation/Api/Data/Bulk/ValidatesBulkTransactionQuery.php b/app/Validation/Api/Data/Bulk/ValidatesBulkTransactionQuery.phpindex 35126c6359..85c823ea1e 100644--- a/app/Validation/Api/Data/Bulk/ValidatesBulkTransactionQuery.php+++ b/app/Validation/Api/Data/Bulk/ValidatesBulkTransactionQuery.php@@ -67,8 +67,16 @@ trait ValidatesBulkTransactionQueryreturn;}+// 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'));}}