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:
1 parent
68f64893f7
commit
cea51281cd
12 files changed
+1535
-214
No files matched your search
@@ -13,6 +13,7 @@
|
||||
budgetId,
|
||||
range,
|
||||
editing,
|
||||
suggested = null,
|
||||
trap = true,
|
||||
onedit,
|
||||
ondone,
|
||||
@@ -21,6 +22,7 @@
|
||||
budgetId: string;
|
||||
range: Range;
|
||||
editing: boolean;
|
||||
suggested?: number | null;
|
||||
trap?: boolean;
|
||||
onedit: () => void;
|
||||
ondone: (move: Move) => void;
|
||||
@@ -33,7 +35,7 @@
|
||||
$effect(() => {
|
||||
if (editing) {
|
||||
untrack(() => {
|
||||
value = line.amount ? String(line.amount) : "";
|
||||
value = String(line.amount || suggested || "");
|
||||
problem = "";
|
||||
});
|
||||
}
|
||||
@@ -123,6 +125,20 @@
|
||||
{@attach focus}
|
||||
>
|
||||
</span>
|
||||
{:else if suggested && line.amount === null}
|
||||
<button
|
||||
class="num border-brand border-b border-dashed font-semibold leading-tight text-brand"
|
||||
onclick={onedit}
|
||||
title="Suggested from the last 3 months (e to change)"
|
||||
type="button"
|
||||
>
|
||||
<span class="font-normal text-[11px]">suggested</span>
|
||||
{formatMoney({
|
||||
amount: suggested,
|
||||
decimals: line.cur.decimals,
|
||||
symbol: line.cur.symbol,
|
||||
})}
|
||||
</button>
|
||||
{:else}
|
||||
<button
|
||||
class="num border-cladd-fg-softest border-b border-dashed leading-tight hover:border-brand hover:text-brand {line.amount
|
||||
|
||||
Reference in new issue
Block a user