Skip to content

Firefly III: a personal finances manager

Add upgrade command.

James Cole6d466af424c9
diff --git a/app/Console/Commands/Upgrade/UpgradeDatabase.php b/app/Console/Commands/Upgrade/UpgradeDatabase.php
index 9f0055a5fe..49d7a4c9eb 100644
--- a/app/Console/Commands/Upgrade/UpgradeDatabase.php
+++ b/app/Console/Commands/Upgrade/UpgradeDatabase.php
@@ -74,6 +74,7 @@ class UpgradeDatabase extends Command
'firefly-iii:migrate-recurrence-meta',
'firefly-iii:migrate-tag-locations',
'firefly-iii:migrate-recurrence-type',
+ 'firefly-iii:upgrade-liabilities',
// there are 16 verify commands.
'firefly-iii:fix-piggies',
diff --git a/app/Http/Controllers/Account/IndexController.php b/app/Http/Controllers/Account/IndexController.php
index 9d9ecabc80..f9b30d3059 100644
--- a/app/Http/Controllers/Account/IndexController.php
+++ b/app/Http/Controllers/Account/IndexController.php
@@ -165,14 +165,11 @@ class IndexController extends Controller
$account->endBalance = $this->isInArray($endBalances, $account->id);
$account->difference = bcsub($account->endBalance, $account->startBalance);
$account->interest = number_format((float)$this->repository->getMetaValue($account, 'interest'), 4, '.', '');
- $account->interestPeriod = (string)trans(
- sprintf('firefly.interest_calc_%s', $this->repository->getMetaValue($account, 'interest_period'))
- );
+ $account->interestPeriod = (string)trans(sprintf('firefly.interest_calc_%s', $this->repository->getMetaValue($account, 'interest_period')));
$account->accountTypeString = (string)trans(sprintf('firefly.account_type_%s', $account->accountType->type));
$account->location = $this->repository->getLocation($account);
-
$account->liability_direction = $this->repository->getMetaValue($account, 'liability_direction');
- $account->current_debt = $this->repository->getMetaValue($account, 'current_debt') ?? '-';
+ $account->current_debt = $this->repository->getMetaValue($account, 'current_debt') ?? '-';
}
);
// make paginator:
diff --git a/app/Http/Controllers/System/InstallController.php b/app/Http/Controllers/System/InstallController.php
index d041c061f9..6740e11ba4 100644
--- a/app/Http/Controllers/System/InstallController.php
+++ b/app/Http/Controllers/System/InstallController.php
@@ -85,6 +85,7 @@ class InstallController extends Controller
'firefly-iii:migrate-recurrence-meta' => [],
'firefly-iii:migrate-tag-locations' => [],
'firefly-iii:migrate-recurrence-type' => [],
+ 'firefly-iii:upgrade-liabilities' => [],
// verify commands
'firefly-iii:fix-piggies' => [],
diff --git a/app/Models/Account.php b/app/Models/Account.php
index fd7e650407..eecbd71487 100644
--- a/app/Models/Account.php
+++ b/app/Models/Account.php
@@ -88,7 +88,16 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
* @method static Builder|Account withTrashed()
* @method static Builder|Account withoutTrashed()
* @mixin Eloquent
- * @property Carbon $lastActivityDate
+ * @property Carbon $lastActivityDate
+ * @property string $startBalance
+ * @property string $endBalance
+ * @property string $difference
+ * @property string $interest
+ * @property string $interestPeriod
+ * @property string $accountTypeString
+ * @property string $location
+ * @property string $liability_direction
+ * @property string $current_debt
*/
class Account extends Model
{
diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.php
index 539d02365c..173f51f445 100644
--- a/resources/lang/en_US/firefly.php
+++ b/resources/lang/en_US/firefly.php
@@ -1332,6 +1332,7 @@ return [
'liability_direction_debit' => 'I owe this debt to somebody else',
'liability_direction_credit_short' => 'Owed this debt',
'liability_direction_debit_short' => 'Owe this debt',
+ 'liability_direction__short' => 'Unknown',
'Liability credit' => 'Liability credit',
'budgets' => 'Budgets',
'tags' => 'Tags',