From: Joe Hunt Date: Tue, 26 Nov 2019 06:45:50 +0000 (+0100) Subject: Bug 4988: Auto Increase of Document References cant be disabled. Fixed. X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=c5e3e1a1d98fb715cd52e4e943ba39b5e3d58765;p=fa-stable.git Bug 4988: Auto Increase of Document References cant be disabled. Fixed. --- 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