the add transaction page of mobile version supports the destinationAccountId and comment parameters

This commit is contained in:
MaysWind
2025-09-14 17:41:21 +08:00
parent 30d36a3b07
commit 538d2b8205
+13
View File
@@ -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 (defaultAccountId && allAccountsMap[defaultAccountId] && !allAccountsMap[defaultAccountId].hidden) {
transaction.sourceAccountId = defaultAccountId;
@@ -143,6 +152,10 @@ export function setTransactionModelByTransaction(transaction: Transaction, trans
transaction.tagIds = finalTagIds;
}
if (options.comment) {
transaction.comment = options.comment;
}
if (transaction2) {
if (setContextData) {
transaction.id = transaction2.id;