Delivery Notes | Cine Power Planner

Delivery Notes

Record what was actually delivered against an order confirmation or accepted quote — the German Lieferschein (LS), with a signature line for proof of delivery

Visibility (production): As of v0.223.8 the entire Accounting surface (sidebar entries, /accounting/* routes, Settings → Accounting tab) is gated to owner accounts in production. Dev / staging builds keep everything visible. This page documents the feature for owners and for the eventual general-availability release.

Overview

The Delivery Notes module lives at /accounting/delivery-notes and is the third document in the German chain:

Angebot (Quote) → Auftragsbestätigung (AB) → Lieferschein (LS) → Rechnung (Invoice).

A Lieferschein accompanies the goods or the service handover and lists what was actually delivered — which can differ from what was ordered when there are substitutions or partial deliveries. It carries a signature line so the recipient can sign on receipt as proof of delivery. For rental houses it doubles as the round-trip sheet: issued on pickup, closed on return. A delivery note does not bill — there are no prices or totals on it.

You reach it from the sidebar under Accounting → Delivery notes.

This is not the sub-rental delivery note. The accounting Lieferschein documented here is a distinct document type. The gear-rental "Delivery Note" with Rental House / Renter checkboxes and condition check-in scratch sheets is a separate feature — see Sub-Rentals. The two are intentionally separate code paths and serve different workflows.

Delivery notes are local-first: creating and driving them works fully offline (auto-saved to IndexedDB, backed up to OPFS), syncing to your self-hosted Supabase when you reconnect. Only finalize — which allocates a gap-free LS number — needs connectivity.

Lifecycle

A delivery note follows a status machine with the states draft, pending, sent, delivered, returned, cancelled, and superseded. The shipped UI drives the happy path:

draft  ──finalize──▶  sent  ──mark delivered──▶  delivered  ──mark returned──▶  returned
(from AB or quote)    (LS number assigned)       (handed over)                  (rental round-trip closed)
  • draft — created from a source document; lives on your device until you finalize.
  • pending — transient internal state while finalize allocates the LS number.
  • sent — finalized: the LS-YYYY-NNNN number is assigned.
  • delivered — the goods were handed over (records the delivery timestamp).
  • returned — rental-house only: the gear came back; records the check-in timestamp and closes the round-trip.
  • cancelled / superseded — defined in the model (e.g. an LS replaced by a re-issue) but not yet driven by a one-click action (see Not yet available).

Each of Finalize, Mark delivered, and Mark returned is a one-way hop with no UI path back, so each is confirmed in a dialog before it runs. As with order confirmations, the client status machine is the authoritative gate — there is no server-side transition trigger (status lives inside the sync_entities JSON blob).

Creating a delivery note

A delivery note is always created from a source document — there is no blank-LS form. Two source paths are supported:

  1. From a finalized order confirmation (AB sent → LS draft), or
  2. directly from an accepted quote (the skip-AB path, when you don't track the AB step).

Steps:

  1. Open Delivery notes in the sidebar.
  2. In the Create from an order confirmation or quote card, pick a source from the dropdown — finalized (sent) ABs and accepted quotes both appear, each tagged so you can tell them apart. If you have neither yet, the card tells you so.
  3. Click Create LS. The app seeds the draft from the source: the customer snapshot, the line items (each with delivered quantity defaulted to the ordered quantity), and a sourceRef back to the AB or quote (its number prints on the PDF).

When the source is an accepted quote, the customer's acceptance selections (chosen alternatives + opted-in optionals) are applied first — the LS reflects what was actually ordered. If the quote still has unresolved optional/alternative lines, creation is blocked until you resolve the selection on the quote.

There is no separate editor screen for a delivery note — it is driven entirely from the list (finalize → deliver → return → download). The delivered quantities are inherited from the source; substitution notes are part of the document model and print on the PDF when present, but per-line editing of delivered quantities / substitutions is not exposed in the current UI (see Not yet available).

Finalizing — assigning the LS number

  1. On the list, click Finalize on a draft row.
  2. Confirm in the dialog ("This assigns a permanent, gap-free LS number and cannot be undone.").
  3. The app allocates the next number from your gap-free, year-resetting counter via an atomic Supabase RPC — format LS-YYYY-NNNN (e.g. LS-2026-0001). The year is derived server-side from Europe/Berlin time. The status advances draft → pending → sent.

Finalize needs connectivity (the counter is server-side); offline it surfaces an error. The prefix is fixed at LS (no settings page yet — see Not yet available).

Marking delivered & returned

Once finalized, two further actions appear on the row, each behind a confirmation dialog:

  • Mark delivered (sent → delivered) — records the handover. Stamps the delivery timestamp; the confirm dialog warns the action can't be undone.
  • Mark returned (delivered → returned) — the rental-house round-trip close. Stamps the check-in timestamp and marks the rental as complete. This step is meant for gear-hire workflows where the same LS tracks pickup and return.

The PDF

Download a delivery note's PDF with the action on any list row. A draft renders with "Entwurf" in place of the number; a finalized LS carries its LS-YYYY-NNNN number.

The document is generated client-side (pdfmake + bundled Ubuntu fonts) with your branding accent colour. If you have built an LS layout in the Document layout designer, that template renders; otherwise the built-in layout shows:

  • LIEFERSCHEIN banner + the LS number (or Entwurf).
  • Sender + customer address blocks.
  • A source-reference line — "Zur Auftragsbestätigung AB-…" or "Zum Angebot ANG-…".
  • A line-item table: Pos. / Beschreibung / Bestellt / Geliefert. The Geliefert (delivered) cell is highlighted when it diverges from Bestellt (ordered), and a substitution note prints under the description when one is set.
  • Your notes, when set.
  • A signature panel"Datum, Unterschrift Empfänger*in" — a blank line for the recipient to sign on receipt (offline signing).

There are no prices or totals (an LS doesn't bill) and no embedded e-invoice XML (no monetary settlement). The file is named after the LS number (e.g. ls-2026-0001.pdf).

The list view

  • Create card — the source picker described above.
  • Filter bar — a status filter + search (matches the LS number and customer name) with a live result count, shown once you have at least one note.
  • Table — columns LS#, Customer, Items (line count), Status, and per-row actions: Finalize (drafts), Mark delivered (sent), Mark returned (delivered), Download PDF. Drafts bubble to the top; finalized rows sort newest-first. A status badge colours each row (info = sent, success = delivered, error = returned/cancelled, muted = draft/superseded).
  • Empty states — a true-empty prompt to create one, and a filtered-empty prompt with a Clear filters action.
  • Mobile — below sm the table becomes a card stack with the same data and actions.

Storage, sync & privacy

  • Delivery notes are an array entity (deliveryNotes) on the standard persistence pipeline: IndexedDB (primary) → OPFS (backup) → Supabase (opt-in cloud sync), RLS-protected to the owner.
  • Concurrent edits resolve via last-writer-wins on the mutable fields (status, deliveredAt, signedBy, the rental check-out/check-in timestamps, rentalReturnState, linkedDamageReportIds, archivedAt).
  • With multi-company accounting enabled, the list and the create-source picker are scoped to the active company, and new notes are stamped to it.
  • Order confirmations — a finalized (sent) AB is the primary source for an LS; the ordered quantities carry forward as the delivered quantities. See Order Confirmations.
  • Quotes — an accepted quote can seed an LS directly (skip-AB path). See Quotes.
  • Invoices — you bill from the invoice surface; the automatic delivery-note → invoice bridge is deferred.

Not yet available

Designed into the data model or specced but not exposed in the current UI:

  • In-app editing of delivered quantities and substitution notes — the LS inherits ordered quantities from its source; there is no editor screen yet.
  • Public delivery-receipt page — the customer-facing link that would let the recipient review items and sign on-screen (flipping the LS to delivered, mirroring the public quote-acceptance page) is not wired. Today you mark delivered/returned yourself from the list, and the PDF carries a blank signature line for handwritten/offline signing.
  • Per-item rental check-in audit — marking individual items returned / damaged / lost and auto-linking damage reports (the fields exist on the record, but the per-item return UI is not built; Mark returned records the round-trip at the document level).
  • Per-item QR / barcode on the PDF for rental-house scanning.
  • Delivery-note → invoice conversion and auto-spawn of an invoice draft on delivered.
  • Cancel / supersede one-click actions.
  • Lieferschein settings sub-page — a dedicated page under Settings → Accounting for the counter prefix, rental-house mode toggle and the default per-item QR option is specced but not yet built. The accounting settings nav has no such entry today.
  • Order Confirmations — the upstream document (Auftragsbestätigung)
  • Quotes — accepted quotes can seed a delivery note directly
  • Invoices — the final document (Rechnung)
  • Sub-Rentals — the separate gear-rental delivery / return note (Rental House / Renter checkboxes, condition scratch sheets)
  • Accounting / Expense Tracking — the wider accounting surface
  • Cloud Sync Consent — how accounting documents traverse the sync engine
  • Developer specs: docs/features/v2-nh-316-auftragsbestaetigung-lieferschein/requirements.md, docs/features/v2-nh-316-auftragsbestaetigung-lieferschein/design.md

Last Updated: 2026-09-08 Version: 0.790.2