Invoice integration and note creation

Understand Delivery Note invoice-payload isolation

Explain how module fields are prevented from entering the core invoice insert or update payload. 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: System administrators and developersPermission: Technical inspectionModule v1.0.0
Jump to steps
Where to goAutomatic code flow during Admin Area → Invoices → Save

What you’ll accomplish

Explain how module fields are prevented from entering the core invoice insert or update payload. This guide follows the supplied Delivery Note module’s live hooks, controller actions, model rules, views and stored side effects.

Follow these steps

  1. Submit an invoice with or without Add Delivery Note.
  2. Verify the core invoice saves normally.
  3. Inspect the module’s before-invoice add/update filter.
  4. Check delivery-note keys are captured for the module and removed from the invoice data array.
  5. Check the after-invoice hook creates or updates only module-owned records.

Fields and options to review

  • Checkbox flag and delivery fields are module-only payload keys
  • Temporary captured payload is associated with the invoice save request
  • Core invoice columns remain unaffected

Rules the system enforces

  • The isolation filter runs for invoice add and update.
  • The module is designed to be portable and makes no invoice-table schema change.
  • An invoice update does not create another note when a non-void note already exists.

How to confirm it worked

  • Core invoicing remains compatible while the optional module workflow receives its own values.

Safety checks and troubleshooting

  • Do not add Delivery Note columns to the core invoice table to reproduce this behaviour.
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.