Skip to content

Firefly III: a personal finances manager

Fix #4739

James Cole9eaacf30ad95
diff --git a/app/Services/Internal/Update/AccountUpdateService.php b/app/Services/Internal/Update/AccountUpdateService.php
index 09ca4f9833..74318bb1a1 100644
--- a/app/Services/Internal/Update/AccountUpdateService.php
+++ b/app/Services/Internal/Update/AccountUpdateService.php
@@ -136,6 +136,15 @@ class AccountUpdateService
$account->account_type_id = $type->id;
}
}
+ // set liability, alternative method used in v1 layout:
+
+ if ($this->isLiability($account) && array_key_exists('account_type_id', $data)) {
+ $type = AccountType::find((int)$data['account_type_id']);
+
+ if (null !== $type && in_array($type->type, config('firefly.valid_liabilities'), true)) {
+ $account->account_type_id = $type->id;
+ }
+ }
// update virtual balance (could be set to zero if empty string).
if (array_key_exists('virtual_balance', $data) && null !== $data['virtual_balance']) {
diff --git a/resources/views/v2/budgets/indexx.twig b/resources/views/v2/budgets/index.twig
similarity index 100%
rename from resources/views/v2/budgets/indexx.twig
rename to resources/views/v2/budgets/index.twig