Fix barcode choice lost if error

This commit is contained in:
Laurent Destailleur 2022-12-01 11:46:48 +01:00
parent 804b806d02
commit 88aadae934

View File

@ -753,16 +753,11 @@ END;
// Barcode type
print '<tr>';
print '<td>'.$langs->trans('BarcodeType').'</td>';
print '<td>'.$langs->trans('GencodBuyPrice').'</td>';
print '<td>';
print $formbarcode->selectBarcodeType(($rowid ? $object->supplier_fk_barcode_type : getDolGlobalint("PRODUIT_DEFAULT_BARCODE_TYPE")), 'fk_barcode_type', 1);
print '</td>';
print '</tr>';
// Barcode value
print '<tr>';
print '<td>'.$langs->trans('BarcodeValue').'</td>';
print '<td>'.img_picto('', 'barcode', 'class="pictofixedwidth"').'<input class="flat" name="barcode" value="'.($rowid ? $object->supplier_barcode : '').'"></td>';
print img_picto('', 'barcode', 'class="pictofixedwidth"');
print $formbarcode->selectBarcodeType((GETPOSTISSET('fk_barcode_type') ? GETPOST('fk_barcode_type', 'int') : ($rowid ? $object->supplier_fk_barcode_type : getDolGlobalint("PRODUIT_DEFAULT_BARCODE_TYPE"))), 'fk_barcode_type', 1);
print ' <input class="flat" name="barcode" value="'.(GETPOSTISSET('barcode') ? GETPOST('barcode') : ($rowid ? $object->supplier_barcode : '')).'"></td>';
print '</tr>';
}