dolibarr-dev
[Top][All Lists]
Advanced

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

[Dolibarr-dev] Patch bug #23878 : Modification éléments dans gestion de


From: Raphaël Bertrand (Résultic)
Subject: [Dolibarr-dev] Patch bug #23878 : Modification éléments dans gestion des commandes
Date: Fri, 25 Jul 2008 14:49:39 +0200
User-agent: Thunderbird 2.0.0.14 (Windows/20080421)

Patch corrigeant le bug #23878 par l'ajout du traitement de certaines requêtes post proposées mais non gérées dans cette fiche.

(copiees collees depuis htdocs\commande\fiche.php)


--
*Raphaël Bertrand*
Résultic - Management & Informatique
Siège : 11 rue Tronchet - 69006 LYON
Bureaux : 11 pl Maréchal Lyautey - 69006 LYON
Fixe. 08 74 77 00 70
Fax. 08 25 24 85 02
E-Mail : address@hidden
Index: compta/commande/fiche.php
===================================================================
RCS file: /sources/dolibarr/dolibarr/htdocs/compta/commande/fiche.php,v
retrieving revision 1.72
diff -u -r1.72 fiche.php
--- compta/commande/fiche.php   20 May 2008 00:09:13 -0000      1.72
+++ compta/commande/fiche.php   25 Jul 2008 10:35:57 -0000
@@ -58,6 +58,50 @@
   $commande->classer_facturee();
 }
 
+// Positionne ref commande client
+if ($_POST['action'] == 'set_ref_client' && $user->rights->commande->creer)
+{
+       $commande = new Commande($db);
+       $commande->fetch($_GET['id']);
+       $commande->set_ref_client($user, $_POST['ref_client']);
+}
+
+if ($_POST['action'] == 'setdate_livraison' && $user->rights->commande->creer)
+{
+       //print "x ".$_POST['liv_month'].", ".$_POST['liv_day'].", 
".$_POST['liv_year'];
+       $datelivraison=dolibarr_mktime(0, 0, 0, $_POST['liv_month'], 
$_POST['liv_day'], $_POST['liv_year']);
+
+       $commande = new Commande($db);
+       $commande->fetch($_GET['id']);
+       $result=$commande->set_date_livraison($user,$datelivraison);
+       if ($result < 0)
+       {
+               $mesg='<div class="error">'.$commande->error.'</div>';
+       }
+}
+
+if ($_POST['action'] == 'setdeliveryadress' && $user->rights->commande->creer)
+{
+       $commande = new Commande($db);
+       $commande->fetch($_GET['id']);
+       $commande->set_adresse_livraison($user,$_POST['adresse_livraison_id']);
+}
+
+if ($_POST['action'] == 'setmode' && $user->rights->commande->creer)
+{
+       $commande = new Commande($db);
+       $commande->fetch($_GET['id']);
+       $result=$commande->mode_reglement($_POST['mode_reglement_id']);
+       if ($result < 0) dolibarr_print_error($db,$commande->error);
+}
+
+if ($_POST['action'] == 'setconditions' && $user->rights->commande->creer)
+{
+       $commande = new Commande($db);
+       $commande->fetch($_GET['id']);
+       $result=$commande->cond_reglement($_POST['cond_reglement_id']);
+       if ($result < 0) dolibarr_print_error($db,$commande->error);
+}
 
 
 llxHeader('',$langs->trans("OrderCard"),"Commande");
@@ -229,7 +273,7 @@
                        print '</tr></table>';
                        print '</td><td colspan="2">';
                        if ($_GET['action'] == 'editconditions')
-                       {
+                       {       
                                
$html->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$commande->id,$commande->cond_reglement_id,'cond_reglement_id');
                        }
                        else
Index: expedition/commande.php
===================================================================
RCS file: /sources/dolibarr/dolibarr/htdocs/expedition/commande.php,v
retrieving revision 1.88
diff -u -r1.88 commande.php
--- expedition/commande.php     26 May 2008 21:27:50 -0000      1.88
+++ expedition/commande.php     25 Jul 2008 10:34:27 -0000
@@ -65,6 +65,52 @@
   $result = $commande->cloture($user);
 }
 
+// Positionne ref commande client
+if ($_POST['action'] == 'set_ref_client' && $user->rights->commande->creer)
+{
+       $commande = new Commande($db);
+       $commande->fetch($_GET['id']);
+       $commande->set_ref_client($user, $_POST['ref_client']);
+}
+
+if ($_POST['action'] == 'setdate_livraison' && $user->rights->commande->creer)
+{
+       //print "x ".$_POST['liv_month'].", ".$_POST['liv_day'].", 
".$_POST['liv_year'];
+       $datelivraison=dolibarr_mktime(0, 0, 0, $_POST['liv_month'], 
$_POST['liv_day'], $_POST['liv_year']);
+
+       $commande = new Commande($db);
+       $commande->fetch($_GET['id']);
+       $result=$commande->set_date_livraison($user,$datelivraison);
+       if ($result < 0)
+       {
+               $mesg='<div class="error">'.$commande->error.'</div>';
+       }
+}
+
+if ($_POST['action'] == 'setdeliveryadress' && $user->rights->commande->creer)
+{
+       $commande = new Commande($db);
+       $commande->fetch($_GET['id']);
+       $commande->set_adresse_livraison($user,$_POST['adresse_livraison_id']);
+}
+
+if ($_POST['action'] == 'setmode' && $user->rights->commande->creer)
+{
+       $commande = new Commande($db);
+       $commande->fetch($_GET['id']);
+       $result=$commande->mode_reglement($_POST['mode_reglement_id']);
+       if ($result < 0) dolibarr_print_error($db,$commande->error);
+}
+
+if ($_POST['action'] == 'setconditions' && $user->rights->commande->creer)
+{
+       $commande = new Commande($db);
+       $commande->fetch($_GET['id']);
+       $result=$commande->cond_reglement($_POST['cond_reglement_id']);
+       if ($result < 0) dolibarr_print_error($db,$commande->error);
+}
+
+
 $html = new Form($db);
 $formfile = new FormFile($db);
 


reply via email to

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