diff --git a/htdocs/product/fiche.php b/htdocs/product/fiche.php index d6417f6b37b..75000cccb21 100644 --- a/htdocs/product/fiche.php +++ b/htdocs/product/fiche.php @@ -87,7 +87,7 @@ if ($_POST["action"] == 'add' && $user->rights->produit->creer) $product->multiprices["$i"] = ""; } } - + if ( $value != $current_lang ) $e_product = $product; $id = $product->create($user); @@ -106,8 +106,8 @@ if ($_POST["action"] == 'add' && $user->rights->produit->creer) } // Action mise a jour d'un produit ou service -if ($_POST["action"] == 'update' && - $_POST["cancel"] <> $langs->trans("Cancel") && +if ($_POST["action"] == 'update' && + $_POST["cancel"] <> $langs->trans("Cancel") && $user->rights->produit->creer) { $product = new Product($db); @@ -177,7 +177,7 @@ if ($_GET["action"] == 'clone' && $user->rights->produit->creer) else if ($id == -3) { $db->rollback(); - + $_error = 1; $_GET["action"] = ""; dolibarr_print_error($product->db); @@ -185,12 +185,12 @@ if ($_GET["action"] == 'clone' && $user->rights->produit->creer) else { $db->rollback(); - + dolibarr_print_error($product->db); } } } - else + else { $db->rollback(); @@ -206,7 +206,7 @@ if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == 'yes' && $user- $product = new Product($db); $product->fetch($_GET["id"]); $result = $product->delete($_GET["id"]); - + if ($result == 0) { llxHeader(); @@ -229,7 +229,7 @@ if ($_POST["action"] == 'addinpropal') { $propal = New Propal($db); $result=$propal->fetch($_POST["propalid"]); - if ($result <= 0) + if ($result <= 0) { dolibarr_print_error($db,$propal->error); exit; @@ -237,15 +237,15 @@ if ($_POST["action"] == 'addinpropal') $soc = new Societe($db); $soc->fetch($propal->socidp,$user); - + $prod = new Product($db, $_GET['id']); $result=$prod->fetch($_GET['id']); - if ($result <= 0) + if ($result <= 0) { dolibarr_print_error($db,$prod->error); exit; } - + // multiprix if ($conf->global->PRODUIT_MULTIPRICES == 1) { @@ -255,7 +255,7 @@ if ($_POST["action"] == 'addinpropal') { $pu=$prod->price; } - + $desc = $prod->description; $tva_tx = get_default_tva($mysoc,$soc,$prod->tva_tx); @@ -271,7 +271,7 @@ if ($_POST["action"] == 'addinpropal') Header("Location: ../comm/propal.php?propalid=".$propal->id); return; } - + $mesg = $langs->trans("ErrorUnknown").": $result"; } @@ -282,13 +282,13 @@ if ($_POST["action"] == 'addincommande') { $product = new Product($db); $result = $product->fetch($_GET["id"]); - + $commande = New Commande($db); $commande->fetch($_POST["commandeid"]); - + $soc = new Societe($db); $soc->fetch($commande->socidp,$user); - + // multiprix if ($conf->global->PRODUIT_MULTIPRICES == 1) { @@ -298,7 +298,7 @@ if ($_POST["action"] == 'addincommande') { $pu=$product->price; } - + $tva_tx = get_default_tva($mysoc,$soc,$product->tva_tx); $result = $commande->addline($commande->id, @@ -307,7 +307,7 @@ if ($_POST["action"] == 'addincommande') $pu, $_POST["qty"], $tva_tx, - $product->id, + $product->id, $_POST["remise_percent"]); Header("Location: ../commande/fiche.php?id=".$commande->id); @@ -321,13 +321,13 @@ if ($_POST["action"] == 'addinfacture' && $user->rights->facture->creer) { $product = new Product($db); $result = $product->fetch($_GET["id"]); - + $facture = New Facture($db); $facture->fetch($_POST["factureid"]); - + $soc = new Societe($db); $soc->fetch($facture->socidp,$user); - + // multiprix if ($conf->global->PRODUIT_MULTIPRICES == 1) { @@ -337,7 +337,7 @@ if ($_POST["action"] == 'addinfacture' && $user->rights->facture->creer) { $pu=$product->price; } - + $tva_tx = get_default_tva($mysoc,$soc,$product->tva_tx); $facture->addline($facture->id, @@ -387,16 +387,16 @@ $html = new Form($db); if ($_GET["action"] == 'create' && $user->rights->produit->creer) { $product = new Product($db); - + if ($mesg) print "$mesg\n"; - + if ($_error == 1) { $product = $e_product; } llxHeader("","",$langs->trans("CardProduct".$product->type)); - + print '