Skip to content

Firefly III: a personal finances manager

🤖 Auto commit for release 'develop' on 2026-10-05

JC58959e894547f
diff --git a/app/Api/V1/Controllers/Insight/Income/TagController.php b/app/Api/V1/Controllers/Insight/Income/TagController.php
index df99eef909..94be2ae461 100644
--- a/app/Api/V1/Controllers/Insight/Income/TagController.php
+++ b/app/Api/V1/Controllers/Insight/Income/TagController.php
@@ -158,7 +158,10 @@ final class TagController extends Controller
'currency_id' => (string) $foreignCurrencyId,
'currency_code' => $journal['foreign_currency_code'],
];
- $response[$foreignKey]['difference'] = bcadd((string) $response[$foreignKey]['difference'], Steam::positive($journal['foreign_amount']));
+ $response[$foreignKey]['difference'] = bcadd(
+ (string) $response[$foreignKey]['difference'],
+ Steam::positive($journal['foreign_amount'])
+ );
$response[$foreignKey]['difference_float'] = (float) $response[$foreignKey]['difference'];
}
}
diff --git a/app/Api/V1/Controllers/Insight/Transfer/TagController.php b/app/Api/V1/Controllers/Insight/Transfer/TagController.php
index f92a7aa9f0..b7b85fd376 100644
--- a/app/Api/V1/Controllers/Insight/Transfer/TagController.php
+++ b/app/Api/V1/Controllers/Insight/Transfer/TagController.php
@@ -155,7 +155,10 @@ final class TagController extends Controller
'currency_id' => (string) $foreignCurrencyId,
'currency_code' => $journal['foreign_currency_code'],
];
- $response[$foreignKey]['difference'] = bcadd((string) $response[$foreignKey]['difference'], Steam::positive($journal['foreign_amount']));
+ $response[$foreignKey]['difference'] = bcadd(
+ (string) $response[$foreignKey]['difference'],
+ Steam::positive($journal['foreign_amount'])
+ );
$response[$foreignKey]['difference_float'] = (float) $response[$foreignKey]['difference']; // intentional float
}
}
diff --git a/app/Http/Controllers/Budget/BudgetLimitController.php b/app/Http/Controllers/Budget/BudgetLimitController.php
index 2edb4f5531..d461374baa 100644
--- a/app/Http/Controllers/Budget/BudgetLimitController.php
+++ b/app/Http/Controllers/Budget/BudgetLimitController.php
@@ -198,7 +198,13 @@ final class BudgetLimitController extends Controller
if ($request->expectsJson()) {
$array = $limit->toArray();
// add some extra metadata:
- $spentArr = $this->opsRepository->sumExpenses($limit->start_date, $limit->end_date, null, new Collection()->push($budget), $currency);
+ $spentArr = $this->opsRepository->sumExpenses(
+ $limit->start_date,
+ $limit->end_date,
+ null,
+ new Collection()->push($budget),
+ $currency
+ );
$array['spent'] = $spentArr[$currency->id]['sum'] ?? '0';
$array['left_formatted'] = Amount::formatAnything($limit->transactionCurrency, bcadd($array['spent'], (string) $array['amount']));
$array['amount_formatted'] = Amount::formatAnything($limit->transactionCurrency, $limit['amount']);
diff --git a/app/Http/Controllers/Budget/IndexController.php b/app/Http/Controllers/Budget/IndexController.php
index 65429e59c1..52c6f900e3 100644
--- a/app/Http/Controllers/Budget/IndexController.php
+++ b/app/Http/Controllers/Budget/IndexController.php
@@ -272,7 +272,10 @@ final class IndexController extends Controller
if (array_key_exists($currency->id, $spentArr) && array_key_exists('sum', $spentArr[$currency->id])) {
$array['spent'][$currency->id]['spent'] = $spentArr[$currency->id]['sum'];
- $array['spent'][$currency->id]['spent_outside'] = Steam::negative(bcsub($spentInLimits[$currency->id], $spentArr[$currency->id]['sum']));
+ $array['spent'][$currency->id]['spent_outside'] = Steam::negative(bcsub(
+ $spentInLimits[$currency->id],
+ $spentArr[$currency->id]['sum']
+ ));
$array['spent'][$currency->id]['currency_id'] = $currency->id;
$array['spent'][$currency->id]['currency_symbol'] = $currency->symbol;
$array['spent'][$currency->id]['currency_decimal_places'] = $currency->decimal_places;
diff --git a/app/Http/Controllers/Chart/BudgetController.php b/app/Http/Controllers/Chart/BudgetController.php
index ad724137dc..f4b32fe5c5 100644
--- a/app/Http/Controllers/Chart/BudgetController.php
+++ b/app/Http/Controllers/Chart/BudgetController.php
@@ -539,7 +539,13 @@ final class BudgetController extends Controller
}
// get spent amount in this period for this currency.
- $sum = $this->opsRepository->sumExpenses($currentStart, $currentEnd, $accounts, new Collection()->push($budget), $currency);
+ $sum = $this->opsRepository->sumExpenses(
+ $currentStart,
+ $currentEnd,
+ $accounts,
+ new Collection()->push($budget),
+ $currency
+ );
$amount = Steam::positive($sum[$currency->id]['sum'] ?? '0');
$chartData[0]['entries'][$title] = Steam::bcround($amount, $currency->decimal_places);
diff --git a/app/Jobs/CreateAutoBudgetLimits.php b/app/Jobs/CreateAutoBudgetLimits.php
index 476da65ac3..affea656a0 100644
--- a/app/Jobs/CreateAutoBudgetLimits.php
+++ b/app/Jobs/CreateAutoBudgetLimits.php
@@ -132,7 +132,13 @@ class CreateAutoBudgetLimits implements ShouldQueue
// if has one, calculate expenses and use that as a base.
$repository = app(OperationsRepositoryInterface::class);
$repository->setUser($autoBudget->budget->user);
- $spent = $repository->sumExpenses($previousStart, $previousEnd, null, new Collection()->push($autoBudget->budget), $autoBudget->transactionCurrency);
+ $spent = $repository->sumExpenses(
+ $previousStart,
+ $previousEnd,
+ null,
+ new Collection()->push($autoBudget->budget),
+ $autoBudget->transactionCurrency
+ );
$currencyId = $autoBudget->transaction_currency_id;
$spentAmount = $spent[$currencyId]['sum'] ?? '0';
Log::debug(sprintf('Spent in previous budget period (%s-%s) is %s', $previousStart->format('Y-m-d'), $previousEnd->format('Y-m-d'), $spentAmount));
@@ -222,7 +228,13 @@ class CreateAutoBudgetLimits implements ShouldQueue
// if has one, calculate expenses and use that as a base.
$repository = app(OperationsRepositoryInterface::class);
$repository->setUser($autoBudget->budget->user);
- $spent = $repository->sumExpenses($previousStart, $previousEnd, null, new Collection()->push($autoBudget->budget), $autoBudget->transactionCurrency);
+ $spent = $repository->sumExpenses(
+ $previousStart,
+ $previousEnd,
+ null,
+ new Collection()->push($autoBudget->budget),
+ $autoBudget->transactionCurrency
+ );
$currencyId = $autoBudget->transaction_currency_id;
$spentAmount = $spent[$currencyId]['sum'] ?? '0';
Log::debug(sprintf('Spent in previous budget period (%s-%s) is %s', $previousStart->format('Y-m-d'), $previousEnd->format('Y-m-d'), $spentAmount));
diff --git a/app/Repositories/Account/AccountRepository.php b/app/Repositories/Account/AccountRepository.php
index f993052a8d..6d56e1fcee 100644
--- a/app/Repositories/Account/AccountRepository.php
+++ b/app/Repositories/Account/AccountRepository.php
@@ -250,28 +250,28 @@ class AccountRepository implements AccountRepositoryInterface, UserGroupInterfac
$filter ??= [];
if (0 !== count($sort)) {
foreach ($sort as $param) {
- // basic sort:
- if (in_array($param[0], $allowed, true)) {
- $query->orderBy($param[0], $param[1]);
- ++$sorted;
- }
+ // basic sort:
+ if (in_array($param[0], $allowed, true)) {
+ $query->orderBy($param[0], $param[1]);
+ ++$sorted;
+ }
}
}
// add filter parameters.
$allowed = config('firefly.allowed_filter_parameters.Account', []);
if (0 !== count($filter)) {
foreach ($filter as $field => $search) {
- if('account_number_and_iban' === $field) {
- $query->leftJoin('account_meta', function(JoinClause $join)
- {
+ if ('account_number_and_iban' === $field) {
+ $query->leftJoin('account_meta', function (JoinClause $join): void {
$join->on('accounts.id', '=', 'account_meta.account_id');
- $join->on('account_meta.name','=',DB::raw("'account_number'"));
+ $join->on('account_meta.name', '=', DB::raw("'account_number'"));
});
- $query->where(function(EloquentBuilder $q1) use ($search) {
+ $query->where(function (EloquentBuilder $q1) use ($search): void {
$q1->whereLike('account_meta.data', sprintf('%%%s%%', $search));
$q1->orWhereLike('accounts.iban', sprintf('%%%s%%', $search));
});
+
continue;
}
if (in_array($field, $allowed, true)) {
diff --git a/app/Support/Http/Controllers/AugumentData.php b/app/Support/Http/Controllers/AugumentData.php
index a3a940b1ba..a507156873 100644
--- a/app/Support/Http/Controllers/AugumentData.php
+++ b/app/Support/Http/Controllers/AugumentData.php
@@ -222,7 +222,14 @@ trait AugumentData
$currentEnd->addMonth();
}
// primary currency amount.
- $expenses = $opsRepository->sumExpenses($currentStart, $currentEnd, null, $budgetCollection, $entry->transactionCurrency, $this->convertToPrimary);
+ $expenses = $opsRepository->sumExpenses(
+ $currentStart,
+ $currentEnd,
+ null,
+ $budgetCollection,
+ $entry->transactionCurrency,
+ $this->convertToPrimary
+ );
$spent = $expenses[$currency->id]['sum'] ?? '0';
$entry->pc_spent = $spent;
diff --git a/app/Support/JsonApi/Enrichments/RecurringEnrichment.php b/app/Support/JsonApi/Enrichments/RecurringEnrichment.php
index d0c09bf027..2428353cb0 100644
--- a/app/Support/JsonApi/Enrichments/RecurringEnrichment.php
+++ b/app/Support/JsonApi/Enrichments/RecurringEnrichment.php
@@ -354,7 +354,11 @@ class RecurringEnrichment implements EnrichmentInterface
/** @var RecurrenceRepetition $repetition */
foreach ($set as $repetition) {
- $recurrence = $this->collection->filter(static fn (Recurrence $item): bool => (int) $item->id === (int) $repetition->recurrence_id)->first();
+ $recurrence = $this->collection->filter(
+ static fn (Recurrence $item): bool => (int) $item->id === (int) $repetition->recurrence_id
+ )
+ ->first()
+ ;
$fromDate = clone ($recurrence->latest_date ?? $recurrence->first_date);
$recurrenceId = (int) $repetition->recurrence_id;
$repId = (int) $repetition->id;
diff --git a/changelog.md b/changelog.md
index d459f89c3c..b17d0bf49d 100644
--- a/changelog.md
+++ b/changelog.md
@@ -7,7 +7,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Fixed
-- #12965
+- [Issue 12965](https://github.com/firefly-iii/firefly-iii/issues/12965) (Unnecessary float conversion in input field when creating or editing transactions) reported by @JC5
## v6.7.7 - 2026-10-04
diff --git a/composer.lock b/composer.lock
index de5f142528..7cf48051c6 100644
--- a/composer.lock
+++ b/composer.lock
@@ -941,16 +941,16 @@
},
{
"name": "filp/whoops",
- "version": "2.18.5",
+ "version": "2.18.6",
"source": {
"type": "git",
"url": "https://github.com/filp/whoops.git",
- "reference": "baec851ad6ae00db8bd0fdd30d208afc1b71c56e"
+ "reference": "7d0a2cde892089bb09372f4366e9b960eb3001a9"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/filp/whoops/zipball/baec851ad6ae00db8bd0fdd30d208afc1b71c56e",
- "reference": "baec851ad6ae00db8bd0fdd30d208afc1b71c56e",
+ "url": "https://api.github.com/repos/filp/whoops/zipball/7d0a2cde892089bb09372f4366e9b960eb3001a9",
+ "reference": "7d0a2cde892089bb09372f4366e9b960eb3001a9",
"shasum": ""
},
"require": {
@@ -1000,7 +1000,7 @@
],
"support": {
"issues": "https://github.com/filp/whoops/issues",
- "source": "https://github.com/filp/whoops/tree/2.18.5"
+ "source": "https://github.com/filp/whoops/tree/2.18.6"
},
"funding": [
{
@@ -1008,7 +1008,7 @@
"type": "github"
}
],
- "time": "2026-09-18T12:00:00+00:00"
+ "time": "2026-10-03T17:03:57+00:00"
},
{
"name": "firebase/php-jwt",
@@ -10215,16 +10215,16 @@
},
{
"name": "carthage-software/mago",
- "version": "1.51.1",
+ "version": "1.51.2",
"source": {
"type": "git",
"url": "https://github.com/carthage-software/mago.git",
- "reference": "59c9265b5b79c2174b921b3b9ef6b933edcad939"
+ "reference": "5415d6900d330a5a6a70728aaa7f9c52c7672495"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/carthage-software/mago/zipball/59c9265b5b79c2174b921b3b9ef6b933edcad939",
- "reference": "59c9265b5b79c2174b921b3b9ef6b933edcad939",
+ "url": "https://api.github.com/repos/carthage-software/mago/zipball/5415d6900d330a5a6a70728aaa7f9c52c7672495",
+ "reference": "5415d6900d330a5a6a70728aaa7f9c52c7672495",
"shasum": ""
},
"require": {
@@ -10266,7 +10266,7 @@
],
"support": {
"issues": "https://github.com/carthage-software/mago/issues",
- "source": "https://github.com/carthage-software/mago/tree/1.51.1"
+ "source": "https://github.com/carthage-software/mago/tree/1.51.2"
},
"funding": [
{
@@ -10274,7 +10274,7 @@
"type": "github"
}
],
- "time": "2026-10-03T03:54:49+00:00"
+ "time": "2026-10-03T09:05:17+00:00"
},
{
"name": "cloudcreativity/json-api-testing",
@@ -11638,11 +11638,11 @@
},
{
"name": "phpstan/phpstan",
- "version": "2.2.16",
+ "version": "2.2.17",
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpstan/phpstan/zipball/46a6d9060e5a7763adfcc21ebcb8b504ebdbcb92",
- "reference": "46a6d9060e5a7763adfcc21ebcb8b504ebdbcb92",
+ "url": "https://api.github.com/repos/phpstan/phpstan/zipball/e676a49fa70cee9f5bf6ff4796186b928a08673f",
+ "reference": "e676a49fa70cee9f5bf6ff4796186b928a08673f",
"shasum": ""
},
"require": {
@@ -11698,7 +11698,7 @@
"type": "github"
}
],
- "time": "2026-09-25T09:31:51+00:00"
+ "time": "2026-10-04T19:40:09+00:00"
},
{
"name": "phpstan/phpstan-deprecation-rules",
@@ -11805,16 +11805,16 @@
},
{
"name": "phpunit/php-code-coverage",
- "version": "14.4.0",
+ "version": "14.4.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
- "reference": "9be27409ad7bedddd34ed3bc27561d47c6faea06"
+ "reference": "f1e54f06b6b4cea73cd6104ba3c0cfa0efa6d73f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/9be27409ad7bedddd34ed3bc27561d47c6faea06",
- "reference": "9be27409ad7bedddd34ed3bc27561d47c6faea06",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f1e54f06b6b4cea73cd6104ba3c0cfa0efa6d73f",
+ "reference": "f1e54f06b6b4cea73cd6104ba3c0cfa0efa6d73f",
"shasum": ""
},
"require": {
@@ -11824,9 +11824,9 @@
"ext-xmlwriter": "*",
"nikic/php-parser": "^5.9.0",
"php": ">=8.4",
- "phpunit/php-text-template": "^6.0",
+ "phpunit/php-text-template": "^6.0.1",
"sebastian/complexity": "^6.0",
- "sebastian/environment": "^9.3.2",
+ "sebastian/environment": "^9.3.3",
"sebastian/git-state": "^1.0",
"sebastian/lines-of-code": "^5.0.2",
"sebastian/version": "^7.0",
@@ -11871,7 +11871,7 @@
"support": {
"issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
"security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy",
- "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/14.4.0"
+ "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/14.4.1"
},
"funding": [
{
@@ -11891,7 +11891,7 @@
"type": "tidelift"
}
],
- "time": "2026-09-30T12:46:01+00:00"
+ "time": "2026-10-03T14:05:38+00:00"
},
{
"name": "phpunit/php-file-iterator",
@@ -13449,16 +13449,16 @@
},
{
"name": "sebastian/version",
- "version": "7.0.0",
+ "version": "7.0.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/version.git",
- "reference": "ad37a5552c8e2b88572249fdc19b6da7792e021b"
+ "reference": "f1598cf1d8d1ca4c0f194a52f2fe72a559a7b0b1"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/ad37a5552c8e2b88572249fdc19b6da7792e021b",
- "reference": "ad37a5552c8e2b88572249fdc19b6da7792e021b",
+ "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/f1598cf1d8d1ca4c0f194a52f2fe72a559a7b0b1",
+ "reference": "f1598cf1d8d1ca4c0f194a52f2fe72a559a7b0b1",
"shasum": ""
},
"require": {
@@ -13491,7 +13491,7 @@
"support": {
"issues": "https://github.com/sebastianbergmann/version/issues",
"security": "https://github.com/sebastianbergmann/version/security/policy",
- "source": "https://github.com/sebastianbergmann/version/tree/7.0.0"
+ "source": "https://github.com/sebastianbergmann/version/tree/7.0.1"
},
"funding": [
{
@@ -13511,7 +13511,7 @@
"type": "tidelift"
}
],
- "time": "2026-02-06T04:52:52+00:00"
+ "time": "2026-10-04T05:51:14+00:00"
},
{
"name": "staabm/side-effects-detector",
diff --git a/config/firefly.php b/config/firefly.php
index 9846f5cdf6..8eda4d031f 100644
--- a/config/firefly.php
+++ b/config/firefly.php
@@ -78,8 +78,8 @@ return [
'running_balance_column' => (bool)env_default_when_empty(env('USE_RUNNING_BALANCE'), true), // this is only the default value, is not used.
// see cer.php for exchange rates feature flag.
],
-'version' => '6.7.7',
-'build_time' => 1791013464,
+'version' => 'develop/2026-10-05',
+'build_time' => 1791172269,
'api_version' => '2.1.0', // field is no longer used.
'db_version' => 28, // field is no longer used.
@@ -851,7 +851,7 @@ return [
'allowed_filter_parameters' => [
'Account' => [
'name',
- 'account_number_and_iban'
+ 'account_number_and_iban',
],
],
'allowed_sort_parameters' => [
diff --git a/resources/assets/v3/js/boot/bootstrap.js b/resources/assets/v3/js/boot/bootstrap.js
index 849327427a..7984f52841 100644
--- a/resources/assets/v3/js/boot/bootstrap.js
+++ b/resources/assets/v3/js/boot/bootstrap.js
@@ -28,10 +28,10 @@ import store from "../store/store.js";
import axios from "axios";
import Shepherd from "shepherd.js";
import "cally";
-import {getFreshVariable} from "../store/get-fresh-variable.js";
-import {getVariables} from "../store/get-variables.js";
-import {getViewRange} from "../support/get-viewrange.js";
-import {loadTranslations} from "../support/load-translations.js";
+import { getFreshVariable } from "../store/get-fresh-variable.js";
+import { getVariables } from "../store/get-variables.js";
+import { getViewRange } from "../support/get-viewrange.js";
+import { loadTranslations } from "../support/load-translations.js";
import i18next from "i18next";
window.bootstrapped = false;
@@ -52,7 +52,14 @@ store.set("cacheValid", localValue === serverValue);
store.set("lastActivity", serverValue);
// get a bunch of variables, and then use them to build the store
-const preferences = await getVariables(["viewRange", "anonymous", "darkMode", "locale", "language", "convert_to_primary"]);
+const preferences = await getVariables([
+ "viewRange",
+ "anonymous",
+ "darkMode",
+ "locale",
+ "language",
+ "convert_to_primary",
+]);
const range = getViewRange(preferences.viewRange, new Date());
if (!store.get("start") || !store.get("end")) {
@@ -79,7 +86,7 @@ store.set("locale", replacedLocale);
console.log("Ready with bootstrap for this page.");
// need the language to be loaded first, so continue only once we have it.
-await loadTranslations(replacedLanguage, replacedLocale)
+await loadTranslations(replacedLanguage, replacedLocale);
const event = new Event("firefly-iii-bootstrapped");
document.dispatchEvent(event);
window.bootstrapped = true;
@@ -89,14 +96,9 @@ if (window.showTour) {
loadTour();
}
-
-
-
-
-
function loadTour() {
const url = "/";
- let site = axios.create({baseURL: url, withCredentials: true,});
+ let site = axios.create({ baseURL: url, withCredentials: true });
axios.defaults.withCredentials = true;
axios.defaults.baseURL = url;
diff --git a/resources/assets/v3/js/pages/accounts/index.js b/resources/assets/v3/js/pages/accounts/index.js
index 7342f2c395..12810d35e6 100644
--- a/resources/assets/v3/js/pages/accounts/index.js
+++ b/resources/assets/v3/js/pages/accounts/index.js
@@ -22,14 +22,14 @@ import "../../boot/bootstrap.js";
import sidebar from "../shared/sidebar.js";
import dates from "../shared/dates.js";
import Alpine from "@alpinejs/csp";
-import {getVariable} from "../../store/get-variable.js";
+import { getVariable } from "../../store/get-variable.js";
import Put from "../../api/model/account/put.js";
import Get from "../../api/model/account/get.js";
import format from "../../util/format.js";
import formatMoney from "../../util/format-money.js";
import i18next from "i18next";
-import {addDrag} from "../shared/drag-and-droppable-rows.js";
-import {sortableTable, storeFilterAndSort, updateHistory} from "../shared/sortable-tables.js";
+import { addDrag } from "../shared/drag-and-droppable-rows.js";
+import { sortableTable, storeFilterAndSort, updateHistory } from "../shared/sortable-tables.js";
window.enableDates = true;
@@ -55,8 +55,8 @@ let index = function () {
formatMoney: formatMoney,
// default settings for sorting
- defaultSortColumn: 'order',
- defaultSortDirection: 'asc',
+ defaultSortColumn: "order",
+ defaultSortDirection: "asc",
// variables necessary for sorting tables.
handleFunc: null,
@@ -73,7 +73,6 @@ let index = function () {
sortableTable: null,
init() {
-
// prepare some variables:
const address = window.location.href.split("?")[0].split("/");
this.objectType = address[address.length - 1].substring(0, 15);
@@ -81,7 +80,8 @@ let index = function () {
this.anonymous = window.store.get("anonymous");
this.storageKey = "accounts-" + this.objectType + (this.active ? "-active" : "-inactive");
this.pageNavUrl = "./accounts/" + this.objectType;
- this.defaultSortColumn = "expense" === this.objectType || "revenue" === this.objectType ? "name" : this.defaultSortColumn;
+ this.defaultSortColumn =
+ "expense" === this.objectType || "revenue" === this.objectType ? "name" : this.defaultSortColumn;
this.active = "inactive-accounts" !== address[address.length - 2];
// grab state from localStorage.
@@ -97,14 +97,13 @@ let index = function () {
const params = new Proxy(new URLSearchParams(window.location.search), {
get: (searchParams, prop) => searchParams.get(prop),
});
- this.page = parseInt(params.page || '1');
+ this.page = parseInt(params.page || "1");
this.defaultSortColumn = params.column ?? this.defaultSortColumn;
this.defaultSortDirection = params.direction ?? this.defaultSortDirection;
// console.log('Restore from params:', {page: this.page, column: this.defaultSortColumn, direction: this.defaultSortDirection});
-
- this.sortableTable = new sortableTable('main');
+ this.sortableTable = new sortableTable("main");
this.sortableTable.sortColumn = this.defaultSortColumn;
this.sortableTable.storageKey = this.storageKey;
this.sortableTable.sortDirection = this.defaultSortDirection;
@@ -113,8 +112,8 @@ let index = function () {
this.sortableTable.init(this);
// watch for changes in the sortable table instructions.
- document.addEventListener('sortable-table-sort-change', (event) => {
- console.log('sortable-table-sort-change', event.detail);
+ document.addEventListener("sortable-table-sort-change", (event) => {
+ console.log("sortable-table-sort-change", event.detail);
this.sortColumn = event.detail.sortColumn;
this.sortDirection = event.detail.sortDirection;
this.updateHistory(this.page, this.sortColumn, this.sortDirection, this.filter);
@@ -133,10 +132,12 @@ let index = function () {
let item = e.detail[i];
if (item.order !== item.currentOrder) {
// PUT new order to system.
- new Put().put({order: item.order}, {id: item.id});
+ new Put().put({ order: item.order }, { id: item.id });
// save new order as current order in the row.
- document.querySelector(`tr[data-id="${item.id}"]`).setAttribute("data-current-order", item.order);
+ document
+ .querySelector(`tr[data-id="${item.id}"]`)
+ .setAttribute("data-current-order", item.order);
}
}
}
@@ -178,7 +179,7 @@ let index = function () {
let start = window.store.get("start");
let end = window.store.get("end");
this.convertToPrimary = window.store.get("convert_to_primary");
- console.log('Download accounts using', JSON.parse(JSON.stringify(this.filter)));
+ console.log("Download accounts using", JSON.parse(JSON.stringify(this.filter)));
new Get()
.list({
active: this.active,
@@ -256,14 +257,22 @@ let index = function () {
pc_current_debt_float: current.attributes.pc_debt_amount_float,
liability_type: i18next.t("firefly.account_type_" + current.attributes.liability_type),
- liability_direction: i18next.t("firefly.liability_direction_" + current.attributes.liability_direction + "_short",),
+ liability_direction: i18next.t(
+ "firefly.liability_direction_" + current.attributes.liability_direction + "_short",
+ ),
liability_interest: current.attributes.interest,
- liability_interest_period: i18next.t("firefly.interest_calc_" + current.attributes.interest_period).toLowerCase(),
+ liability_interest_period: i18next
+ .t("firefly.interest_calc_" + current.attributes.interest_period)
+ .toLowerCase(),
};
this.accounts.push(account);
}
}
- console.log('Done downloading accounts.', JSON.parse(JSON.stringify(this.filter)), this.accounts.length);
+ console.log(
+ "Done downloading accounts.",
+ JSON.parse(JSON.stringify(this.filter)),
+ this.accounts.length,
+ );
this.loadingPage = false;
this.loadingNewSort = false;
this.sortableTable.disableRefresh = false;
@@ -286,7 +295,7 @@ let index = function () {
}
return format(
new Date(date),
- i18next.t("config.date_time_fns_short", {lng: window.store.get("locale")}),
+ i18next.t("config.date_time_fns_short", { lng: window.store.get("locale") }),
window.store.get("locale"),
);
},
diff --git a/resources/assets/v3/js/pages/exchange-rates/rates.js b/resources/assets/v3/js/pages/exchange-rates/rates.js
index 92b97bafa3..0fa0bcd060 100644
--- a/resources/assets/v3/js/pages/exchange-rates/rates.js
+++ b/resources/assets/v3/js/pages/exchange-rates/rates.js
@@ -257,7 +257,9 @@ let rates = function () {
inverse_id: inverse_id,
date_formatted: format(
date,
- i18next.t("config.date_time_fns", { lng: window.store.get("locale") }), window.store.get("locale"),),
+ i18next.t("config.date_time_fns", { lng: window.store.get("locale") }),
+ window.store.get("locale"),
+ ),
date_field: current.attributes.date.substring(0, 10),
rate: rate,
inverse: "",
diff --git a/resources/assets/v3/js/pages/shared/sortable-tables.js b/resources/assets/v3/js/pages/shared/sortable-tables.js
index ded4bfe14f..eefcc2d194 100644
--- a/resources/assets/v3/js/pages/shared/sortable-tables.js
+++ b/resources/assets/v3/js/pages/shared/sortable-tables.js
@@ -19,10 +19,10 @@
*/
export class sortableTable {
- tableId = '';
- sortColumn = 'order';
- sortDirection = 'asc';
- storageKey = '';
+ tableId = "";
+ sortColumn = "order";
+ sortDirection = "asc";
+ storageKey = "";
disableRefresh = false;
parent = null;
@@ -48,7 +48,7 @@ export class sortableTable {
// add a watch for sortColumn, sortDirection and page
// parent.$watch('sortColumn', (newValue, oldValue) => {
// console.log('sortColumn changed from "' + oldValue + '" to "' + newValue + '"');
- // this.updateHeaderClasses();
+ // this.updateHeaderClasses();
// });
// parent.$watch('sortDirection', (newValue, oldValue) => {
@@ -58,44 +58,48 @@ export class sortableTable {
// console.log('page changed from "' + oldValue + '" to "' + newValue + '"');
// });
// loop all filtered columns and watch those values.
- document.querySelectorAll('table[data-sort-identifier="' + this.tableId + '"] thead th[data-filter-column]').forEach((th) => {
- let column = th.getAttribute('data-filter-column');
- console.log('[class] Will watch filter for column "' + column + '"');
-
- // also grab current filter value from store AND from url and push back to the parent whichever is set.
- const key = 'filter[' + column + ']';
- let urlValue = params[key] ?? null;
- let fromStore = window.store.get(this.storageKey);
- let storeValue = fromStore ? fromStore.filter[column] ?? null : null;
- let valueToUse = null !== urlValue ? urlValue : storeValue;
-
- parent.$watch('filter.' + column, (newValue, oldValue) => {
- // parent.filter[column] = newValue;
- console.log('filter for column "' + column + '" changed from "' + oldValue + '" to "' + newValue + '"');
- this.fireSortChangeEvent();
- if('' !== newValue) {
- showSearchBox(th);
+ document
+ .querySelectorAll('table[data-sort-identifier="' + this.tableId + '"] thead th[data-filter-column]')
+ .forEach((th) => {
+ let column = th.getAttribute("data-filter-column");
+ console.log('[class] Will watch filter for column "' + column + '"');
+
+ // also grab current filter value from store AND from url and push back to the parent whichever is set.
+ const key = "filter[" + column + "]";
+ let urlValue = params[key] ?? null;
+ let fromStore = window.store.get(this.storageKey);
+ let storeValue = fromStore ? (fromStore.filter[column] ?? null) : null;
+ let valueToUse = null !== urlValue ? urlValue : storeValue;
+
+ parent.$watch("filter." + column, (newValue, oldValue) => {
+ // parent.filter[column] = newValue;
+ console.log(
+ 'filter for column "' + column + '" changed from "' + oldValue + '" to "' + newValue + '"',
+ );
+ this.fireSortChangeEvent();
+ if ("" !== newValue) {
+ showSearchBox(th);
+ }
+ });
+
+ if (null !== valueToUse && "" !== valueToUse) {
+ // console.log('DISABLE refresh');
+ this.disableRefresh = true;
+ parent.isFiltering = true;
+ // console.log('Setting initial filter value for column "' + column + '" to "' + valueToUse + '"');
+ parent.filter[column] = valueToUse;
+ // make sure the button is visible.
+ setTimeout(() => {
+ showSearchBox(th);
+ }, 50);
}
});
-
- if (null !== valueToUse && '' !== valueToUse) {
- // console.log('DISABLE refresh');
- this.disableRefresh = true;
- parent.isFiltering = true;
- // console.log('Setting initial filter value for column "' + column + '" to "' + valueToUse + '"');
- parent.filter[column] = valueToUse;
- // make sure the button is visible.
- setTimeout(() => {
- showSearchBox(th);
- },50);
- }
- });
}
clickColumnTitle(event) {
let parent = event.currentTarget.parentNode;
let newColumn = parent.dataset.sortColumn;
- this.sortDirection = typeof this.sortDirection !== 'undefined' ? this.sortDirection : 'asc';
+ this.sortDirection = typeof this.sortDirection !== "undefined" ? this.sortDirection : "asc";
if (newColumn === this.sortColumn) {
this.sortDirection = "asc" === this.sortDirection ? "desc" : "asc";
}
@@ -114,16 +118,16 @@ export class sortableTable {
sortColumn: this.sortColumn,
sortDirection: this.sortDirection,
};
- console.log('Change sort instructions', obj);
- let event = new CustomEvent('sortable-table-sort-change', {
- detail: obj
+ console.log("Change sort instructions", obj);
+ let event = new CustomEvent("sortable-table-sort-change", {
+ detail: obj,
});
- if(!this.disableRefresh) {
- console.log('Fire event!');
+ if (!this.disableRefresh) {
+ console.log("Fire event!");
document.dispatchEvent(event);
}
- if(this.disableRefresh) {
- console.log('Do NOT fire event!');
+ if (this.disableRefresh) {
+ console.log("Do NOT fire event!");
this.disableRefresh = false;
}
}
@@ -131,72 +135,80 @@ export class sortableTable {
clickCloseButton(event) {
let th = event.currentTarget.parentNode.parentNode.parentNode;
let column = th.dataset.filterColumn;
- console.log('close search box for ', column);
- th.querySelector('.search-filter').classList.add('d-none');
- th.querySelector('.title').classList.remove('d-none');
- th.querySelector('span.search-spacer').classList.remove("d-none");
- th.querySelector('.search-button').classList.remove('d-none');
+ console.log("close search box for ", column);
+ th.querySelector(".search-filter").classList.add("d-none");
+ th.querySelector(".title").classList.remove("d-none");
+ th.querySelector("span.search-spacer").classList.remove("d-none");
+ th.querySelector(".search-button").classList.remove("d-none");
// console.log(th.querySelector('.form-control').value);
- th.querySelector('.form-control').value = '';
- this.parent.filter[column] = '';
+ th.querySelector(".form-control").value = "";
+ this.parent.filter[column] = "";
this.fireSortChangeEvent();
}
addClickEvents() {
// add sortable click events.
- document.querySelectorAll('table[data-sort-identifier="' + this.tableId + '"] th[data-sort-column] span.title').forEach((el) => {
- el.addEventListener("click", this.clickColumnTitle.bind(this));
- });
+ document
+ .querySelectorAll('table[data-sort-identifier="' + this.tableId + '"] th[data-sort-column] span.title')
+ .forEach((el) => {
+ el.addEventListener("click", this.clickColumnTitle.bind(this));
+ });
// create search buttons and inputs.
- document.querySelectorAll('table[data-sort-identifier="' + this.tableId + '"] th[data-filter-column]').forEach(function(el) {
- this.createSearchBox(el);
- }.bind(this));
-
- document.querySelectorAll('table[data-sort-identifier="' + this.tableId + '"] th[data-filter-column] .search-button').forEach((el) => {
- el.addEventListener("click", () => {
- const th = el.parentNode.parentNode;
- showSearchBox(th);
+ document.querySelectorAll('table[data-sort-identifier="' + this.tableId + '"] th[data-filter-column]').forEach(
+ function (el) {
+ this.createSearchBox(el);
+ }.bind(this),
+ );
+
+ document
+ .querySelectorAll(
+ 'table[data-sort-identifier="' + this.tableId + '"] th[data-filter-column] .search-button',
+ )
+ .forEach((el) => {
+ el.addEventListener("click", () => {
+ const th = el.parentNode.parentNode;
+ showSearchBox(th);
+ });
});
- });
}
createSearchBox(th) {
//console.log('createSearchBox', th);
let column = th.dataset.filterColumn;
// create filter inset.
- let inset = document.createElement('span');
- inset.classList.add('search-inset');
+ let inset = document.createElement("span");
+ inset.classList.add("search-inset");
// add spacer
- let searchSpacer = document.createElement('span');
- searchSpacer.classList.add('search-spacer');
- searchSpacer.innerHTML = ' ';
+ let searchSpacer = document.createElement("span");
+ searchSpacer.classList.add("search-spacer");
+ searchSpacer.innerHTML = " ";
inset.appendChild(searchSpacer);
// make button.
- let searchButton = document.createElement('em');
- searchButton.classList.add('search-button', 'bi', 'bi-search');
- searchButton.setAttribute('data-filter-column', column);
+ let searchButton = document.createElement("em");
+ searchButton.classList.add("search-button", "bi", "bi-search");
+ searchButton.setAttribute("data-filter-column", column);
inset.appendChild(searchButton);
// add hidden div
- let div = document.createElement('div');
- div.classList.add('d-none', 'input-group', 'search-filter');
+ let div = document.createElement("div");
+ div.classList.add("d-none", "input-group", "search-filter");
// append input to div.
- let input = document.createElement('input');
- input.classList.add('form-control', 'form-control-sm');
- input.setAttribute('type', 'search');
- input.setAttribute('placeholder', 'TODO placeholder');
- input.setAttribute('x-model', 'filter.' + column);
+ let input = document.createElement("input");
+ input.classList.add("form-control", "form-control-sm");
+ input.setAttribute("type", "search");
+ input.setAttribute("placeholder", "TODO placeholder");
+ input.setAttribute("x-model", "filter." + column);
div.appendChild(input);
// create button
- let button = document.createElement('button');
- button.classList.add('btn', 'btn-outline-secondary', 'btn-sm', 'hide-button');
- button.setAttribute('type', 'button');
- button.addEventListener('click', this.clickCloseButton.bind(this));
- let icon = document.createElement('em');
- icon.classList.add('bi', 'bi-x', 'text-danger');
+ let button = document.createElement("button");
+ button.classList.add("btn", "btn-outline-secondary", "btn-sm", "hide-button");
+ button.setAttribute("type", "button");
+ button.addEventListener("click", this.clickCloseButton.bind(this));
+ let icon = document.createElement("em");
+ icon.classList.add("bi", "bi-x", "text-danger");
// append icon to button
button.appendChild(icon);
// add button to div
@@ -207,54 +219,53 @@ export class sortableTable {
th.appendChild(inset);
}
-
updateHeaderClasses() {
// console.log('updateHeaderClasses()', this.sortColumn, this.sortDirection);
- document.querySelectorAll('table[data-sort-identifier="' + this.tableId + '"] thead th[data-sort-column]').forEach((th) => {
- // console.log(th);
- if (this.sortColumn === th.dataset.sortColumn) {
- // th.classList.add('sortable');
- th.classList.add('sortable_sorted');
- if ('asc' === this.sortDirection) {
- th.classList.add('sortable_sorted_asc');
- th.classList.remove('sortable_sorted_desc');
+ document
+ .querySelectorAll('table[data-sort-identifier="' + this.tableId + '"] thead th[data-sort-column]')
+ .forEach((th) => {
+ // console.log(th);
+ if (this.sortColumn === th.dataset.sortColumn) {
+ // th.classList.add('sortable');
+ th.classList.add("sortable_sorted");
+ if ("asc" === this.sortDirection) {
+ th.classList.add("sortable_sorted_asc");
+ th.classList.remove("sortable_sorted_desc");
+ }
+ if ("desc" === this.sortDirection) {
+ th.classList.add("sortable_sorted_desc");
+ th.classList.remove("sortable_sorted_asc");
+ }
}
- if ('desc' === this.sortDirection) {
- th.classList.add('sortable_sorted_desc');
- th.classList.remove('sortable_sorted_asc');
+ if (this.sortColumn !== th.dataset.sortColumn) {
+ th.classList.remove("sortable_sorted_asc");
+ th.classList.remove("sortable_sorted_desc");
+ th.classList.remove("sortable_sorted");
}
- }
- if (this.sortColumn !== th.dataset.sortColumn) {
- th.classList.remove('sortable_sorted_asc');
- th.classList.remove('sortable_sorted_desc');
- th.classList.remove('sortable_sorted');
- }
- });
+ });
}
}
function showSearchBox(th) {
// let column = th.dataset.filterColumn;
// hide search buttons etc.
- console.log('search button?',th.querySelector('.search-button'));
- th.querySelector('.search-button').classList.add("d-none");
- th.querySelector('span.title').classList.add("d-none");
- th.querySelector('span.search-spacer').classList.add("d-none");
+ console.log("search button?", th.querySelector(".search-button"));
+ th.querySelector(".search-button").classList.add("d-none");
+ th.querySelector("span.title").classList.add("d-none");
+ th.querySelector("span.search-spacer").classList.add("d-none");
// add class to parent if it's used to sort
// if th has class sortable_sorted, add class is-searching
- if (th.classList.contains('sortable_sorted')) {
+ if (th.classList.contains("sortable_sorted")) {
th.classList.add("is-searching");
}
// show search input in div.search-filter
- let input = th.querySelector('div.search-filter');
+ let input = th.querySelector("div.search-filter");
input.classList.remove("d-none");
input.querySelector("input").focus();
}
-
-
function objectToQueryString(obj, prefix) {
if (null === obj) {
return "";
@@ -283,14 +294,14 @@ export function updateHistory(page, column, direction, filter) {
direction: direction,
filter: JSON.parse(JSON.stringify(filter)),
};
- if(filter.length > 0) {
+ if (filter.length > 0) {
this.isFiltering = true;
this.loadingPage = true;
}
let string = objectToQueryString(obj);
- console.log('Update history', string);
+ console.log("Update history", string);
let newUrl = window.location.protocol + "//" + window.location.host + window.location.pathname + "?" + string;
- window.history.pushState({path: newUrl}, "", newUrl);
+ window.history.pushState({ path: newUrl }, "", newUrl);
}
}
@@ -300,7 +311,6 @@ export function storeFilterAndSort(storageKey, column, direction, filter) {
direction: direction,
filter: JSON.parse(JSON.stringify(filter)),
};
- console.log('storeFilterAndSort', storageKey, obj);
+ console.log("storeFilterAndSort", storageKey, obj);
window.store.set(storageKey, obj);
-
}
diff --git a/resources/assets/v3/js/pages/transactions/shared/changed-amount.js b/resources/assets/v3/js/pages/transactions/shared/changed-amount.js
index 41b4b1e5d6..567b89b12f 100644
--- a/resources/assets/v3/js/pages/transactions/shared/changed-amount.js
+++ b/resources/assets/v3/js/pages/transactions/shared/changed-amount.js
@@ -22,7 +22,7 @@ export function changedAmount(e) {
if (null !== e) {
let index = parseInt(e.target.dataset.index);
let value = e.target.value;
- if('-' === value.charAt(0)) {
+ if ("-" === value.charAt(0)) {
value = value.substring(1);
}
// switch commas for dots.
diff --git a/resources/assets/v3/js/pages/transactions/shared/changed-foreign-amount.js b/resources/assets/v3/js/pages/transactions/shared/changed-foreign-amount.js
index ce7bece9bc..fc41366556 100644
--- a/resources/assets/v3/js/pages/transactions/shared/changed-foreign-amount.js
+++ b/resources/assets/v3/js/pages/transactions/shared/changed-foreign-amount.js
@@ -22,7 +22,7 @@ export function changedForeignAmount(e) {
if (null !== e) {
let index = parseInt(e.target.dataset.index);
let value = e.target.value;
- if('-' === value.charAt(0)) {
+ if ("-" === value.charAt(0)) {
value = value.substring(1);
}
// switch commas for dots.
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 702539fd63..578e40d102 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
@@ -55,7 +55,8 @@ export function disableSplitInputs() {
"withdrawal" === this.groupProperties.transactionType
) {
console.log("Prefill destination account #", i, this.entries[i].destination_account);
- this.entries[i].destination_account = JSON.parse(JSON.stringify(this.entries[i - 1].destination_account),
+ this.entries[i].destination_account = JSON.parse(
+ JSON.stringify(this.entries[i - 1].destination_account),
); //structuredClone();
}
diff --git a/resources/assets/v3/js/pages/transactions/show.js b/resources/assets/v3/js/pages/transactions/show.js
index 2aa9cfed34..610f748c49 100644
--- a/resources/assets/v3/js/pages/transactions/show.js
+++ b/resources/assets/v3/js/pages/transactions/show.js
@@ -91,7 +91,8 @@ let show = function () {
current.dateObject = new Date(current.date);
current.dateFormatted = format(
current.dateObject,
- i18next.t("config.date_time_fns", { lng: locale }), locale,
+ i18next.t("config.date_time_fns", { lng: locale }),
+ locale,
);
console.log("Date formatted is", current.dateFormatted);
this.group.transactions.push(current);