From e3a3dd0454a54a07ca4faebeb842ca19b5041b6b Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 25 Jul 2012 12:53:02 +0200 Subject: [PATCH] Fix: it's for margin module --- htdocs/product/fournisseurs.php | 37 +++++++++++++++++---------------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index bdff801393c..177ce4b2f26 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -37,6 +37,7 @@ $langs->load("bills"); $id = GETPOST('id', 'int'); $ref = GETPOST('ref', 'alpha'); +$rowid=GETPOST('rowid','int'); $action=GETPOST('action', 'alpha'); $socid=GETPOST('socid', 'int'); $error=0; $mesg = ''; @@ -77,16 +78,16 @@ if ($action == 'remove_pf') $product = new ProductFournisseur($db); if ($product->fetch($id) > 0) { - if ($_GET["rowid"]) + if ($rowid) { - $result=$product->remove_product_fournisseur_price($_GET["rowid"]); + $result=$product->remove_product_fournisseur_price($rowid); $action = ''; $mesg = '
'.$langs->trans("PriceRemoved").'.
'; } } } -if ($action == 'updateprice' && $_POST["cancel"] <> $langs->trans("Cancel")) +if ($action == 'updateprice' && GETPOST('cancel') <> $langs->trans("Cancel")) { $id_fourn=GETPOST("id_fourn"); if (empty($id_fourn)) $id_fourn=GETPOST("search_id_fourn"); @@ -255,9 +256,9 @@ if ($id || $ref) { $langs->load("suppliers"); - if ($_GET["rowid"]) + if ($rowid) { - $product->fetch_product_fournisseur_price($_GET["rowid"]); + $product->fetch_product_fournisseur_price($rowid); print_fiche_titre($langs->trans("ChangeSupplierPrice")); } else @@ -272,14 +273,14 @@ if ($id || $ref) print ''; print ''; print ''; print ''; - print ''; print ''; // Charges ???? - if (! empty($conf->global->PRODUCT_LOAD)) + if (! empty($conf->margin->enabled)) { print ''; print ''; - print ''; print ''; } @@ -404,10 +405,10 @@ if ($id || $ref) print ''; print ''; // Charges ???? - if (! empty($conf->global->PRODUCT_LOAD)) print ''; + if (! empty($conf->margin->enabled)) print ''; print_liste_field_titre($langs->trans("UnitPriceHT"),$_SERVER["PHP_SELF"],"pfp.unitprice","",$param,'align="right"',$sortfield,$sortorder); // Charges ???? - if (! empty($conf->global->PRODUCT_LOAD)) print ''; + if (! empty($conf->margin->enabled)) print ''; print ''; print "\n"; @@ -453,7 +454,7 @@ if ($id || $ref) print ''; // Charges ???? - if (! empty($conf->global->PRODUCT_LOAD)) + if (! empty($conf->margin->enabled)) { print ''; // Unit Charges ??? - if (! empty($conf->global->PRODUCT_LOAD)) + if (! empty($conf->margin->enabled)) { print '
'.$langs->trans("Supplier").''; - if ($_GET["rowid"]) + if ($rowid) { $supplier=new Fournisseur($db); $supplier->fetch($socid); print $supplier->getNomUrl(1); print ''; print ''; - print ''; + print ''; } else { @@ -297,7 +298,7 @@ if ($id || $ref) // Ref supplier print '
'.$langs->trans("SupplierRef").''; - if ($_GET["rowid"]) + if ($rowid) { print $product->fourn_ref; } @@ -328,8 +329,8 @@ if ($id || $ref) print '
'.$langs->trans("QtyMin").''; - $quantity = $_REQUEST["qty"] ? $_REQUEST["qty"] : "1"; - if ($_GET["rowid"]) + $quantity = GETPOST('qty') ? GETPOST('qty') : "1"; + if ($rowid) { print ''; print $product->fourn_qty; @@ -342,18 +343,18 @@ if ($id || $ref) // Price qty min print ''.$langs->trans("PriceQtyMin").'fourn_price)?price($product->fourn_price):'')).'">'; + print ''; print ' '; - print $form->select_PriceBaseType(($_POST["price_base_type"]?$_POST["price_base_type"]:$product->price_base_type), "price_base_type"); + print $form->select_PriceBaseType((GETPOST('price_base_type')?GETPOST('price_base_type'):$product->price_base_type), "price_base_type"); print '
'.$langs->trans("Charges").'fourn_charges)).'">'; + print ''; print '
'.$langs->trans("VATRate").''.$langs->trans("PriceQtyMinHT").''.$langs->trans("Charges").''.$langs->trans("Charges").''.$langs->trans("UnitCharges").''.$langs->trans("UnitCharges").'
'; print $productfourn->fourn_charges?price($productfourn->fourn_charges):""; @@ -467,7 +468,7 @@ if ($id || $ref) print ''; print $productfourn->fourn_unitcharges?price($productfourn->fourn_unitcharges) : ($productfourn->fourn_qty?price($productfourn->fourn_charges/$productfourn->fourn_qty):" ");