erpnext
erpnext copied to clipboard
fix: Prevent set_payment_schedule when creating Sales Invoice that is return
The set_payment_schedule() function should not be used in Sales Invoices that are returns (see the reference below).
This commit adds a validation to prevent set_payment_schedule() from being called when creating a Sales Invoice from a Delivery Note, if the Sales Invoice is a return.