From 7945011955b9ffb28ef9a07772dea9009b9b7238 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Tue, 19 Nov 2013 17:54:36 +0100 Subject: [PATCH] Make AJAX new line form work again FIXME: Factorize! --- htdocs/comm/propal.php | 6 ++++++ htdocs/commande/fiche.php | 6 ++++++ htdocs/compta/facture.php | 6 ++++++ htdocs/contrat/fiche.php | 6 ++++++ 4 files changed, 24 insertions(+) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 685841560bd..447e065219e 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -653,6 +653,12 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights- $price_ht = ''; $tva_tx = ''; } + if (GETPOST('usenewaddlineform')) { + $idprod=GETPOST('idprod', 'int'); + $product_desc = (GETPOST('product_desc')?GETPOST('product_desc'):(GETPOST('np_desc')?GETPOST('np_desc'):(GETPOST('dp_desc')?GETPOST('dp_desc'):''))); + $price_ht = GETPOST('price_ht'); + $tva_tx=(GETPOST('tva_tx')?GETPOST('tva_tx'):0); + } $qty = GETPOST('qty'.$predef); $remise_percent=GETPOST('remise_percent'.$predef); diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index ccc2f13cbea..d40d8bf5a7c 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -587,6 +587,12 @@ else if ($action == 'addline' && $user->rights->commande->creer) $price_ht = ''; $tva_tx = ''; } + if (GETPOST('usenewaddlineform')) { + $idprod=GETPOST('idprod', 'int'); + $product_desc = (GETPOST('product_desc')?GETPOST('product_desc'):(GETPOST('np_desc')?GETPOST('np_desc'):(GETPOST('dp_desc')?GETPOST('dp_desc'):''))); + $price_ht = GETPOST('price_ht'); + $tva_tx=(GETPOST('tva_tx')?GETPOST('tva_tx'):0); + } $qty = GETPOST('qty'.$predef); $remise_percent=GETPOST('remise_percent'.$predef); diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index dc573de6eca..293796c77a5 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1145,6 +1145,12 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights- $price_ht = ''; $tva_tx = ''; } + if (GETPOST('usenewaddlineform')) { + $idprod=GETPOST('idprod', 'int'); + $product_desc = (GETPOST('product_desc')?GETPOST('product_desc'):(GETPOST('np_desc')?GETPOST('np_desc'):(GETPOST('dp_desc')?GETPOST('dp_desc'):''))); + $price_ht = GETPOST('price_ht'); + $tva_tx=(GETPOST('tva_tx')?GETPOST('tva_tx'):0); + } $qty = GETPOST('qty'.$predef); $remise_percent=GETPOST('remise_percent'.$predef); diff --git a/htdocs/contrat/fiche.php b/htdocs/contrat/fiche.php index 4a919ece44c..65d485d129c 100644 --- a/htdocs/contrat/fiche.php +++ b/htdocs/contrat/fiche.php @@ -359,6 +359,12 @@ else if ($action == 'addline' && $user->rights->contrat->creer) $price_ht = ''; $tva_tx = ''; } + if (GETPOST('usenewaddlineform')) { + $idprod=GETPOST('idprod', 'int'); + $product_desc = (GETPOST('product_desc')?GETPOST('product_desc'):(GETPOST('np_desc')?GETPOST('np_desc'):(GETPOST('dp_desc')?GETPOST('dp_desc'):''))); + $price_ht = GETPOST('price_ht'); + $tva_tx=(GETPOST('tva_tx')?GETPOST('tva_tx'):0); + } $qty = GETPOST('qty'.$predef); $remise_percent=GETPOST('remise_percent'.$predef);