From 710e12420f21ad7e2a845ece529318f40f0d5820 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur <eldy@destailleur.fr> Date: Mon, 10 Oct 2016 02:01:30 +0200 Subject: [PATCH] Use correct picto for lot --- htdocs/langs/en_US/productbatch.lang | 2 ++ htdocs/product/list.php | 2 +- htdocs/product/reassort.php | 26 +++++++++---------- htdocs/product/reassortlot.php | 18 ++++++------- .../product/stock/class/productlot.class.php | 7 ++--- htdocs/product/stock/productlot_card.php | 9 +++++-- htdocs/product/stock/productlot_list.php | 12 ++++----- 7 files changed, 40 insertions(+), 36 deletions(-) diff --git a/htdocs/langs/en_US/productbatch.lang b/htdocs/langs/en_US/productbatch.lang index cdf1313509d..9b9fd13f5cb 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 c95156b4393..ec55ad4f74c 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 b4573bdc9e7..b193e553b61 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 2e4438c416d..43f956b5eea 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 58adecd9651..c5f29df67c6 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 e1cd07d597b..3407c75a6f5 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 2b771a9c9aa..ecd14237787 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'])) -- GitLab