mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-18 08:44:25 +08:00
use the first visible account as default if the default account is hidden when creating new transaction
This commit is contained in:
@@ -112,7 +112,7 @@ export function setTransactionModelByTransaction(transaction: Transaction, trans
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!transaction.sourceAccountId) {
|
if (!transaction.sourceAccountId) {
|
||||||
if (defaultAccountId && allAccountsMap[defaultAccountId]) {
|
if (defaultAccountId && allAccountsMap[defaultAccountId] && !allAccountsMap[defaultAccountId].hidden) {
|
||||||
transaction.sourceAccountId = defaultAccountId;
|
transaction.sourceAccountId = defaultAccountId;
|
||||||
} else {
|
} else {
|
||||||
transaction.sourceAccountId = allVisibleAccounts[0].id;
|
transaction.sourceAccountId = allVisibleAccounts[0].id;
|
||||||
@@ -120,7 +120,7 @@ export function setTransactionModelByTransaction(transaction: Transaction, trans
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!transaction.destinationAccountId) {
|
if (!transaction.destinationAccountId) {
|
||||||
if (defaultAccountId && allAccountsMap[defaultAccountId]) {
|
if (defaultAccountId && allAccountsMap[defaultAccountId] && !allAccountsMap[defaultAccountId].hidden) {
|
||||||
transaction.destinationAccountId = defaultAccountId;
|
transaction.destinationAccountId = defaultAccountId;
|
||||||
} else {
|
} else {
|
||||||
transaction.destinationAccountId = allVisibleAccounts[0].id;
|
transaction.destinationAccountId = allVisibleAccounts[0].id;
|
||||||
|
|||||||
Reference in New Issue
Block a user