diff --git a/htdocs/langs/en_US/productbatch.lang b/htdocs/langs/en_US/productbatch.lang
index a63442d4b74..26dc9650308 100644
--- a/htdocs/langs/en_US/productbatch.lang
+++ b/htdocs/langs/en_US/productbatch.lang
@@ -27,4 +27,5 @@ StockDetailPerBatch=Stock detail per lot
SerialNumberAlreadyInUse=Serial number %s is already used for product %s
TooManyQtyForSerialNumber=You can only have one product %s for serial number %s
BatchLotNumberingModules=Options for automatic generation of batch products managed by lots
-BatchSerialNumberingModules=Options for automatic generation of batch products managed by serial numbers
\ No newline at end of file
+BatchSerialNumberingModules=Options for automatic generation of batch products managed by serial numbers
+ManageLotMask=Custom mask
\ No newline at end of file
diff --git a/htdocs/langs/fr_FR/productbatch.lang b/htdocs/langs/fr_FR/productbatch.lang
index eed5a063318..81551a38dca 100644
--- a/htdocs/langs/fr_FR/productbatch.lang
+++ b/htdocs/langs/fr_FR/productbatch.lang
@@ -27,4 +27,5 @@ StockDetailPerBatch=Stock détaillé par lot
SerialNumberAlreadyInUse=Le numéro de série %s est déjà utilisé pour le produit %s
TooManyQtyForSerialNumber=Vous ne pouvez avoir qu'un produit %s avec le numéro de série %s
BatchLotNumberingModules=Modèle de génération et contrôle des numéros de lot
-BatchSerialNumberingModules=Modèle de génération et contrôle des numéros de série
\ No newline at end of file
+BatchSerialNumberingModules=Modèle de génération et contrôle des numéros de série
+ManageLotMask=Masque personnalisé
\ No newline at end of file
diff --git a/htdocs/product/card.php b/htdocs/product/card.php
index 094ce8670a9..e6b3adb7439 100644
--- a/htdocs/product/card.php
+++ b/htdocs/product/card.php
@@ -307,6 +307,10 @@ if (empty($reshook)) {
$object->status = GETPOST('statut');
$object->status_buy = GETPOST('statut_buy');
$object->status_batch = GETPOST('status_batch');
+ if ($object->status_batch !== 0) {
+ $object->batch_mask = GETPOST('batch_mask');
+ }
+ else $object->batch_mask = '';
$object->barcode_type = GETPOST('fk_barcode_type');
$object->barcode = GETPOST('barcode');
@@ -475,6 +479,10 @@ if (empty($reshook)) {
$object->status = GETPOST('statut', 'int');
$object->status_buy = GETPOST('statut_buy', 'int');
$object->status_batch = GETPOST('status_batch', 'aZ09');
+ if ($object->status_batch !== 0) {
+ $object->batch_mask = GETPOST('batch_mask', 'alpha');
+ }
+ else $object->batch_mask = '';
$object->fk_default_warehouse = GETPOST('fk_default_warehouse');
// removed from update view so GETPOST always empty
/*
@@ -1083,10 +1091,48 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Batch number management
if (!empty($conf->productbatch->enabled)) {
- print '