diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php
index 2d0f34314ce..4f3fbb9c0a8 100644
--- a/htdocs/fourn/commande/fiche.php
+++ b/htdocs/fourn/commande/fiche.php
@@ -177,6 +177,18 @@ if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == yes && $user->r
Header("Location: index.php");
}
+if ($_POST["action"] == 'livraison' && $user->rights->fournisseur->commande->receptionner)
+{
+ $commande = new CommandeFournisseur($db);
+ $commande->fetch($_GET["id"]);
+
+ $date_liv = mktime(0,0,0,$_POST["remonth"],$_POST["reday"],$_POST["reyear"]);
+
+ $result = $commande->Livraison($user, $date_liv, $_POST["type"]);
+ Header("Location: fiche.php?id=".$_GET["id"]);
+}
+
+
/*
* Créé une commande
*/
@@ -282,7 +294,7 @@ if ($_GET["id"] > 0)
*/
if ($_GET["action"] == 'commande')
{
- $date_com = mktime(12,12,12,$_POST["remonth"],$_POST["reday"],$_POST["reyear"]);
+ $date_com = mktime(0,0,0,$_POST["remonth"],$_POST["reday"],$_POST["reyear"]);
$html->form_confirm("fiche.php?id=".$commande->id."&datecommande=".$date_com."&methode=".$_POST["methodecommande"],
"Envoi de la commande","Etes-vous sûr de vouloir confirmer cette commande en date du ".strftime("%d/%m/%Y",$date_com)." ?","confirm_commande");
print '
';
@@ -675,6 +687,38 @@ if ($_GET["id"] > 0)
print '';
print '';
}
+ /*
+ *
+ *
+ */
+ if ( $user->rights->fournisseur->commande->receptionner && ($commande->statut == 3 ||$commande->statut == 4 ))
+ {
+ /**
+ * Réceptionner
+ */
+ $form = new Form($db);
+
+ print '