dolibarr-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dolibarr-cvs] dolibarr/htdocs/fourn/facture fiche.php


From: Regis Houssin
Subject: [Dolibarr-cvs] dolibarr/htdocs/fourn/facture fiche.php
Date: Tue, 13 Jun 2006 12:19:33 +0000

CVSROOT:        /cvsroot/dolibarr
Module name:    dolibarr
Changes by:     Regis Houssin <hregis>  06/06/13 12:19:33

Modified files:
        htdocs/fourn/facture: fiche.php 

Log message:
        Ajout possibilité de modifier une ligne produit

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/dolibarr/htdocs/fourn/facture/fiche.php?cvsroot=dolibarr&r1=1.95&r2=1.96

Patches:
Index: fiche.php
===================================================================
RCS file: /cvsroot/dolibarr/dolibarr/htdocs/fourn/facture/fiche.php,v
retrieving revision 1.95
retrieving revision 1.96
diff -u -b -r1.95 -r1.96
--- fiche.php   8 Jun 2006 21:03:20 -0000       1.95
+++ fiche.php   13 Jun 2006 12:19:33 -0000      1.96
@@ -18,7 +18,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  *
- * $Id: fiche.php,v 1.95 2006/06/08 21:03:20 eldy Exp $
+ * $Id: fiche.php,v 1.96 2006/06/13 12:19:33 hregis Exp $
  * $Source: /cvsroot/dolibarr/dolibarr/htdocs/fourn/facture/fiche.php,v $
  */
 
@@ -26,7 +26,7 @@
        \file       htdocs/fourn/facture/fiche.php
        \ingroup    facture, fournisseur
        \brief      Page des la fiche facture fournisseur
-       \version    $Revision: 1.95 $
+       \version    $Revision: 1.96 $
 */
 
 require('./pre.inc.php');
@@ -203,6 +203,18 @@
        $_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 @@
                        print '<br>';
                        $var=true;
 
-                       print '<form 
action="fiche.php?facid='.$fac->id.'&amp;action=add_ligne" method="post">';
                        print '<table class="noborder" width="100%">';
                        print '<tr 
class="liste_titre"><td>'.$langs->trans('Label').'</td>';
                        print '<td 
align="right">'.$langs->trans('PriceUHT').'</td>';
@@ -438,6 +449,28 @@
                        for ($i = 0 ; $i < sizeof($fac->lignes) ; $i++)
                        {
                                $var=!$var;
+                               // Ligne en modification
+                               if ($_GET['etat'] == '0' && $_GET['ligne_id'] 
== $fac->lignes[$i][7])
+                               {
+                                       print '<form 
action="fiche.php?facid='.$fac->id.'&amp;action=mod_ligne&amp;etat=1&amp;ligne_id='.$fac->lignes[$i][7].'"
 method="post">';
+                                       print '<input type="hidden" 
name="tauxtva" value="'.$fac->lignes[$i][2].'">';
+                                       print '<tr '.$bc[$var].'><td><input 
size="30" name="label" type="text" value="'.$fac->lignes[$i][0].'"></td>';
+                                       print '<td align="right" 
nowrap="nowrap"><input size="6" name="puht" type="text" 
value="'.price($fac->lignes[$i][1]).'"></td>';
+                                       print '<td align="right" 
nowrap="nowrap"></td>';
+                                       print '<td align="right"><input 
size="1" name="qty" type="text" value="'.$fac->lignes[$i][3].'"></td>';
+                                       print '<td align="right" 
nowrap="nowrap"><input size="6" name="totalht" type="text" 
value="'.price($fac->lignes[$i][4]).'"></td>';
+                                       print '<td align="right">';
+                                       
$html->select_tva('tauxtva',$fac->lignes[$i][2],$societe,$mysoc);
+                                       print '</td>';
+                                       print '<td align="right" 
nowrap="nowrap"></td>';
+                                       print '<td align="right" 
nowrap="nowrap"></td>';
+                                       print '<td align="center"><input 
type="submit" class="button" value="'.$langs->trans('Save').'">';
+                                       print '<br /><input type="submit" 
class="button" name="cancel" value="'.$langs->trans('Cancel').'"></td>';
+                                       print '</tr>';
+                                       print '</form>';
+                               }
+                               else // Affichage simple de la ligne
+                               {
                                print '<tr 
'.$bc[$var].'><td>'.$fac->lignes[$i][0].'</td>';
                                print '<td align="right" 
nowrap="nowrap">'.price($fac->lignes[$i][1]).'</td>';
                                print '<td align="right" 
nowrap="nowrap">'.price($fac->lignes[$i][1] * 
(1+($fac->lignes[$i][2]/100))).'</td>';
@@ -447,12 +480,15 @@
                                print '<td align="right" 
nowrap="nowrap">'.price($fac->lignes[$i][5]).'</td>';
                                print '<td align="right" 
nowrap="nowrap">'.price($fac->lignes[$i][6]).'</td>';
                                print '<td align="center">';
-                               print '<a 
href="fiche.php?facid='.$fac->id.'&amp;action=del_ligne&amp;ligne_id='.$fac->lignes[$i][7].'">'.img_delete().'</a></td>';
+                                       print '<a 
href="fiche.php?facid='.$fac->id.'&amp;action=del_ligne&amp;ligne_id='.$fac->lignes[$i][7].'">'.img_delete().'</a>';
+                                       print '<a 
href="fiche.php?facid='.$fac->id.'&amp;action=mod_ligne&amp;etat=0&amp;ligne_id='.$fac->lignes[$i][7].'">'.img_edit().'</a></td>';
                                print '</tr>';
                        }
+                       }
 
                        /* Nouvelle ligne */
                        $var=!$var;
+                       print '<form 
action="fiche.php?facid='.$fac->id.'&amp;action=add_ligne" method="post">';
                        print '<tr '.$bc[$var].'>';
                        print '<td>';
                        print '<input size="30" name="label" type="text">';
@@ -744,5 +780,5 @@
 
 $db->close();
 
-llxFooter('$Date: 2006/06/08 21:03:20 $ - $Revision: 1.95 $');
+llxFooter('$Date: 2006/06/13 12:19:33 $ - $Revision: 1.96 $');
 ?>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]