diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php
index 4842de41dbf..3a921f97edf 100644
--- a/htdocs/commande/card.php
+++ b/htdocs/commande/card.php
@@ -2493,13 +2493,13 @@ if ($action == 'create' && $user->rights->commande->creer)
if ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && $object->getNbOfProductsLines() > 0) {
if (($conf->expedition_bon->enabled && $user->rights->expedition->creer) || ($conf->livraison_bon->enabled && $user->rights->expedition->livraison->creer)) {
if ($user->rights->expedition->creer) {
- print '
';
+ print '';
} else {
- print '';
+ print '';
}
} else {
$langs->load("errors");
- print '';
+ print '';
}
}
}
diff --git a/htdocs/core/lib/sendings.lib.php b/htdocs/core/lib/sendings.lib.php
index d81b636633f..488a74b76a3 100644
--- a/htdocs/core/lib/sendings.lib.php
+++ b/htdocs/core/lib/sendings.lib.php
@@ -172,9 +172,9 @@ function show_list_sending_receive($origin,$origin_id,$filter='')
$expedition=new Expedition($db);
$warehousestatic=new Entrepot($db);
- $sql = "SELECT obj.rowid, obj.fk_product, obj.label, obj.description, obj.product_type as fk_product_type, obj.qty as qty_asked, obj.date_start, obj.date_end";
- $sql.= ", ed.qty as qty_shipped, ed.fk_expedition as expedition_id, ed.fk_origin_line, ed.fk_entrepot as warehouse_id";
- $sql.= ", e.rowid as sendingid, e.ref as exp_ref, e.date_creation, e.date_delivery, e.date_expedition,";
+ $sql = "SELECT obj.rowid, obj.fk_product, obj.label, obj.description, obj.product_type as fk_product_type, obj.qty as qty_asked, obj.date_start, obj.date_end,";
+ $sql.= " ed.rowid as edrowid, ed.qty as qty_shipped, ed.fk_expedition as expedition_id, ed.fk_origin_line, ed.fk_entrepot as warehouse_id,";
+ $sql.= " e.rowid as sendingid, e.ref as exp_ref, e.date_creation, e.date_delivery, e.date_expedition,";
//if ($conf->livraison_bon->enabled) $sql .= " l.rowid as livraison_id, l.ref as livraison_ref, l.date_delivery, ld.qty as qty_received,";
$sql.= ' p.label as product_label, p.ref, p.fk_product_type, p.rowid as prodid, p.tobatch as product_tobatch,';
$sql.= ' p.description as product_desc';
@@ -183,6 +183,7 @@ function show_list_sending_receive($origin,$origin_id,$filter='')
$sql.= ", ".MAIN_DB_PREFIX.$origin."det as obj";
//if ($conf->livraison_bon->enabled) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."livraison as l ON l.fk_expedition = e.rowid LEFT JOIN ".MAIN_DB_PREFIX."livraisondet as ld ON ld.fk_livraison = l.rowid AND obj.rowid = ld.fk_origin_line";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON obj.fk_product = p.rowid";
+ //TODO Add link to expeditiondet_batch
$sql.= " WHERE e.entity IN (".getEntity('expedition', 1).")";
$sql.= " AND obj.fk_".$origin." = ".$origin_id;
$sql.= " AND obj.rowid = ed.fk_origin_line";
@@ -210,11 +211,17 @@ function show_list_sending_receive($origin,$origin_id,$filter='')
print ''.$langs->trans("Description").' | ';
print ''.$langs->trans("DateCreation").' | ';
print ''.$langs->trans("DateDeliveryPlanned").' | ';
- print ''.$langs->trans("QtyShipped").' | ';
+ print ''.$langs->trans("QtyPreparedOrShipped").' | ';
if (! empty($conf->stock->enabled))
{
print ''.$langs->trans("Warehouse").' | ';
}
+ /*TODO Add link to expeditiondet_batch
+ if (! empty($conf->productbatch->enabled))
+ {
+ print '';
+ print ' | ';
+ }*/
if (! empty($conf->livraison_bon->enabled))
{
print ''.$langs->trans("DeliveryOrder").' | ';
@@ -231,7 +238,9 @@ function show_list_sending_receive($origin,$origin_id,$filter='')
print "";
// Sending id
- print '| '.img_object($langs->trans("ShowSending"),'sending').' '.$objp->exp_ref.' | ';
+ print '';
+ print ''.img_object($langs->trans("ShowSending"),'sending').' '.$objp->exp_ref.'';
+ print ' | ';
// Description
if ($objp->fk_product > 0)
@@ -328,6 +337,34 @@ function show_list_sending_receive($origin,$origin_id,$filter='')
print '';
}
+ // Batch number managment
+ /*TODO Add link to expeditiondet_batch
+ if (! empty($conf->productbatch->enabled))
+ {
+ var_dump($objp->edrowid);
+ $lines[$i]->detail_batch
+ if (isset($lines[$i]->detail_batch))
+ {
+ print '';
+ if ($lines[$i]->product_tobatch)
+ {
+ $detail = '';
+ foreach ($lines[$i]->detail_batch as $dbatch)
+ {
+ $detail.= $langs->trans("DetailBatchFormat",$dbatch->batch,dol_print_date($dbatch->eatby,"day"),dol_print_date($dbatch->sellby,"day"),$dbatch->dluo_qty).' ';
+ }
+ print $form->textwithtooltip(img_picto('', 'object_barcode').' '.$langs->trans("DetailBatchNumber"),$detail);
+ }
+ else
+ {
+ print $langs->trans("NA");
+ }
+ print ' | ';
+ } else {
+ print ' | ';
+ }
+ }*/
+
// Informations on receipt
if (! empty($conf->livraison_bon->enabled))
{
diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php
index 799eed27c23..b94723d5878 100644
--- a/htdocs/expedition/card.php
+++ b/htdocs/expedition/card.php
@@ -613,7 +613,7 @@ $warehousestatic = new Entrepot($db);
if ($action == 'create2')
{
- print load_fiche_titre($langs->trans("CreateASending")).'
';
+ print load_fiche_titre($langs->trans("CreateShipment")).'
';
print $langs->trans("ShipmentCreationIsDoneFromOrder");
$action=''; $id=''; $ref='';
}
@@ -623,7 +623,7 @@ if ($action == 'create')
{
$expe = new Expedition($db);
- print load_fiche_titre($langs->trans("CreateASending"));
+ print load_fiche_titre($langs->trans("CreateShipment"));
if (! $origin)
{
setEventMessages($langs->trans("ErrorBadParameters"), null, 'errors');
@@ -1715,7 +1715,7 @@ else if ($id || $ref)
//if ($filter) $sql.= $filter;
$sql.= " ORDER BY obj.fk_product";
- dol_syslog("show_list_sending_receive", LOG_DEBUG);
+ dol_syslog("get list of shipment lines", LOG_DEBUG);
$resql = $db->query($sql);
if ($resql)
{
diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php
index 3fa5de43447..4674a2a4583 100644
--- a/htdocs/expedition/shipment.php
+++ b/htdocs/expedition/shipment.php
@@ -695,7 +695,7 @@ if ($id > 0 || ! empty($ref))
{
if ($user->rights->expedition->creer)
{
- print ''.$langs->trans("NewSending").'';
+ print ''.$langs->trans("CreateShipment").'';
if ($toBeShippedTotal <= 0)
{
print ' '.img_warning($langs->trans("WarningNoQtyLeftToSend"));
@@ -703,7 +703,7 @@ if ($id > 0 || ! empty($ref))
}
else
{
- print ''.$langs->trans("NewSending").'';
+ print ''.$langs->trans("CreateShipment").'';
}
}
print "";
@@ -721,42 +721,46 @@ if ($id > 0 || ! empty($ref))
{
if ($user->rights->expedition->creer)
{
- print load_fiche_titre($langs->trans("NewSending"));
-
+ //print load_fiche_titre($langs->trans("CreateShipment"));
+ print '';
+
print '
\n";
- print '
';
+
+ print '
';
$somethingshown=1;
@@ -764,7 +768,7 @@ if ($id > 0 || ! empty($ref))
else
{
print '';
}
}
diff --git a/htdocs/langs/en_US/sendings.lang b/htdocs/langs/en_US/sendings.lang
index b85b61bc334..1b90020edde 100644
--- a/htdocs/langs/en_US/sendings.lang
+++ b/htdocs/langs/en_US/sendings.lang
@@ -16,8 +16,9 @@ NbOfSendings=Number of shipments
NumberOfShipmentsByMonth=Number of shipments by month
SendingCard=Shipment card
NewSending=New shipment
-CreateASending=Create a shipment
+CreateShipment=Create shipment
QtyShipped=Qty shipped
+QtyPreparedOrShipped=Qty prepared or shipped
QtyToShip=Qty to ship
QtyReceived=Qty received
QtyInOtherShipments=Qty in other shipments
diff --git a/htdocs/livraison/card.php b/htdocs/livraison/card.php
index c1236f239bd..b6097886529 100644
--- a/htdocs/livraison/card.php
+++ b/htdocs/livraison/card.php
@@ -750,14 +750,6 @@ else
// Rien a droite
print '
';
-
- // List of existing shipment and delivery receipts
- /*if ($expedition->origin_id)
- {
- print '
';
- //show_list_sending_receive($expedition->origin,$expedition->origin_id," AND e.rowid <> ".$expedition->id);
- show_list_sending_receive($expedition->origin,$expedition->origin_id);
- }*/
}
else
{