From 030b67224e3689a1907af0f70ab456e49f77a1a7 Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Wed, 16 Dec 2020 15:36:15 +0000 Subject: [PATCH] Reset payments on item remove and sales register mode change (#3043) --- application/controllers/Sales.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/application/controllers/Sales.php b/application/controllers/Sales.php index 6a2c25113..49e1baed8 100644 --- a/application/controllers/Sales.php +++ b/application/controllers/Sales.php @@ -192,6 +192,8 @@ class Sales extends Secure_Controller $this->sale_lib->set_sale_location($stock_location); } + $this->sale_lib->empty_payments(); + $this->_reload(); } @@ -446,6 +448,7 @@ class Sales extends Secure_Controller $data['warning'] = $this->sale_lib->out_of_stock($item_id_or_number_or_item_kit_or_receipt, $item_location); } } + $this->_reload($data); } @@ -487,6 +490,8 @@ class Sales extends Secure_Controller { $this->sale_lib->delete_item($item_number); + $this->sale_lib->empty_payments(); + $this->_reload(); } @@ -993,8 +998,8 @@ class Sales extends Secure_Controller } $invoice_type = $this->config->item('invoice_type'); - $data['invoice_view'] = $invoice_type; + return $this->xss_clean($data); } @@ -1371,6 +1376,7 @@ class Sales extends Secure_Controller } $this->sale_lib->clear_all(); + $this->_reload($data); }