diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php
index 00dde07cb10..1aeede8b5ba 100644
--- a/htdocs/expedition/class/expedition.class.php
+++ b/htdocs/expedition/class/expedition.class.php
@@ -613,7 +613,7 @@ class Expedition extends CommonObject
if ($conf->livraison_bon->enabled)
{
- if ($this->statut == 1)
+ if ($this->statut == 1 || $this->statut == 2)
{
// Expedition validee
include_once DOL_DOCUMENT_ROOT.'/livraison/class/livraison.class.php';
diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php
index ed6c44ef8a0..363ec801e3a 100644
--- a/htdocs/expedition/fiche.php
+++ b/htdocs/expedition/fiche.php
@@ -1331,12 +1331,20 @@ else
{
if ($user->rights->facture->creer)
{
- // TODO until the module is autonomous
print ''.$langs->trans("CreateBill").'';
- //print ''.$langs->trans("CreateBill").'';
}
+ }
- if ($user->rights->expedition->creer && $object->statut > 0 && ! $object->billed)
+ // This is just to generate a delivery receipt
+ if ($conf->livraison_bon->enabled && ($object->statut == 1 || $object->statut == 2) && $user->rights->expedition->livraison->creer && empty($object->linkedObjectsIds))
+ {
+ print 'id.'&action=create_delivery">'.$langs->trans("DeliveryOrder").'';
+ }
+
+ // Close
+ if (! empty($conf->facture->enabled) && $object->statut > 0)
+ {
+ if ($user->rights->expedition->creer && $object->statut > 0 && ! $object->billed)
{
$label="Close";
// Label here should be "Close" or "ClassifyBilled" if we decided to make bill on shipments instead of orders
@@ -1345,11 +1353,6 @@ else
}
}
- if ($conf->livraison_bon->enabled && $object->statut == 1 && $user->rights->expedition->livraison->creer && empty($object->linkedObjectsIds))
- {
- print 'id.'&action=create_delivery">'.$langs->trans("DeliveryOrder").'';
- }
-
if ($user->rights->expedition->supprimer)
{
print 'id.'&action=delete">'.$langs->trans("Delete").'';
diff --git a/htdocs/livraison/fiche.php b/htdocs/livraison/fiche.php
index 98ca4ce2f0e..d0a4807e33d 100644
--- a/htdocs/livraison/fiche.php
+++ b/htdocs/livraison/fiche.php
@@ -295,7 +295,6 @@ if ($action == 'create')
/*
* Lignes de commandes
- *
*/
print '
| '.$langs->trans("Description").' | '; - print 'Quan. commandee | '; - print 'Quan. livree | '; - print 'Quan. a livrer | '; + print ''.$langs->trans("QtyOrdered").' | '; + print ''.$langs->trans("QtyReceived").' | '; + print ''.$langs->trans("QtyToShip").' | '; if (! empty($conf->stock->enabled)) { print ''.$langs->trans("Stock").' | ';