diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index 8c0cc76f075..19875f55148 100644 --- a/htdocs/langs/en_US/stocks.lang +++ b/htdocs/langs/en_US/stocks.lang @@ -96,7 +96,7 @@ RealStock=Real Stock RealStockDesc=Physical/real stock is the stock currently in the warehouses. RealStockWillAutomaticallyWhen=The real stock will be modified according to this rule (as defined in the Stock module): VirtualStock=Virtual stock -VirtualStockAtDate=Virtual stock at date +VirtualStockAtDate=Virtual stock at a future date VirtualStockAtDateDesc=Virtual stock once all the pending orders that are planned to be processed before the chosen date will be finished VirtualStockDesc=Virtual stock is the calculated stock available once all open/pending actions (that affect stocks) are closed (purchase orders received, sales orders shipped, manufacturing orders produced, etc) AtDate=At date diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 23900c85c0b..247d11d00c6 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -763,7 +763,7 @@ if ($id > 0 || $ref) { if ($result < 0) { dol_print_error($db, $object->error); } - $helpondiff .= ' ('.$langs->trans("ProductQtyInDraft").': '.$object->stats_commande['qty'].')'; + $helpondiff .= ' ('.$langs->trans("ProductQtyInDraft").': '.$object->stats_commande['qty'].')'; } // Number of product from customer order already sent (partial shipping) @@ -797,7 +797,7 @@ if ($id > 0 || $ref) { if ($result < 0) { dol_print_error($db, $object->error); } - $helpondiff .= ' ('.$langs->trans("ProductQtyInDraftOrWaitingApproved").': '.$object->stats_commande_fournisseur['qty'].')'; + $helpondiff .= ' ('.$langs->trans("ProductQtyInDraftOrWaitingApproved").': '.$object->stats_commande_fournisseur['qty'].')'; } // Number of product from supplier order already received (partial receipt) @@ -983,6 +983,7 @@ if (!$variants) { $entrepotstatic = new Entrepot($db); $product_lot_static = new Productlot($db); + $num = 0; $total = 0; $totalvalue = $totalvaluesell = 0; @@ -1025,18 +1026,45 @@ if (!$variants) { print ''.(price2num($object->pmp) ? price(price2num($object->pmp * $obj->reel, 'MT')) : '').''; // Sell price + $minsellprice = null; $maxsellprice = null; print ''; - print price(price2num($object->price, 'MU'), 1); if (!empty($conf->global->PRODUIT_MULTIPRICES)) { + foreach ($object->multiprices as $priceforlevel) { + if (is_numeric($priceforlevel)) { + if (is_null($maxsellprice) || $priceforlevel > $maxsellprice) { + $maxsellprice = $priceforlevel; + } + if (is_null($minsellprice) || $priceforlevel < $minsellprice) { + $minsellprice = $priceforlevel; + } + } + } + print ''; + if ($minsellprice != $maxsellprice) { + print price(price2num($minsellprice, 'MU'), 1).' - '.price(price2num($maxsellprice, 'MU'), 1); + } else { + print price(price2num($minsellprice, 'MU'), 1); + } + print ''; print $form->textwithpicto('', $langs->trans("Variable")); + } else { + print price(price2num($object->price, 'MU'), 1); } print ''; // Value sell print ''; - print price(price2num($object->price * $obj->reel, 'MT'), 1); if (!empty($conf->global->PRODUIT_MULTIPRICES)) { + print ''; + if ($minsellprice != $maxsellprice) { + print price(price2num($minsellprice * $obj->reel, 'MT'), 1).' - '.price(price2num($maxsellprice * $obj->reel, 'MT'), 1); + } else { + print price(price2num($minsellprice * $obj->reel, 'MT'), 1); + } + print ''; print $form->textwithpicto('', $langs->trans("Variable")); + } else { + print price(price2num($object->price * $obj->reel, 'MT'), 1); } print ''; print ''; @@ -1148,17 +1176,28 @@ if (!$variants) { print $totalvalue ? price(price2num($totalvalue, 'MT'), 1) : ' '; print ''; print ''; - print ($total ? price($totalvaluesell / $total, 1) : ' '); - if (!empty($conf->global->PRODUIT_MULTIPRICES)) { - print $form->textwithpicto('', $langs->trans("Variable")); + if ($num) { + if ($total) { + print ''; + if (!empty($conf->global->PRODUIT_MULTIPRICES)) { + print $form->textwithpicto('', $langs->trans("Variable")); + } else { + print price($totalvaluesell / $total, 1); + } + print ''; + } } print ''; // Value to sell - print ''; - if (empty($conf->global->PRODUIT_MULTIPRICES)) { - print price(price2num($totalvaluesell, 'MT'), 1); - } else { - print $langs->trans("Variable"); + print ''; + if ($num) { + print ''; + if (empty($conf->global->PRODUIT_MULTIPRICES)) { + print price(price2num($totalvaluesell, 'MT'), 1); + } else { + print $form->textwithpicto('', $langs->trans("Variable")); + } + print ''; } print ''; print ''; @@ -1180,13 +1219,13 @@ if (!$variants) { } print ''; if (!empty($user->rights->produit->creer)) { - print ''; + print ''; print ''; print ''; print ''; print ''; } else { - print ''; + print ''; print ''; print ''; print ''; @@ -1200,7 +1239,7 @@ if (!$variants) { foreach ($lines as $line) { $ent = new Entrepot($db); $ent->fetch($line['fk_entrepot']); - print ''; + print ''; print ''; print ''; if (!empty($user->rights->produit->creer)) {
'.$formproduct->selectWarehouses('', 'fk_entrepot').'
'.$formproduct->selectWarehouses('', 'fk_entrepot').'
'.$langs->trans("Warehouse").'
'.$langs->trans("Warehouse").''.$langs->trans("StockLimit").''.$langs->trans("DesiredStock").'
'.$ent->getNomUrl(3).'
'.$ent->getNomUrl(3).''.$line['seuil_stock_alerte'].''.$line['desiredstock'].'