diff --git a/htdocs/langs/en_US/productbatch.lang b/htdocs/langs/en_US/productbatch.lang index cdf1313509d0b82cb6b4c7de67725d11c21cdf17..9b9fd13f5cbc902fdad50feaa8d7c6d9b792a785 100644 --- a/htdocs/langs/en_US/productbatch.lang +++ b/htdocs/langs/en_US/productbatch.lang @@ -20,3 +20,5 @@ AddDispatchBatchLine=Add a line for Shelf Life dispatching WhenProductBatchModuleOnOptionAreForced=When module Lot/Serial is on, increase/decrease stock mode is forced to last choice and can't be edited. Other options can be defined as you want. ProductDoesNotUseBatchSerial=This product does not use lot/serial number ProductLotSetup=Setup of module lot/serial +ShowCurrentStockOfLot=Show current stock for couple product/lot +ShowLogOfMovementIfLot=Show log of movements for couple product/lot diff --git a/htdocs/product/list.php b/htdocs/product/list.php index c95156b4393ffc1344e97c505409ed326e0845c7..ec55ad4f74c439d7eb08befc4f1c8015c07d7507 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -177,7 +177,7 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers +if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers { $sall=""; $sref=""; diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php index b4573bdc9e79a5065c9e5c3cf67c3c97e80df3ff..b193e553b6157327f80fc04c82de3d5ceeeb546c 100644 --- a/htdocs/product/reassort.php +++ b/htdocs/product/reassort.php @@ -73,18 +73,6 @@ if (! empty($canvas)) $objcanvas->getCanvas('product','list',$canvas); } -if (! empty($_POST["button_removefilter_x"])) -{ - $sref=""; - $snom=""; - $sall=""; - $search_sale=""; - $search_categ=""; - $type=""; - $catid=''; - $toolowstock=''; -} - // Define virtualdiffersfromphysical $virtualdiffersfromphysical=0; if (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT) || ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)) @@ -98,7 +86,17 @@ if (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT) || ! empty($conf->global * Actions */ -// None +if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers +{ + $sref=""; + $snom=""; + $sall=""; + $search_sale=""; + $search_categ=""; + $type=""; + $catid=''; + $toolowstock=''; +} @@ -180,7 +178,7 @@ if ($resql) $i = 0; - if ($num == 1 && ($sall or $snom or $sref)) + if ($num == 1 && GETPOST('autojumpifoneonly') && ($sall || $snom || $sref)) { $objp = $db->fetch_object($resql); header("Location: card.php?id=$objp->rowid"); diff --git a/htdocs/product/reassortlot.php b/htdocs/product/reassortlot.php index 2e4438c416d3e4465646167b03d8684e998afe59..43f956b5eea00d551cd25bc984abf99766e38c0f 100644 --- a/htdocs/product/reassortlot.php +++ b/htdocs/product/reassortlot.php @@ -77,7 +77,13 @@ if (! empty($canvas)) $objcanvas->getCanvas('product','list',$canvas); } -if (! empty($_POST["button_removefilter_x"])) + + +/* + * Actions + */ + +if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers { $sref=""; $snom=""; @@ -92,14 +98,6 @@ if (! empty($_POST["button_removefilter_x"])) } - -/* - * Actions - */ - -// None - - /* * View */ @@ -174,7 +172,7 @@ if ($resql) $i = 0; - if ($num == 1 && ($sall or $snom or $sref)) + if ($num == 1 && GETPOST('autojumpifoneonly') && ($sall or $snom or $sref)) { $objp = $db->fetch_object($resql); header("Location: card.php?id=$objp->rowid"); diff --git a/htdocs/product/stock/class/productlot.class.php b/htdocs/product/stock/class/productlot.class.php index 58adecd9651cfcc50c833ab9b66720f01e62a5ac..c5f29df67c6918c13cd48ed322be5f2b023c0c24 100644 --- a/htdocs/product/stock/class/productlot.class.php +++ b/htdocs/product/stock/class/productlot.class.php @@ -44,6 +44,8 @@ class Productlot extends CommonObject */ public $table_element = 'product_lot'; + public $picto='barcode'; + public $isnolinkedbythird = 1; public $ismultientitymanaged = 1; @@ -523,7 +525,7 @@ class Productlot extends CommonObject } /** - * Return a link to the user card (with optionaly the picto) + * Return a link to the a lot card (with optionaly the picto) * Use this->id,this->lastname, this->firstname * * @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto) @@ -541,7 +543,6 @@ class Productlot extends CommonObject $result = ''; - $companylink = ''; $label = '<u>' . $langs->trans("Batch") . '</u>'; $label.= '<div width="100%">'; @@ -554,7 +555,7 @@ class Productlot extends CommonObject if ($withpicto) { - $result.=($link.img_object(($notooltip?'':$label), 'label', ($notooltip?'':'class="classfortooltip"')).$linkend); + $result.=($link.img_object(($notooltip?'':$label), 'barcode', ($notooltip?'':'class="classfortooltip"')).$linkend); if ($withpicto != 2) $result.=' '; } $result.= $link . $this->batch . $linkend; diff --git a/htdocs/product/stock/productlot_card.php b/htdocs/product/stock/productlot_card.php index e1cd07d597b5098dd5bfe2a121f562ef3a46e565..3407c75a6f50794a33a662d2534ceb20c50d9a2e 100644 --- a/htdocs/product/stock/productlot_card.php +++ b/htdocs/product/stock/productlot_card.php @@ -324,10 +324,10 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea { $res = $object->fetch_optionals($object->id, $extralabels); - print load_fiche_titre($langs->trans("Batch")); + //print load_fiche_titre($langs->trans("Batch")); $head = productlot_prepare_head($object); - dol_fiche_head($head, 'card', $langs->trans("Batch"), 0, 'stock'); + dol_fiche_head($head, 'card', $langs->trans("Batch"), 0, 'barcode'); if ($action == 'delete') { @@ -398,6 +398,11 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea */ } print '</div>'."\n"; + + + print '<a href="'.DOL_URL_ROOT.'/product/reassortlot.php?sref='.urlencode($producttmp->ref).'&search_batch='.urlencode($object->batch).'">'.$langs->trans("ShowCurrentStockOfLot").'</a><br>'; + print '<br>'; + print '<a href="'.DOL_URL_ROOT.'/product/stock/mouvement.php?search_product_ref='.urlencode($producttmp->ref).'&search_batch='.urlencode($object->batch).'">'.$langs->trans("ShowLogOfMovementIfLot").'</a><br>'; } diff --git a/htdocs/product/stock/productlot_list.php b/htdocs/product/stock/productlot_list.php index 2b771a9c9aa427d67a70e1f545e6b2a04bf3481e..ecd14237787a8a0f9ff3a529c25c2a9a922b5fab 100644 --- a/htdocs/product/stock/productlot_list.php +++ b/htdocs/product/stock/productlot_list.php @@ -343,11 +343,11 @@ if ($resql) // Fields title print '<tr class="liste_titre">'; - if (! empty($arrayfields['t.entity']['checked'])) print_liste_field_titre($arrayfields['t.entity']['label'],$_SERVER['PHP_SELF'],'t.entity','',$param,'',$sortfield,$sortorder); - if (! empty($arrayfields['t.batch']['checked'])) print_liste_field_titre($arrayfields['t.batch']['label'],$_SERVER['PHP_SELF'],'t.batch','',$param,'',$sortfield,$sortorder); - if (! empty($arrayfields['t.fk_product']['checked'])) print_liste_field_titre($arrayfields['t.fk_product']['label'],$_SERVER['PHP_SELF'],'t.fk_product','',$param,'',$sortfield,$sortorder); - if (! empty($arrayfields['t.eatby']['checked'])) print_liste_field_titre($arrayfields['t.eatby']['label'],$_SERVER['PHP_SELF'],'t.eatby','',$param,'',$sortfield,$sortorder); - if (! empty($arrayfields['t.sellby']['checked'])) print_liste_field_titre($arrayfields['t.sellby']['label'],$_SERVER['PHP_SELF'],'t.sellby','',$param,'',$sortfield,$sortorder); + if (! empty($arrayfields['t.entity']['checked'])) print_liste_field_titre($arrayfields['t.entity']['label'],$_SERVER['PHP_SELF'],'t.entity','',$param,'',$sortfield,$sortorder); + if (! empty($arrayfields['t.batch']['checked'])) print_liste_field_titre($arrayfields['t.batch']['label'],$_SERVER['PHP_SELF'],'t.batch','',$param,'',$sortfield,$sortorder); + if (! empty($arrayfields['t.fk_product']['checked'])) print_liste_field_titre($arrayfields['t.fk_product']['label'],$_SERVER['PHP_SELF'],'t.fk_product','',$param,'',$sortfield,$sortorder); + if (! empty($arrayfields['t.eatby']['checked'])) print_liste_field_titre($arrayfields['t.eatby']['label'],$_SERVER['PHP_SELF'],'t.eatby','',$param,'',$sortfield,$sortorder); + if (! empty($arrayfields['t.sellby']['checked'])) print_liste_field_titre($arrayfields['t.sellby']['label'],$_SERVER['PHP_SELF'],'t.sellby','',$param,'',$sortfield,$sortorder); if (! empty($arrayfields['t.fk_user_creat']['checked'])) print_liste_field_titre($arrayfields['t.fk_user_creat']['label'],$_SERVER['PHP_SELF'],'t.fk_user_creat','',$param,'',$sortfield,$sortorder); if (! empty($arrayfields['t.fk_user_modif']['checked'])) print_liste_field_titre($arrayfields['t.fk_user_modif']['label'],$_SERVER['PHP_SELF'],'t.fk_user_modif','',$param,'',$sortfield,$sortorder); if (! empty($arrayfields['t.import_key']['checked'])) print_liste_field_titre($arrayfields['t.import_key']['label'],$_SERVER['PHP_SELF'],'t.import_key','',$param,'',$sortfield,$sortorder); @@ -460,7 +460,7 @@ if ($resql) } if (! empty($arrayfields['t.batch']['checked'])) { - print '<td>'.$productlot->getNomUrl().'</td>'; + print '<td>'.$productlot->getNomUrl(1).'</td>'; if (! $i) $totalarray['nbfield']++; } if (! empty($arrayfields['t.fk_product']['checked']))