mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Repositories can now deal with new account types.
This commit is contained in:
parent
4bbc3c3bd8
commit
affa9014d2
@ -84,7 +84,7 @@ class EloquentTransactionJournalRepository implements TransactionJournalReposito
|
|||||||
$journalType = \TransactionType::where('type', 'Opening balance')->first();
|
$journalType = \TransactionType::where('type', 'Opening balance')->first();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ($fromAT == 'Default account' && $toAT == 'Default account'): // both are yours:
|
case (in_array($fromAT,['Default account','Asset account']) && in_array($toAT,['Default account','Asset account'])): // both are yours:
|
||||||
// determin transaction type. If both accounts are new, it's an initial balance transfer.
|
// determin transaction type. If both accounts are new, it's an initial balance transfer.
|
||||||
$journalType = \TransactionType::where('type', 'Transfer')->first();
|
$journalType = \TransactionType::where('type', 'Transfer')->first();
|
||||||
break;
|
break;
|
||||||
@ -92,11 +92,11 @@ class EloquentTransactionJournalRepository implements TransactionJournalReposito
|
|||||||
$journalType = \TransactionType::where('type', 'Deposit')->first();
|
$journalType = \TransactionType::where('type', 'Deposit')->first();
|
||||||
break;
|
break;
|
||||||
// is deposit into one of your own accounts:
|
// is deposit into one of your own accounts:
|
||||||
case ($toAT == 'Default account'):
|
case ($toAT == 'Default account' || $toAT == 'Asset account'):
|
||||||
$journalType = \TransactionType::where('type', 'Deposit')->first();
|
$journalType = \TransactionType::where('type', 'Deposit')->first();
|
||||||
break;
|
break;
|
||||||
// is withdrawal from one of your own accounts:
|
// is withdrawal from one of your own accounts:
|
||||||
case ($fromAT == 'Default account'):
|
case ($fromAT == 'Default account' || $fromAT == 'Asset account'):
|
||||||
$journalType = \TransactionType::where('type', 'Withdrawal')->first();
|
$journalType = \TransactionType::where('type', 'Withdrawal')->first();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user