Quelques améliorations diverses sur gestion des éxpéditions
This commit is contained in:
parent
7facc82362
commit
1b6d7d5de4
@ -943,9 +943,8 @@ class Commande extends CommonObject
|
|||||||
{
|
{
|
||||||
if ($user->rights->commande->creer)
|
if ($user->rights->commande->creer)
|
||||||
{
|
{
|
||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."commande SET model_pdf = '$modelpdf'";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."commande SET model_pdf = '$modelpdf'";
|
||||||
$sql .= " WHERE rowid = $this->id AND fk_statut < 2 ;";
|
$sql.= " WHERE rowid = ".$this->id;
|
||||||
|
|
||||||
if ($this->db->query($sql) )
|
if ($this->db->query($sql) )
|
||||||
{
|
{
|
||||||
@ -970,7 +969,7 @@ class Commande extends CommonObject
|
|||||||
$this->lignes = array();
|
$this->lignes = array();
|
||||||
$sql = 'SELECT l.rowid, l.fk_product, l.fk_commande, l.description, l.price, l.qty, l.tva_tx,';
|
$sql = 'SELECT l.rowid, l.fk_product, l.fk_commande, l.description, l.price, l.qty, l.tva_tx,';
|
||||||
$sql.= ' l.remise_percent, l.subprice, l.rang, l.coef, l.label,';
|
$sql.= ' l.remise_percent, l.subprice, l.rang, l.coef, l.label,';
|
||||||
$sql.= ' p.ref as product_ref, p.description as product_desc';
|
$sql.= ' p.ref as product_ref, p.description as product_desc, p.fk_product_type';
|
||||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'commandedet as l';
|
$sql.= ' FROM '.MAIN_DB_PREFIX.'commandedet as l';
|
||||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON (p.rowid = l.fk_product)';
|
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON (p.rowid = l.fk_product)';
|
||||||
$sql.= ' WHERE l.fk_commande = '.$this->id;
|
$sql.= ' WHERE l.fk_commande = '.$this->id;
|
||||||
@ -1001,9 +1000,10 @@ class Commande extends CommonObject
|
|||||||
$ligne->coef = $objp->coef;
|
$ligne->coef = $objp->coef;
|
||||||
$ligne->rang = $objp->rang;
|
$ligne->rang = $objp->rang;
|
||||||
|
|
||||||
$ligne->libelle = $objp->label; // Label produit
|
$ligne->ref = $objp->product_ref;
|
||||||
$ligne->product_desc = $objp->product_desc; // Description produit
|
$ligne->libelle = $objp->label; // Label produit
|
||||||
$ligne->ref = $objp->product_ref;
|
$ligne->product_desc = $objp->product_desc; // Description produit
|
||||||
|
$ligne->fk_product_type= $objp->fk_product_type; // Produit ou service
|
||||||
|
|
||||||
$this->lignes[$i] = $ligne;
|
$this->lignes[$i] = $ligne;
|
||||||
$i++;
|
$i++;
|
||||||
@ -1012,14 +1012,27 @@ class Commande extends CommonObject
|
|||||||
}
|
}
|
||||||
return $this->lignes;
|
return $this->lignes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Renvoie nombre de lignes de type produits. Doit etre appelé après fetch_lignes
|
||||||
|
* \return int <0 si ko, Nbre de lignes produits sinon
|
||||||
|
*/
|
||||||
|
function getNbOfProductsLines()
|
||||||
|
{
|
||||||
|
$nb=0;
|
||||||
|
foreach($this->lignes as $ligne)
|
||||||
|
{
|
||||||
|
if ($ligne->fk_product_type == 0) $nb++;
|
||||||
|
}
|
||||||
|
return $nb;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
function fetch_adresse_livraison($id)
|
||||||
function fetch_adresse_livraison($id)
|
|
||||||
{
|
{
|
||||||
$idadresse = $id;
|
$idadresse = $id;
|
||||||
$adresse = new Societe($this->db);
|
$adresse = new Societe($this->db);
|
||||||
@ -1414,7 +1427,7 @@ class Commande extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Renvoi la liste des propal (éventuellement filtrée sur un user) dans un tableau
|
* \brief Renvoi la liste des commandes (éventuellement filtrée sur un user) dans un tableau
|
||||||
* \param brouillon 0=non brouillon, 1=brouillon
|
* \param brouillon 0=non brouillon, 1=brouillon
|
||||||
* \param user Objet user de filtre
|
* \param user Objet user de filtre
|
||||||
* \return int -1 si erreur, tableau résultat si ok
|
* \return int -1 si erreur, tableau résultat si ok
|
||||||
|
|||||||
@ -234,7 +234,7 @@ if ($id > 0)
|
|||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td colspan="3">';
|
print '<tr><td width="18%">'.$langs->trans("Ref").'</td><td colspan="3">';
|
||||||
print $commande->ref;
|
print $commande->ref;
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
|
|
||||||
|
|||||||
@ -1600,7 +1600,8 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Ship
|
// Ship
|
||||||
if ($commande->statut > 0 && $commande->statut < 3 && $user->rights->expedition->creer)
|
if ($commande->statut > 0 && $commande->statut < 3 && $user->rights->expedition->creer
|
||||||
|
&& $commande->getNbOfProductsLines() > 0)
|
||||||
{
|
{
|
||||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/expedition/commande.php?id='.$_GET['id'].'">'.$langs->trans('ShipProduct').'</a>';
|
print '<a class="butAction" href="'.DOL_URL_ROOT.'/expedition/commande.php?id='.$_GET['id'].'">'.$langs->trans('ShipProduct').'</a>';
|
||||||
}
|
}
|
||||||
@ -1690,59 +1691,8 @@ else
|
|||||||
}
|
}
|
||||||
print '</td><td valign="top" width="50%">';
|
print '</td><td valign="top" width="50%">';
|
||||||
|
|
||||||
/*
|
// Rien a droite
|
||||||
* Liste des expéditions
|
|
||||||
*/
|
|
||||||
$sql = 'SELECT e.rowid as expedition_id, 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);
|
|
||||||
if ($result)
|
|
||||||
{
|
|
||||||
$num = $db->num_rows($result);
|
|
||||||
if ($num)
|
|
||||||
{
|
|
||||||
print_titre($langs->trans('Sendings'));
|
|
||||||
$i = 0; $total = 0;
|
|
||||||
print '<table class="border" width="100%">';
|
|
||||||
print '<tr '.$bc[$var].'><td>'.$langs->trans('Sendings').'</td>';
|
|
||||||
if ($conf->livraison->enabled)
|
|
||||||
{
|
|
||||||
print '<td>'.$langs->trans("DeliveryOrder").'</td>';
|
|
||||||
}
|
|
||||||
print '<td>'.$langs->trans('Date').'</td></tr>';
|
|
||||||
|
|
||||||
$var=True;
|
|
||||||
while ($i < $num)
|
|
||||||
{
|
|
||||||
$objp = $db->fetch_object($result);
|
|
||||||
$var=!$var;
|
|
||||||
print '<tr '.$bc[$var].'>';
|
|
||||||
print '<td><a href="../expedition/fiche.php?id='.$objp->expedition_id.'">'.img_object($langs->trans('ShowSending'),'sending').' '.$objp->ref.'</a></td>';
|
|
||||||
if ($conf->livraison->enabled)
|
|
||||||
{
|
|
||||||
if ($objp->livraison_id)
|
|
||||||
{
|
|
||||||
print '<td><a href="'.DOL_URL_ROOT.'/livraison/fiche.php?id='.$objp->livraison_id.'">'.img_object($langs->trans("ShowSending"),'generic').' '.$objp->livraison_ref.'<a></td>';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print '<td><a href="'.DOL_URL_ROOT.'/expedition/fiche.php?id='.$objp->expedition_id.'&action=create_delivery">'.$langs->trans("CreateDeliveryOrder").'<a></td>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
print '<td>'.dolibarr_print_date($objp->de).'</td></tr>';
|
|
||||||
$i++;
|
|
||||||
}
|
|
||||||
print '</table>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
dolibarr_print_error($db);
|
|
||||||
}
|
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -111,7 +111,7 @@ if ($_GET["id"])
|
|||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td colspan="3">';
|
print '<tr><td width="18%">'.$langs->trans("Ref").'</td><td colspan="3">';
|
||||||
print $commande->ref;
|
print $commande->ref;
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
|
|
||||||
|
|||||||
@ -538,22 +538,22 @@ if ($_GET["id"] > 0)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
print '<table width="100%"><tr><td width="50%" valign="top">';
|
print '<table width="100%"><tr><td width="50%" valign="top">';
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Documents générés
|
* Documents générés
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
$comref = sanitize_string($commande->ref);
|
$comref = sanitize_string($commande->ref);
|
||||||
$file = $conf->commande->dir_output . '/' . $comref . '/' . $comref . '.pdf';
|
$file = $conf->commande->dir_output . '/' . $comref . '/' . $comref . '.pdf';
|
||||||
$relativepath = $comref.'/'.$comref.'.pdf';
|
$relativepath = $comref.'/'.$comref.'.pdf';
|
||||||
$filedir = $conf->commande->dir_output . '/' . $comref;
|
$filedir = $conf->commande->dir_output . '/' . $comref;
|
||||||
$urlsource=$_SERVER["PHP_SELF"]."?id=".$commande->id;
|
$urlsource=$_SERVER["PHP_SELF"]."?id=".$commande->id;
|
||||||
$genallowed=0;
|
$genallowed=0;
|
||||||
$delallowed=0;
|
$delallowed=0;
|
||||||
|
|
||||||
$somethingshown=$html->show_documents('commande',$comref,$filedir,$urlsource,$genallowed,$delallowed,$commande->modelpdf);
|
$somethingshown=$html->show_documents('commande',$comref,$filedir,$urlsource,$genallowed,$delallowed,$commande->modelpdf);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Liste des factures
|
* Liste des factures
|
||||||
@ -598,38 +598,73 @@ if ($_GET["id"] > 0)
|
|||||||
|
|
||||||
print '</td><td valign="top" width="50%">';
|
print '</td><td valign="top" width="50%">';
|
||||||
|
|
||||||
/*
|
// Rien a droite
|
||||||
* Liste des expéditions
|
|
||||||
*/
|
|
||||||
$sql = "SELECT e.rowid as expedition_id, 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);
|
print "</td></tr></table>";
|
||||||
if ($result)
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Liste des expéditions
|
||||||
|
*/
|
||||||
|
$sql = "SELECT cd.fk_product, cd.description, cd.rowid, cd.qty as qty_commande";
|
||||||
|
$sql .= " , ed.qty as qty_livre, e.ref, ed.fk_expedition as expedition_id";
|
||||||
|
$sql .= ",".$db->pdate("e.date_expedition")." as date_expedition";
|
||||||
|
if ($conf->livraison->enabled) $sql .= ", l.rowid as livraison_id, l.ref as livraison_ref";
|
||||||
|
$sql .= " FROM ".MAIN_DB_PREFIX."commandedet as cd";
|
||||||
|
$sql .= " , ".MAIN_DB_PREFIX."expeditiondet as ed, ".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 cd.fk_commande = ".$commande->id;
|
||||||
|
$sql .= " AND cd.rowid = ed.fk_commande_ligne";
|
||||||
|
$sql .= " AND ed.fk_expedition = e.rowid";
|
||||||
|
$sql .= " ORDER BY cd.fk_product";
|
||||||
|
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
if ($resql)
|
||||||
{
|
{
|
||||||
$num = $db->num_rows($result);
|
$num = $db->num_rows($resql);
|
||||||
|
$i = 0;
|
||||||
|
|
||||||
if ($num)
|
if ($num)
|
||||||
{
|
{
|
||||||
print_titre($langs->trans("Sendings"));
|
if ($somethingshown) print '<br>';
|
||||||
$i = 0; $total = 0;
|
|
||||||
print '<table class="border" width="100%">';
|
print_titre($langs->trans("SendingsForSameOrder"));
|
||||||
print "<tr $bc[$var]><td>".$langs->trans("Sendings")."</td>";
|
print '<table class="liste" width="100%">';
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
print '<td align="left">'.$langs->trans("Sending").'</td>';
|
||||||
|
print '<td>'.$langs->trans("Product").'</td>';
|
||||||
|
print '<td align="center">'.$langs->trans("QtyShipped").'</td>';
|
||||||
|
print '<td align="center">'.$langs->trans("Date").'</td>';
|
||||||
if ($conf->livraison->enabled)
|
if ($conf->livraison->enabled)
|
||||||
{
|
{
|
||||||
print '<td>'.$langs->trans("DeliveryOrder").'</td>';
|
print '<td>'.$langs->trans("DeliveryOrder").'</td>';
|
||||||
}
|
}
|
||||||
print "<td>".$langs->trans("Date")."</td></tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
$var=True;
|
$var=True;
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$objp = $db->fetch_object($result);
|
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
|
$objp = $db->fetch_object($resql);
|
||||||
print "<tr $bc[$var]>";
|
print "<tr $bc[$var]>";
|
||||||
print '<td><a href="../../expedition/fiche.php?id='.$objp->expedition_id.'">'.img_object($langs->trans("ShowSending"),"sending").' '.$objp->ref.'</a></td>';
|
print '<td align="left"><a href="'.DOL_URL_ROOT.'/expedition/fiche.php?id='.$objp->expedition_id.'">'.img_object($langs->trans("ShowSending"),'sending').' '.$objp->ref.'<a></td>';
|
||||||
|
|
||||||
|
if ($objp->fk_product > 0)
|
||||||
|
{
|
||||||
|
$product = new Product($db);
|
||||||
|
$product->fetch($objp->fk_product);
|
||||||
|
|
||||||
|
print '<td>';
|
||||||
|
print '<a href="'.DOL_URL_ROOT.'/product/fiche.php?id='.$objp->fk_product.'">'.img_object($langs->trans("ShowProduct"),"product").' '.$product->ref.'</a> - '.$product->libelle;
|
||||||
|
if ($objp->description) print '<br>'.nl2br($objp->description);
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print "<td>".stripslashes(nl2br($objp->description))."</td>\n";
|
||||||
|
}
|
||||||
|
print '<td align="center">'.$objp->qty_livre.'</td>';
|
||||||
|
print '<td align="center">'.dolibarr_print_date($objp->date_expedition).'</td>';
|
||||||
if ($conf->livraison->enabled)
|
if ($conf->livraison->enabled)
|
||||||
{
|
{
|
||||||
if ($objp->livraison_id)
|
if ($objp->livraison_id)
|
||||||
@ -641,19 +676,20 @@ if ($_GET["id"] > 0)
|
|||||||
print '<td><a href="'.DOL_URL_ROOT.'/expedition/fiche.php?id='.$objp->expedition_id.'&action=create_delivery">'.$langs->trans("CreateDeliveryOrder").'<a></td>';
|
print '<td><a href="'.DOL_URL_ROOT.'/expedition/fiche.php?id='.$objp->expedition_id.'&action=create_delivery">'.$langs->trans("CreateDeliveryOrder").'<a></td>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print "<td>".dolibarr_print_date($objp->de)."</td></tr>\n";
|
print '</tr>';
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
print "</table>";
|
|
||||||
|
print '</table>';
|
||||||
}
|
}
|
||||||
|
$db->free($resql);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dolibarr_print_error($db);
|
dolibarr_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
print "</td></tr></table>";
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -422,9 +422,33 @@ if ($_GET["id"] > 0)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
print '<table width="100%"><tr><td width="50%" valign="top">';
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Documents générés
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
$comref = sanitize_string($commande->ref);
|
||||||
|
$file = $conf->commande->dir_output . '/' . $comref . '/' . $comref . '.pdf';
|
||||||
|
$relativepath = $comref.'/'.$comref.'.pdf';
|
||||||
|
$filedir = $conf->commande->dir_output . '/' . $comref;
|
||||||
|
$urlsource=$_SERVER["PHP_SELF"]."?id=".$commande->id;
|
||||||
|
$genallowed=0;
|
||||||
|
$delallowed=0;
|
||||||
|
|
||||||
|
$somethingshown=$html->show_documents('commande',$comref,$filedir,$urlsource,$genallowed,$delallowed,$commande->modelpdf);
|
||||||
|
|
||||||
|
|
||||||
|
print '</td><td valign="top" width="50%">';
|
||||||
|
|
||||||
|
|
||||||
// Bouton expedier avec gestion des stocks
|
// Bouton expedier avec gestion des stocks
|
||||||
if ($conf->stock->enabled && $reste_a_livrer_total > 0 && $commande->statut > 0 && $commande->statut < 3 && $user->rights->expedition->creer)
|
if ($conf->stock->enabled && $reste_a_livrer_total > 0 && $commande->statut > 0 && $commande->statut < 3 && $user->rights->expedition->creer)
|
||||||
{
|
{
|
||||||
|
print_titre($langs->trans("NewSending"));
|
||||||
|
|
||||||
print '<form method="GET" action="'.DOL_URL_ROOT.'/expedition/fiche.php">';
|
print '<form method="GET" action="'.DOL_URL_ROOT.'/expedition/fiche.php">';
|
||||||
print '<input type="hidden" name="action" value="create">';
|
print '<input type="hidden" name="action" value="create">';
|
||||||
print '<input type="hidden" name="id" value="'.$commande->id.'">';
|
print '<input type="hidden" name="id" value="'.$commande->id.'">';
|
||||||
@ -454,12 +478,17 @@ if ($_GET["id"] > 0)
|
|||||||
print '<input type="submit" class="button" named="save" value="'.$langs->trans("NewSending").'">';
|
print '<input type="submit" class="button" named="save" value="'.$langs->trans("NewSending").'">';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print "</table><br>";
|
print "</table>";
|
||||||
print "</form>\n";
|
print "</form>\n";
|
||||||
|
|
||||||
|
$somethingshown=1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print "</td></tr></table>";
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Déjà livré
|
* Liste des expéditions
|
||||||
*/
|
*/
|
||||||
$sql = "SELECT cd.fk_product, cd.description, cd.rowid, cd.qty as qty_commande";
|
$sql = "SELECT cd.fk_product, cd.description, cd.rowid, cd.qty as qty_commande";
|
||||||
$sql .= " , ed.qty as qty_livre, e.ref, ed.fk_expedition as expedition_id";
|
$sql .= " , ed.qty as qty_livre, e.ref, ed.fk_expedition as expedition_id";
|
||||||
@ -471,7 +500,6 @@ if ($_GET["id"] > 0)
|
|||||||
$sql .= " WHERE cd.fk_commande = ".$commande->id;
|
$sql .= " WHERE cd.fk_commande = ".$commande->id;
|
||||||
$sql .= " AND cd.rowid = ed.fk_commande_ligne";
|
$sql .= " AND cd.rowid = ed.fk_commande_ligne";
|
||||||
$sql .= " AND ed.fk_expedition = e.rowid";
|
$sql .= " AND ed.fk_expedition = e.rowid";
|
||||||
$sql .= " AND e.fk_statut > 0";
|
|
||||||
$sql .= " ORDER BY cd.fk_product";
|
$sql .= " ORDER BY cd.fk_product";
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
@ -482,9 +510,9 @@ if ($_GET["id"] > 0)
|
|||||||
|
|
||||||
if ($num)
|
if ($num)
|
||||||
{
|
{
|
||||||
print '<br>';
|
if ($somethingshown) print '<br>';
|
||||||
|
|
||||||
print_titre($langs->trans("OtherSendingsForSameOrder"));
|
print_titre($langs->trans("SendingsForSameOrder"));
|
||||||
print '<table class="liste" width="100%">';
|
print '<table class="liste" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td align="left">'.$langs->trans("Sending").'</td>';
|
print '<td align="left">'.$langs->trans("Sending").'</td>';
|
||||||
|
|||||||
@ -40,6 +40,7 @@ class Expedition extends CommonObject
|
|||||||
var $id;
|
var $id;
|
||||||
var $brouillon;
|
var $brouillon;
|
||||||
var $entrepot_id;
|
var $entrepot_id;
|
||||||
|
var $modelpdf;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -192,11 +193,12 @@ class Expedition extends CommonObject
|
|||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$sql = "SELECT e.rowid, e.date_creation, e.ref, e.fk_user_author, e.fk_statut, e.fk_commande, e.fk_entrepot";
|
$sql = "SELECT e.rowid, e.date_creation, e.ref, e.fk_user_author, e.fk_statut, e.fk_commande, e.fk_entrepot,";
|
||||||
$sql.= ", ".$this->db->pdate("e.date_expedition")." as date_expedition, c.fk_adresse_livraison";
|
$sql.= " ".$this->db->pdate("e.date_expedition")." as date_expedition, e.model_pdf,";
|
||||||
|
$sql.= " c.fk_adresse_livraison";
|
||||||
if ($conf->livraison->enabled) $sql.=", l.rowid as livraison_id";
|
if ($conf->livraison->enabled) $sql.=", l.rowid as livraison_id";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."commande as c";
|
$sql.= " FROM ".MAIN_DB_PREFIX."commande as c,";
|
||||||
$sql.= ", ".MAIN_DB_PREFIX."expedition as e";
|
$sql.= " ".MAIN_DB_PREFIX."expedition as e";
|
||||||
if ($conf->livraison->enabled) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."livraison as l ON e.rowid = l.fk_expedition";
|
if ($conf->livraison->enabled) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."livraison as l ON e.rowid = l.fk_expedition";
|
||||||
$sql.= " WHERE e.rowid = ".$id;
|
$sql.= " WHERE e.rowid = ".$id;
|
||||||
$sql.= " AND e.fk_commande = c.rowid";
|
$sql.= " AND e.fk_commande = c.rowid";
|
||||||
@ -219,6 +221,7 @@ class Expedition extends CommonObject
|
|||||||
$this->date = $obj->date_expedition;
|
$this->date = $obj->date_expedition;
|
||||||
$this->entrepot_id = $obj->fk_entrepot;
|
$this->entrepot_id = $obj->fk_entrepot;
|
||||||
$this->adresse_livraison_id = $obj->fk_adresse_livraison;
|
$this->adresse_livraison_id = $obj->fk_adresse_livraison;
|
||||||
|
$this->modelpdf = $obj->model_pdf;
|
||||||
$this->db->free($result);
|
$this->db->free($result);
|
||||||
|
|
||||||
if ($this->statut == 0) $this->brouillon = 1;
|
if ($this->statut == 0) $this->brouillon = 1;
|
||||||
@ -519,6 +522,8 @@ class Expedition extends CommonObject
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Classe la commande
|
* Classe la commande
|
||||||
*
|
*
|
||||||
@ -540,6 +545,32 @@ class Expedition extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Positionne modele derniere generation
|
||||||
|
* \param user Objet use qui modifie
|
||||||
|
* \param modelpdf Nom du modele
|
||||||
|
*/
|
||||||
|
function set_pdf_model($user, $modelpdf)
|
||||||
|
{
|
||||||
|
if ($user->rights->expedition->creer)
|
||||||
|
{
|
||||||
|
$sql = "UPDATE ".MAIN_DB_PREFIX."expedition SET model_pdf = '$modelpdf'";
|
||||||
|
$sql.= " WHERE rowid = ".$this->id;
|
||||||
|
|
||||||
|
if ($this->db->query($sql) )
|
||||||
|
{
|
||||||
|
$this->modelpdf=$modelpdf;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dolibarr_print_error($this->db);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Lit la commande associée
|
* Lit la commande associée
|
||||||
*
|
*
|
||||||
@ -588,22 +619,39 @@ class Expedition extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Retourne le libellé du statut d'un entrepot (ouvert, fermé)
|
* \brief Retourne le libellé du statut d'une expedition
|
||||||
* \return string Libellé
|
* \return string Libellé
|
||||||
*/
|
*/
|
||||||
function getLibStatut()
|
function getLibStatut($mode=0)
|
||||||
{
|
{
|
||||||
return $this->LibStatut($this->statut);
|
return $this->LibStatut($this->statut,$mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Renvoi le libellé d'un statut donné
|
* \brief Renvoi le libellé d'un statut donné
|
||||||
* \param statut id statut
|
* \param statut Id statut
|
||||||
* \return string Libellé
|
* \param mode 0=libellé long, 1=libellé court, 2=Picto + Libellé court, 3=Picto, 4=Picto + Libellé long, 5=Libellé court + Picto
|
||||||
*/
|
* \return string Libellé
|
||||||
function LibStatut($statut)
|
*/
|
||||||
|
function LibStatut($statut,$mode)
|
||||||
{
|
{
|
||||||
return $this->statuts[$statut];
|
global $langs;
|
||||||
|
|
||||||
|
if ($mode==0)
|
||||||
|
{
|
||||||
|
if ($statut==0) return $this->statuts[$statut];
|
||||||
|
if ($statut==1) return $this->statuts[$statut];
|
||||||
|
}
|
||||||
|
if ($mode==1)
|
||||||
|
{
|
||||||
|
if ($statut==0) return $this->statuts[$statut];
|
||||||
|
if ($statut==1) return $this->statuts[$statut];
|
||||||
|
}
|
||||||
|
if ($mode == 4)
|
||||||
|
{
|
||||||
|
if ($statut==0) return img_picto($langs->trans('StatusSendingDraft'),'statut0').' '.$langs->trans('StatusSendingDraft');
|
||||||
|
if ($statut==1) return img_picto($langs->trans('StatusSendingValidated'),'statut4').' '.$langs->trans('StatusSendingValidated');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -139,12 +139,20 @@ if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == 'yes')
|
|||||||
*/
|
*/
|
||||||
if ($_REQUEST['action'] == 'builddoc') // En get ou en post
|
if ($_REQUEST['action'] == 'builddoc') // En get ou en post
|
||||||
{
|
{
|
||||||
|
// Sauvegarde le dernier modèle choisi pour générer un document
|
||||||
|
$expedition = new Expedition($db, 0, $_REQUEST['id']);
|
||||||
|
$expedition->fetch($_REQUEST['id']);
|
||||||
|
if ($_REQUEST['model'])
|
||||||
|
{
|
||||||
|
$expedition->set_pdf_model($user, $_REQUEST['model']);
|
||||||
|
}
|
||||||
|
|
||||||
if ($_REQUEST['lang_id'])
|
if ($_REQUEST['lang_id'])
|
||||||
{
|
{
|
||||||
$outputlangs = new Translate(DOL_DOCUMENT_ROOT ."/langs");
|
$outputlangs = new Translate(DOL_DOCUMENT_ROOT ."/langs");
|
||||||
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
|
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
|
||||||
}
|
}
|
||||||
$result=expedition_pdf_create($db, $_REQUEST['id'],$_REQUEST['model'],$outputlangs);
|
$result=expedition_pdf_create($db, $expedition->id,$expedition->modelpdf,$outputlangs);
|
||||||
if ($result <= 0)
|
if ($result <= 0)
|
||||||
{
|
{
|
||||||
dolibarr_print_error($db,$result);
|
dolibarr_print_error($db,$result);
|
||||||
@ -513,7 +521,7 @@ else
|
|||||||
|
|
||||||
// Statut
|
// Statut
|
||||||
print '<tr><td>'.$langs->trans("Status").'</td>';
|
print '<tr><td>'.$langs->trans("Status").'</td>';
|
||||||
print '<td colspan="3">'.$expedition->getLibStatut()."</td>\n";
|
print '<td colspan="3">'.$expedition->getLibStatut(4)."</td>\n";
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
if (!$conf->expedition->enabled && $conf->stock->enabled)
|
if (!$conf->expedition->enabled && $conf->stock->enabled)
|
||||||
@ -617,8 +625,11 @@ else
|
|||||||
print '<a class="butAction" href="fiche.php?id='.$expedition->id.'&action=create_delivery">'.$langs->trans("DeliveryOrder").'</a>';
|
print '<a class="butAction" href="fiche.php?id='.$expedition->id.'&action=create_delivery">'.$langs->trans("DeliveryOrder").'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<a class="butAction" href="fiche.php?id='.$expedition->id.'&action=builddoc">'.$langs->trans('BuildPDF').'</a>';
|
if ($user->rights->expedition->lire && ($expedition->statut > 0))
|
||||||
|
{
|
||||||
|
print '<a class="butAction" href="fiche.php?id='.$expedition->id.'&action=builddoc">'.$langs->trans('BuildPDF').'</a>';
|
||||||
|
}
|
||||||
|
|
||||||
if ($expedition->brouillon && $user->rights->expedition->supprimer)
|
if ($expedition->brouillon && $user->rights->expedition->supprimer)
|
||||||
{
|
{
|
||||||
print '<a class="butActionDelete" href="fiche.php?id='.$expedition->id.'&action=delete">'.$langs->trans("Delete").'</a>';
|
print '<a class="butActionDelete" href="fiche.php?id='.$expedition->id.'&action=delete">'.$langs->trans("Delete").'</a>';
|
||||||
@ -639,7 +650,7 @@ else
|
|||||||
|
|
||||||
$urlsource = $_SERVER["PHP_SELF"]."?id=".$expedition->id;
|
$urlsource = $_SERVER["PHP_SELF"]."?id=".$expedition->id;
|
||||||
|
|
||||||
$genallowed=$user->rights->expedition->creer && ($expedition->statut > 0);
|
$genallowed=$user->rights->expedition->lire && ($expedition->statut > 0);
|
||||||
$delallowed=$user->rights->expedition->supprimer;
|
$delallowed=$user->rights->expedition->supprimer;
|
||||||
//$genallowed=1;
|
//$genallowed=1;
|
||||||
//$delallowed=0;
|
//$delallowed=0;
|
||||||
@ -648,7 +659,7 @@ else
|
|||||||
if ($genallowed && ! $somethingshown) $somethingshown=1;
|
if ($genallowed && ! $somethingshown) $somethingshown=1;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Déjà livre
|
* Autres expeditions
|
||||||
*/
|
*/
|
||||||
$sql = "SELECT cd.fk_product, cd.description, cd.rowid, cd.qty as qty_commande";
|
$sql = "SELECT cd.fk_product, cd.description, cd.rowid, cd.qty as qty_commande";
|
||||||
$sql .= " , ed.qty as qty_livre, e.ref, ed.fk_expedition as expedition_id";
|
$sql .= " , ed.qty as qty_livre, e.ref, ed.fk_expedition as expedition_id";
|
||||||
@ -659,7 +670,6 @@ else
|
|||||||
$sql .= " AND e.rowid <> ".$expedition->id;
|
$sql .= " AND e.rowid <> ".$expedition->id;
|
||||||
$sql .= " AND cd.rowid = ed.fk_commande_ligne";
|
$sql .= " AND cd.rowid = ed.fk_commande_ligne";
|
||||||
$sql .= " AND ed.fk_expedition = e.rowid";
|
$sql .= " AND ed.fk_expedition = e.rowid";
|
||||||
$sql .= " AND e.fk_statut > 0";
|
|
||||||
$sql .= " ORDER BY cd.fk_product";
|
$sql .= " ORDER BY cd.fk_product";
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
@ -716,102 +726,11 @@ else
|
|||||||
dolibarr_print_error($db);
|
dolibarr_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Commandes associées
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
$file = $conf->commande->dir_output . "/" . $commande->ref . "/" . $commande->ref . ".pdf";
|
|
||||||
$relativepath = $commande->ref . "/" . $commande->ref . ".pdf";
|
|
||||||
|
|
||||||
$var=true;
|
|
||||||
|
|
||||||
if (file_exists($file))
|
|
||||||
{
|
|
||||||
print '<br>';
|
|
||||||
print_titre("Orders");
|
|
||||||
print '<table width="100%" class="border">';
|
|
||||||
|
|
||||||
print "<tr $bc[$true]><td>PDF</td>";
|
|
||||||
print '<td><a href="'.DOL_URL_ROOT.'/document.php?modulepart=commande&file='.urlencode($relativepath).'">'.$commande->ref.'.pdf</a></td>';
|
|
||||||
print '<td align="right">'.filesize($file). ' bytes</td>';
|
|
||||||
print '<td align="right">'.strftime("%d %b %Y %H:%M:%S",filemtime($file)).'</td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
print "</table>\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
print '</td><td valign="top" width="50%">';
|
print '</td><td valign="top" width="50%">';
|
||||||
|
|
||||||
|
// Rien a droite
|
||||||
/*
|
|
||||||
* Liste des actions
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
print_titre("Actions");
|
|
||||||
|
|
||||||
$sql = "SELECT ".$db->pdate("a.datea")." as da, a.note";
|
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a";
|
|
||||||
$sql .= " WHERE a.fk_soc = ".$commande->socidp." AND a.fk_action in (9,10)";
|
|
||||||
$sql .= " AND a.fk_commande = ".$expedition->id;
|
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
|
||||||
if ($resql)
|
|
||||||
{
|
|
||||||
$num = $db->num_rows($resql);
|
|
||||||
if ($num)
|
|
||||||
{
|
|
||||||
$i = 0;
|
|
||||||
print '<table class="border" width="100%">';
|
|
||||||
print "<tr $bc[$var]><td>".$langs->trans("Date")."</td><td>".$langs->trans("Action")."</td></tr>\n";
|
|
||||||
|
|
||||||
$var=True;
|
|
||||||
while ($i < $num)
|
|
||||||
{
|
|
||||||
$objp = $db->fetch_object($resql);
|
|
||||||
$var=!$var;
|
|
||||||
print "<tr $bc[$var]>";
|
|
||||||
print "<td>".strftime("%d %B %Y",$objp->da)."</td>\n";
|
|
||||||
print '<td>'.stripslashes($objp->note).'</td>';
|
|
||||||
print "</tr>";
|
|
||||||
$i++;
|
|
||||||
}
|
|
||||||
print "</table>";
|
|
||||||
}
|
|
||||||
$db->free($resql);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
dolibarr_print_error($db);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($action == 'presend')
|
|
||||||
{
|
|
||||||
$replytoname = $user->fullname;
|
|
||||||
$from_name = $replytoname;
|
|
||||||
|
|
||||||
$replytomail = $user->email;
|
|
||||||
$from_mail = $replytomail;
|
|
||||||
|
|
||||||
print "<form method=\"post\" action=\"fiche.php?id=$expedition->id&action=send\">\n";
|
|
||||||
print '<input type="hidden" name="replytoname" value="'.$replytoname.'">';
|
|
||||||
print '<input type="hidden" name="replytomail" value="'.$replytomail.'">';
|
|
||||||
|
|
||||||
print "<p><b>Envoyer la commande par mail</b>";
|
|
||||||
print "<table cellspacing=0 border=1 cellpadding=3>";
|
|
||||||
print '<tr><td>Destinataire</td><td colspan="5">';
|
|
||||||
|
|
||||||
$form = new Form($db);
|
|
||||||
$form->select_array("destinataire",$soc->contact_email_array());
|
|
||||||
|
|
||||||
print "</td><td><input size=\"30\" name=\"sendto\" value=\"$commande->email\"></td></tr>";
|
|
||||||
print "<tr><td>Expéditeur</td><td colspan=\"5\">$from_name</td><td>$from_mail</td></tr>";
|
|
||||||
print "<tr><td>Reply-to</td><td colspan=\"5\">$replytoname</td>";
|
|
||||||
print "<td>$replytomail</td></tr></table>";
|
|
||||||
|
|
||||||
print "<input type=\"submit\" value=\"Envoyer\"></form>";
|
|
||||||
}
|
|
||||||
|
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -87,6 +87,7 @@ Class pdf_expedition_merou extends ModelePdfExpedition
|
|||||||
$outputlangs->load("bills");
|
$outputlangs->load("bills");
|
||||||
$outputlangs->load("propal");
|
$outputlangs->load("propal");
|
||||||
$outputlangs->load("products");
|
$outputlangs->load("products");
|
||||||
|
$outputlangs->load("sendings");
|
||||||
|
|
||||||
$outputlangs->setPhpLang();
|
$outputlangs->setPhpLang();
|
||||||
|
|
||||||
@ -171,7 +172,7 @@ Class pdf_expedition_merou extends ModelePdfExpedition
|
|||||||
//Generation du tableau
|
//Generation du tableau
|
||||||
$this->_tableau($pdf, $tab_top, $tab_height, $nexY);
|
$this->_tableau($pdf, $tab_top, $tab_height, $nexY);
|
||||||
//Recuperation des produits de la commande.
|
//Recuperation des produits de la commande.
|
||||||
$this->expe->commande->fetch_lignes();
|
$this->expe->commande->fetch_lignes(1);
|
||||||
$Produits = $this->expe->commande->lignes;
|
$Produits = $this->expe->commande->lignes;
|
||||||
$nblignes = sizeof($Produits);
|
$nblignes = sizeof($Produits);
|
||||||
for ($i = 0 ; $i < $nblignes ; $i++){
|
for ($i = 0 ; $i < $nblignes ; $i++){
|
||||||
@ -188,7 +189,7 @@ Class pdf_expedition_merou extends ModelePdfExpedition
|
|||||||
//Insertion du libelle
|
//Insertion du libelle
|
||||||
$pdf->SetFont('Arial','', 7);
|
$pdf->SetFont('Arial','', 7);
|
||||||
$pdf->SetXY (50, $curY );
|
$pdf->SetXY (50, $curY );
|
||||||
$pdf->MultiCell(130, 5, stripslashes($Prod->libelle), 0, 'L', 0);
|
$pdf->MultiCell(130, 5, $Prod->libelle, 0, 'L', 0);
|
||||||
//Insertion de la quantite
|
//Insertion de la quantite
|
||||||
$pdf->SetFont('Arial','', 7);
|
$pdf->SetFont('Arial','', 7);
|
||||||
$pdf->SetXY (180, $curY );
|
$pdf->SetXY (180, $curY );
|
||||||
@ -319,7 +320,7 @@ Class pdf_expedition_merou extends ModelePdfExpedition
|
|||||||
$pdf->SetXY(60,7);
|
$pdf->SetXY(60,7);
|
||||||
$pdf->SetFont('Arial','B',14);
|
$pdf->SetFont('Arial','B',14);
|
||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0,0,0);
|
||||||
$pdf->MultiCell(0, 8, "BON DE LIVRAISON", '' , 'L');
|
$pdf->MultiCell(0, 8, $langs->trans("SendingSheet"), '' , 'L');
|
||||||
//Num Expedition
|
//Num Expedition
|
||||||
$Yoff = $Yoff+7;
|
$Yoff = $Yoff+7;
|
||||||
$Xoff = 115;
|
$Xoff = 115;
|
||||||
@ -327,10 +328,10 @@ Class pdf_expedition_merou extends ModelePdfExpedition
|
|||||||
$pdf->SetXY($Xoff,$Yoff);
|
$pdf->SetXY($Xoff,$Yoff);
|
||||||
$pdf->SetFont('Arial','',8);
|
$pdf->SetFont('Arial','',8);
|
||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0,0,0);
|
||||||
$pdf->MultiCell(0, 8, $langs->trans("Ref: ").$exp->ref, '' , 'L');
|
$pdf->MultiCell(0, 8, $langs->trans("RefSending").': '.$exp->ref, '' , 'L');
|
||||||
//$this->Code39($Xoff+43, $Yoff+1, $this->expe->ref,$ext = true, $cks = false, $w = 0.4, $h = 4, $wide = true);
|
//$this->Code39($Xoff+43, $Yoff+1, $this->expe->ref,$ext = true, $cks = false, $w = 0.4, $h = 4, $wide = true);
|
||||||
//Num Commande
|
//Num Commande
|
||||||
$Yoff = $Yoff+10;
|
$Yoff = $Yoff+4;
|
||||||
// $pdf->rect($Xoff, $Yoff, 85, 8);
|
// $pdf->rect($Xoff, $Yoff, 85, 8);
|
||||||
$pdf->SetXY($Xoff,$Yoff);
|
$pdf->SetXY($Xoff,$Yoff);
|
||||||
$pdf->SetFont('Arial','',8);
|
$pdf->SetFont('Arial','',8);
|
||||||
|
|||||||
@ -56,7 +56,8 @@ OrdersStatistics=Orders' statistics
|
|||||||
NumberOfOrdersByMonth=Number of orders by month
|
NumberOfOrdersByMonth=Number of orders by month
|
||||||
ListOfOrders=List of orders
|
ListOfOrders=List of orders
|
||||||
CloseOrder=Close order
|
CloseOrder=Close order
|
||||||
ConfirmCloseOrder=Are you sure you want to close this order ?
|
ConfirmCloseOrder=Are you sure you want to close this order ? Once an order is closed, it can only be billed.
|
||||||
|
ConfirmCloseOrderIfSending=Are you sure you want to close this order ? You must close an order only when all shipping are done.
|
||||||
ConfirmDeleteOrder=Are you sure you want to delete this order ?
|
ConfirmDeleteOrder=Are you sure you want to delete this order ?
|
||||||
ConfirmValidateOrder=Are you sure you want to validate this order ?
|
ConfirmValidateOrder=Are you sure you want to validate this order ?
|
||||||
ConfirmCancelOrder=Are you sure you want to cancel this order ?
|
ConfirmCancelOrder=Are you sure you want to cancel this order ?
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
# Dolibarr language file - en_US - sendings
|
# Dolibarr language file - en_US - sendings
|
||||||
|
RefSending=Ref. sending
|
||||||
Sending=Sending
|
Sending=Sending
|
||||||
Sendings=Sendings
|
Sendings=Sendings
|
||||||
SendingsArea=Sendings area
|
SendingsArea=Sendings area
|
||||||
@ -18,5 +19,11 @@ QtyShipped=Qty shipped
|
|||||||
QtyReceived=Qty received
|
QtyReceived=Qty received
|
||||||
QtyToShip=Qty to ship
|
QtyToShip=Qty to ship
|
||||||
KeepToShip=Keep to ship
|
KeepToShip=Keep to ship
|
||||||
OtherSendingsForSameOrder=Other sendings already shipped
|
OtherSendingsForSameOrder=Other sendings for this order
|
||||||
SendingsToValidate=Sending to validate
|
SendingsForSameOrder=Sendings for this order
|
||||||
|
SendingsToValidate=Sending to validate
|
||||||
|
StatusSendingDraft=Draft
|
||||||
|
StatusSendingValidated=Validated (products to ship or already received)
|
||||||
|
StatusSendingDraftShort=Draft
|
||||||
|
StatusSendingValidatedShort=Validated
|
||||||
|
SendingSheet=Sending sheet
|
||||||
@ -56,7 +56,8 @@ OrdersStatistics=Statistiques des commandes
|
|||||||
NumberOfOrdersByMonth=Nombre de commandes par mois
|
NumberOfOrdersByMonth=Nombre de commandes par mois
|
||||||
ListOfOrders=Liste des commandes
|
ListOfOrders=Liste des commandes
|
||||||
CloseOrder=Cloturer commande
|
CloseOrder=Cloturer commande
|
||||||
ConfirmCloseOrder=Êtes-vous sur de vouloir cloturer cette commande ?
|
ConfirmCloseOrder=Êtes-vous sur de vouloir cloturer cette commande ? Une fois une commande cloturée, elle doit être facturée.
|
||||||
|
ConfirmCloseOrderIfSending=Êtes-vous sur de vouloir cloturer cette commande ? Vous ne devez cloturer une commande qu'une fois les produits expédiés.
|
||||||
ConfirmDeleteOrder=Êtes-vous sur de vouloir effacer cette commande ?
|
ConfirmDeleteOrder=Êtes-vous sur de vouloir effacer cette commande ?
|
||||||
ConfirmValidateOrder=Êtes-vous sur de vouloir valider cette commande ?
|
ConfirmValidateOrder=Êtes-vous sur de vouloir valider cette commande ?
|
||||||
ConfirmCancelOrder=Êtes-vous sur de vouloir annuler cette commande ?
|
ConfirmCancelOrder=Êtes-vous sur de vouloir annuler cette commande ?
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
# Dolibarr language file - fr_FR - sendings
|
# Dolibarr language file - fr_FR - sendings
|
||||||
|
RefSending=Réf. expédition
|
||||||
Sending=Expédition
|
Sending=Expédition
|
||||||
Sendings=Expéditions
|
Sendings=Expéditions
|
||||||
SendingsArea=Espace expéditions
|
SendingsArea=Espace expéditions
|
||||||
@ -18,5 +19,11 @@ QtyShipped=Qt
|
|||||||
QtyToShip=Qté à expédier
|
QtyToShip=Qté à expédier
|
||||||
QtyReceived=Qté reçue
|
QtyReceived=Qté reçue
|
||||||
KeepToShip=Reste à expédier
|
KeepToShip=Reste à expédier
|
||||||
OtherSendingsForSameOrder=Autres expéditions déjà envoyés
|
OtherSendingsForSameOrder=Autres expéditions pour cette commande
|
||||||
SendingsToValidate=Expéditions à valider
|
SendingsForSameOrder=Expéditions pour cette commandes
|
||||||
|
SendingsToValidate=Expéditions à valider
|
||||||
|
StatusSendingDraft=Brouillon
|
||||||
|
StatusSendingValidated=Validée (produits à envoyer ou reçus)
|
||||||
|
StatusSendingDraftShort=Brouillon
|
||||||
|
StatusSendingValidatedShort=Validée
|
||||||
|
SendingSheet=Bon d'expédition
|
||||||
@ -49,7 +49,7 @@ function commande_prepare_head($commande)
|
|||||||
if (($conf->expedition->enabled || $conf->livraison->enabled) && $user->rights->expedition->lire)
|
if (($conf->expedition->enabled || $conf->livraison->enabled) && $user->rights->expedition->lire)
|
||||||
{
|
{
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/expedition/commande.php?id='.$commande->id;
|
$head[$h][0] = DOL_URL_ROOT.'/expedition/commande.php?id='.$commande->id;
|
||||||
$head[$h][1] = $langs->trans("SendingCard");
|
$head[$h][1] = $langs->trans("Sendings");
|
||||||
$head[$h][2] = 'shipping';
|
$head[$h][2] = 'shipping';
|
||||||
$h++;
|
$h++;
|
||||||
}
|
}
|
||||||
@ -58,7 +58,7 @@ function commande_prepare_head($commande)
|
|||||||
if ($conf->facture->enabled)
|
if ($conf->facture->enabled)
|
||||||
{
|
{
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/compta/commande/fiche.php?id='.$commande->id;
|
$head[$h][0] = DOL_URL_ROOT.'/compta/commande/fiche.php?id='.$commande->id;
|
||||||
$head[$h][1] = $langs->trans("ComptaCard");
|
$head[$h][1] = $langs->trans("Compta");
|
||||||
$head[$h][2] = 'accountancy';
|
$head[$h][2] = 'accountancy';
|
||||||
$h++;
|
$h++;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -628,101 +628,11 @@ else
|
|||||||
dolibarr_print_error($db);
|
dolibarr_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Commandes associées
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
$file = $conf->commande->dir_output . "/" . $commande->ref . "/" . $commande->ref . ".pdf";
|
|
||||||
$relativepath = $commande->ref . "/" . $commande->ref . ".pdf";
|
|
||||||
|
|
||||||
$var=true;
|
|
||||||
|
|
||||||
if (file_exists($file))
|
|
||||||
{
|
|
||||||
print '<br>';
|
|
||||||
print_titre("Orders");
|
|
||||||
print '<table width="100%" class="border">';
|
|
||||||
|
|
||||||
print "<tr $bc[$true]><td>".$langs->trans("Order")." PDF</td>";
|
|
||||||
print '<td><a href="'.DOL_URL_ROOT.'/document.php?modulepart=commande&file='.urlencode($relativepath).'">'.$commande->ref.'.pdf</a></td>';
|
|
||||||
print '<td align="right">'.filesize($file). ' bytes</td>';
|
|
||||||
print '<td align="right">'.strftime("%d %b %Y %H:%M:%S",filemtime($file)).'</td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
print "</table>\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
print '</td><td valign="top" width="50%">';
|
print '</td><td valign="top" width="50%">';
|
||||||
|
|
||||||
|
// Rien à droite
|
||||||
print_titre("Actions");
|
|
||||||
/*
|
|
||||||
* Liste des actions
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
$sql = "SELECT ".$db->pdate("a.datea")." as da, a.note";
|
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a";
|
|
||||||
$sql .= " WHERE a.fk_soc = ".$commande->socidp." AND a.fk_action in (9,10)";
|
|
||||||
$sql .= " AND a.fk_commande = ".$livraison->id;
|
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
|
||||||
if ($resql)
|
|
||||||
{
|
|
||||||
$num = $db->num_rows($resql);
|
|
||||||
if ($num)
|
|
||||||
{
|
|
||||||
$i = 0;
|
|
||||||
print '<table class="border" width="100%">';
|
|
||||||
print "<tr $bc[$var]><td>".$langs->trans("Date")."</td><td>".$langs->trans("Action")."</td></tr>\n";
|
|
||||||
|
|
||||||
$var=True;
|
|
||||||
while ($i < $num)
|
|
||||||
{
|
|
||||||
$objp = $db->fetch_object($resql);
|
|
||||||
$var=!$var;
|
|
||||||
print "<tr $bc[$var]>";
|
|
||||||
print "<td>".strftime("%d %B %Y",$objp->da)."</td>\n";
|
|
||||||
print '<td>'.stripslashes($objp->note).'</td>';
|
|
||||||
print "</tr>";
|
|
||||||
$i++;
|
|
||||||
}
|
|
||||||
print "</table>";
|
|
||||||
}
|
|
||||||
$db->free($resql);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
dolibarr_print_error($db);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($action == 'presend')
|
|
||||||
{
|
|
||||||
$replytoname = $user->fullname;
|
|
||||||
$from_name = $replytoname;
|
|
||||||
|
|
||||||
$replytomail = $user->email;
|
|
||||||
$from_mail = $replytomail;
|
|
||||||
|
|
||||||
print "<form method=\"post\" action=\"fiche.php?id=$livraison->id&action=send\">\n";
|
|
||||||
print '<input type="hidden" name="replytoname" value="'.$replytoname.'">';
|
|
||||||
print '<input type="hidden" name="replytomail" value="'.$replytomail.'">';
|
|
||||||
|
|
||||||
print "<p><b>Envoyer le bon de livraison par mail</b>";
|
|
||||||
print "<table cellspacing=0 border=1 cellpadding=3>";
|
|
||||||
print '<tr><td>Destinataire</td><td colspan="5">';
|
|
||||||
|
|
||||||
$form = new Form($db);
|
|
||||||
$form->select_array("destinataire",$soc->contact_email_array());
|
|
||||||
|
|
||||||
print "</td><td><input size=\"30\" name=\"sendto\" value=\"$commande->email\"></td></tr>";
|
|
||||||
print "<tr><td>Expéditeur</td><td colspan=\"5\">$from_name</td><td>$from_mail</td></tr>";
|
|
||||||
print "<tr><td>Reply-to</td><td colspan=\"5\">$replytoname</td>";
|
|
||||||
print "<td>$replytomail</td></tr></table>";
|
|
||||||
|
|
||||||
print "<input type=\"submit\" value=\"Envoyer\"></form>";
|
|
||||||
}
|
|
||||||
|
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user