feat(invoices): surface monthly/manual accumulator drafts in the Bills list

Manual/monthly-cadence customers accumulate logged hours into one running
draft invoice (is_monthly_draft, migration 128). That draft gets a real
invoice number and stamps the hours ("Billed: R-2026-0026"), but listInvoices
hid is_monthly_draft rows from the main list — so the invoice looked lost even
though it existed on the customer's monthly-queue card. It also carried status
'scheduled' despite never auto-sending on manual cadence, reading misleadingly
as "Scheduled".

- Bills list now opts into drafts via a new `includeDrafts` query param
  (GET /admin/invoices → listInvoices includeMonthlyDrafts). Pickers/sub-lists
  that reuse billsService.list leave it off, so they're unaffected.
- Draft rows render a distinct "Draft" badge instead of "Scheduled"
  (transformInvoice already exposes isMonthlyDraft).
- The hours "Billed: R-…" chip now links straight to its invoice.
- i18n: bills.status.draft (de "Entwurf", en "Draft").
This commit is contained in:
Luca
2026-06-29 19:39:40 +02:00
parent b9d91385b4
commit e457656b9d
6 changed files with 52 additions and 14 deletions
+8
View File
@@ -92,6 +92,10 @@ export interface InvoiceSummary {
* (migration 111). Hide line-item editing on these rows; the
* uploaded PDF is the source of truth. */
isImported?: boolean;
/** True for the running monthly/manual accumulator draft
* (migration 128). Carries status 'scheduled' but never auto-sends
* (manual) — shown with a "Draft" badge in the list. */
isMonthlyDraft?: boolean;
}
export interface InvoiceDetail extends InvoiceSummary {
@@ -225,6 +229,10 @@ export const billsService = {
sort?: InvoiceSort;
page?: number;
pageSize?: number;
/** Include the running monthly/manual accumulator drafts that the
* main list hides by default (migration 128). Only the Bills list
* opts in; pickers/sub-lists leave it off. */
includeDrafts?: boolean;
} = {}): Promise<InvoiceListResponse> {
const { data } = await api.get('/admin/invoices', {
params: {