By default, when an invoice (or its items) is deleted, the delivery note generated from the invoice is also deleted. This behavior is controlled by the zdrojProSkl field (Source for warehouse documents) on the invoice.
If the zdrojProSkl field (Source for warehouse documents) is set to false when creating the invoice, the delivery note created from the invoice will not be deleted when the invoice (items) is deleted.
If it is set to true (default value), the delivery note is, by default, automatically deleted along with the invoice (items).
From a warehouse perspective, deleting a delivery note is not blocked by anything, as no relationships hold it in place. However, if it was created by an invoice, the invoice must be deleted first — the delivery note cannot be deleted on its own.
ℹ️ If you don't want to delete the document, use cancellation. The result in the warehouse is the same, but the document remains in the records, crossed out and traceable. For goods receipt notes, the opposite rule applies compared to delivery notes — their deletion is blocked by related issues. The procedure is described in the guide for cases where an incorrectly created goods receipt note cannot be deleted.
