diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 6f50978c8a8..4ec106c278a 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -196,7 +196,13 @@ if ($_GET["id"] || $_GET["ref"]) print $product->getLibStatut(2,1); print ''; - // Stock physique + // PMP + print ''.$langs->trans("AverageUnitPricePMP").''; + print ''.price($product->pmp); + print ''; + print ''; + + // Real stock print ''.$langs->trans("PhysicalStock").''; print ''.$product->stock_reel; if ($product->seuil_stock_alerte && ($product->stock_reel < $product->seuil_stock_alerte)) print ' '.img_warning($langs->trans("StockTooLow")); @@ -458,11 +464,11 @@ if ($resql) print ''; print ''.$entrepotstatic->getNomUrl(1).''; print ''.$obj->reel.($obj->reel<0?' '.img_warning():'').''; - print ''.price2num($obj->pmp,'MU').''; - print ''.price(price2num($obj->pmp*$obj->reel,'MT')).''; + print ''.price2num(($obj->pmp > 0 ? $obj->pmp : $product->pmp),'MU').''; // Ditto : Show PMP from movement or from product + print ''.price(price2num(($obj->pmp > 0 ? $obj->pmp : $product->pmp)*$obj->reel,'MT')).''; // Ditto : Show PMP from movement or from product print ''; ; $total = $total + $obj->reel; - $totalvalue = $totalvalue + price2num($obj->pmp*$obj->reel,'MT'); + $totalvalue = $totalvalue + price2num(($obj->pmp > 0 ? $obj->pmp : $product->pmp)*$obj->reel,'MT'); // Ditto : Show PMP from movement or from product $i++; $var=!$var; }