From 5ee97dfd4a6917e512024e12e0093f97280d6bad Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Jan 2021 16:27:37 +0100 Subject: [PATCH] Update mod_barcode_product_standard.php --- htdocs/core/modules/barcode/mod_barcode_product_standard.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/core/modules/barcode/mod_barcode_product_standard.php b/htdocs/core/modules/barcode/mod_barcode_product_standard.php index a4c56928688..0c91f0210f4 100644 --- a/htdocs/core/modules/barcode/mod_barcode_product_standard.php +++ b/htdocs/core/modules/barcode/mod_barcode_product_standard.php @@ -155,6 +155,10 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/barcode.lib.php'; // to be able to call function barcode_gen_ean_sum($ean) + if (empty($type)) { + $type = $conf->global->PRODUIT_DEFAULT_BARCODE_TYPE; + } //get barcode type configuration for products if $type not set + // TODO // Get Mask value @@ -173,7 +177,6 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode $numFinal = get_next_value($db, $mask, 'product', $field, $where, '', $now); //if EAN13 calculate and substitute the last 13th character (* or ?) used in the mask by the EAN13 key - if ($type=='') {$type=$conf->global->PRODUIT_DEFAULT_BARCODE_TYPE;} //get barcode type configuration for products if $type not set if ($type==2) //2 = EAN13 { if (strlen($numFinal)==13)