From 538d2b8205ddd707cce1909fbddcb52c03f4dc80 Mon Sep 17 00:00:00 2001 From: MaysWind Date: Sun, 14 Sep 2025 17:41:21 +0800 Subject: [PATCH] the add transaction page of mobile version supports the destinationAccountId and comment parameters --- src/lib/transaction.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/lib/transaction.ts b/src/lib/transaction.ts index 578d2d15..2a9714ca 100644 --- a/src/lib/transaction.ts +++ b/src/lib/transaction.ts @@ -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;