feat(budgets): top line per currency, sorting places into budgets, projections

Budgets show budgeted, left, spent and spent without a budget per
currency, safe per day and where the month ends. t sorts expenses
without a budget by place, 1 to 9 move a whole place into a budget, u
undoes, and the editor and quick entry remember the place. A suggests
empty amounts from three months. Categories get the same sorting.
This commit is contained in:
hh committed 2026-10-16 15:13:35 +00:00
1 parent 68f64893f7
commit cea51281cd
12 files changed
+1535 -214

No files matched your search

@@ -7,6 +7,14 @@ export function periodPath(base: string, start: string, end: string) {
return `${base}/${start}/${end}?start=${start}&end=${end}`;
}
export function keptParams() {
const params = new URLSearchParams(page.url.search);
params.delete("start");
params.delete("end");
const rest = params.toString();
return rest ? `&${rest}` : "";
}
export function usePeriodPath(base: () => string) {
$effect(() => {
const { start, end } = page.params;
@@ -25,7 +33,9 @@ export function usePeriodPath(base: () => string) {
const target = base();
setTimeout(() => {
if (page.url.pathname.startsWith(`${target}/${from}`)) {
goto(periodPath(target, start, end), { replace: true });
goto(`${periodPath(target, start, end)}${keptParams()}`, {
replace: true,
});
}
});
}