Skip to content

Firefly III: a personal finances manager

Fix #12758

James Colede4e5711a3b7
diff --git a/changelog.md b/changelog.md
index cde7b7292e..f9b2eed539 100644
--- a/changelog.md
+++ b/changelog.md
@@ -7,6 +7,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Fixed
- [Issue 12757](https://github.com/firefly-iii/firefly-iii/issues/12757) (Transaction List - "Clone" and "Clone and Edit" button doesn't work) reported by @fabienfitoussi
+- #12758
## v6.7.1 - 2026-09-15
diff --git a/resources/assets/v3/js/pages/dashboard/boxes.js b/resources/assets/v3/js/pages/dashboard/boxes.js
index 2438903e5d..c021ac0e27 100644
--- a/resources/assets/v3/js/pages/dashboard/boxes.js
+++ b/resources/assets/v3/js/pages/dashboard/boxes.js
@@ -36,6 +36,7 @@ export default () => ({
loading: false,
boxData: null,
boxOptions: null,
+ anonymous: false,
eventListeners: {
["@convert-to-primary.window"](event) {
this.convertToPrimary = event.detail;
@@ -98,11 +99,7 @@ export default () => ({
let key = current.key;
// console.log('NOT PRIMARY CURRENCY');
if (key.startsWith("balance-in-")) {
- this.balanceBox.amounts.push(
- formatMoney(
- current.monetary_value,
- current.currency_code,
- ),
+ this.balanceBox.amounts.push(formatMoney(this.anonymous ? 0 : current.monetary_value, current.currency_code,),
);
continue;
}
@@ -113,12 +110,7 @@ export default () => ({
subtitles[current.currency_code] = "";
}
// append the amount spent.
- subtitles[current.currency_code] =
- subtitles[current.currency_code] +
- formatMoney(
- current.monetary_value,
- current.currency_code,
- );
+ subtitles[current.currency_code] = subtitles[current.currency_code] + formatMoney(this.anonymous ? 0 : current.monetary_value, current.currency_code,);
continue;
}
// earned info is used in subtitle:
@@ -128,66 +120,35 @@ export default () => ({
subtitles[current.currency_code] = "";
}
// prepend the amount earned.
- subtitles[current.currency_code] =
- formatMoney(
- current.monetary_value,
- current.currency_code,
- ) +
- " + " +
- subtitles[current.currency_code];
+ subtitles[current.currency_code] = formatMoney(this.anonymous ? 0 : current.monetary_value, current.currency_code,) + " + " + subtitles[current.currency_code];
continue;
}
if (key.startsWith("bills-unpaid-in-")) {
- this.billBox.unpaid.push(
- formatMoney(
- current.monetary_value,
- current.currency_code,
- ),
- );
+ this.billBox.unpaid.push(formatMoney(this.anonymous ? 0 : current.monetary_value, current.currency_code,),);
continue;
}
if (key.startsWith("bills-paid-in-")) {
- this.billBox.paid.push(
- formatMoney(
- current.monetary_value,
- current.currency_code,
- ),
- );
+ this.billBox.paid.push(formatMoney(this.anonymous ? 0 : current.monetary_value, current.currency_code,),);
continue;
}
if (key.startsWith("left-to-spend-in-")) {
- sumMoneyLeft =
- sumMoneyLeft + parseFloat(current.monetary_value);
- this.leftBox.left.push(
- formatMoney(
- current.monetary_value,
- current.currency_code,
- ),
- );
+ sumMoneyLeft = sumMoneyLeft + parseFloat(current.monetary_value);
+ this.leftBox.left.push(formatMoney(this.anonymous ? 0 : current.monetary_value, current.currency_code,),);
continue;
}
if (key.startsWith("left-per-day-to-spend-in-")) {
- this.leftBox.perDay.push(
- formatMoney(
- current.monetary_value,
- current.currency_code,
- ),
- );
+ this.leftBox.perDay.push(formatMoney(this.anonymous ? 0 : current.monetary_value, current.currency_code,),);
continue;
}
if (key.startsWith("net-worth-in-")) {
- this.netBox.net.push(
- formatMoney(
- current.monetary_value,
- current.currency_code,
- ),
- );
+ this.netBox.net.push(formatMoney(this.anonymous ? 0 : current.monetary_value, current.currency_code,),);
}
}
}
this.noMoneyLeft = sumMoneyLeft <= 0;
+ this.noMoneyLeft = this.anonymous ? true : this.noMoneyLeft;
for (let i in subtitles) {
if (Object.hasOwn(subtitles, i)) {
this.balanceBox.subtitles.push(subtitles[i]);
@@ -210,13 +171,12 @@ export default () => ({
// Getter
init() {
- // console.log('boxes init');
- // TODO can be replaced by "getVariables"
- getVariables(["convert_to_primary"]).then((values) => {
- // console.log('boxes after promises');
+ getVariables(["convert_to_primary", "anonymous"]).then((values) => {
afterPromises = true;
- this.convertToPrimary = values[0];
+ this.convertToPrimary = values.convert_to_primary;
+ this.anonymous = values.anonymous;
this.loadBoxes();
+
});
window.store.observe("end", () => {
if (!afterPromises) {
@@ -234,5 +194,13 @@ export default () => ({
this.convertToPrimary = newValue;
this.loadBoxes();
});
+ window.store.observe("anonymous", (newValue) => {
+ if (!afterPromises) {
+ return;
+ }
+ // console.log('boxes observe convertToPrimary');
+ this.anonymous = newValue;
+ this.loadBoxes();
+ });
},
});
diff --git a/resources/assets/v3/js/pages/dashboard/dashboard.js b/resources/assets/v3/js/pages/dashboard/dashboard.js
index 00979124db..587cfdd4cd 100644
--- a/resources/assets/v3/js/pages/dashboard/dashboard.js
+++ b/resources/assets/v3/js/pages/dashboard/dashboard.js
@@ -32,13 +32,14 @@ import format from "../../util/format.js";
let index = function () {
return {
piggyBanks: [],
+ anonymous: false,
loadingPiggyBanks: true,
init() {
- this.loadPiggyBanks();
- console.log("Dashboard");
getVariable("anonymous").then((value) => {
let start = new Date(window.store.get("start"));
let end = new Date(window.store.get("end"));
+ this.anonymous = value;
+ this.loadPiggyBanks();
drawMultiCurrencyChart(
"line",
"api/v1/chart/account/overview?period=1D&start=" +
@@ -102,6 +103,9 @@ let index = function () {
current.attributes.currency_code,
) + " / ∞";
}
+ if(this.anonymous) {
+ piggy.amount = '- / -';
+ }
this.piggyBanks.push(piggy);
}