Compare commits

..

11 Commits

Author SHA1 Message Date
github-actions[bot]
f91063c88b Merge pull request #12184 from firefly-iii/release-1777100403
🤖 Automatically merge the PR into the develop branch.
2026-04-25 09:00:10 +02:00
JC5
30c1f4c13d 🤖 Auto commit for release 'develop' on 2026-04-25 2026-04-25 09:00:03 +02:00
James Cole
39be5075eb Clean up JS scripts. 2026-04-25 08:54:28 +02:00
James Cole
714133dad5 Merge pull request #12182 from tasnim0tantawi/bug/fix-sidebar-expanding-when-navigating
fix shrinked sidebar expanding when navigating by clicking on icons
2026-04-25 08:45:47 +02:00
James Cole
1caf639b85 Move to jQuery func 2026-04-25 08:45:20 +02:00
tasnim0tantawi
1ebff22785 fix delay 2026-04-24 22:42:22 +03:00
tasnim0tantawi
8b14a11969 lines 2026-04-24 22:28:06 +03:00
tasnim0tantawi
7b0e40543b all code in firefly js 2026-04-24 22:26:38 +03:00
tasnim0tantawi
ea57a0a8c8 remove code from default twig 2026-04-24 21:49:37 +03:00
tasnim0tantawi
62ee37f631 implement collapse save in v1 2026-04-24 21:17:19 +03:00
tasnim0tantawi
c96cc8d941 fix shrinked sidebar expanding when navigating by clicking on icons 2026-04-24 21:01:03 +03:00
13 changed files with 77 additions and 26 deletions

View File

@@ -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'];
}
}

View File

@@ -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
}
}

View File

@@ -255,7 +255,10 @@ final class IndexController extends Controller
if (count($bill['paid_dates']) < count($bill['pay_dates'])) {
$count = count($bill['pay_dates']) - count($bill['paid_dates']);
if ($count > 0) {
$avg = bcdiv(bcadd((string) $bill['amount_min'], (string) $bill['amount_max']), '2');
$avg = bcdiv(
bcadd((string) $bill['amount_min'], (string) $bill['amount_max']),
'2'
);
$avg = bcmul($avg, (string) $count);
$sums[$groupOrder][$currencyId]['total_left_to_pay'] = bcadd($sums[$groupOrder][$currencyId]['total_left_to_pay'], $avg);
Log::debug(

View File

@@ -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']);

View File

@@ -245,13 +245,7 @@ final class IndexController extends Controller
$inPast = $limitPeriod->startsBefore(now()) && $limitPeriod->endsBefore(now());
$currency = $limit->transactionCurrency ?? $primaryCurrency;
$amount = Steam::bcround($limit->amount, $currency->decimal_places);
$spent = $this->opsRepository->sumExpenses(
$limit->start_date,
$limit->end_date,
null,
new Collection()->push($budget),
$currency
);
$spent = $this->opsRepository->sumExpenses($limit->start_date, $limit->end_date, null, new Collection()->push($budget), $currency);
$spentAmount = $spent[$currency->id]['sum'] ?? '0';
$array['budgeted'][] = [
'id' => $limit->id,
@@ -289,7 +283,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'] = bcmul(bcsub($spentInLimits[$currency->id], $spentArr[$currency->id]['sum']), '-1');
$array['spent'][$currency->id]['spent_outside'] = bcmul(
bcsub($spentInLimits[$currency->id], $spentArr[$currency->id]['sum']),
'-1'
);
$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;

View File

@@ -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);

View File

@@ -122,7 +122,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));
@@ -212,7 +218,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));

View File

@@ -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;

View File

@@ -354,7 +354,10 @@ 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;

View File

@@ -79,7 +79,7 @@ return [
// see cer.php for exchange rates feature flag.
],
'version' => 'develop/2026-04-25',
'build_time' => 1777088715,
'build_time' => 1777100403,
'api_version' => '2.1.0', // field is no longer used.
'db_version' => 28, // field is no longer used.

View File

@@ -18,7 +18,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
(function () {
$(function () {
"use strict";
const form = document.querySelector('form[action="'+route+'"]');
const errorBox = document.getElementById('client-errors');
const errorList = document.getElementById('client-errors-list');

View File

@@ -38,9 +38,9 @@ function parseToLocalDates() {
var obj = moment.utc(date).local();
console.log('auto convert to timezone is: "' + obj.format() + '"');
console.log('moment.js format is: "'+date_time_js+'"');
console.log('moment.js format is: "' + date_time_js + '"');
$(this).text(obj.format(date_time_js) + ' ('+ timeZone +')');
$(this).text(obj.format(date_time_js) + ' (' + timeZone + ')');
});
}
@@ -50,19 +50,25 @@ $(function () {
configAccounting(currencySymbol);
// on submit of logout button:
$('.logout-link').click(function(e) {
$('.logout-link').click(function (e) {
e.preventDefault();
document.getElementById('logout-form').submit();
return false;
});
// save sidebar collapsed state when page loads.
$('[data-toggle="push-menu"]').click(function () {
localStorage.setItem('ff3_sidebar_collapsed', (!$('body').hasClass('sidebar-collapse')).toString());
});
// on submit of form, disable any button in form:
$('form.form-horizontal:not(.nodisablebutton)').on('submit', function () {
$('button[type="submit"]').prop('disabled', true);
});
// when you click on a currency, this happens:
$('.currency-option').on('click', currencySelect);

View File

@@ -86,14 +86,18 @@
<script src="v1/js/lib/respond.min.js?v={{ FF_BUILD_TIME }}" nonce="{{ JS_NONCE }}"></script>
<![endif]-->
{# this entry is in the header so it's loaded early #}
<script type="text/javascript" nonce="{{ JS_NONCE }}">var forceDemoOff = false;</script>
{# favicons #}
{% include 'partials.favicons' %}
</head>
<body class="skin-firefly-iii sidebar-mini hold-transition">
{# this entry is in the header so it's loaded early #}
<script type="text/javascript" nonce="{{ JS_NONCE }}">
var forceDemoOff = false;
if ('true' === localStorage.getItem('ff3_sidebar_collapsed')) {
document.body.classList.add('sidebar-collapse');
}
</script>
<div class="wrapper" id="app">
<header class="main-header">