diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index b18ed68eaa2..d75ec44798f 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2577,7 +2577,7 @@ class Form } } if ($showempty) { - $out .= ''; + $out .= ''; } $i = 0; diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index aabbe1791b3..4585841911b 100644 --- a/htdocs/langs/en_US/stocks.lang +++ b/htdocs/langs/en_US/stocks.lang @@ -155,7 +155,7 @@ StockMustBeEnoughForInvoice=Stock level must be enough to add product/service to StockMustBeEnoughForOrder=Stock level must be enough to add product/service to order (check is done on current real stock when adding a line into order whatever the rule for automatic stock change) StockMustBeEnoughForShipment= Stock level must be enough to add product/service to shipment (check is done on current real stock when adding a line into shipment whatever the rule for automatic stock change) MovementLabel=Label of movement -TypeMovement=Type of movement +TypeMovement=Direction of movement DateMovement=Date of movement InventoryCode=Movement or inventory code IsInPackage=Contained into package diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 3c04618c900..8b2d729c29c 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -1107,6 +1107,47 @@ class MouvementStock extends CommonObject // There is no specific properties. All data into insert are provided as method parameter. } + /** + * Return html string with picto for type of movement + * + * @param int $withlabel With label + * @return string String with URL + */ + public function getTypeMovement($withlabel = 0) + { + global $langs; + + $s = ''; + switch ($this->type) { + case "0": + $s = ''; + if ($withlabel) { + $s .= $langs->trans('StockIncreaseAfterCorrectTransfer'); + } + break; + case "1": + $s = ''; + if ($withlabel) { + $s .= $langs->trans('StockDecreaseAfterCorrectTransfer'); + } + break; + case "2": + $s = ''; + if ($withlabel) { + $s .= $langs->trans('StockDecrease'); + } + break; + case "3": + $s = ''; + if ($withlabel) { + $s .= $langs->trans('StockIncrease'); + } + break; + } + + return $s; + } + /** * Return a link (with optionaly the picto) * Use this->id,this->lastname, this->firstname diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index 7c2e2df67e5..62cbe7f8620 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -944,22 +944,6 @@ if ($resql) { print ''; print ''; } - if (!empty($arrayfields['m.type_mouvement']['checked'])) { - // Type of movement - print ''; - //print ''; - print ''; - print ajax_combobox('search_type_mouvement'); - // TODO: add new function $formentrepot->selectTypeOfMovement(...) like - // print $formproduct->selectWarehouses($search_warehouse, 'search_warehouse', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, null, 'maxwidth200'); - print ''; - } if (!empty($arrayfields['origin']['checked'])) { // Origin of movement print ''; @@ -972,6 +956,22 @@ if ($resql) { print '  '; print ''; } + if (!empty($arrayfields['m.type_mouvement']['checked'])) { + // Type of movement + print ''; + //print ''; + print ''; + print ajax_combobox('search_type_mouvement'); + // TODO: add new function $formentrepot->selectTypeOfMovement(...) like + // print $formproduct->selectWarehouses($search_warehouse, 'search_warehouse', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, null, 'maxwidth200'); + print ''; + } if (!empty($arrayfields['m.value']['checked'])) { // Qty print ''; @@ -1044,15 +1044,15 @@ if ($resql) { if (!empty($arrayfields['m.label']['checked'])) { print_liste_field_titre($arrayfields['m.label']['label'], $_SERVER["PHP_SELF"], "m.label", "", $param, "", $sortfield, $sortorder); } - if (!empty($arrayfields['m.type_mouvement']['checked'])) { - print_liste_field_titre($arrayfields['m.type_mouvement']['label'], $_SERVER["PHP_SELF"], "m.type_mouvement", "", $param, '', $sortfield, $sortorder, 'center '); - } if (!empty($arrayfields['origin']['checked'])) { print_liste_field_titre($arrayfields['origin']['label'], $_SERVER["PHP_SELF"], "", "", $param, "", $sortfield, $sortorder); } if (!empty($arrayfields['m.fk_projet']['checked'])) { print_liste_field_titre($arrayfields['m.fk_projet']['label'], $_SERVER["PHP_SELF"], "m.fk_projet", "", $param, '', $sortfield, $sortorder); } + if (!empty($arrayfields['m.type_mouvement']['checked'])) { + print_liste_field_titre($arrayfields['m.type_mouvement']['label'], $_SERVER["PHP_SELF"], "m.type_mouvement", "", $param, '', $sortfield, $sortorder, 'center '); + } if (!empty($arrayfields['m.value']['checked'])) { print_liste_field_titre($arrayfields['m.value']['label'], $_SERVER["PHP_SELF"], "m.value", "", $param, '', $sortfield, $sortorder, 'right '); } @@ -1113,6 +1113,8 @@ if ($resql) { $warehousestatic->fk_parent = $objp->fk_parent; $warehousestatic->statut = $objp->statut; + $movement->type = $objp->type_mouvement; + $arrayofuniqueproduct[$objp->rowid] = $objp->produit; if (!empty($objp->fk_origin)) { $origin = $movement->get_origin($objp->fk_origin, $objp->origintype); @@ -1176,23 +1178,6 @@ if ($resql) { // Label of movement print ''.$objp->label.''; } - if (!empty($arrayfields['m.type_mouvement']['checked'])) { - // Type of movement - switch ($objp->type_mouvement) { - case "0": - print ''.$langs->trans('StockIncreaseAfterCorrectTransfer').''; - break; - case "1": - print ''.$langs->trans('StockDecreaseAfterCorrectTransfer').''; - break; - case "2": - print ''.$langs->trans('StockDecrease').''; - break; - case "3": - print ''.$langs->trans('StockIncrease').''; - break; - } - } if (!empty($arrayfields['origin']['checked'])) { // Origin of movement print ''.$origin.''; @@ -1205,13 +1190,25 @@ if ($resql) { } print ''; } + if (!empty($arrayfields['m.type_mouvement']['checked'])) { + // Type of movement + print ''; + print $movement->getTypeMovement(); + print ''; + } if (!empty($arrayfields['m.value']['checked'])) { // Qty print ''; - if ($objp->qt > 0) { + if ($objp->qty > 0) { + print ''; print '+'; + print $objp->qty; + print ''; + } else { + print ''; + print $objp->qty; + print ''; } - print $objp->qty; print ''; } if (!empty($arrayfields['m.price']['checked'])) { diff --git a/htdocs/product/stock/stockatdate.php b/htdocs/product/stock/stockatdate.php index cbdaa62014b..5a3b0cb0a9c 100644 --- a/htdocs/product/stock/stockatdate.php +++ b/htdocs/product/stock/stockatdate.php @@ -358,12 +358,12 @@ print ''.$langs->trans('Date').' '.$form->sel print '   '; print img_picto('', 'product').' '; print $langs->trans('Product').' '; -$form->select_produits($productid, 'productid', '', 0, 0, -1, 2, '', 0, array(), 0, '1', 0, 'maxwidth300'); +print $form->select_produits($productid, 'productid', '', 0, 0, -1, 2, '', 0, array(), 0, '1', 0, 'maxwidth300', 0, '', null, 1); print '   '; print img_picto('', 'stock').' '; print $langs->trans('Warehouse').' '; -print $formproduct->selectWarehouses((GETPOSTISSET('fk_warehouse') ? $fk_warehouse : 'ifone'), 'fk_warehouse', '', 1); +print $formproduct->selectWarehouses((GETPOSTISSET('fk_warehouse') ? $fk_warehouse : 'ifone'), 'fk_warehouse', '', 1, 0, 0, '', 0, 0, null, '', '', 1, false, 'e.ref'); print ''; $parameters = array(); diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 9a9b4e7ed6c..6549a4d38cb 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -768,6 +768,19 @@ i.fa-mars::before, i.fa-venus::before, i.fa-genderless::before { opacity: 0.4; padding-: 3px; } +.stockmovemententry { + color: #080; + transform: rotate(0.25turn); + font-size: 1.2em; +} +.stockmovementexit { + color: #968822; + transform: rotate(0.3turn); + font-size: 1.2em; +} +.stockmovement { + font-size: 1.4em; +} body[class*="colorblind-"] .text-warning{ color :