From 6b5f46624cc230bc4e436bd68f38323d385b7042 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 9 Jul 2020 16:19:40 +0200 Subject: [PATCH] Fix label of AWP --- htdocs/bom/tpl/objectline_title.tpl.php | 2 +- htdocs/langs/en_US/stocks.lang | 4 ++-- htdocs/product/fournisseurs.php | 32 +++++++++++++++---------- htdocs/product/stock/product.php | 16 ++++++++++--- 4 files changed, 35 insertions(+), 19 deletions(-) diff --git a/htdocs/bom/tpl/objectline_title.tpl.php b/htdocs/bom/tpl/objectline_title.tpl.php index ab0184189a8..56e6cb59657 100644 --- a/htdocs/bom/tpl/objectline_title.tpl.php +++ b/htdocs/bom/tpl/objectline_title.tpl.php @@ -69,7 +69,7 @@ print ''.$form->textwithpicto($langs print ''.$form->textwithpicto($langs->trans('ManufacturingEfficiency'), $langs->trans('ValueOfMeansLoss')).''; // Cost -print ''.$langs->trans('CostPrice').''; +print ''.$form->textwithpicto($langs->trans("TotalCost"), $langs->trans("BOMTotalCost")).''; print ''; // No width to allow autodim diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index f62bf5d9cc5..cd11bdb9803 100644 --- a/htdocs/langs/en_US/stocks.lang +++ b/htdocs/langs/en_US/stocks.lang @@ -90,8 +90,8 @@ DescWareHouse=Description warehouse LieuWareHouse=Localisation warehouse WarehousesAndProducts=Warehouses and products WarehousesAndProductsBatchDetail=Warehouses and products (with detail per lot/serial) -AverageUnitPricePMPShort=Weighted average input price -AverageUnitPricePMP=Weighted average input price +AverageUnitPricePMPShort=Weighted average price +AverageUnitPricePMPDesc=The input average unit price we had to pay to suppliers to get the product into our stock. SellPriceMin=Selling Unit Price EstimatedStockValueSellShort=Value for sell EstimatedStockValueSell=Value for sell diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 7cc5d3966c1..563fb881152 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -413,19 +413,7 @@ if ($id > 0 || $ref) print '
'; print ''; - // Minimum Price - print ''; - print ''; - // Cost price. Can be used for margin module for option "calculate margin on explicit cost price - // Accountancy sell code print ''; - print '
'.$langs->trans("BuyingPriceMin").''; - $product_fourn = new ProductFournisseur($db); - if ($product_fourn->find_min_price_product_fournisseur($object->id) > 0) - { - if ($product_fourn->product_fourn_price_id > 0) print $product_fourn->display_price_product_fournisseur(); - else print $langs->trans("NotDefined"); - } - print '
'; $textdesc = $langs->trans("CostPriceDescription"); $textdesc .= "
".$langs->trans("CostPriceUsage"); @@ -435,7 +423,25 @@ if ($id > 0 || $ref) print $form->editfieldval($text, 'cost_price', $object->cost_price, $object, $usercancreate, 'amount:6'); print '
'; + // PMP + print ''.$form->textwithpicto($langs->trans("AverageUnitPricePMPShort"), $langs->trans("AverageUnitPricePMPDesc")).''; + print ''; + if ($object->pmp > 0) print price($object->pmp).' '.$langs->trans("HT"); + print ''; + print ''; + + // Best buying Price + print ''.$langs->trans("BuyingPriceMin").''; + print ''; + $product_fourn = new ProductFournisseur($db); + if ($product_fourn->find_min_price_product_fournisseur($object->id) > 0) + { + if ($product_fourn->product_fourn_price_id > 0) print $product_fourn->display_price_product_fournisseur(); + else print $langs->trans("NotDefined"); + } + print ''; + + print ''; print ''; print '
'; diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 89e99df4b1e..5ae9e06f2ca 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -54,7 +54,7 @@ if (!empty($conf->variants->enabled)) { } // Load translation files required by the page -$langs->loadlangs(array('products', 'orders', 'bills', 'stocks', 'sendings')); +$langs->loadlangs(array('products', 'suppliers', 'orders', 'bills', 'stocks', 'sendings', 'margins')); if (!empty($conf->productbatch->enabled)) $langs->load("productbatch"); $backtopage = GETPOST('backtopage', 'alpha'); @@ -564,8 +564,18 @@ if ($id > 0 || $ref) print ''; } + // Cost price. Can be used for margin module for option "calculate margin on explicit cost price + print ''; + $textdesc = $langs->trans("CostPriceDescription"); + $textdesc .= "
".$langs->trans("CostPriceUsage"); + $text = $form->textwithpicto($langs->trans("CostPrice"), $textdesc, 1, 'help', ''); + print $form->editfieldkey($text, 'cost_price', $object->cost_price, $object, $usercancreate, 'amount:6'); + print ''; + print $form->editfieldval($text, 'cost_price', $object->cost_price, $object, $usercancreate, 'amount:6'); + print ''; + // PMP - print ''.$langs->trans("AverageUnitPricePMP").''; + print ''.$form->textwithpicto($langs->trans("AverageUnitPricePMPShort"), $langs->trans("AverageUnitPricePMPDesc")).''; print ''; if ($object->pmp > 0) print price($object->pmp).' '.$langs->trans("HT"); print ''; @@ -822,7 +832,7 @@ if (!$variants) { print ''; print ''.$langs->trans("Warehouse").''; print ''.$langs->trans("NumberOfUnit").''; - print ''.$langs->trans("AverageUnitPricePMPShort").''; + print ''.$form->textwithpicto($langs->trans("AverageUnitPricePMPShort"), $langs->trans("AverageUnitPricePMPDesc")).''; print ''.$langs->trans("EstimatedStockValueShort").''; print ''.$langs->trans("SellPriceMin").''; print ''.$langs->trans("EstimatedStockValueSellShort").'';