custom masks : create, edit and display
This commit is contained in:
parent
7c0d3d4d14
commit
000342c2d8
@ -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
|
||||
BatchSerialNumberingModules=Options for automatic generation of batch products managed by serial numbers
|
||||
ManageLotMask=Custom mask
|
||||
@ -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
|
||||
BatchSerialNumberingModules=Modèle de génération et contrôle des numéros de série
|
||||
ManageLotMask=Masque personnalisé
|
||||
@ -1086,10 +1086,28 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
|
||||
// Batch number management
|
||||
if (!empty($conf->productbatch->enabled)) {
|
||||
print '<tr><td>'.$langs->trans("ManageLotSerial").'</td><td colspan="3">';
|
||||
print '<tr><td>'.$langs->trans("ManageLotSerial").'</td><td>';
|
||||
$statutarray = array('0' => $langs->trans("ProductStatusNotOnBatch"), '1' => $langs->trans("ProductStatusOnBatch"), '2' => $langs->trans("ProductStatusOnSerial"));
|
||||
print $form->selectarray('status_batch', $statutarray, GETPOST('status_batch'));
|
||||
print '</td></tr>';
|
||||
print '</td>';
|
||||
// Product specific batch number management
|
||||
$status_batch = GETPOST('status_batch');
|
||||
if ($status_batch !== '0'
|
||||
&& (($status_batch == '1' && $conf->global->PRODUCTBATCH_LOT_USE_PRODUCT_MASKS && $conf->global->PRODUCTBATCH_LOT_ADDON == 'mod_lot_advanced')
|
||||
|| ($status_batch == '2' && $conf->global->PRODUCTBATCH_SN_ADDON == 'mod_sn_advanced' && $conf->global->PRODUCTBATCH_SN_USE_PRODUCT_MASKS))) {
|
||||
$inherited_mask = $object->status_batch == '1' ? $conf->global->LOT_ADVANCED_MASK : $conf->global->SN_ADVANCED_MASK;
|
||||
print '<td>'.$langs->trans("ManageLotMask").'</td>';
|
||||
$tooltip = $langs->trans("GenericMaskCodes", $langs->transnoentities("Batch"), $langs->transnoentities("Batch"));
|
||||
$tooltip .= $langs->trans("GenericMaskCodes2");
|
||||
$tooltip .= $langs->trans("GenericMaskCodes3");
|
||||
$tooltip .= $langs->trans("GenericMaskCodes4a", $langs->transnoentities("Batch"), $langs->transnoentities("Batch"));
|
||||
$tooltip .= $langs->trans("GenericMaskCodes5");
|
||||
print '<td>';
|
||||
print $form->textwithpicto('<input type="text" class="flat" size="24" name="batch_mask" id="batch_mask" value="'.$inherited_mask.'">', $tooltip, 1, 1);
|
||||
print '</td>';
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
}
|
||||
|
||||
$showbarcode = empty($conf->barcode->enabled) ? 0 : 1;
|
||||
@ -2055,6 +2073,13 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
print '<tr><td>'.$langs->trans("ManageLotSerial").'</td><td colspan="2">';
|
||||
print $object->getLibStatut(0, 2);
|
||||
print '</td></tr>';
|
||||
if ((($object->status_batch == '1' && $conf->global->PRODUCTBATCH_LOT_USE_PRODUCT_MASKS && $conf->global->PRODUCTBATCH_LOT_ADDON == 'mod_lot_advanced')
|
||||
|| ($object->status_batch == '2' && $conf->global->PRODUCTBATCH_SN_ADDON == 'mod_sn_advanced' && $conf->global->PRODUCTBATCH_SN_USE_PRODUCT_MASKS))) {
|
||||
print '<tr><td>'.$langs->trans("ManageLotMask").'</td><td colspan="2">';
|
||||
print $object->batch_mask;
|
||||
print '</td></tr>';
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -678,6 +678,7 @@ class Product extends CommonObject
|
||||
$sql .= ", canvas";
|
||||
$sql .= ", finished";
|
||||
$sql .= ", tobatch";
|
||||
$sql .= ", batch_mask";
|
||||
$sql .= ", fk_unit";
|
||||
$sql .= ") VALUES (";
|
||||
$sql .= "'".$this->db->idate($now)."'";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user