Determine default transaction type in TransactionWizard using user's preferences
MODIFY
app/Http/Controllers/TransactionController.php
app/Http/Controllers/TransactionController.php
@@ -53,6 +53,7 @@ class TransactionController extends Controller
return view('transactions.create', [
'tags' => $tags,
'currencies' => $this->currencyRepository->getIfConversionRatePresent(),
+ 'defaultTransactionType' => Auth::user()->default_transaction_type,
'defaultCurrencyId' => Space::find(session('space_id'))->currency_id,
'recurringsIntervals' => $this->recurringRepository->getSupportedIntervals()
]);

MODIFY
resources/assets/js/components/TransactionWizard.vue
resources/assets/js/components/TransactionWizard.vue
props: [
'tags',
'currencies',
+ 'defaultTransactionType',
'defaultCurrencyId',
'recurringsIntervals'
],
data() {
return {
- type: 'earning',
+ type: this.defaultTransactionType,
errors: [],
tag: null,

MODIFY
resources/views/transactions/create.blade.php
resources/views/transactions/create.blade.php
<transaction-wizard
:tags='@json($tags)'
:currencies='@json($currencies)'
+ default-transaction-type='{{ $defaultTransactionType }}'
:default-currency-id='{{ $defaultCurrencyId }}'
:recurrings-intervals='@json($recurringsIntervals)'
></transaction-wizard>

Determine default transaction type in TransactionWizard using user's preferences