Invoice integration and note creation

Understand the Create or View Delivery Note invoice button

Know how the dynamic invoice action decides whether to create or open a note.

Audience: Invoice and delivery staffPermission: Delivery Note: View; Create required when no note existsModule v1.0.0
Exact navigationAdmin Area → Invoices → Open invoice

What this guide covers

Know how the dynamic invoice action decides whether to create or open a note. This guide follows the supplied Delivery Note module’s live hooks, controller actions, model rules, views and stored side effects.

Exact step-by-step process

  1. Open an invoice.
  2. Wait for the injected Delivery Note action.
  3. When no active note exists, select Create Delivery Note and complete the form.
  4. When an active note exists, select View Delivery Note to open it.
  5. Use the separate PDF action when it is shown.

Fields, choices and supported possibilities

  • Invoice ID detected from page configuration, URL, data attributes or invoice links
  • Metadata endpoint returns exists, reference, status, view URL and PDF URL
  • Button label/action changes from Create to View

Code-backed validations and workflow rules

  • The script avoids inserting duplicate buttons.
  • It observes dynamic invoice layouts and AJAX refreshes.
  • The button depends on module enabled, invoice UI enabled and relevant capability/access.
  • A void note is excluded by the active-note lookup, so the button can return to Create.

Expected result and verification

  • The invoice presents the correct delivery action for its current active-note state.

Checks, security and troubleshooting

  • If the action is missing, verify permissions and options before changing templates.
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.