diff --git a/htdocs/product/card.php b/htdocs/product/card.php index c31c8885454..db62d5b01fd 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -820,6 +820,23 @@ $formfile = new FormFile($db); $formproduct = new FormProduct($db); if (! empty($conf->accounting->enabled)) $formaccountancy = New FormVentilation($db); +// Load object modBarCodeProduct +$res=0; +if (! empty($conf->barcode->enabled) && ! empty($conf->global->BARCODE_PRODUCT_ADDON_NUM)) +{ + $module=strtolower($conf->global->BARCODE_PRODUCT_ADDON_NUM); + $dirbarcode=array_merge(array('/core/modules/barcode/'),$conf->modules_parts['barcode']); + foreach ($dirbarcode as $dirroot) + { + $res=dol_include_once($dirroot.$module.'.php'); + if ($res) break; + } + if ($res > 0) + { + $modBarCodeProduct =new $module(); + } +} + if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { @@ -857,22 +874,6 @@ else $modCodeProduct = new $module(); } - // Load object modBarCodeProduct - if (! empty($conf->barcode->enabled) && ! empty($conf->global->BARCODE_PRODUCT_ADDON_NUM)) - { - $module=strtolower($conf->global->BARCODE_PRODUCT_ADDON_NUM); - $dirbarcode=array_merge(array('/core/modules/barcode/'),$conf->modules_parts['barcode']); - foreach ($dirbarcode as $dirroot) - { - $res=dol_include_once($dirroot.$module.'.php'); - if ($res) break; - } - if ($res > 0) - { - $modBarCodeProduct =new $module(); - } - } - print '