From aa323d9633d5b0a16e55feee02bb07ce52cd3bfe Mon Sep 17 00:00:00 2001 From: James Cole Date: Wed, 30 Sep 2026 09:24:29 +0200 Subject: [PATCH] Fix #12909 --- .../assets/v3/js/pages/dashboard/dashboard.js | 3 --- .../assets/v3/js/pages/transactions/create.js | 2 +- .../assets/v3/js/pages/transactions/edit.js | 2 +- .../shared/autocomplete-functions.js | 25 ++++++++++++++++--- .../shared/disable-split-inputs.js | 2 +- .../transaction/destination-account.blade.php | 2 +- 6 files changed, 25 insertions(+), 11 deletions(-) diff --git a/resources/assets/v3/js/pages/dashboard/dashboard.js b/resources/assets/v3/js/pages/dashboard/dashboard.js index 6649fcbba2..ffe33c400f 100644 --- a/resources/assets/v3/js/pages/dashboard/dashboard.js +++ b/resources/assets/v3/js/pages/dashboard/dashboard.js @@ -36,9 +36,6 @@ let index = function () { anonymous: false, loadingPiggyBanks: true, init() { - console.log("I am translation"); - console.log(i18next.t(format(new Date(), "d MMMM yyyy 'o' HH:mm"))); - getVariable("anonymous").then((value) => { let start = new Date(window.store.get("start")); let end = new Date(window.store.get("end")); diff --git a/resources/assets/v3/js/pages/transactions/create.js b/resources/assets/v3/js/pages/transactions/create.js index 4d6802793e..ff4d7107e5 100644 --- a/resources/assets/v3/js/pages/transactions/create.js +++ b/resources/assets/v3/js/pages/transactions/create.js @@ -336,7 +336,7 @@ let create = function () { this.processUploadError(event); }); document.addEventListener("upload-failed", (event) => { - console.log('Now in event listener "upload-failed"'); + // console.log('Now in event listener "upload-failed"'); this.processUploadError(event); }); }, diff --git a/resources/assets/v3/js/pages/transactions/edit.js b/resources/assets/v3/js/pages/transactions/edit.js index e56c974f10..f25fffe43a 100644 --- a/resources/assets/v3/js/pages/transactions/edit.js +++ b/resources/assets/v3/js/pages/transactions/edit.js @@ -345,7 +345,7 @@ let transactions = function () { }); document.addEventListener("upload-failed", (event) => { - console.log('Now in event listener "upload-failed"'); + // console.log('Now in event listener "upload-failed"'); this.processUploadError(event); }); diff --git a/resources/assets/v3/js/pages/transactions/shared/autocomplete-functions.js b/resources/assets/v3/js/pages/transactions/shared/autocomplete-functions.js index 79539de6d7..f2ddefd29e 100644 --- a/resources/assets/v3/js/pages/transactions/shared/autocomplete-functions.js +++ b/resources/assets/v3/js/pages/transactions/shared/autocomplete-functions.js @@ -37,11 +37,10 @@ export function changeDescription(item, ac) { } export function changeDestinationAccount(item, ac) { - console.log("changeDestinationAccount", item, ac); if (typeof item === "object") { // changed account but did not select. const index = parseInt(ac._searchInput.dataset.index); - console.log("changeDestinationAccount X", document.querySelector("#form")); + // console.log("[a] changeDestinationAccount("+index+")", document.querySelector("#form")); document.querySelector("#form")._x_dataStack[0].$data.entries[index].destination_account = { id: item.id, name: item.name, @@ -54,6 +53,7 @@ export function changeDestinationAccount(item, ac) { } if (typeof item === "undefined") { const index = parseInt(ac._searchInput.dataset.index); + // console.log("[b]changeDestinationAccount("+index+")", document.querySelector("#form")); let destination = document.querySelector("#form")._x_dataStack[0].$data.entries[index].destination_account; if (destination.name === ac._searchInput.value) { console.warn('Ignore hallucinated destination account name change to "' + ac._searchInput.value + '"'); @@ -69,7 +69,7 @@ export function changeDestinationAccount(item, ac) { export function selectDestinationAccount(item, ac) { const index = parseInt(ac._searchInput.attributes["data-index"].value); - console.log("selectDestinationAccount", index); + // console.log("selectDestinationAccount("+index+")"); document.querySelector("#form")._x_dataStack[0].$data.entries[index].destination_account = { id: item.id, name: item.name, @@ -78,7 +78,15 @@ export function selectDestinationAccount(item, ac) { currency_code: item.currency_code, account_currency_code: item.account_currency_code, }; - document.querySelector("#form")._x_dataStack[0].changedDestinationAccount(); + // document.querySelector("#form")._x_dataStack[0].entries[index].destination_account = { + // id: item.id, + // name: item.name, + // alpine_name: item.name, + // type: item.type, + // currency_code: item.currency_code, + // account_currency_code: item.account_currency_code, + // }; + document.querySelector("#form")._x_dataStack[0].changedDestinationAccount("selectDestinationAccount("+index+")"); } export function changeSourceAccount(item, ac) { @@ -120,5 +128,14 @@ export function selectSourceAccount(item, ac) { currency_code: item.currency_code, account_currency_code: item.account_currency_code, }; + // console.log('$data', document.querySelector("#form")._x_dataStack[0].$data); + // document.querySelector("#form")._x_dataStack[0].entries[index].source_account = { + // id: item.id, + // name: item.name, + // alpine_name: item.name, + // type: item.type, + // currency_code: item.currency_code, + // account_currency_code: item.account_currency_code, + // }; document.querySelector("#form")._x_dataStack[0].changedSourceAccount(index); } diff --git a/resources/assets/v3/js/pages/transactions/shared/disable-split-inputs.js b/resources/assets/v3/js/pages/transactions/shared/disable-split-inputs.js index 83c728d135..dad949e890 100644 --- a/resources/assets/v3/js/pages/transactions/shared/disable-split-inputs.js +++ b/resources/assets/v3/js/pages/transactions/shared/disable-split-inputs.js @@ -69,7 +69,7 @@ export function disableSplitInputs() { // if is withdrawal, pre-fill the destination account with the first entry's destination account. if ("withdrawal" === this.groupProperties.transactionType) { - this.entries[i].destination_account = this.entries[i - 1].destination_account; + this.entries[i].destination_account = JSON.parse(JSON.stringify(this.entries[i - 1].destination_account));//structuredClone(); } // disable source when withdrawal or transfer diff --git a/resources/views/partials/form/transaction/destination-account.blade.php b/resources/views/partials/form/transaction/destination-account.blade.php index 5fe2a1f434..321f166e4e 100644 --- a/resources/views/partials/form/transaction/destination-account.blade.php +++ b/resources/views/partials/form/transaction/destination-account.blade.php @@ -16,7 +16,7 @@