';
- // Warehouse or product
- print '';
- if ($object->element == 'product')
- {
- print '| '.$langs->trans("Warehouse").' | ';
- print '';
- print $formproduct->selectWarehouses((GETPOST("dwid") ?GETPOST("dwid", 'int') : (GETPOST('id_entrepot') ?GETPOST('id_entrepot', 'int') : ($object->element == 'product' && $object->fk_default_warehouse ? $object->fk_default_warehouse : 'ifone'))), 'id_entrepot', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, null, 'minwidth100');
- print ' ';
- print ' | ';
- }
- if ($object->element == 'stock')
- {
- print ''.$langs->trans("Product").' | ';
- print '';
- $form->select_produits(GETPOST('product_id', 'int'), 'product_id', (empty($conf->global->STOCK_SUPPORTS_SERVICES) ? '0' : ''), 0, 0, -1, 2, '', 0, null, 0, 1, 0, 'maxwidth500');
- print ' ';
- print ' | ';
- }
- print ''.$langs->trans("NumberOfUnit").' | ';
- print ' | ';
- print '
';
+// Warehouse or product
+print '';
+if ($object->element == 'product') {
+ print '| '.$langs->trans("Warehouse").' | ';
+ print '';
+ print $formproduct->selectWarehouses((GETPOST("dwid") ?GETPOST("dwid", 'int') : (GETPOST('id_entrepot') ?GETPOST('id_entrepot', 'int') : ($object->element == 'product' && $object->fk_default_warehouse ? $object->fk_default_warehouse : 'ifone'))), 'id_entrepot', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, null, 'minwidth100');
+ print ' ';
+ print ' | ';
+}
+if ($object->element == 'stock') {
+ print ''.$langs->trans("Product").' | ';
+ print '';
+ $form->select_produits(GETPOST('product_id', 'int'), 'product_id', (empty($conf->global->STOCK_SUPPORTS_SERVICES) ? '0' : ''), 0, 0, -1, 2, '', 0, null, 0, 1, 0, 'maxwidth500');
+ print ' ';
+ print ' | ';
+}
+print ''.$langs->trans("NumberOfUnit").' | ';
+print ' | ';
+print '
';
- // Serial / Eat-by date
- if (!empty($conf->productbatch->enabled) &&
- (($object->element == 'product' && $object->hasbatch())
- || ($object->element == 'stock'))
- )
- {
- print '';
- print '| element == 'stock' ? '' : ' class="fieldrequired"').'>'.$langs->trans("batch_number").' | ';
- print '';
- print ' | ';
- print '
';
- print '';
- print '| '.$langs->trans("EatByDate").' | ';
- $eatbyselected = dol_mktime(0, 0, 0, GETPOST('eatbymonth'), GETPOST('eatbyday'), GETPOST('eatbyyear'));
- print $form->selectDate($eatbyselected, 'eatby', '', '', 1, "");
- print ' | ';
- print ''.$langs->trans("SellByDate").' | ';
- $sellbyselected = dol_mktime(0, 0, 0, GETPOST('sellbymonth'), GETPOST('sellbyday'), GETPOST('sellbyyear'));
- print $form->selectDate($sellbyselected, 'sellby', '', '', 1, "");
- print ' | ';
- print '
';
- }
+// Serial / Eat-by date
+if (!empty($conf->productbatch->enabled) &&
+(($object->element == 'product' && $object->hasbatch())
+|| ($object->element == 'stock'))
+)
+{
+ print '';
+ print '| element == 'stock' ? '' : ' class="fieldrequired"').'>'.$langs->trans("batch_number").' | ';
+ print '';
+ print ' | ';
+ print '
';
+ print '';
+ print '| '.$langs->trans("EatByDate").' | ';
+ $eatbyselected = dol_mktime(0, 0, 0, GETPOST('eatbymonth'), GETPOST('eatbyday'), GETPOST('eatbyyear'));
+ print $form->selectDate($eatbyselected, 'eatby', '', '', 1, "");
+ print ' | ';
+ print ''.$langs->trans("SellByDate").' | ';
+ $sellbyselected = dol_mktime(0, 0, 0, GETPOST('sellbymonth'), GETPOST('sellbyday'), GETPOST('sellbyyear'));
+ print $form->selectDate($sellbyselected, 'sellby', '', '', 1, "");
+ print ' | ';
+ print '
';
+}
- // Purchase price and project
- print '';
- print '| '.$langs->trans("UnitPurchaseValue").' | ';
- print ' | ';
- if (!empty($conf->projet->enabled))
- {
- print ''.$langs->trans('Project').' | ';
- print '';
- $formproject->select_projects(-1, '', 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0, 'maxwidth300');
- print ' | ';
- }
- print '
';
+// Purchase price and project
+print '';
+print '| '.$langs->trans("UnitPurchaseValue").' | ';
+print ' | ';
+if (!empty($conf->projet->enabled))
+{
+ print ''.$langs->trans('Project').' | ';
+ print '';
+ $formproject->select_projects(-1, '', 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0, 'maxwidth300');
+ print ' | ';
+}
+print '
';
- // Label of mouvement of id of inventory
- $valformovementlabel = ((GETPOST("label") && (GETPOST('label') != $langs->trans("MovementCorrectStock", ''))) ? GETPOST("label") : $langs->trans("MovementCorrectStock", $productref));
- print '';
- print '| '.$langs->trans("MovementLabel").' | ';
- print '';
- print '';
- print ' | ';
- print ''.$langs->trans("InventoryCode").' | | ';
- print '
';
+// Label of mouvement of id of inventory
+$valformovementlabel = ((GETPOST("label") && (GETPOST('label') != $langs->trans("MovementCorrectStock", ''))) ? GETPOST("label") : $langs->trans("MovementCorrectStock", $productref));
+print '';
+print '| '.$langs->trans("MovementLabel").' | ';
+print '';
+print '';
+print ' | ';
+print ''.$langs->trans("InventoryCode").' | | ';
+print '
';
- print '
';
+print '