Skip to content

Firefly III: a personal finances manager

Fix https://github.com/firefly-iii/firefly-iii/issues/12766

James Cole95968e1edb2c
diff --git a/changelog.md b/changelog.md
index d2d56fc709..083415f90b 100644
--- a/changelog.md
+++ b/changelog.md
@@ -11,6 +11,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- [Issue 12761](https://github.com/firefly-iii/firefly-iii/issues/12761) (Fiscal year start date not showing it settings) reported by @ppslim
- [Issue 12755](https://github.com/firefly-iii/firefly-iii/issues/12755) (Tags are not visible when editing transactions) reported by @fabienfitoussi
- #12768
+- #12766
## v6.7.1 - 2026-09-15
diff --git a/resources/assets/v3/js/pages/transactions/create.js b/resources/assets/v3/js/pages/transactions/create.js
index 260f563262..16c424fc21 100644
--- a/resources/assets/v3/js/pages/transactions/create.js
+++ b/resources/assets/v3/js/pages/transactions/create.js
@@ -30,7 +30,7 @@ import { loadPiggyBanks } from "./shared/load-piggy-banks.js";
import { loadSubscriptions } from "./shared/load-subscriptions.js";
import { addAllAutocompleteToForm } from "./shared/add-autocomplete.js";
import { processAttachments } from "./shared/process-attachments.js";
-import { disableSplitAccounts } from "./shared/disable-split-accounts.js";
+import { disableSplitInputs } from "./shared/disable-split-inputs.js";
import { parseTotalAmount } from "./shared/parse-total-amount.js";
import { keyUpFromCategory } from "./shared/keyup-from-category.js";
import { changedAmount } from "./shared/changed-amount.js";
@@ -179,7 +179,7 @@ let create = function () {
this.detectTransactionType();
},
// shared functions with edit/create transaction.
- disableSplitAccounts: disableSplitAccounts,
+ disableSplitInputs: disableSplitInputs,
parseTotalAmount: parseTotalAmount,
processUploadError: processUploadError,
keyUpFromCategory: keyUpFromCategory,
diff --git a/resources/assets/v3/js/pages/transactions/edit.js b/resources/assets/v3/js/pages/transactions/edit.js
index a8192d90fe..f496e29181 100644
--- a/resources/assets/v3/js/pages/transactions/edit.js
+++ b/resources/assets/v3/js/pages/transactions/edit.js
@@ -39,7 +39,7 @@ import Put from "../../api/model/transaction/put.js";
import { showMessageOrRedirectUser } from "./shared/show-message-or-redirect.js";
import { processAttachments } from "./shared/process-attachments.js";
import sidebar from "../shared/sidebar.js";
-import { disableSplitAccounts } from "./shared/disable-split-accounts.js";
+import { disableSplitInputs } from "./shared/disable-split-inputs.js";
import { parseTotalAmount } from "./shared/parse-total-amount.js";
import { keyUpFromCategory } from "./shared/keyup-from-category.js";
import { changedAmount } from "./shared/changed-amount.js";
@@ -169,7 +169,7 @@ let transactions = function () {
// shared functions between edit/create
parseTotalAmount: parseTotalAmount,
- disableSplitAccounts: disableSplitAccounts,
+ disableSplitInputs: disableSplitInputs,
processUploadError: processUploadError,
keyUpFromCategory: keyUpFromCategory,
changedAmount: changedAmount,
@@ -489,7 +489,7 @@ let transactions = function () {
// exclusive to edit form, used to initialize splits.
addedSplit() {
- this.disableSplitAccounts();
+ this.disableSplitInputs();
this.addAllAutocompleteToForm();
this.addTabListener();
},
diff --git a/resources/assets/v3/js/pages/transactions/shared/add-split.js b/resources/assets/v3/js/pages/transactions/shared/add-split.js
index b27268c685..a6a6c25635 100644
--- a/resources/assets/v3/js/pages/transactions/shared/add-split.js
+++ b/resources/assets/v3/js/pages/transactions/shared/add-split.js
@@ -23,5 +23,5 @@ import { createEmptySplit } from "./create-empty-split.js";
export function addSplit() {
this.entries.push(createEmptySplit());
this.links.push([]);
- this.disableSplitAccounts();
+ this.disableSplitInputs();
}
diff --git a/resources/assets/v3/js/pages/transactions/shared/create-empty-split.js b/resources/assets/v3/js/pages/transactions/shared/create-empty-split.js
index 2a63440fe0..c8fc3013ac 100644
--- a/resources/assets/v3/js/pages/transactions/shared/create-empty-split.js
+++ b/resources/assets/v3/js/pages/transactions/shared/create-empty-split.js
@@ -107,6 +107,7 @@ export function createEmptySplit() {
// date and time
date: formatted,
+ date_disabled: false,
interest_date: "",
book_date: "",
process_date: "",
diff --git a/resources/assets/v3/js/pages/transactions/shared/detect-transaction-type.js b/resources/assets/v3/js/pages/transactions/shared/detect-transaction-type.js
index 2760a725ce..b1b7914b32 100644
--- a/resources/assets/v3/js/pages/transactions/shared/detect-transaction-type.js
+++ b/resources/assets/v3/js/pages/transactions/shared/detect-transaction-type.js
@@ -26,7 +26,7 @@ export function detectTransactionType() {
console.warn(
"Cannot infer transaction type from two unknown accounts.",
);
- this.disableSplitAccounts();
+ this.disableSplitInputs();
return;
}
@@ -51,7 +51,7 @@ export function detectTransactionType() {
this.filterForeignCurrencies(
this.entries[0].destination_account.currency_code,
);
- this.disableSplitAccounts();
+ this.disableSplitInputs();
return;
}
// withdrawals:
@@ -68,7 +68,7 @@ export function detectTransactionType() {
this.determineAmountCurrency(
this.entries[0].source_account.currency_code,
);
- this.disableSplitAccounts();
+ this.disableSplitInputs();
return;
}
if ("Asset account" === sourceType && "unknown" === destType) {
@@ -81,7 +81,7 @@ export function detectTransactionType() {
this.determineAmountCurrency(
this.entries[0].source_account.currency_code,
);
- this.disableSplitAccounts();
+ this.disableSplitInputs();
return;
}
if (
@@ -97,7 +97,7 @@ export function detectTransactionType() {
this.determineAmountCurrency(
this.entries[0].source_account.currency_code,
);
- this.disableSplitAccounts();
+ this.disableSplitInputs();
return;
}
@@ -112,7 +112,7 @@ export function detectTransactionType() {
// this.groupProperties.transactionType +
// '".',
// );
- this.disableSplitAccounts();
+ this.disableSplitInputs();
this.determineAmountCurrency(
this.entries[0].destination_account.currency_code,
);
@@ -131,7 +131,7 @@ export function detectTransactionType() {
this.determineAmountCurrency(
this.entries[0].destination_account.currency_code,
);
- this.disableSplitAccounts();
+ this.disableSplitInputs();
return;
}
if (
@@ -148,7 +148,7 @@ export function detectTransactionType() {
this.determineAmountCurrency(
this.entries[0].destination_account.currency_code,
);
- this.disableSplitAccounts();
+ this.disableSplitInputs();
return;
}
if (
@@ -164,7 +164,7 @@ export function detectTransactionType() {
this.determineAmountCurrency(
this.entries[0].destination_account.currency_code,
);
- this.disableSplitAccounts();
+ this.disableSplitInputs();
return;
}
console.warn(
@@ -174,5 +174,5 @@ export function detectTransactionType() {
destType +
'".',
);
- this.disableSplitAccounts();
+ this.disableSplitInputs();
}
diff --git a/resources/assets/v3/js/pages/transactions/shared/disable-split-accounts.js b/resources/assets/v3/js/pages/transactions/shared/disable-split-inputs.js
similarity index 89%
rename from resources/assets/v3/js/pages/transactions/shared/disable-split-accounts.js
rename to resources/assets/v3/js/pages/transactions/shared/disable-split-inputs.js
index 7597a1fe63..0795a68d66 100644
--- a/resources/assets/v3/js/pages/transactions/shared/disable-split-accounts.js
+++ b/resources/assets/v3/js/pages/transactions/shared/disable-split-inputs.js
@@ -19,12 +19,15 @@
*/
// what happens when a user adds more than one split?
-export function disableSplitAccounts() {
- //console.log('Call disableSplitAccounts');
+export function disableSplitInputs() {
+ //console.log('Call disableSplitInputs');
if (this.entries.length > 1) {
- //console.log('Activate disableSplitAccounts');
+ //console.log('Activate disableSplitInputs');
// disable source and/or destination, based on account type.
for (let i = 1; i < this.entries.length; i++) {
+ // disable dates
+ this.entries[i].date_disabled = true;
+
// disable source when withdrawal or transfer
if (
"transfer" === this.groupProperties.transactionType ||
diff --git a/resources/assets/v3/js/pages/transactions/shared/parse-from-entries.js b/resources/assets/v3/js/pages/transactions/shared/parse-from-entries.js
index ab80c45dc9..7c6c89bec0 100644
--- a/resources/assets/v3/js/pages/transactions/shared/parse-from-entries.js
+++ b/resources/assets/v3/js/pages/transactions/shared/parse-from-entries.js
@@ -52,6 +52,11 @@ export function parseFromEntries(entries, originals, transactionType) {
// dates
current.date = entry.date;
+ if(i > 0 && !!returnArray[0]) {
+ console.log("Overrule date for entry ", i, " with ", returnArray[0].date);
+ current.date = returnArray[0].date;
+ }
+
current.interest_date = entry.interest_date;
current.book_date = entry.book_date;
current.process_date = entry.process_date;
diff --git a/resources/views/partials/form/transaction/date-time.blade.php b/resources/views/partials/form/transaction/date-time.blade.php
index 59125b714e..b98aea6825 100644
--- a/resources/views/partials/form/transaction/date-time.blade.php
+++ b/resources/views/partials/form/transaction/date-time.blade.php
@@ -6,6 +6,8 @@
<input type="datetime-local" class="form-control" :id="'date_' + index"
@change="changedDateTime"
@keyup.enter="save()"
+ x-bind:disabled="true===transaction.date_disabled"
+ x-bind:readonly="true===transaction.date_disabled"
x-model="transaction.date"
>
</div>