diff --git a/app/Models/AccountType.php b/app/Models/AccountType.php index 2a0c2fa7ca..1446d0d6e3 100644 --- a/app/Models/AccountType.php +++ b/app/Models/AccountType.php @@ -35,51 +35,19 @@ use Illuminate\Database\Eloquent\Relations\HasMany; */ class AccountType extends Model { - /** - * - */ - public const DEFAULT = 'Default account'; - /** - * - */ - public const CASH = 'Cash account'; - /** - * - */ - public const ASSET = 'Asset account'; - /** - * - */ - public const EXPENSE = 'Expense account'; - /** - * - */ - public const REVENUE = 'Revenue account'; - /** - * - */ + public const DEFAULT = 'Default account'; + public const CASH = 'Cash account'; + public const ASSET = 'Asset account'; + public const EXPENSE = 'Expense account'; + public const REVENUE = 'Revenue account'; public const INITIAL_BALANCE = 'Initial balance account'; - /** - * - */ - public const BENEFICIARY = 'Beneficiary account'; - /** - * - */ - public const IMPORT = 'Import account'; - /** - * - */ - public const RECONCILIATION = 'Reconciliation account'; - /** - * - */ - public const LOAN = 'Loan'; - /** - * The attributes that should be casted to native types. - * - * @var array - */ + public const BENEFICIARY = 'Beneficiary account'; + public const IMPORT = 'Import account'; + public const RECONCILIATION = 'Reconciliation account'; + public const LOAN = 'Loan'; + public const DEBT = 'Debt'; + public const MORTGAGE = 'Mortgage'; + public const CREDITCARD = 'Credit card'; protected $casts = [ 'created_at' => 'datetime', diff --git a/config/firefly.php b/config/firefly.php index 1af5d5b4a7..c996c32c76 100644 --- a/config/firefly.php +++ b/config/firefly.php @@ -197,10 +197,11 @@ return [ ], 'accountTypesByIdentifier' => [ - 'asset' => ['Default account', 'Asset account'], - 'expense' => ['Expense account', 'Beneficiary account'], - 'revenue' => ['Revenue account'], - 'import' => ['Import account'], + 'asset' => ['Default account', 'Asset account'], + 'expense' => ['Expense account', 'Beneficiary account'], + 'revenue' => ['Revenue account'], + 'import' => ['Import account'], + 'liabilities' => ['Loan', 'Debt', 'Credit card', 'Mortgage'], ], 'accountTypeByIdentifier' => [ @@ -267,7 +268,7 @@ return [ 'journalLink' => \FireflyIII\Models\TransactionJournalLink::class, 'currency' => \FireflyIII\Models\TransactionCurrency::class, 'piggyBank' => \FireflyIII\Models\PiggyBank::class, - 'preference' => \FireflyIII\Models\Preference::class, + 'preference' => \FireflyIII\Models\Preference::class, 'tj' => \FireflyIII\Models\TransactionJournal::class, 'tag' => \FireflyIII\Models\Tag::class, 'recurrence' => \FireflyIII\Models\Recurrence::class, diff --git a/database/seeds/AccountTypeSeeder.php b/database/seeds/AccountTypeSeeder.php index 0ebde97fb3..f695c310d8 100644 --- a/database/seeds/AccountTypeSeeder.php +++ b/database/seeds/AccountTypeSeeder.php @@ -41,12 +41,15 @@ class AccountTypeSeeder extends Seeder AccountType::IMPORT, AccountType::LOAN, AccountType::RECONCILIATION, + AccountType::DEBT, + AccountType::MORTGAGE, + AccountType::CREDITCARD, ]; foreach ($types as $type) { try { AccountType::create(['type' => $type]); } catch (PDOException $e) { - Log::warning(sprintf('Could not create account type "%s". It might exist already.', $type)); + Log::warning(sprintf('Could not create account type "%s". It might exist already: %s', $type , $e->getMessage())); } } } diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.php index e93a20952e..dd9f127293 100644 --- a/resources/lang/en_US/firefly.php +++ b/resources/lang/en_US/firefly.php @@ -700,6 +700,7 @@ return [ 'revenue_accounts' => 'Revenue accounts', 'cash_accounts' => 'Cash accounts', 'Cash account' => 'Cash account', + 'liabilities_accounts' => 'Liabilities', 'reconcile_account' => 'Reconcile account ":account"', 'overview_of_reconcile_modal' => 'Overview of reconciliation', 'delete_reconciliation' => 'Delete reconciliation', @@ -1187,6 +1188,10 @@ return [ 'no_accounts_intro_revenue' => 'You have no revenue accounts yet. Revenue accounts are the places where you receive money from, such as your employer.', 'no_accounts_imperative_revenue' => 'Revenue accounts are created automatically when you create transactions, but you can create one manually too, if you want. Let\'s create one now:', 'no_accounts_create_revenue' => 'Create a revenue account', + 'no_accounts_title_liabilities' => 'Let\'s create a liability!', + 'no_accounts_intro_liabilities' => 'You have no liabilities yet. Liabilities are the accounts that register your credit card(s), (student) loans and other debts.', + 'no_accounts_imperative_liabilities' => 'You don\'t have to use this feature, but it can be useful if you want to keep track of these things.', + 'no_accounts_create_liabilities' => 'Create a liability', 'no_budgets_title_default' => 'Let\'s create a budget', 'no_budgets_intro_default' => 'You have no budgets yet. Budgets are used to organise your expenses into logical groups, which you can give a soft-cap to limit your expenses.', 'no_budgets_imperative_default' => 'Budgets are the basic tools of financial management. Let\'s create one now:', diff --git a/resources/views/partials/menu-sidebar.twig b/resources/views/partials/menu-sidebar.twig index 8d959b7807..048c4d77d5 100644 --- a/resources/views/partials/menu-sidebar.twig +++ b/resources/views/partials/menu-sidebar.twig @@ -27,6 +27,11 @@ {{ 'revenue_accounts'|_ }} +