From 8c5a86cb725e89929a1a677458d1722b1b9e565e Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Wed, 12 Aug 2020 07:07:18 +0200 Subject: [PATCH] Avoid empty sales and orders when all lines are removed. --- htdocs/takepos/invoice.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index cfde72c9fd3..350299814ec 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -398,6 +398,7 @@ if ($action == "deleteline") { $invoice->deleteline($deletelineid); $invoice->fetch($placeid); } + if (count($invoice->lines)==0) $invoice->delete($user); } if ($action == "delete") {