From 50461931b0604f06a0b77d24e399ac7aa392ae93 Mon Sep 17 00:00:00 2001 From: zuiko Date: Sat, 9 Jan 2021 01:13:02 +0100 Subject: [PATCH] Update card.php $type replaced by $fk_barcode_type in $tmpcode = $modBarCodeProduct->getNextValue($object, $type); in order to set it --- htdocs/product/card.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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 '
'; print '';