Proposal to Enhance Delivery Note Creation Workflow

Dear @lubos ,

I am writing to propose a refinement to the delivery note creation process in manager.io to prevent discrepancies between sales orders and delivery notes.

The current system allows users to add items from outside a selected sales order, which can lead to inconsistencies. To ensure data integrity and accuracy, I suggest the following logic be implemented:

  1. Item Selection Lock:

    • When a user creates a delivery note by either selecting a Sales Order number or cloning a Sales Order, the list of selectable items should be restricted only to the products listed on that specific sales order.
  2. Quantity Validation:

    • When a Sales Order is selected, the system should enforce a hard validation that prevents the user from entering a delivery quantity that exceeds the reserved quantity.
  3. Flexibility for Non-Order Items:

    • If a user needs to add an item that was not part of the original sales order, they must first de-select or remove the Sales Order reference from the delivery note. This action would unlock the item list and remove the quantity restriction, allowing for a manual, ad-hoc delivery.

Benefits:
This change will ensure that our delivery notes always match their corresponding sales orders unless intentionally created as a standalone delivery, thereby improving order fulfillment accuracy and simplifying our audit trail.

Thank you for your consideration.