feat: support unassigned purchases and allocation status
Allow month-only purchases to start finance plans. Keep unbudgeted posts distinct from explicit zero rules in overspend reporting.
This commit is contained in:
1 parent
c1446db39f
commit
b0e8145d2e
31 files changed
+469
-80
No files matched your search
@@ -39,6 +39,26 @@ export function SplitEditor({ draft, posts, onChange }: Props) {
|
||||
|
||||
return (
|
||||
<fieldset className="space-y-3">
|
||||
<label className="flex items-center gap-2 text-sm">
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={draft.splits.length === 0}
|
||||
onChange={(event) =>
|
||||
onChange({
|
||||
...draft,
|
||||
splits: event.target.checked
|
||||
? []
|
||||
: posts[0]
|
||||
? [{ postId: posts[0].id, value: 100, absorbsRemainder: true }]
|
||||
: [],
|
||||
})
|
||||
}
|
||||
disabled={posts.length === 0 && draft.splits.length === 0}
|
||||
/>
|
||||
No post — leave this purchase unassigned
|
||||
</label>
|
||||
{draft.splits.length > 0 && (
|
||||
<>
|
||||
<div className="flex items-center justify-between">
|
||||
<Label>Split across posts</Label>
|
||||
<Segmented
|
||||
@@ -136,6 +156,8 @@ export function SplitEditor({ draft, posts, onChange }: Props) {
|
||||
: `${fmt.amount(balance)} ${unit} unassigned — the rounding post absorbs it.`}
|
||||
</span>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</fieldset>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user