From c3b74e66ffc7f04f214884e271f11bbfd2c46e80 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 3 Dec 2014 00:22:48 +0100 Subject: [PATCH] Fix: Add constant to hide an obscur feature --- htdocs/product/fournisseurs.php | 58 ++++++++++++++++++++------------- 1 file changed, 36 insertions(+), 22 deletions(-) diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 9832e57eb6d..7e58a8e11b9 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -34,7 +34,6 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php'; $langs->load("products"); $langs->load("suppliers"); $langs->load("bills"); -// Charges ???? if (! empty($conf->margin->enabled)) $langs->load("margins"); $id = GETPOST('id', 'int'); @@ -383,15 +382,18 @@ if ($id || $ref) print ''; // Charges ???? - if (! empty($conf->margin->enabled)) + if ($conf->global->PRODUCT_CHARGES) { - print ''; - print ''.$langs->trans("Charges").''; - print ''; - print ''; - print ''; + if (! empty($conf->margin->enabled)) + { + print ''; + print ''.$langs->trans("Charges").''; + print ''; + print ''; + print ''; + } } - + if (is_object($hookmanager)) { $parameters=array('id_fourn'=>$id_fourn,'prod_id'=>$product->id); @@ -444,11 +446,17 @@ if ($id || $ref) print ''.$langs->trans("VATRate").''; print ''.$langs->trans("PriceQtyMinHT").''; // Charges ???? - if (! empty($conf->margin->enabled)) print ''.$langs->trans("Charges").''; + if ($conf->global->PRODUCT_CHARGES) + { + if (! empty($conf->margin->enabled)) print ''.$langs->trans("Charges").''; + } print_liste_field_titre($langs->trans("UnitPriceHT"),$_SERVER["PHP_SELF"],"pfp.unitprice","",$param,'align="right"',$sortfield,$sortorder); print ''.$langs->trans("DiscountQtyMin").''; // Charges ???? - if (! empty($conf->margin->enabled)) print ''.$langs->trans("UnitCharges").''; + if ($conf->global->PRODUCT_CHARGES) + { + if (! empty($conf->margin->enabled)) print ''.$langs->trans("UnitCharges").''; + } print ''; print "\n"; @@ -494,13 +502,16 @@ if ($id || $ref) print ''; // Charges ???? - if (! empty($conf->margin->enabled)) - { - print ''; - print $productfourn->fourn_charges?price($productfourn->fourn_charges):""; - print ''; + if ($conf->global->PRODUCT_CHARGES) + { + if (! empty($conf->margin->enabled)) + { + print ''; + print $productfourn->fourn_charges?price($productfourn->fourn_charges):""; + print ''; + } } - + // Unit price print ''; print price($productfourn->fourn_unitprice); @@ -512,14 +523,17 @@ if ($id || $ref) print price2num($productfourn->fourn_remise_percent).'%'; print ''; - // Unit Charges ??? - if (! empty($conf->margin->enabled)) + // Charges ???? + if ($conf->global->PRODUCT_CHARGES) { - print ''; - print $productfourn->fourn_unitcharges?price($productfourn->fourn_unitcharges) : ($productfourn->fourn_qty?price($productfourn->fourn_charges/$productfourn->fourn_qty):" "); - print ''; + if (! empty($conf->margin->enabled)) + { + print ''; + print $productfourn->fourn_unitcharges?price($productfourn->fourn_unitcharges) : ($productfourn->fourn_qty?price($productfourn->fourn_charges/$productfourn->fourn_qty):" "); + print ''; + } } - + if (is_object($hookmanager)) { $parameters=array('id_pfp'=>$productfourn->product_fourn_price_id,'id_fourn'=>$id_fourn,'prod_id'=>$product->id);