diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php
index 44f1d7050a3..1cbb92f13eb 100644
--- a/htdocs/expedition/fiche.php
+++ b/htdocs/expedition/fiche.php
@@ -21,11 +21,11 @@
// Code identique a /expedition/commande.php
/**
- \file htdocs/expedition/fiche.php
- \ingroup expedition
- \brief Fiche descriptive d'une expedition
- \version $Id$
-*/
+ * \file htdocs/expedition/fiche.php
+ * \ingroup expedition
+ * \brief Fiche descriptive d'une expedition
+ * \version $Id$
+ */
require("./pre.inc.php");
require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
@@ -44,14 +44,14 @@ $langs->load('stocks');
$langs->load('other');
if (! $user->rights->expedition->lire)
- accessforbidden();
+accessforbidden();
// Security customer access
if ($user->societe_id > 0)
{
- $action = '';
- $socid = $user->societe_id;
+ $action = '';
+ $socid = $user->societe_id;
}
$origin = $_GET["origin"]?$_GET["origin"]:$_POST["origin"]; // Example: commande, propal
@@ -63,53 +63,53 @@ $origin_id = $_GET["object_id"]?$_GET["object_id"]:$_POST["object_id"]; // Id o
if ($_POST["action"] == 'add')
{
- $db->begin();
+ $db->begin();
- // Creation de l'objet expedition
- $expedition = new Expedition($db);
+ // Creation de l'objet expedition
+ $expedition = new Expedition($db);
- $expedition->date_expedition = time();
- $expedition->note = $_POST["note"];
- $expedition->origin = $origin;
- $expedition->origin_id = $origin_id;
+ $expedition->date_expedition = time();
+ $expedition->note = $_POST["note"];
+ $expedition->origin = $origin;
+ $expedition->origin_id = $origin_id;
- // On boucle sur chaque ligne du document d'origine pour compléter objet expedition
- // avec qté à livrer
- $class = ucfirst($expedition->origin);
- $object = new $class($db);
- $object->fetch($expedition->origin_id);
- //$object->fetch_lines();
-
- $expedition->socid = $object->socid;
- $expedition->expedition_method_id = $_POST["expedition_method_id"];
- $expedition->tracking_number = $_POST["tracking_number"];
-
- for ($i = 0 ; $i < sizeof($object->lignes) ; $i++)
- {
- $ent = "entl".$i;
- $idl = "idl".$i;
- $qty = "qtyl".$i;
- $entrepot_id = $_POST[$ent]?$_POST[$ent]:$_POST["entrepot_id"];
- if ($_POST[$qty] > 0)
- {
- $expedition->addline($entrepot_id,$_POST[$idl],$_POST[$qty]);
- }
- }
-
- $ret=$expedition->create($user);
- if ($ret > 0)
- {
- $db->commit();
- Header("Location: fiche.php?id=".$expedition->id);
- exit;
- }
- else
- {
- $db->rollback();
- $mesg='
";
-
+
/*
* Lignes de commandes
*
*/
print '';
-
+
//$lignes = $object->fetch_lines(1);
$numAsked = sizeof($object->lignes);
-
+
/* Lecture des expeditions déjà effectuées */
$object->loadExpeditions();
-
+
if ($numAsked)
- {
- print '';
- print '| '.$langs->trans("Description").' | ';
- print ''.$langs->trans("QtyOrdered").' | ';
- print ''.$langs->trans("QtyShipped").' | ';
- print ''.$langs->trans("QtyToShip").' | ';
- if ($conf->stock->enabled)
- {
- if ($_GET["entrepot_id"])
- {
- print ''.$langs->trans("Stock").' | ';
- }
- else
- {
- print ''.$langs->trans("Warehouse").' | ';
- }
- }
- print "
\n";
- }
-
+ {
+ print '';
+ print '| '.$langs->trans("Description").' | ';
+ print ''.$langs->trans("QtyOrdered").' | ';
+ print ''.$langs->trans("QtyShipped").' | ';
+ print ''.$langs->trans("QtyToShip").' | ';
+ if ($conf->stock->enabled)
+ {
+ if ($_GET["entrepot_id"])
+ {
+ print ''.$langs->trans("Stock").' | ';
+ }
+ else
+ {
+ print ''.$langs->trans("Warehouse").' | ';
+ }
+ }
+ print "
\n";
+ }
+
$var=true;
$indiceAsked = 0;
while ($indiceAsked < $numAsked)
- {
- $ligne = $object->lignes[$indiceAsked];
- $var=!$var;
- print "\n";
- if ($ligne->fk_product > 0)
- {
- $product = new Product($db);
- $product->fetch($ligne->fk_product);
-
- print '| ';
- print ''.img_object($langs->trans("ShowProduct"),"product").' '.$product->ref.' - '.$product->libelle;
- if ($ligne->description) print nl2br($ligne->description);
- print ' | ';
- }
- else
- {
- print "".nl2br($ligne->description)." | \n";
- }
-
- print ''.$ligne->qty.' | ';
-
- print '';
- $quantityDelivered = $object->expeditions[$ligne->fk_product];
- print $quantityDelivered;
- print ' | ';
-
- $quantityAsked = $ligne->qty;
- $quantityToBeDelivered = $quantityAsked - $quantityDelivered;
-
- if ($conf->stock->enabled)
- {
- $defaultqty=0;
- if ($_GET["entrepot_id"])
- {
- $stock = $product->stock_entrepot[$_GET["entrepot_id"]];
- $stock+=0; // Convertit en numérique
- $defaultqty=min($quantityToBeDelivered, $stock);
- if ($defaultqty < 0) $defaultqty=0;
- }
-
- // Quantité à livrer
- print '';
- print '';
- print '';
- print ' | ';
-
- // Stock
- if ($_GET["entrepot_id"])
- {
- print ''.$stock;
- if ($stock < $quantityToBeDelivered)
- {
- print ' '.img_warning($langs->trans("StockTooLow"));
- }
- print ' | ';
- }
- else
- {
- $array=array();
-
- $sql = "SELECT e.rowid, e.label, ps.reel";
- $sql.= " FROM ".MAIN_DB_PREFIX."product_stock as ps, ".MAIN_DB_PREFIX."entrepot as e";
- $sql.= " WHERE ps.fk_entrepot = e.rowid AND fk_product = '".$product->id."'";
- $result = $db->query($sql) ;
- if ($result)
- {
- $num = $db->num_rows($result);
- $i=0;
- if ($num > 0)
+ {
+ $ligne = $object->lignes[$indiceAsked];
+ $var=!$var;
+ print "
\n";
+ if ($ligne->fk_product > 0)
+ {
+ $product = new Product($db);
+ $product->fetch($ligne->fk_product);
+
+ print '| ';
+ print ''.img_object($langs->trans("ShowProduct"),"product").' '.$product->ref.' - '.$product->libelle;
+ if ($ligne->description) print nl2br($ligne->description);
+ print ' | ';
+ }
+ else
+ {
+ print "".nl2br($ligne->description)." | \n";
+ }
+
+ print ''.$ligne->qty.' | ';
+
+ print '';
+ $quantityDelivered = $object->expeditions[$ligne->fk_product];
+ print $quantityDelivered;
+ print ' | ';
+
+ $quantityAsked = $ligne->qty;
+ $quantityToBeDelivered = $quantityAsked - $quantityDelivered;
+
+ if ($conf->stock->enabled)
+ {
+ $defaultqty=0;
+ if ($_GET["entrepot_id"])
+ {
+ $stock = $product->stock_entrepot[$_GET["entrepot_id"]];
+ $stock+=0; // Convertit en numérique
+ $defaultqty=min($quantityToBeDelivered, $stock);
+ if ($defaultqty < 0) $defaultqty=0;
+ }
+
+ // Quantité à livrer
+ print '';
+ print '';
+ print '';
+ print ' | ';
+
+ // Stock
+ if ($_GET["entrepot_id"])
+ {
+ print ''.$stock;
+ if ($stock < $quantityToBeDelivered)
+ {
+ print ' '.img_warning($langs->trans("StockTooLow"));
+ }
+ print ' | ';
+ }
+ else
+ {
+ $array=array();
+
+ $sql = "SELECT e.rowid, e.label, ps.reel";
+ $sql.= " FROM ".MAIN_DB_PREFIX."product_stock as ps, ".MAIN_DB_PREFIX."entrepot as e";
+ $sql.= " WHERE ps.fk_entrepot = e.rowid AND fk_product = '".$product->id."'";
+ $result = $db->query($sql) ;
+ if ($result)
+ {
+ $num = $db->num_rows($result);
+ $i=0;
+ if ($num > 0)
{
- while ($i < $num)
- {
- $obj = $db->fetch_object($result);
- $array[$obj->rowid] = $obj->label.' ('.$obj->reel.')';
- $i++;
- }
+ while ($i < $num)
+ {
+ $obj = $db->fetch_object($result);
+ $array[$obj->rowid] = $obj->label.' ('.$obj->reel.')';
+ $i++;
+ }
}
- $db->free($result);
- }
- else
- {
- $this->error=$db->error();
- return -1;
- }
-
- print '';
- $html->select_array('entl'.$i,$array,'',1,0,0);
- print ' | ';
- }
- }
- else
- {
- // Quantité à livrer
- print '';
- print '';
- print '';
- print ' | ';
- }
-
- print "
\n";
-
- $indiceAsked++;
- }
-
+ $db->free($result);
+ }
+ else
+ {
+ $this->error=$db->error();
+ return -1;
+ }
+
+ print '';
+ $html->select_array('entl'.$i,$array,'',1,0,0);
+ print ' | ';
+ }
+ }
+ else
+ {
+ // Quantité à livrer
+ print '';
+ print '';
+ print '';
+ print ' | ';
+ }
+
+ print "\n";
+
+ $indiceAsked++;
+ }
+
/*
*
*/
-
+
print '
|
';
print "
";
print '';
- }
- else
- {
+ }
+ else
+ {
dolibarr_print_error($db);
+ }
}
- }
}
else
/* *************************************************************************** */
@@ -460,288 +460,293 @@ else
/* */
/* *************************************************************************** */
{
- if ($_GET["id"] > 0)
- {
- $expedition = New Expedition($db);
- $result = $expedition->fetch($_GET["id"]);
- $lignes = $expedition->lignes;
- $num_prod = sizeof($lignes);
-
- if ($expedition->id > 0)
+ if ($_GET["id"] > 0)
{
- $object = $expedition->origin;
- $expedition->fetch_object();
-
- if (strlen($expedition->tracking_number) && strlen($expedition->expedition_method_id)) {
- $expedition->GetUrlTrackingStatus();
- }
-
- $soc = new Societe($db);
- $soc->fetch($expedition->socid);
-
- $h=0;
- $head[$h][0] = DOL_URL_ROOT."/expedition/fiche.php?id=".$expedition->id;
- $head[$h][1] = $langs->trans("SendingCard");
- $hselected = $h;
- $h++;
-
- if ($conf->livraison_bon->enabled && $expedition->livraison_id)
- {
- $head[$h][0] = DOL_URL_ROOT."/livraison/fiche.php?id=".$expedition->livraison_id;
- $head[$h][1] = $langs->trans("DeliveryCard");
- $h++;
- }
-
- dolibarr_fiche_head($head, $hselected, $langs->trans("Sending"));
-
- if ($mesg) print $mesg;
-
- /*
- * Confirmation de la suppression
- *
- */
- if ($_GET["action"] == 'delete')
- {
- $html->form_confirm($_SERVER['PHP_SELF'].'?id='.$expedition->id,$langs->trans('DeleteSending'),'Etes-vous sûr de vouloir supprimer cette expedition ?','confirm_delete');
- print '';
-
- // Ref
- print '| '.$langs->trans("Ref").' | ';
- print ''.$expedition->ref.' |
';
-
- // Customer
- print '| '.$langs->trans("Customer").' | ';
- print ''.$soc->getNomUrl(1).' | ';
- print "
";
-
- // Document liée
- print '| ';
- if ($conf->commande->enabled)
- {
- $order=new Commande($db);
- $order->fetch($expedition->$object->id);
- print $langs->trans("RefOrder").' | ';
- print '';
- print $order->getNomUrl(1,4);
- print " | \n";
- }
- else
- {
- $propal=new Propal($db);
- $propal->fetch($livraison->origin_id);
- print $langs->trans("RefProposal").'';
- print '';
- print $propal->getNomUrl(1,'expedition');
- print " | \n";
- }
- print '
';
-
- // Ref client
- print '| '.$langs->trans("RefCustomer").' | ';
- print ''.$object->ref_client." | \n";
- print '
';
-
- // Date
- print '| '.$langs->trans("Date").' | ';
- print ''.dolibarr_print_date($expedition->date,"day")." | \n";
- print '
';
-
- // Poids Total
- print '| '.$langs->trans("TotalWeight").' | ';
- print ''.$totalWeight.' '.measuring_units_string($weightUnit,"weight")." | \n";
- print '
';
-
- // Volume Total
- print '| '.$langs->trans("TotalVolume").' | ';
- print ''.$totalVolume.' '.measuring_units_string($volumeUnit,"volume")." | \n";
- print '
';
-
- // Status
- print '| '.$langs->trans("Status").' | ';
- print ''.$expedition->getLibStatut(4)." | \n";
- print '
';
-
- // Tracking Number
- print '| '.$langs->trans("TrackingNumber").' | ';
- print ''.$expedition->tracking_number.' | '.$expedition->tracking_url." | \n";
- print '
';
-
- print "
\n";
-
- /*
- * Lignes produits
- */
- print '';
- print '';
- print '| '.$langs->trans("Products").' | ';
- print ''.$langs->trans("QtyOrdered").' | ';
- if ($expedition->fk_statut <= 1)
- {
- print ''.$langs->trans("QtyToShip").' | ';
- }
- else
- {
- print ''.$langs->trans("QtyShipped").' | ';
- }
-
- print ''.$langs->trans("Weight").' | ';
- print ''.$langs->trans("Volume").' | ';
-
- if ($conf->stock->enabled)
- {
- print ''.$langs->trans("WarehouseSource").' | ';
- }
- print "
\n";
-
- $var=false;
-
- for ($i = 0 ; $i < $num_prod ; $i++)
- {
- print "";
- if ($lignes[$i]->fk_product > 0)
+ $expedition = New Expedition($db);
+ $result = $expedition->fetch($_GET["id"]);
+ if ($result < 0)
{
- print '';
- print ''.img_object($langs->trans("ShowProduct"),"product").' '.$lignes[$i]->ref.' - '.$lignes[$i]->libelle;
- if ($lignes[$i]->description) print ' '.nl2br($lignes[$i]->description);
- print ' | ';
- }
- else
- {
- print "".nl2br($lignes[$i]->description)." | \n";
- }
-
- // Qte commandé
- print ''.$lignes[$i]->qty_asked.' | ';
-
- // Qte a expedier ou expedier
- print ''.$lignes[$i]->qty_shipped.' | ';
-
- // Poids
- print ''.$lignes[$i]->weight*$lignes[$i]->qty_shipped.' '.measuring_units_string($lignes[$i]->weight_units,"weight").' | ';
-
- // Volume
- print ''.$lignes[$i]->volume*$lignes[$i]->qty_shipped.' '.measuring_units_string($lignes[$i]->volume_units,"volume").' | ';
+ dolibarr_print_error($db,$expedition->error);
+ exit -1;
+ }
+ $lignes = $expedition->lignes;
+ $num_prod = sizeof($lignes);
- // Entrepot source
- if ($conf->stock->enabled)
- {
- $entrepot = new Entrepot($db);
- $entrepot->fetch($lignes[$i]->entrepot_id);
- print ''.$entrepot->getNomUrl(1).' | ';
- }
-
+ if ($expedition->id > 0)
+ {
+ $object = $expedition->origin;
+ $expedition->fetch_object();
- print "
";
-
- $var=!$var;
- }
- }
+ if (strlen($expedition->tracking_number) && strlen($expedition->expedition_method_id)) {
+ $expedition->GetUrlTrackingStatus();
+ }
- print "
\n";
+ $soc = new Societe($db);
+ $soc->fetch($expedition->socid);
- print "\n\n";
+ $h=0;
+ $head[$h][0] = DOL_URL_ROOT."/expedition/fiche.php?id=".$expedition->id;
+ $head[$h][1] = $langs->trans("SendingCard");
+ $hselected = $h;
+ $h++;
-
- /*
- * Boutons actions
- */
-
- if ($user->societe_id == 0)
- {
- print '';
-
- if (! eregi('^(valid|delete)',$_REQUEST["action"]))
- {
- if ($expedition->statut == 0 && $user->rights->expedition->valider && $num_prod > 0)
- {
- print '
'.$langs->trans("Validate").'';
- }
-
- if ($conf->livraison_bon->enabled && $expedition->statut == 1 && $user->rights->expedition->livraison->creer && !$expedition->livraison_id)
- {
- print '
'.$langs->trans("DeliveryOrder").'';
- }
-
- if ($expedition->brouillon && $user->rights->expedition->supprimer)
- {
- print '
'.$langs->trans("Delete").'';
- }
- }
-
- print '
';
- }
- print "\n";
-
- print "";
-
-
- /*
- * Documents générés
- */
- if ($conf->expedition_bon->enabled)
+ if ($conf->livraison_bon->enabled && $expedition->livraison_id)
{
- $expeditionref = sanitize_string($expedition->ref);
- $filedir = $conf->expedition_bon->dir_output . "/" .$expeditionref;
-
- $urlsource = $_SERVER["PHP_SELF"]."?id=".$expedition->id;
-
- $genallowed=$user->rights->expedition->lire && ($expedition->statut > 0);
- $delallowed=$user->rights->expedition->supprimer;
- //$genallowed=1;
- //$delallowed=0;
-
- $somethingshown=$formfile->show_documents('expedition',$expeditionref,$filedir,$urlsource,$genallowed,$delallowed,$expedition->modelpdf);
- if ($genallowed && ! $somethingshown) $somethingshown=1;
- }
+ $head[$h][0] = DOL_URL_ROOT."/livraison/fiche.php?id=".$expedition->livraison_id;
+ $head[$h][1] = $langs->trans("DeliveryCard");
+ $h++;
+ }
+
+ dolibarr_fiche_head($head, $hselected, $langs->trans("Sending"));
+
+ if ($mesg) print $mesg;
+
+ /*
+ * Confirmation de la suppression
+ *
+ */
+ if ($_GET["action"] == 'delete')
+ {
+ $html->form_confirm($_SERVER['PHP_SELF'].'?id='.$expedition->id,$langs->trans('DeleteSending'),'Etes-vous sûr de vouloir supprimer cette expedition ?','confirm_delete');
+ print ' ';
+ }
+
+ /*
+ * Confirmation de la validation
+ *
+ */
+ if ($_GET["action"] == 'valid')
+ {
+ $html->form_confirm($_SERVER['PHP_SELF'].'?id='.$expedition->id,$langs->trans('ValidateSending'),'Etes-vous sûr de vouloir valider cette expédition ?','confirm_valid');
+ print ' ';
+ }
+ /*
+ * Confirmation de l'annulation
+ *
+ */
+ if ($_GET["action"] == 'annuler')
+ {
+ $html->form_confirm($_SERVER['PHP_SELF'].'?id='.$expedition->id,$langs->trans('CancelSending'),'Etes-vous sûr de vouloir annuler cette commande ?','confirm_cancel');
+ print ' ';
+ }
+
+ // calcul du poids total et du volume total des produits
+ //TODO: ajouter conversion pour le poids et le volume et selection de l'unité de mesure la plus utilisée
+ $totalWeight = '';
+ $totalVolume = '';
+ for ($i = 0 ; $i < $num_prod ; $i++)
+ {
+ $totalWeight += $lignes[$i]->weight*$lignes[$i]->qty_shipped;
+ $weightUnit = $lignes[$i]->weight_units;
+ $totalVolume += $lignes[$i]->volume*$lignes[$i]->qty_shipped;
+ $volumeUnit = $lignes[$i]->volume_units;
+ }
+
+ print '';
+
+ // Ref
+ print '| '.$langs->trans("Ref").' | ';
+ print ''.$expedition->ref.' | ';
+
+ // Customer
+ print '| '.$langs->trans("Customer").' | ';
+ print ''.$soc->getNomUrl(1).' | ';
+ print " ";
+
+ // Document liée
+ print '| ';
+ if ($conf->commande->enabled)
+ {
+ $order=new Commande($db);
+ $order->fetch($expedition->$object->id);
+ print $langs->trans("RefOrder").' | ';
+ print '';
+ print $order->getNomUrl(1,4);
+ print " | \n";
+ }
+ else
+ {
+ $propal=new Propal($db);
+ $propal->fetch($livraison->origin_id);
+ print $langs->trans("RefProposal").'';
+ print '';
+ print $propal->getNomUrl(1,'expedition');
+ print " | \n";
+ }
+ print ' ';
+
+ // Ref client
+ print '| '.$langs->trans("RefCustomer").' | ';
+ print ''.$object->ref_client." | \n";
+ print ' ';
+
+ // Date
+ print '| '.$langs->trans("Date").' | ';
+ print ''.dolibarr_print_date($expedition->date,"day")." | \n";
+ print ' ';
+
+ // Poids Total
+ print '| '.$langs->trans("TotalWeight").' | ';
+ print ''.$totalWeight.' '.measuring_units_string($weightUnit,"weight")." | \n";
+ print ' ';
+
+ // Volume Total
+ print '| '.$langs->trans("TotalVolume").' | ';
+ print ''.$totalVolume.' '.measuring_units_string($volumeUnit,"volume")." | \n";
+ print ' ';
+
+ // Status
+ print '| '.$langs->trans("Status").' | ';
+ print ''.$expedition->getLibStatut(4)." | \n";
+ print ' ';
+
+ // Tracking Number
+ print '| '.$langs->trans("TrackingNumber").' | ';
+ print ''.$expedition->tracking_number.' | '.$expedition->tracking_url." | \n";
+ print ' ';
+
+ print " \n";
+
+ /*
+ * Lignes produits
+ */
+ print '
';
+ print '';
+ print '| '.$langs->trans("Products").' | ';
+ print ''.$langs->trans("QtyOrdered").' | ';
+ if ($expedition->fk_statut <= 1)
+ {
+ print ''.$langs->trans("QtyToShip").' | ';
+ }
+ else
+ {
+ print ''.$langs->trans("QtyShipped").' | ';
+ }
+
+ print ''.$langs->trans("Weight").' | ';
+ print ''.$langs->trans("Volume").' | ';
+
+ if ($conf->stock->enabled)
+ {
+ print ''.$langs->trans("WarehouseSource").' | ';
+ }
+ print " \n";
+
+ $var=false;
+
+ for ($i = 0 ; $i < $num_prod ; $i++)
+ {
+ print "";
+ if ($lignes[$i]->fk_product > 0)
+ {
+ print '';
+ print ''.img_object($langs->trans("ShowProduct"),"product").' '.$lignes[$i]->ref.' - '.$lignes[$i]->libelle;
+ if ($lignes[$i]->description) print ' '.nl2br($lignes[$i]->description);
+ print ' | ';
+ }
+ else
+ {
+ print "".nl2br($lignes[$i]->description)." | \n";
+ }
+
+ // Qte commandé
+ print ''.$lignes[$i]->qty_asked.' | ';
+
+ // Qte a expedier ou expedier
+ print ''.$lignes[$i]->qty_shipped.' | ';
+
+ // Poids
+ print ''.$lignes[$i]->weight*$lignes[$i]->qty_shipped.' '.measuring_units_string($lignes[$i]->weight_units,"weight").' | ';
+
+ // Volume
+ print ''.$lignes[$i]->volume*$lignes[$i]->qty_shipped.' '.measuring_units_string($lignes[$i]->volume_units,"volume").' | ';
+
+ // Entrepot source
+ if ($conf->stock->enabled)
+ {
+ $entrepot = new Entrepot($db);
+ $entrepot->fetch($lignes[$i]->entrepot_id);
+ print ''.$entrepot->getNomUrl(1).' | ';
+ }
+
+
+ print " ";
+
+ $var=!$var;
+ }
+ }
+
+ print " \n";
+
+ print "\n\n";
+
+
+ /*
+ * Boutons actions
+ */
+
+ if ($user->societe_id == 0)
+ {
+ print '';
+
+ if (! eregi('^(valid|delete)',$_REQUEST["action"]))
+ {
+ if ($expedition->statut == 0 && $user->rights->expedition->valider && $num_prod > 0)
+ {
+ print ' '.$langs->trans("Validate").'';
+ }
+
+ if ($conf->livraison_bon->enabled && $expedition->statut == 1 && $user->rights->expedition->livraison->creer && !$expedition->livraison_id)
+ {
+ print ' '.$langs->trans("DeliveryOrder").'';
+ }
+
+ if ($expedition->brouillon && $user->rights->expedition->supprimer)
+ {
+ print ' '.$langs->trans("Delete").'';
+ }
+ }
+
+ print ' ';
+ }
+ print "\n";
+
+ print "| ";
+
+
+ /*
+ * Documents générés
+ */
+ if ($conf->expedition_bon->enabled)
+ {
+ $expeditionref = sanitize_string($expedition->ref);
+ $filedir = $conf->expedition_bon->dir_output . "/" .$expeditionref;
+
+ $urlsource = $_SERVER["PHP_SELF"]."?id=".$expedition->id;
+
+ $genallowed=$user->rights->expedition->lire && ($expedition->statut > 0);
+ $delallowed=$user->rights->expedition->supprimer;
+ //$genallowed=1;
+ //$delallowed=0;
+
+ $somethingshown=$formfile->show_documents('expedition',$expeditionref,$filedir,$urlsource,$genallowed,$delallowed,$expedition->modelpdf);
+ if ($genallowed && ! $somethingshown) $somethingshown=1;
+ }
- print ' | ';
+ print ' | ';
- // Rien a droite
+ // Rien a droite
- print ' | ';
+ print ' |
';
- print '