diff --git a/htdocs/product/card.php b/htdocs/product/card.php
index d6f62b34769..4a964250cfd 100644
--- a/htdocs/product/card.php
+++ b/htdocs/product/card.php
@@ -1052,7 +1052,7 @@ else
if ($conf->browser->layout == 'phone') print '
';
print '| '.$langs->trans("BarcodeValue").' | ';
$tmpcode = isset($_POST['barcode']) ?GETPOST('barcode') : $object->barcode;
- if (empty($tmpcode) && !empty($modBarCodeProduct->code_auto)) $tmpcode = $modBarCodeProduct->getNextValue($object, $type);
+ if (empty($tmpcode) && !empty($modBarCodeProduct->code_auto)) $tmpcode = $modBarCodeProduct->getNextValue($object, $fk_barcode_type);
print '';
print ' |
';
}
@@ -1491,7 +1491,7 @@ else
print $formbarcode->selectBarcodeType($fk_barcode_type, 'fk_barcode_type', 1);
print ''.$langs->trans("BarcodeValue").' | ';
$tmpcode = isset($_POST['barcode']) ?GETPOST('barcode') : $object->barcode;
- if (empty($tmpcode) && !empty($modBarCodeProduct->code_auto)) $tmpcode = $modBarCodeProduct->getNextValue($object, $type);
+ if (empty($tmpcode) && !empty($modBarCodeProduct->code_auto)) $tmpcode = $modBarCodeProduct->getNextValue($object, $fk_barcode_type);
print '';
print ' | ';
}
@@ -1805,13 +1805,16 @@ else
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formbarcode.class.php';
$formbarcode = new FormBarCode($db);
}
+ $fk_barcode_type='';
if ($action == 'editbarcodetype')
{
print $formbarcode->formBarcodeType($_SERVER['PHP_SELF'].'?id='.$object->id, $object->barcode_type, 'fk_barcode_type');
+ $fk_barcode_type=$object->barcode_type;
}
else
{
$object->fetch_barcode();
+ $fk_barcode_type = $object->barcode_type;
print $object->barcode_type_label ? $object->barcode_type_label : ($object->barcode ? ''.$langs->trans("SetDefaultBarcodeType").'
' : '');
}
print ''."\n";
@@ -1827,7 +1830,7 @@ else
if ($action == 'editbarcode')
{
$tmpcode = isset($_POST['barcode']) ?GETPOST('barcode') : $object->barcode;
- if (empty($tmpcode) && !empty($modBarCodeProduct->code_auto)) $tmpcode = $modBarCodeProduct->getNextValue($object, $type);
+ if (empty($tmpcode) && !empty($modBarCodeProduct->code_auto)) $tmpcode = $modBarCodeProduct->getNextValue($object, $fk_barcode_type);
print '