30 require
'../main.inc.php';
31 require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
32 require_once DOL_DOCUMENT_ROOT.
'/product/stock/class/productlot.class.php';
33 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
34 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
35 require_once DOL_DOCUMENT_ROOT.
'/product/stock/class/entrepot.class.php';
36 require_once DOL_DOCUMENT_ROOT.
'/product/stock/class/productlot.class.php';
39 $langs->loadLangs(array(
'products',
'stocks',
'productbatch'));
41 $action =
GETPOST(
'action',
'aZ09') ?
GETPOST(
'action',
'aZ09') :
'view';
42 $massaction =
GETPOST(
'massaction',
'alpha');
43 $contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'myobjectlist';
44 $backtopage =
GETPOST(
'backtopage',
'alpha');
45 $optioncss =
GETPOST(
'optioncss',
'aZ');
48 $sref =
GETPOST(
"sref",
'alpha');
49 $snom =
GETPOST(
"snom",
'alpha');
50 $sall = trim((
GETPOST(
'search_all',
'alphanohtml') !=
'') ?
GETPOST(
'search_all',
'alphanohtml') :
GETPOST(
'sall',
'alphanohtml'));
52 $search_barcode =
GETPOST(
"search_barcode",
'alpha');
53 $search_warehouse =
GETPOST(
'search_warehouse',
'alpha');
54 $search_batch =
GETPOST(
'search_batch',
'alpha');
55 $toolowstock =
GETPOST(
'toolowstock');
58 $fourn_id =
GETPOST(
"fourn_id",
'int');
59 $sbarcode =
GETPOST(
"sbarcode",
'int');
60 $search_stock_physique =
GETPOST(
'search_stock_physique',
'alpha');
63 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
64 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
65 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
67 if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
71 $offset = $limit * $page;
72 $pageprev = $page - 1;
73 $pagenext = $page + 1;
77 $search_sale =
GETPOST(
"search_sale");
79 $search_categ =
GETPOST(
'catid',
'int');
81 $search_categ =
GETPOST(
'search_categ',
'int');
85 $extrafields->fetch_name_optionals_label($object->table_element);
88 $search_array_options = $extrafields->getOptionalsFromPost($object->table_element,
'',
'search_');
92 reset($object->fields);
93 $sortfield =
"p.".key($object->fields);
102 foreach ($object->fields as $key => $val) {
103 if (
GETPOST(
'search_'.$key,
'alpha') !==
'') {
104 $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
106 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
107 $search[$key.
'_dtstart'] =
dol_mktime(0, 0, 0,
GETPOST(
'search_'.$key.
'_dtstartmonth',
'int'),
GETPOST(
'search_'.$key.
'_dtstartday',
'int'),
GETPOST(
'search_'.$key.
'_dtstartyear',
'int'));
108 $search[$key.
'_dtend'] =
dol_mktime(23, 59, 59,
GETPOST(
'search_'.$key.
'_dtendmonth',
'int'),
GETPOST(
'search_'.$key.
'_dtendday',
'int'),
GETPOST(
'search_'.$key.
'_dtendyear',
'int'));
112 $search[$key.
'_dtstart'] =
dol_mktime(0, 0, 0,
GETPOST(
'search_'.$key.
'_dtstartmonth',
'int'),
GETPOST(
'search_'.$key.
'_dtstartday',
'int'),
GETPOST(
'search_'.$key.
'_dtstartyear',
'int'));
113 $search[$key.
'_dtend'] =
dol_mktime(23, 59, 59,
GETPOST(
'search_'.$key.
'_dtendmonth',
'int'),
GETPOST(
'search_'.$key.
'_dtendday',
'int'),
GETPOST(
'search_'.$key.
'_dtendyear',
'int'));
115 $search[$key.
'_dtstart'] =
dol_mktime(0, 0, 0,
GETPOST(
'search_'.$key.
'_dtstartmonth',
'int'),
GETPOST(
'search_'.$key.
'_dtstartday',
'int'),
GETPOST(
'search_'.$key.
'_dtstartyear',
'int'));
116 $search[$key.
'_dtend'] =
dol_mktime(23, 59, 59,
GETPOST(
'search_'.$key.
'_dtendmonth',
'int'),
GETPOST(
'search_'.$key.
'_dtendday',
'int'),
GETPOST(
'search_'.$key.
'_dtendyear',
'int'));
121 if (!empty($canvas)) {
122 require_once DOL_DOCUMENT_ROOT.
'/core/class/canvas.class.php';
123 $objcanvas =
new Canvas($db, $action);
124 $objcanvas->getCanvas(
'product',
'list', $canvas);
129 $socid = $user->socid;
131 $result =
restrictedArea($user,
'produit|service', 0,
'product&product');
133 $hookmanager->initHooks(array(
'reassortlotlist'));
140 if (
GETPOST(
'cancel',
'alpha')) {
144 if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
148 $parameters = array();
149 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
154 if (empty($reshook)) {
156 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
159 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
160 foreach ($object->fields as $key => $val) {
162 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
163 $search[$key.
'_dtstart'] =
'';
164 $search[$key.
'_dtend'] =
'';
167 $search[
'sellby_dtstart'] =
'';
168 $search[
'eatby_dtstart'] =
'';
169 $search[
'sellby_dtend'] =
'';
170 $search[
'eatby_dtend'] =
'';
180 $search_warehouse =
'';
183 $search_stock_physique =
'';
185 $search_array_options = array();
187 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
188 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
211 $helpurl =
'EN:Module_Stocks_En|FR:Module_Stock|ES:Módulo_Stocks';
212 $title = $langs->trans(
"ProductsAndServices");
216 $sql =
'SELECT p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type, p.entity,';
217 $sql .=
' p.fk_product_type, p.tms as datem,';
218 $sql .=
' p.duration, p.tosell as statut, p.tobuy, p.seuil_stock_alerte, p.desiredstock, p.stock, p.tosell, p.tobuy, p.tobatch,';
219 $sql .=
' ps.fk_entrepot, ps.reel,';
220 $sql .=
' e.ref as warehouse_ref, e.lieu as warehouse_lieu, e.fk_parent as warehouse_parent,';
221 $sql .=
' pb.batch, pb.eatby as oldeatby, pb.sellby as oldsellby,';
222 $sql .=
' pl.rowid as lotid, pl.eatby, pl.sellby,';
223 $sql .=
' SUM(pb.qty) as stock_physique, COUNT(pb.rowid) as nbinbatchtable';
224 $sql .=
' FROM '.MAIN_DB_PREFIX.
'product as p';
225 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'product_stock as ps on p.rowid = ps.fk_product';
226 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'entrepot as e on ps.fk_entrepot = e.rowid';
227 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'product_batch as pb on pb.fk_product_stock = ps.rowid';
228 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'product_lot as pl on pl.fk_product = p.rowid AND pl.batch = pb.batch';
229 $sql .=
" WHERE p.entity IN (".getEntity(
'product').
")";
230 if (!empty($search_categ) && $search_categ !=
'-1') {
232 if ($search_categ == -2) {
233 $sql .=
" NOT EXISTS ";
238 $sql .=
" SELECT cp.fk_categorie, cp.fk_product";
239 $sql .=
" FROM " . MAIN_DB_PREFIX .
"categorie_product as cp";
240 $sql .=
" WHERE cp.fk_product = p.rowid";
241 if ($search_categ > 0) {
242 $sql .=
" AND cp.fk_categorie = " . ((int) $search_categ);
247 $sql .=
natural_search(array(
'p.ref',
'p.label',
'p.description',
'p.note'), $sall);
252 $sql .=
" AND p.fk_product_type = '1'";
254 $sql .=
" AND p.fk_product_type <> '1'";
260 if ($search_barcode) {
266 if (!empty($tosell)) {
267 $sql .=
" AND p.tosell = ".((int) $tosell);
269 if (!empty($tobuy)) {
270 $sql .=
" AND p.tobuy = ".((int) $tobuy);
272 if (!empty($canvas)) {
273 $sql .=
" AND p.canvas = '".$db->escape($canvas).
"'";
276 $sql .=
" AND p.rowid = pf.fk_product AND pf.fk_soc = ".((int) $fourn_id);
278 if ($search_warehouse) {
285 foreach ($search as $key => $val) {
286 if (array_key_exists($key, $object->fields)) {
287 if ($key ==
'status' && $search[$key] == -1) {
290 $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0);
291 if ((strpos($object->fields[$key][
'type'],
'integer:') === 0) || (strpos($object->fields[$key][
'type'],
'sellist:') === 0) || !empty($object->fields[$key][
'arrayofkeyval'])) {
292 if ($search[$key] ==
'-1' || ($search[$key] ===
'0' && (empty($object->fields[$key][
'arrayofkeyval']) || !array_key_exists(
'0', $object->fields[$key][
'arrayofkeyval'])))) {
297 if ($search[$key] !=
'') {
298 $sql .=
natural_search(
"t.".$db->escape($key), $search[$key], (($key ==
'status') ? 2 : $mode_search));
301 if (preg_match(
'/(_dtstart|_dtend)$/', $key) && $search[$key] !=
'') {
302 $columnName = preg_replace(
'/(_dtstart|_dtend)$/',
'', $key);
303 if ($columnName ==
'eatby' || $columnName ==
'sellby') {
304 if (preg_match(
'/_dtstart$/', $key)) {
305 $sql .=
" AND pl.".$db->escape($columnName).
" >= '".$db->idate($search[$key]).
"'";
307 if (preg_match(
'/_dtend$/', $key)) {
308 $sql .=
" AND pl.".$db->escape($columnName).
" <= '".$db->idate($search[$key]).
"'";
315 $sql .=
" GROUP BY p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type, p.entity,";
316 $sql .=
" p.fk_product_type, p.tms,";
317 $sql .=
" p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock, p.stock, p.tosell, p.tobuy, p.tobatch,";
318 $sql .=
" ps.fk_entrepot, ps.reel,";
319 $sql .=
" e.ref, e.lieu, e.fk_parent,";
320 $sql .=
" pb.batch, pb.eatby, pb.sellby,";
321 $sql .=
" pl.rowid, pl.eatby, pl.sellby";
324 $sql_having .=
" HAVING SUM(".$db->ifsql(
'ps.reel IS NULL',
'0',
'ps.reel').
") < p.seuil_stock_alerte";
326 if ($search_stock_physique !=
'') {
327 $natural_search_physique =
natural_search(
'SUM(' . $db->ifsql(
'pb.qty IS NULL', $db->ifsql(
'ps.reel IS NULL',
'0',
'ps.reel'),
'pb.qty') .
')', $search_stock_physique, 1, 1);
328 $natural_search_physique =
" " . substr($natural_search_physique, 1, -1);
329 if (!empty($sql_having)) {
330 $sql_having .=
" AND";
332 $sql_having .=
" HAVING";
334 $sql_having .= $natural_search_physique;
336 if (!empty($sql_having)) {
343 $nbtotalofrecords =
'';
344 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
345 $resql = $db->query($sql);
346 $nbtotalofrecords = $db->num_rows(
$resql);
348 if (($page * $limit) > $nbtotalofrecords) {
356 $sql .= $db->order($sortfield, $sortorder);
358 $sql .= $db->plimit($limit + 1, $offset);
361 $resql = $db->query($sql);
367 $num = $db->num_rows(
$resql);
371 if ($num == 1 &&
GETPOST(
'autojumpifoneonly') && ($sall or $snom or $sref)) {
372 $objp = $db->fetch_object(
$resql);
373 header(
"Location: card.php?id=$objp->rowid");
379 $texte = $langs->trans(
"Services");
381 $texte = $langs->trans(
"Products");
384 $texte = $langs->trans(
"ProductsAndServices");
386 $texte .=
' ('.$langs->trans(
"StocksByLotSerial").
')';
390 $param .=
'&mode='.urlencode($mode);
392 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
393 $param .=
'&contextpage='.urlencode($contextpage);
395 if ($limit > 0 && $limit != $conf->liste_limit) {
396 $param .=
'&limit='.urlencode($limit);
398 foreach ($search as $key => $val) {
399 if (is_array($search[$key]) && count($search[$key])) {
400 foreach ($search[$key] as $skey) {
402 $param .=
'&search_'.$key.
'[]='.urlencode($skey);
405 } elseif ($search[$key] !=
'') {
406 $param .=
'&search_'.$key.
'='.urlencode($search[$key]);
409 if ($optioncss !=
'') {
410 $param .=
'&optioncss='.urlencode($optioncss);
413 $param .=
"&sall=".urlencode($sall);
416 $param .=
"&tosell=".urlencode($tosell);
419 $param .=
"&tobuy=".urlencode($tobuy);
422 $param .=
"&type=".urlencode($type);
425 $param .=
"&fourn_id=".urlencode($fourn_id);
428 $param .=
"&snom=".urlencode($snom);
431 $param .=
"&sref=".urlencode($sref);
434 $param .=
"&search_batch=".urlencode($search_batch);
437 $param .=
"&sbarcode=".urlencode($sbarcode);
439 if ($search_warehouse) {
440 $param .=
"&search_warehouse=".urlencode($search_warehouse);
443 $param .=
"&toolowstock=".urlencode($toolowstock);
446 $param .=
"&search_sale=".urlencode($search_sale);
448 if (!empty($search_categ) && $search_categ !=
'-1') {
449 $param .=
"&search_categ=".urlencode($search_categ);
451 if ($search_stock_physique) {
452 $param .=
'&search_stock_physique=' . urlencode($search_stock_physique);
459 print
'<form id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'" method="POST" name="formulaire">'.
"\n";
460 if ($optioncss !=
'') {
461 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
463 print
'<input type="hidden" name="token" value="'.newToken().
'">';
464 print
'<input type="hidden" name="action" value="list">';
465 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
466 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
467 print
'<input type="hidden" name="type" value="'.$type.
'">';
468 print
'<input type="hidden" name="page" value="'.$page.
'">';
469 print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
470 print
'<input type="hidden" name="mode" value="'.$mode.
'">';
472 print_barre_liste($texte, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder,
'', $num, $nbtotalofrecords,
'product', 0,
'',
'', $limit, 0, 0, 1);
475 if ($search_categ > 0) {
476 print
"<div id='ways'>";
478 $c->fetch($search_categ);
479 $ways = $c->print_all_ways(
' > ',
'product/reassortlot.php');
480 print
" > ".$ways[0].
"<br>\n";
486 if (!empty($conf->categorie->enabled)) {
487 $moreforfilter .=
'<div class="divsearchfield">';
488 $moreforfilter .=
img_picto($langs->trans(
'Categories'),
'category',
'class="pictofixedwidth"');
489 $moreforfilter .= $htmlother->select_categories(Categorie::TYPE_PRODUCT, $search_categ,
'search_categ', 1);
490 $moreforfilter .=
'</div>';
494 if (!empty($moreforfilter)) {
495 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
496 print $moreforfilter;
497 $parameters = array();
498 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters);
499 print $hookmanager->resPrint;
504 print
'<div class="div-table-responsive">';
505 print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">';
509 print
'<tr class="liste_titre_filter">';
510 print
'<td class="liste_titre">';
511 print
'<input class="flat" type="text" name="sref" size="6" value="'.$sref.
'">';
513 print
'<td class="liste_titre">';
514 print
'<input class="flat" type="text" name="snom" size="8" value="'.$snom.
'">';
516 if (!empty($conf->service->enabled) && $type == 1) {
517 print
'<td class="liste_titre">';
521 print
'<td class="liste_titre"><input class="flat" type="text" name="search_warehouse" size="6" value="'.$search_warehouse.
'"></td>';
522 print
'<td class="liste_titre center"><input class="flat" type="text" name="search_batch" size="6" value="'.$search_batch.
'"></td>';
523 if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
524 print
'<td class="liste_titre center">';
526 print
'<div class="nowrap">';
527 print
$form->selectDate($search[$key.
'_dtstart'] ? $search[$key.
'_dtstart'] :
'',
"search_".$key.
"_dtstart", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
529 print
'<div class="nowrap">';
530 print
$form->selectDate($search[$key.
'_dtend'] ? $search[$key.
'_dtend'] :
'',
"search_".$key.
"_dtend", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
534 if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
535 print
'<td class="liste_titre center">';
537 print
'<div class="nowrap">';
538 print
$form->selectDate($search[$key.
'_dtstart'] ? $search[$key.
'_dtstart'] :
'',
"search_".$key.
"_dtstart", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
540 print
'<div class="nowrap">';
541 print
$form->selectDate($search[$key.
'_dtend'] ? $search[$key.
'_dtend'] :
'',
"search_".$key.
"_dtend", 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
546 print
'<td class="liste_titre right">';
547 print
'<input class="flat" type="text" size="5" name="search_stock_physique" value="'.dol_escape_htmltag($search_stock_physique).
'">';
549 print
'<td class="liste_titre"> </td>';
550 print
'<td class="liste_titre"> </td>';
551 print
'<td class="liste_titre"> </td>';
553 if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
554 print
'<td class="liste_titre maxwidthsearch">';
555 $searchpicto =
$form->showFilterButtons();
561 $totalarray = array();
562 $totalarray[
'nbfield'] = 0;
566 print
'<tr class="liste_titre">';
569 if (!empty($conf->service->enabled) && $type == 1) {
570 print_liste_field_titre(
"Duration", $_SERVER[
"PHP_SELF"],
"p.duration",
'', $param,
"", $sortfield, $sortorder,
'center ');
574 print_liste_field_titre(
"Batch", $_SERVER[
"PHP_SELF"],
"pb.batch",
'', $param,
"", $sortfield, $sortorder,
'center ');
575 if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
576 print_liste_field_titre(
"SellByDate", $_SERVER[
"PHP_SELF"],
"pl.sellby",
'', $param,
"", $sortfield, $sortorder,
'center ');
578 if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
579 print_liste_field_titre(
"EatByDate", $_SERVER[
"PHP_SELF"],
"pl.eatby",
'', $param,
"", $sortfield, $sortorder,
'center ');
581 print_liste_field_titre(
"PhysicalStock", $_SERVER[
"PHP_SELF"],
"stock_physique",
'', $param,
"", $sortfield, $sortorder,
'right ');
585 print_liste_field_titre(
"ProductStatusOnSell", $_SERVER[
"PHP_SELF"],
"p.tosell",
"", $param,
'', $sortfield, $sortorder,
'right ');
586 print_liste_field_titre(
"ProductStatusOnBuy", $_SERVER[
"PHP_SELF"],
"p.tobuy",
"", $param,
'', $sortfield, $sortorder,
'right ');
590 $product_static =
new Product($db);
597 $savnbfield = $totalarray[
'nbfield'];
598 $totalarray[
'nbfield'] = 0;
599 $imaxinloop = ($limit ? min($num, $limit) : $num);
600 while ($i < $imaxinloop) {
601 $objp = $db->fetch_object(
$resql);
604 if (!empty($conf->global->MAIN_MULTILANGS)) {
606 $sql =
"SELECT label";
607 $sql .=
" FROM ".MAIN_DB_PREFIX.
"product_lang";
608 $sql .=
" WHERE fk_product = ".((int) $objp->rowid);
609 $sql .=
" AND lang = '".$db->escape($langs->getDefaultLang()).
"'";
612 $result = $db->query($sql);
614 $objtp = $db->fetch_object($result);
615 if (!empty($objtp->label)) {
616 $objp->label = $objtp->label;
621 $product_static->ref = $objp->ref;
622 $product_static->id = $objp->rowid;
623 $product_static->label = $objp->label;
624 $product_static->type = $objp->fk_product_type;
625 $product_static->entity = $objp->entity;
626 $product_static->status = $objp->tosell;
627 $product_static->status_buy = $objp->tobuy;
628 $product_static->status_batch = $objp->tobatch;
630 $product_lot_static->batch = $objp->batch;
631 $product_lot_static->product_id = $objp->rowid;
632 $product_lot_static->id = $objp->lotid;
633 $product_lot_static->eatby = $objp->eatby;
634 $product_lot_static->sellby = $objp->sellby;
637 $warehousetmp->id = $objp->fk_entrepot;
638 $warehousetmp->ref = $objp->warehouse_ref;
639 $warehousetmp->label = $objp->warehouse_ref;
640 $warehousetmp->fk_parent = $objp->warehouse_parent;
645 print
'<td class="nowrap">';
646 print $product_static->getNomUrl(1,
'', 16);
651 print
'<td>'.$objp->label.
'</td>';
653 if (!empty($conf->service->enabled) && $type == 1) {
654 print
'<td class="center">';
655 if (preg_match(
'/([0-9]+)y/i', $objp->duration, $regs)) {
656 print $regs[1].
' '.$langs->trans(
"DurationYear");
657 } elseif (preg_match(
'/([0-9]+)m/i', $objp->duration, $regs)) {
658 print $regs[1].
' '.$langs->trans(
"DurationMonth");
659 } elseif (preg_match(
'/([0-9]+)d/i', $objp->duration, $regs)) {
660 print $regs[1].
' '.$langs->trans(
"DurationDay");
662 print $objp->duration;
671 print
'<td class="nowrap">';
672 if ($objp->fk_entrepot > 0) {
673 print $warehousetmp->getNomUrl(1);
678 print
'<td class="center nowrap">';
679 if ($product_lot_static->batch) {
680 print $product_lot_static->getNomUrl(1);
684 if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
685 print
'<td class="center">'.dol_print_date($db->jdate($objp->sellby),
'day').
'</td>';
688 if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
689 print
'<td class="center">'.dol_print_date($db->jdate($objp->eatby),
'day').
'</td>';
692 print
'<td class="right">';
694 if (is_null($objp->stock_physique)) {
695 if (!empty($objp->reel)) {
699 if (!empty($objp->stock_physique)) {
700 print
price2num($objp->stock_physique,
'MS');
705 print
'<td class="right">';
706 print
img_picto($langs->trans(
"StockMovement"),
'movement',
'class="pictofixedwidth"');
707 print
'<a href="'.DOL_URL_ROOT.
'/product/stock/movement_list.php?idproduct='.$product_static->id.
'&search_warehouse='.$objp->fk_entrepot.
'&search_batch='.($objp->batch !=
'Undefined' ? $objp->batch :
'Undefined').
'">'.$langs->trans(
"Movements").
'</a>';
710 print
'<td class="right nowrap">'.$product_static->LibStatut($objp->statut, 5, 0).
'</td>';
712 print
'<td class="right nowrap">'.$product_static->LibStatut($objp->tobuy, 5, 1).
'</td>';
722 print
'</table>'.
"\n";
725 print
'</form>'.
"\n";