From c5e3e1a1d98fb715cd52e4e943ba39b5e3d58765 Mon Sep 17 00:00:00 2001 From: Joe Hunt Date: Tue, 26 Nov 2019 07:45:50 +0100 Subject: [PATCH] Bug 4988: Auto Increase of Document References cant be disabled. Fixed. --- sales/includes/cart_class.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sales/includes/cart_class.inc b/sales/includes/cart_class.inc index b387ef48..e19ea316 100644 --- a/sales/includes/cart_class.inc +++ b/sales/includes/cart_class.inc @@ -293,11 +293,11 @@ class Cart { if (!empty($SysPrefs->prefs['ref_no_auto_increase'])) $this->reference = $Refs->get_next($this->trans_type, null, array('date' => Today())); - if (!is_new_reference($this->reference, $this->trans_type)) + else { commit_transaction(); return -1; - } + } } if (count($this->src_docs) == 0 && ($this->trans_type == ST_SALESINVOICE || $this->trans_type == ST_CUSTDELIVERY) && !$this->is_prepaid()) { // this is direct document - first add parent -- 2.30.2