Module setup, access and architecture

Understand invoice and item snapshot data

This guide explains that which invoice, client and item data is copied so the delivery record remains auditable. The guide then takes you through the correct route, the checks to complete before making changes, the workflow in order, and the evidence to review afterwards.

Audience: Delivery operations and auditorsPermission: Delivery Note: Create or ViewModule v1.0.0
Jump to steps
Where to goAdmin Area → Invoices → Open invoice → Create Delivery Note

What you’ll accomplish

Know which invoice, client and item data is copied so the delivery record remains auditable. This guide follows the supplied Delivery Note module’s live hooks, controller actions, model rules, views and stored side effects.

Follow these steps

  1. Go to the source invoice.
  2. Create the delivery note.
  3. Check the Invoice Snapshot panel before saving.
  4. After creation, compare delivered items with the source invoice as it existed at creation time.

Fields and options to review

  • Invoice row snapshot
  • Client row snapshot
  • Invoice items ordered by `item_order`
  • Item descriptions, long descriptions, quantity and unit
  • Invoice/client IDs retained as links

Rules the system enforces

  • Snapshots are stored as JSON in the module table.
  • Later invoice edits do not rewrite an existing note snapshot.
  • The PDF intentionally omits commercial prices and uses delivered quantities/units.
  • If source tables or records are unavailable, snapshot values can be empty and must be investigated.

How to confirm it worked

  • The note preserves the delivery-relevant source state even if the invoice changes later.

Safety checks and troubleshooting

  • A snapshot is evidence of creation-time data; it is not a live mirror.
Stay within the supported flowDo not force database values, expose secure tokens, bypass permission checks, replace a stored signature or invent a status or interface that the supplied code does not implement.