mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-18 00:34:28 +08:00
the add transaction page of mobile version supports the destinationAccountId and comment parameters
This commit is contained in:
@@ -111,6 +111,15 @@ export function setTransactionModelByTransaction(transaction: Transaction, trans
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (options.destinationAccountId && options.destinationAccountId !== '0') {
|
||||||
|
for (const account of allVisibleAccounts) {
|
||||||
|
if (account.id === options.destinationAccountId) {
|
||||||
|
transaction.destinationAccountId = options.destinationAccountId;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!transaction.sourceAccountId) {
|
if (!transaction.sourceAccountId) {
|
||||||
if (defaultAccountId && allAccountsMap[defaultAccountId] && !allAccountsMap[defaultAccountId].hidden) {
|
if (defaultAccountId && allAccountsMap[defaultAccountId] && !allAccountsMap[defaultAccountId].hidden) {
|
||||||
transaction.sourceAccountId = defaultAccountId;
|
transaction.sourceAccountId = defaultAccountId;
|
||||||
@@ -143,6 +152,10 @@ export function setTransactionModelByTransaction(transaction: Transaction, trans
|
|||||||
transaction.tagIds = finalTagIds;
|
transaction.tagIds = finalTagIds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (options.comment) {
|
||||||
|
transaction.comment = options.comment;
|
||||||
|
}
|
||||||
|
|
||||||
if (transaction2) {
|
if (transaction2) {
|
||||||
if (setContextData) {
|
if (setContextData) {
|
||||||
transaction.id = transaction2.id;
|
transaction.id = transaction2.id;
|
||||||
|
|||||||
Reference in New Issue
Block a user