diff --git a/htdocs/compta/commande/fiche.php b/htdocs/compta/commande/fiche.php
index 0448362ab61..d778b50bcf2 100644
--- a/htdocs/compta/commande/fiche.php
+++ b/htdocs/compta/commande/fiche.php
@@ -58,6 +58,50 @@ if ($_GET["action"] == 'facturee')
$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='
'.$commande->error.'
';
+ }
+}
+
+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 @@ if ($_GET["id"] > 0)
print '';
print '';
if ($_GET['action'] == 'editconditions')
- {
+ {
$html->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$commande->id,$commande->cond_reglement_id,'cond_reglement_id');
}
else
diff --git a/htdocs/expedition/commande.php b/htdocs/expedition/commande.php
index 41a561b4dc3..dc57c0ce323 100644
--- a/htdocs/expedition/commande.php
+++ b/htdocs/expedition/commande.php
@@ -65,6 +65,52 @@ if ($_POST["action"] == 'confirm_cloture' && $_POST["confirm"] == 'yes')
$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=' '.$commande->error.' ';
+ }
+}
+
+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);
|