From b1c6df7a292c51a85c34b9d462a8927318508475 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 13 Jun 2006 12:19:33 +0000 Subject: [PATCH] =?UTF-8?q?Ajout=20possibilit=E9=20de=20modifier=20une=20l?= =?UTF-8?q?igne=20produit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/fourn/facture/fiche.php | 60 +++++++++++++++++++++++++++------- 1 file changed, 48 insertions(+), 12 deletions(-) diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index a625ef68264..a244b9245f6 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -203,6 +203,18 @@ if ($_GET['action'] == 'del_ligne') $_GET['action'] = 'edit'; } +// Modification d'une ligne +if ($_GET['action'] == 'mod_ligne') +{ + if ($_GET['etat'] == '1' && !$_GET['cancel']) // si on valide la modification + { + $facfou = new FactureFournisseur($db,'',$_GET['facid']); + + $facfou->updateline($_GET['ligne_id'], $_POST['label'], $_POST['puht'], $_POST['tauxtva'], $_POST['qty']); + } + $_GET['action'] = 'edit'; +} + if ($_GET['action'] == 'add_ligne') { $facfou = new FactureFournisseur($db, '', $_GET['facid']); @@ -425,7 +437,6 @@ else print '
'; $var=true; - print '
'; print ''; print ''; print ''; @@ -438,21 +449,46 @@ else for ($i = 0 ; $i < sizeof($fac->lignes) ; $i++) { $var=!$var; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; + // Ligne en modification + if ($_GET['etat'] == '0' && $_GET['ligne_id'] == $fac->lignes[$i][7]) + { + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + } + else // Affichage simple de la ligne + { + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + } } /* Nouvelle ligne */ $var=!$var; + print ''; print ''; print '
'.$langs->trans('Label').''.$langs->trans('PriceUHT').'
'.$fac->lignes[$i][0].''.price($fac->lignes[$i][1]).''.price($fac->lignes[$i][1] * (1+($fac->lignes[$i][2]/100))).''.$fac->lignes[$i][3].''.price($fac->lignes[$i][4]).''.$fac->lignes[$i][2].''.price($fac->lignes[$i][5]).''.price($fac->lignes[$i][6]).''; - print ''.img_delete().'
'; + $html->select_tva('tauxtva',$fac->lignes[$i][2],$societe,$mysoc); + print ''; + print '
'.$fac->lignes[$i][0].''.price($fac->lignes[$i][1]).''.price($fac->lignes[$i][1] * (1+($fac->lignes[$i][2]/100))).''.$fac->lignes[$i][3].''.price($fac->lignes[$i][4]).''.$fac->lignes[$i][2].''.price($fac->lignes[$i][5]).''.price($fac->lignes[$i][6]).''; + print ''.img_delete().''; + print ''.img_edit().'
'; print '';