diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php
index 3082a65311d..cfe2ba753b2 100644
--- a/htdocs/commande/fiche.php
+++ b/htdocs/commande/fiche.php
@@ -1493,7 +1493,9 @@ else
* Liste des expéditions
*/
$sql = 'SELECT e.rowid,e.ref,'.$db->pdate('e.date_expedition').' as de';
+ if ($conf->livraison->enabled) $sql .= ", l.rowid as livraison_id, l.ref as livraison_ref";
$sql .= ' FROM '.MAIN_DB_PREFIX.'expedition as e';
+ if ($conf->livraison->enabled) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."livraison as l ON l.fk_expedition = e.rowid";
$sql .= ' WHERE e.fk_commande = '. $commande->id;
$result = $db->query($sql);
@@ -1505,7 +1507,12 @@ else
print_titre($langs->trans('Sendings'));
$i = 0; $total = 0;
print '
';
- print '| '.$langs->trans('Sendings').' | '.$langs->trans('Date').' |
';
+ print '| '.$langs->trans('Sendings').' | ';
+ if ($conf->livraison->enabled)
+ {
+ print ''.$langs->trans("DeliveryOrder").' | ';
+ }
+ print ''.$langs->trans('Date').' |
';
$var=True;
while ($i < $num)
@@ -1514,6 +1521,18 @@ else
$var=!$var;
print '';
print '| '.img_object($langs->trans('ShowSending'),'sending').' '.$objp->ref.' | ';
+ if ($conf->livraison->enabled)
+ {
+ $langs->load('deliveries');
+ if ($objp->livraison_id)
+ {
+ print ''.img_object($langs->trans("ShowSending"),'generic').' '.$objp->livraison_ref.' | ';
+ }
+ else
+ {
+ print ''.$langs->trans("CreateDeliveryOrder").' | ';
+ }
+ }
print ''.dolibarr_print_date($objp->de).' |
';
$i++;
}
diff --git a/htdocs/compta/commande/fiche.php b/htdocs/compta/commande/fiche.php
index 657a887759e..aa7e594a7e0 100644
--- a/htdocs/compta/commande/fiche.php
+++ b/htdocs/compta/commande/fiche.php
@@ -585,7 +585,9 @@ if ($_GET["id"] > 0)
* Liste des expéditions
*/
$sql = "SELECT e.rowid,e.ref,".$db->pdate("e.date_expedition")." as de";
+ if ($conf->livraison->enabled) $sql .= ", l.rowid as livraison_id, l.ref as livraison_ref";
$sql .= " FROM ".MAIN_DB_PREFIX."expedition as e";
+ if ($conf->livraison->enabled) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."livraison as l ON l.fk_expedition = e.rowid";
$sql .= " WHERE e.fk_commande = ". $commande->id;
$result = $db->query($sql);
@@ -597,7 +599,12 @@ if ($_GET["id"] > 0)
print_titre($langs->trans("Sendings"));
$i = 0; $total = 0;
print '';
- print "| ".$langs->trans("Sendings")." | ".$langs->trans("Date")." |
\n";
+ print "| ".$langs->trans("Sendings")." | ";
+ if ($conf->livraison->enabled)
+ {
+ print ''.$langs->trans("DeliveryOrder").' | ';
+ }
+ print "".$langs->trans("Date")." |
\n";
$var=True;
while ($i < $num)
@@ -606,6 +613,18 @@ if ($_GET["id"] > 0)
$var=!$var;
print "";
print '| '.img_object($langs->trans("ShowSending"),"sending").' '.$objp->ref.' | ';
+ if ($conf->livraison->enabled)
+ {
+ $langs->load('deliveries');
+ if ($objp->livraison_id)
+ {
+ print ''.img_object($langs->trans("ShowSending"),'generic').' '.$objp->livraison_ref.' | ';
+ }
+ else
+ {
+ print ''.$langs->trans("CreateDeliveryOrder").' | ';
+ }
+ }
print "".dolibarr_print_date($objp->de)." |
\n";
$i++;
}
diff --git a/htdocs/expedition/commande.php b/htdocs/expedition/commande.php
index 32baec2df77..b6b43732d24 100644
--- a/htdocs/expedition/commande.php
+++ b/htdocs/expedition/commande.php
@@ -539,6 +539,7 @@ if ($_GET["id"] > 0)
if ($conf->livraison->enabled)
{
+ $langs->load('deliveries');
if ($objp->livraison_id)
{
print ''.img_object($langs->trans("ShowSending"),'generic').' '.$objp->livraison_ref.' | ';
diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php
index 63dd1262ccc..13a79b1575a 100644
--- a/htdocs/expedition/fiche.php
+++ b/htdocs/expedition/fiche.php
@@ -37,6 +37,7 @@ require_once(DOL_DOCUMENT_ROOT."/propal.class.php");
require_once(DOL_DOCUMENT_ROOT."/product/stock/entrepot.class.php");
$langs->load("bills");
+$langs->load('deliveries');
$user->getrights('expedition');
if (!$user->rights->expedition->lire)
diff --git a/htdocs/livraison/fiche.php b/htdocs/livraison/fiche.php
index 9deaf798d81..a80cc8f6a0e 100644
--- a/htdocs/livraison/fiche.php
+++ b/htdocs/livraison/fiche.php
@@ -42,6 +42,7 @@ if (!$conf->expedition->enabled && $conf->stock->enabled)
$langs->load("bills");
+$langs->load('deliveries');
$user->getrights('expedition');
if (!$user->rights->expedition->livraison->lire)