Skip to content

Firefly III: a personal finances manager

Fix #3902

James Colea5c37f1e4a7d
diff --git a/app/Validation/FireflyValidator.php b/app/Validation/FireflyValidator.php
index ac23d6c935..f272b0945f 100644
--- a/app/Validation/FireflyValidator.php
+++ b/app/Validation/FireflyValidator.php
@@ -335,6 +335,11 @@ class FireflyValidator extends Validator
return '' !== $value;
}
+ // check if it's an existing account.
+ if (in_array($triggerType, ['destination_account_id', 'source_account_id'])) {
+ return is_numeric($value) && (int) $value > 0;
+ }
+
// check transaction type.
if ('transaction_type' === $triggerType) {
$count = TransactionType::where('type', ucfirst($value))->count();