diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index 57dc3ac1f8e..b3873ae821f 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -85,7 +85,7 @@ if ($_REQUEST['action'] == 'setremisepercent' && $user->rights->fournisseur->com */ if ($_POST['action'] == 'addline' && $user->rights->fournisseur->commande->creer) { - if ($_POST['qty'] && (($_POST['pu'] && ($_POST['np_desc'] || $_POST['dp_desc'])) || $_POST['idprodfournprice'])) + if (($_POST['qty'] || $_POST['pqty']) && (($_POST['pu'] && ($_POST['np_desc'] || $_POST['dp_desc'])) || $_POST['idprodfournprice'])) { $commande = new CommandeFournisseur($db); $ret=$commande->fetch($id); @@ -120,6 +120,10 @@ if ($_POST['action'] == 'addline' && $user->rights->fournisseur->commande->creer $desc = $product->description; $desc.= $product->description && $_POST['np_desc'] ? "\n" : ""; $desc.= $_POST['np_desc']; + + $qty = $_POST['qty'] ? $_POST['qty'] : $_POST['pqty']; + + $remise_percent = $_POST["remise_percent"] ? $_POST["remise_percent"] : $_POST["p_remise_percent"]; $tva_tx = get_default_tva($societe,$mysoc,$product->tva_tx,$product->id); $type = $product->type; @@ -127,12 +131,12 @@ if ($_POST['action'] == 'addline' && $user->rights->fournisseur->commande->creer $result=$commande->addline( $desc, $pu, - $_POST['qty'], + $qty, $tva_tx, $product->id, $_POST['idprodfournprice'], $product->fourn_ref, - $_POST['remise_percent'], + $remise_percent, 'HT', $type ); @@ -883,11 +887,11 @@ if ($id > 0 || ! empty($ref)) //if($soc->tva_assuj == "0") //print '0'; //else - print $html->select_tva('tva_tx',$conf->defaulttx,$soc,$mysoc); + print $html->select_tva('tva_tx',($_POST["tva_tx"]?$_POST["tva_tx"]:$conf->defaulttx),$soc,$mysoc); print ''; - print ''; - print ''; - print '%'; + print ''; + print ''; + print 'remise_client).'">%'; print ''; print ''; @@ -938,8 +942,8 @@ if ($id > 0 || ! empty($ref)) } print ''; - print ''; - print '%'; + print ''; + print 'remise_client).'">%'; print ''; print '';