mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-15 01:41:08 +02:00
Full draft → sent → paid flow with the supporting surface: Data layer - totals.ts: pure computeLineTotal / computeInvoiceTotals (testable without Dexie); per-line rounding then per-rate summing so the breakdown equals the sum-of-lines exactly - queries.ts: useAllInvoices (live, overdue derived on read), useInvoiceClients, computeStats per currency, formatAmount - stores/settings.svelte.ts: singleton with stable sentinel id, ensureSettings() lazy-creates, takeNextNumber() atomic via Dexie rw-transaction (plaintext-only fields → no crypto breaks the tx) - stores/invoices.svelte.ts: create / update / updateLines (recomputes totals) / markSent / markPaid / void / duplicate / soft-delete; drafts only editable, paid can't be voided, sent/paid can't be deleted Components - StatusBadge, LinesEditor (add/remove/reorder, live per-line totals, minor-unit conversion on type), ClientPicker (contacts + invoice client book, manual entry fallback, snapshot binding), SenderProfileForm (sender + sequence + defaults), InvoiceForm (create + edit with live totals + VAT breakdown) Views & routes - DetailView with full action bar (edit/duplicate/mark sent/mark paid/ void/delete), lines table, per-rate totals block - ListView rewritten: status chips with counts, stats cards (open/overdue/YTD fakturiert/YTD bezahlt) scoped to primary currency, search, row-click to detail - routes: /invoices/new, /invoices/[id], /invoices/[id]/edit (with edit-lock for non-drafts), /invoices/settings Design notes addressed - Number sequence atomicity: rw-transaction around plaintext fields guards same-device race; cross-device offline collision documented in settings store header as a known gap, acceptable for solo-MVP - Edit-after-send: drafts only are editable; to revise a sent invoice, void and duplicate (keeps bookkeeping evidence intact) Plan: docs/plans/invoices-module.md §M2. Next: M3 pdf-lib renderer + M5 swissqrbill. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| api | ||
| calc/packages/shared | ||
| calendar | ||
| cards | ||
| chat | ||
| citycorners | ||
| contacts | ||
| context | ||
| docs | ||
| food | ||
| guides | ||
| inventory | ||
| mana | ||
| manavoxel | ||
| memoro | ||
| moodlit | ||
| mukke | ||
| news | ||
| photos | ||
| picture | ||
| plants | ||
| presi | ||
| questions | ||
| quotes/packages/content | ||
| skilltree | ||
| storage | ||
| times | ||
| todo | ||
| traces | ||
| uload | ||