diff --git a/app/Console/Commands/Correction/FixTransactionTypes.php b/app/Console/Commands/Correction/FixTransactionTypes.php index 02296d3a36..8ca46f9507 100644 --- a/app/Console/Commands/Correction/FixTransactionTypes.php +++ b/app/Console/Commands/Correction/FixTransactionTypes.php @@ -108,7 +108,11 @@ class FixTransactionTypes extends Command } $expectedType = (string) config(sprintf('firefly.account_to_transaction.%s.%s', $source->accountType->type, $destination->accountType->type)); if ($expectedType !== $type) { - $this->line(sprintf('Transaction journal #%d was of type "%s" but is corrected to "%s"', $journal->id, $type, $expectedType)); + $this->line( + sprintf('Transaction journal #%d was of type "%s" but is corrected to "%s" (%s -> %s)', + $journal->id, $type, $expectedType, + $source->accountType->type, $destination->accountType->type, + )); $this->changeJournal($journal, $expectedType); return true; diff --git a/config/firefly.php b/config/firefly.php index 0431fbad74..4163106e38 100644 --- a/config/firefly.php +++ b/config/firefly.php @@ -608,7 +608,10 @@ return [ AccountType::RECONCILIATION => TransactionTypeModel::RECONCILIATION, ], AccountType::CASH => [ - AccountType::ASSET => TransactionTypeEnum::DEPOSIT->value, + AccountType::ASSET => TransactionTypeModel::DEPOSIT, + AccountType::LOAN => TransactionTypeModel::DEPOSIT, + AccountType::DEBT => TransactionTypeModel::DEPOSIT, + AccountType::MORTGAGE => TransactionTypeModel::DEPOSIT, ], AccountType::DEBT => [ AccountType::ASSET => TransactionTypeEnum::DEPOSIT->value, @@ -690,9 +693,10 @@ return [ AccountType::ASSET => [AccountType::RECONCILIATION], ], TransactionTypeModel::LIABILITY_CREDIT => [ - AccountType::LOAN => [AccountType::LIABILITY_CREDIT], - AccountType::DEBT => [AccountType::LIABILITY_CREDIT], - AccountType::MORTGAGE => [AccountType::LIABILITY_CREDIT], + AccountType::LOAN => [AccountType::LIABILITY_CREDIT], + AccountType::DEBT => [AccountType::LIABILITY_CREDIT], + AccountType::MORTGAGE => [AccountType::LIABILITY_CREDIT], + AccountType::LIABILITY_CREDIT => [AccountType::LOAN, AccountType::DEBT, AccountType::MORTGAGE], ], ], // if you add fields to this array, dont forget to update the export routine (ExportDataGenerator). diff --git a/frontend/src/pages/accounts/Index.vue b/frontend/src/pages/accounts/Index.vue index 6061adb765..2e3fcc9de1 100644 --- a/frontend/src/pages/accounts/Index.vue +++ b/frontend/src/pages/accounts/Index.vue @@ -159,18 +159,24 @@ export default { }, mounted() { this.type = this.$route.params.type; - if (null === this.getRange.start || null === this.getRange.end) { + + + + if (null === this.store.getRange.start || null === this.store.getRange.end) { // subscribe, then update: - const $store = useStore(); - $store.subscribe((mutation, state) => { - if ('fireflyiii/setRange' === mutation.type) { - this.range = {start: mutation.payload.start, end: mutation.payload.end}; - this.triggerUpdate(); + this.store.$onAction( + ({name, $store, args, after, onError,}) => { + after((result) => { + if (name === 'setRange') { + this.range = result; + this.triggerUpdate(); + } + }) } - }); + ) } - if (null !== this.getRange.start && null !== this.getRange.end) { - this.range = {start: this.getRange.start, end: this.getRange.end}; + if (null !== this.store.getRange.start && null !== this.store.getRange.end) { + this.range = {start: this.store.getRange.start, end: this.store.getRange.end}; this.triggerUpdate(); } }, diff --git a/frontend/src/pages/budgets/Index.vue b/frontend/src/pages/budgets/Index.vue index 7ace02f6d5..d7a3b73d78 100644 --- a/frontend/src/pages/budgets/Index.vue +++ b/frontend/src/pages/budgets/Index.vue @@ -168,7 +168,7 @@ export default { }, destroyBudget: function (id) { (new Destroy('budgets')).destroy(id).then(() => { - this.store.dispatch('fireflyiii/refreshCacheKey'); + this.store.refreshCacheKey(); this.triggerUpdate(); }); }, diff --git a/frontend/src/pages/categories/Edit.vue b/frontend/src/pages/categories/Edit.vue index 71a4dd48ab..9738875db1 100644 --- a/frontend/src/pages/categories/Edit.vue +++ b/frontend/src/pages/categories/Edit.vue @@ -76,6 +76,7 @@