Add previous/next on shippings

This commit is contained in:
Laurent Destailleur 2010-06-06 15:53:49 +00:00
parent 42e47fd567
commit 6b2fb32bf5
2 changed files with 11 additions and 5 deletions

View File

@ -242,20 +242,24 @@ class Expedition extends CommonObject
/**
* \brief Lit une expedition
* \param id
* \param id Id of object
* \param ref Ref of object
*/
function fetch($id)
function fetch($id,$ref='')
{
global $conf;
$sql = "SELECT e.rowid, e.fk_soc as socid, e.date_creation, e.ref, e.ref_customer, e.fk_user_author, e.fk_statut";
if (empty($id) && empty($ref)) return -1;
$sql = "SELECT e.rowid, e.ref, e.fk_soc as socid, e.date_creation, e.ref_customer, e.fk_user_author, e.fk_statut";
$sql.= ", e.weight, e.weight_units, e.size, e.size_units, e.width, e.height";
$sql.= ", e.date_expedition as date_expedition, e.model_pdf, e.fk_adresse_livraison, e.date_delivery";
$sql.= ", e.fk_expedition_methode, e.tracking_number";
$sql.= ", el.fk_source as origin_id, el.sourcetype as origin";
$sql.= " FROM ".MAIN_DB_PREFIX."expedition as e";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as el ON el.fk_target = e.rowid AND el.targettype = '".$this->element."'";
$sql.= " WHERE e.rowid = ".$id;
if ($id) $sql.= " WHERE e.rowid = ".$id;
if ($ref) $sql.= " WHERE e.ref = '".$ref."'";
dol_syslog("Expedition::fetch sql=".$sql);
$result = $this->db->query($sql) ;

View File

@ -735,7 +735,9 @@ else
// Ref
print '<tr><td width="20%">'.$langs->trans("Ref").'</td>';
print '<td colspan="3">'.$expedition->ref.'</td></tr>';
print '<td colspan="3">';
print $html->showrefnav($expedition,'ref','',1,'ref','ref');
print '</td></tr>';
// Customer
print '<tr><td width="20%">'.$langs->trans("Customer").'</td>';