Add upgrade command.

This commit is contained in:
James Cole 2021-05-02 06:39:18 +02:00
parent 3f4697b6c3
commit 6d466af424
No known key found for this signature in database
GPG Key ID: B5669F9493CDE38D
5 changed files with 15 additions and 6 deletions

View File

@ -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',

View File

@ -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:

View File

@ -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' => [],

View File

@ -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
{

View File

@ -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',