Fix: A lot of fixes on delivery date
This commit is contained in:
parent
8b8d851995
commit
757f9491e1
@ -1567,7 +1567,7 @@ class Commande extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Definit une date de livraison
|
||||
* \brief Set the planned delivery date
|
||||
* \param user Objet utilisateur qui modifie
|
||||
* \param date_livraison Date de livraison
|
||||
* \return int <0 si ko, >0 si ok
|
||||
@ -1577,10 +1577,10 @@ class Commande extends CommonObject
|
||||
if ($user->rights->commande->creer)
|
||||
{
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."commande";
|
||||
$sql.= " SET date_livraison = ".($date_livraison ? $this->db->idate($date_livraison) : 'null');
|
||||
$sql.= " WHERE rowid = ".$this->id." AND fk_statut = 0";
|
||||
$sql.= " SET date_livraison = ".($date_livraison ? "'".$this->db->idate($date_livraison)."'" : 'null');
|
||||
$sql.= " WHERE rowid = ".$this->id;
|
||||
|
||||
dol_syslog("Commande::set_date_livraison sql=$sql",LOG_DEBUG);
|
||||
dol_syslog("Commande::set_date_livraison sql=".$sql,LOG_DEBUG);
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
|
||||
@ -1489,13 +1489,13 @@ else
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Delivery date
|
||||
// Delivery date planed
|
||||
print '<tr><td height="10">';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print $langs->trans('DeliveryDate');
|
||||
print $langs->trans('DateDeliveryPlanned');
|
||||
print '</td>';
|
||||
|
||||
if ($_GET['action'] != 'editdate_livraison' && $commande->brouillon) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editdate_livraison&id='.$commande->id.'">'.img_edit($langs->trans('SetDeliveryDate'),1).'</a></td>';
|
||||
if ($_GET['action'] != 'editdate_livraison') print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editdate_livraison&id='.$commande->id.'">'.img_edit($langs->trans('SetDeliveryDate'),1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="2">';
|
||||
if ($_GET['action'] == 'editdate_livraison')
|
||||
@ -1503,7 +1503,7 @@ else
|
||||
print '<form name="setdate_livraison" action="'.$_SERVER["PHP_SELF"].'?id='.$commande->id.'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="setdate_livraison">';
|
||||
$html->select_date($commande->date_livraison,'liv_','','','',"setdate_livraison");
|
||||
$html->select_date($commande->date_livraison?$commande->date_livraison:-1,'liv_','','','',"setdate_livraison");
|
||||
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
@ -240,13 +240,13 @@ if ($id > 0 || ! empty($ref))
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Date de livraison
|
||||
// Delivery date planed
|
||||
print '<tr><td height="10">';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print $langs->trans('DeliveryDate');
|
||||
print $langs->trans('DateDeliveryPlanned');
|
||||
print '</td>';
|
||||
|
||||
if (1 == 2 && $_GET['action'] != 'editdate_livraison' && $commande->brouillon) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editdate_livraison&id='.$commande->id.'">'.img_edit($langs->trans('SetDeliveryDate'),1).'</a></td>';
|
||||
if (1 == 2 && $_GET['action'] != 'editdate_livraison') print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editdate_livraison&id='.$commande->id.'">'.img_edit($langs->trans('SetDeliveryDate'),1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="2">';
|
||||
if ($_GET['action'] == 'editdate_livraison')
|
||||
@ -254,7 +254,7 @@ if ($id > 0 || ! empty($ref))
|
||||
print '<form name="setdate_livraison" action="'.$_SERVER["PHP_SELF"].'?id='.$commande->id.'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="setdate_livraison">';
|
||||
$html->select_date($commande->date_livraison,'liv_','','','',"setdate_livraison");
|
||||
$html->select_date($commande->date_livraison>0?$commande->date_livraison:-1,'liv_','','','',"setdate_livraison");
|
||||
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
@ -1022,7 +1022,7 @@ class CommonObject
|
||||
function setStatut($statut,$elementId='',$elementType='')
|
||||
{
|
||||
$elementId = (!empty($elementId)?$elementId:$this->id);
|
||||
$elementTable = (!empty($elementType)?$elementType:$this->element);
|
||||
$elementTable = (!empty($elementType)?$elementType:$this->table_element);
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX.$elementTable;
|
||||
$sql.= " SET fk_statut = ".$statut;
|
||||
|
||||
@ -32,7 +32,7 @@ if ($conf->commande->enabled) require_once(DOL_DOCUMENT_ROOT."/commande/class/co
|
||||
|
||||
/**
|
||||
* \class Expedition
|
||||
* \brief Classe de gestion des expeditions
|
||||
* \brief Class to manage shippings
|
||||
*/
|
||||
class Expedition extends CommonObject
|
||||
{
|
||||
@ -53,7 +53,19 @@ class Expedition extends CommonObject
|
||||
var $lignes;
|
||||
var $meths;
|
||||
|
||||
var $date_delivery;
|
||||
var $trueWeight;
|
||||
var $weight_units;
|
||||
var $trueWidth;
|
||||
var $width_units;
|
||||
var $trueHeight;
|
||||
var $height_units;
|
||||
var $trueDepth;
|
||||
var $depth_units;
|
||||
// A denormalized value
|
||||
var $trueSize;
|
||||
|
||||
var $date_delivery; // Date delivery planed
|
||||
var $date_expedition; // Date delivery real
|
||||
var $date_creation;
|
||||
var $date_valid;
|
||||
|
||||
@ -115,14 +127,14 @@ class Expedition extends CommonObject
|
||||
$sql.= "'(PROV)'";
|
||||
$sql.= ", '".$this->ref_customer."'";
|
||||
$sql.= ", ".$conf->entity;
|
||||
$sql.= ", ".$this->db->idate(gmmktime());
|
||||
$sql.= ", '".$this->db->idate(gmmktime())."'";
|
||||
$sql.= ", ".$user->id;
|
||||
$sql.= ", ".$this->db->idate($this->date_expedition);
|
||||
$sql.= ", ".$this->db->idate($this->date_delivery);
|
||||
$sql.= ", ".($this->date_expedition>0?"'".$this->db->idate($this->date_expedition)."'":"null");
|
||||
$sql.= ", ".($this->date_delivery>0?"'".$this->db->idate($this->date_delivery)."'":"null");
|
||||
$sql.= ", ".$this->socid;
|
||||
$sql.= ", ".($this->fk_delivery_address>0?$this->fk_delivery_address:"null");
|
||||
$sql.= ", ".($this->expedition_method_id>0?$this->expedition_method_id:"null");
|
||||
$sql.= ", '". $this->tracking_number."'";
|
||||
$sql.= ", '".addslashes($this->tracking_number)."'";
|
||||
$sql.= ", ".$this->weight;
|
||||
$sql.= ", ".$this->sizeS;
|
||||
$sql.= ", ".$this->sizeW;
|
||||
@ -258,9 +270,11 @@ class Expedition extends CommonObject
|
||||
$this->ref_customer = $obj->ref_customer;
|
||||
$this->statut = $obj->fk_statut;
|
||||
$this->user_author_id = $obj->fk_user_author;
|
||||
$this->date_creation = $this->db->jdate($obj->date_creation);
|
||||
$this->date = $this->db->jdate($obj->date_expedition); // TODO obsolete
|
||||
$this->date_shipping = $this->db->jdate($obj->date_expedition);
|
||||
$this->date_delivery = $this->db->jdate($obj->date_delivery);
|
||||
$this->date_expedition = $this->db->jdate($obj->date_expedition); // TODO obsolete
|
||||
$this->date_shipping = $this->db->jdate($obj->date_expedition); // Date real
|
||||
$this->date_delivery = $this->db->jdate($obj->date_delivery); // Date planed
|
||||
$this->fk_delivery_address = $obj->fk_adresse_livraison;
|
||||
$this->modelpdf = $obj->model_pdf;
|
||||
$this->expedition_method_id = $obj->fk_expedition_methode;
|
||||
@ -624,12 +638,13 @@ class Expedition extends CommonObject
|
||||
$sql = "SELECT cd.rowid, cd.fk_product, cd.description, cd.qty as qty_asked";
|
||||
$sql.= ", ed.qty as qty_shipped, ed.fk_origin_line, ed.fk_entrepot";
|
||||
$sql.= ", p.ref, p.fk_product_type, p.label, p.weight, p.weight_units, p.volume, p.volume_units";
|
||||
$sql.= " FROM (".MAIN_DB_PREFIX."commandedet as cd";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."expeditiondet as ed)";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON (p.rowid = cd.fk_product)";
|
||||
$sql.= " FROM (".MAIN_DB_PREFIX."expeditiondet as ed,";
|
||||
$sql.= " ".MAIN_DB_PREFIX."commandedet as cd)";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = cd.fk_product";
|
||||
$sql.= " WHERE ed.fk_expedition = ".$this->id;
|
||||
$sql.= " AND ed.fk_origin_line = cd.rowid";
|
||||
|
||||
dol_syslog("Expedition::fetch_lines sql=".$sql);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
@ -803,6 +818,40 @@ class Expedition extends CommonObject
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Set the planned delivery date
|
||||
* \param user Objet utilisateur qui modifie
|
||||
* \param date_livraison Date de livraison
|
||||
* \return int <0 si ko, >0 si ok
|
||||
*/
|
||||
function set_date_livraison($user, $date_livraison)
|
||||
{
|
||||
if ($user->rights->expedition->creer)
|
||||
{
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."expedition";
|
||||
$sql.= " SET date_delivery = ".($date_livraison ? "'".$this->db->idate($date_livraison)."'" : 'null');
|
||||
$sql.= " WHERE rowid = ".$this->id;
|
||||
|
||||
dol_syslog("Expedition::set_date_livraison sql=".$sql,LOG_DEBUG);
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$this->date_delivery = $date_livraison;
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=$this->db->error();
|
||||
dol_syslog("Commande::set_date_livraison ".$this->error,LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return -2;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Fetch deliveries method and return an array. Load array this->meths(rowid=>label).
|
||||
*/
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003-2008 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
|
||||
* Copyright (C) 2005-2010 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
@ -72,7 +72,6 @@ if ($_POST["action"] == 'add')
|
||||
// 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;
|
||||
@ -83,8 +82,8 @@ if ($_POST["action"] == 'add')
|
||||
$expedition->size_units = $_POST["size_units"];
|
||||
$expedition->weight_units = $_POST["weight_units"];
|
||||
|
||||
// On boucle sur chaque ligne du document d'origine pour completer objet expedition
|
||||
// avec qte a livrer
|
||||
// On va boucler sur chaque ligne du document d'origine pour completer objet expedition
|
||||
// avec info diverses + qte a livrer
|
||||
$classname = ucfirst($expedition->origin);
|
||||
$object = new $classname($db);
|
||||
$object->fetch($expedition->origin_id);
|
||||
@ -92,7 +91,7 @@ if ($_POST["action"] == 'add')
|
||||
|
||||
$expedition->socid = $object->socid;
|
||||
$expedition->ref_customer = $object->ref_client;
|
||||
$expedition->date_delivery = $object->date_livraison;
|
||||
$expedition->date_delivery = $object->date_livraison; // Date delivery planed
|
||||
$expedition->fk_delivery_address = $object->fk_delivery_address;
|
||||
$expedition->expedition_method_id = $_POST["expedition_method_id"];
|
||||
$expedition->tracking_number = $_POST["tracking_number"];
|
||||
@ -189,6 +188,34 @@ if ($_REQUEST["action"] == 'confirm_delete' && $_REQUEST["confirm"] == 'yes')
|
||||
}
|
||||
}
|
||||
|
||||
if ($_REQUEST["action"] == 'open')
|
||||
{
|
||||
if ($user->rights->expedition->valider )
|
||||
{
|
||||
$expedition = new Expedition($db);
|
||||
$expedition->fetch($_GET["id"]);
|
||||
$result = $expedition->setStatut(0);
|
||||
if ($result < 0)
|
||||
{
|
||||
$mesg = $expedition->error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($_POST['action'] == 'setdate_livraison' && $user->rights->expedition->creer)
|
||||
{
|
||||
//print "x ".$_POST['liv_month'].", ".$_POST['liv_day'].", ".$_POST['liv_year'];
|
||||
$datelivraison=dol_mktime(0, 0, 0, $_POST['liv_month'], $_POST['liv_day'], $_POST['liv_year']);
|
||||
|
||||
$shipping = new Expedition($db);
|
||||
$shipping->fetch($_GET['id']);
|
||||
$result=$shipping->set_date_livraison($user,$datelivraison);
|
||||
if ($result < 0)
|
||||
{
|
||||
$mesg='<div class="error">'.$shipping->error.'</div>';
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Build doc
|
||||
*/
|
||||
@ -275,7 +302,7 @@ if ($_GET["action"] == 'create')
|
||||
/*
|
||||
* Document source
|
||||
*/
|
||||
print '<form action="fiche.php" method="post">';
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
print '<input type="hidden" name="origin" value="'.$origin.'">';
|
||||
@ -318,7 +345,10 @@ if ($_GET["action"] == 'create')
|
||||
|
||||
// Date delivery planned
|
||||
print '<tr><td>'.$langs->trans("DateDeliveryPlanned").'</td>';
|
||||
print '<td colspan="3">'.dol_print_date($object->date_livraison,'day')."</td>\n";
|
||||
print '<td colspan="3">';
|
||||
print dol_print_date($object->date_livraison,"day");
|
||||
//$html->select_date($object->date_livraison,'date_delivery');
|
||||
print "</td>\n";
|
||||
print '</tr>';
|
||||
|
||||
// Delivery address
|
||||
@ -351,31 +381,31 @@ if ($_GET["action"] == 'create')
|
||||
|
||||
print '<tr><td>';
|
||||
print $langs->trans("Weight");
|
||||
print '</td><td><input name="weight" size="4" value=""></td><td>';
|
||||
print $formproduct->select_measuring_units("weight_units","weight");
|
||||
print '</td><td><input name="weight" size="4" value="'.$_POST["weight"].'"></td><td>';
|
||||
print $formproduct->select_measuring_units("weight_units","weight",$_POST["weight_units"]);
|
||||
print '</td></tr><tr><td>';
|
||||
print $langs->trans("Width");
|
||||
print ' </td><td><input name="sizeW" size="4" value=""></td>';
|
||||
print '<td> </td></tr><tr><td>';
|
||||
print $langs->trans("Height");
|
||||
print '</td><td><input name="sizeH" size="4" value=""></td><td>';
|
||||
print ' </td><td><input name="sizeW" size="4" value="'.$_POST["sizeW"].'"></td><td rowspan="3">';
|
||||
print $formproduct->select_measuring_units("size_units","size");
|
||||
print '</td></tr><tr><td>';
|
||||
print $langs->trans("Height");
|
||||
print '</td><td><input name="sizeH" size="4" value="'.$_POST["sizeH"].'"></td>';
|
||||
print '</tr><tr><td>';
|
||||
print $langs->trans("Depth");
|
||||
print '</td><td><input name="sizeS" size="4" value=""></td>';
|
||||
print '<td> </td></tr>';
|
||||
print '</td><td><input name="sizeS" size="4" value="'.$_POST["sizeS"].'"></td>';
|
||||
print '</tr>';
|
||||
|
||||
// Delivery method
|
||||
print "<tr><td>".$langs->trans("DeliveryMethod")."</td>";
|
||||
print '<td colspan="3">';
|
||||
$expe->fetch_delivery_methods();
|
||||
$html->select_array("expedition_method_id",$expe->meths,'',1,0,0,0,"",1);
|
||||
$html->select_array("expedition_method_id",$expe->meths,$_POST["expedition_method_id"],1,0,0,0,"",1);
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Tracking number
|
||||
print "<tr><td>".$langs->trans("TrackingNumber")."</td>";
|
||||
print '<td colspan="3">';
|
||||
print '<input name="tracking_number" size="20">';
|
||||
print '<input name="tracking_number" size="20" value="'.$_POST["tracking_number"].'">';
|
||||
print "</td></tr>\n";
|
||||
|
||||
print "</table>";
|
||||
@ -709,13 +739,33 @@ else
|
||||
print '</tr>';
|
||||
|
||||
// Date
|
||||
print '<tr><td>'.$langs->trans("Date").'</td>';
|
||||
print '<td colspan="3">'.dol_print_date($expedition->date,"daytext")."</td>\n";
|
||||
print '<tr><td>'.$langs->trans("DateCreation").'</td>';
|
||||
print '<td colspan="3">'.dol_print_date($expedition->date_creation,"daytext")."</td>\n";
|
||||
print '</tr>';
|
||||
|
||||
// Date delivery planned
|
||||
print '<tr><td>'.$langs->trans("DateDeliveryPlanned").'</td>';
|
||||
print '<td colspan="3">'.dol_print_date($expedition->date_delivery,'daytext')."</td>\n";
|
||||
// Delivery date planed
|
||||
print '<tr><td height="10">';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print $langs->trans('DateDeliveryPlanned');
|
||||
print '</td>';
|
||||
|
||||
if ($_GET['action'] != 'editdate_livraison' && $expedition->brouillon) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editdate_livraison&id='.$expedition->id.'">'.img_edit($langs->trans('SetDeliveryDate'),1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="2">';
|
||||
if ($_GET['action'] == 'editdate_livraison')
|
||||
{
|
||||
print '<form name="setdate_livraison" action="'.$_SERVER["PHP_SELF"].'?id='.$expedition->id.'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="setdate_livraison">';
|
||||
$html->select_date($expedition->date_delivery?$expedition->date_delivery:-1,'liv_','','','',"setdate_livraison");
|
||||
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
|
||||
print '</form>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print $expedition->date_delivery ? dol_print_date($expedition->date_delivery,'daytext') : ' ';
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Delivery address
|
||||
@ -882,9 +932,14 @@ else
|
||||
// Entrepot source
|
||||
if ($conf->stock->enabled)
|
||||
{
|
||||
$entrepot = new Entrepot($db);
|
||||
$entrepot->fetch($lignes[$i]->entrepot_id);
|
||||
print '<td align="left">'.$entrepot->getNomUrl(1).'</td>';
|
||||
print '<td align="left">';
|
||||
if ($lignes[$i]->entrepot_id > 0)
|
||||
{
|
||||
$entrepot = new Entrepot($db);
|
||||
$entrepot->fetch($lignes[$i]->entrepot_id);
|
||||
print $entrepot->getNomUrl(1);
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
|
||||
@ -907,6 +962,11 @@ else
|
||||
{
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
if ($expedition->statut > 0 && $user->rights->expedition->valider)
|
||||
{
|
||||
print '<a class="butAction" href="fiche.php?id='.$expedition->id.'&action=open">'.$langs->trans("Modify").'</a>';
|
||||
}
|
||||
|
||||
if ($expedition->statut == 0 && $num_prod > 0)
|
||||
{
|
||||
if ($user->rights->expedition->valider)
|
||||
|
||||
@ -247,13 +247,13 @@ if ($id > 0 || ! empty($ref))
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Date de livraison
|
||||
// Delivery date planed
|
||||
print '<tr><td height="10">';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print $langs->trans('DeliveryDate');
|
||||
print $langs->trans('DateDeliveryPlanned');
|
||||
print '</td>';
|
||||
|
||||
if ($_GET['action'] != 'editdate_livraison' && $commande->brouillon) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editdate_livraison&id='.$commande->id.'">'.img_edit($langs->trans('SetDeliveryDate'),1).'</a></td>';
|
||||
if ($_GET['action'] != 'editdate_livraison') print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editdate_livraison&id='.$commande->id.'">'.img_edit($langs->trans('SetDeliveryDate'),1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="2">';
|
||||
if ($_GET['action'] == 'editdate_livraison')
|
||||
@ -261,7 +261,7 @@ if ($id > 0 || ! empty($ref))
|
||||
print '<form name="setdate_livraison" action="'.$_SERVER["PHP_SELF"].'?id='.$commande->id.'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="setdatedelivery">';
|
||||
$html->select_date($commande->date_livraison,'liv_','','','',"setdatedelivery");
|
||||
$html->select_date($commande->date_livraison>0?$commande->date_livraison:-1,'liv_','','','',"setdatedelivery");
|
||||
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
@ -46,6 +46,8 @@ Enlevement=Gotten by customer
|
||||
DocumentModelSimple=Simple document model
|
||||
WarningNoQtyLeftToSend=Warning, no products waiting to be shipped.
|
||||
StatsOnShipmentsOnlyValidated=Statistics conducted on shipments only validated
|
||||
DateDeliveryPlanned=Planed date of delivery
|
||||
DateReceived=Date delivery received
|
||||
|
||||
# Sending methods
|
||||
SendingMethodCATCH=Catch by customer
|
||||
|
||||
@ -46,6 +46,8 @@ Enlevement=Enlèvement sur place par le client
|
||||
DocumentModelSimple=Modèle simple
|
||||
WarningNoQtyLeftToSend=Alerte, aucun produit en attente de livraison.
|
||||
StatsOnShipmentsOnlyValidated=Statistiques effectuées sur les expéditions validées uniquement
|
||||
DateDeliveryPlanned=Date livraison prévue
|
||||
DateReceived=Date réception réelle
|
||||
|
||||
# Sending methods
|
||||
SendingMethodCATCH=Enlèvement par le client
|
||||
|
||||
@ -221,13 +221,19 @@ function show_list_sending_receive($origin='commande',$origin_id,$filter='')
|
||||
|
||||
print '<td align="center">'.$objp->qty_shipped.'</td>';
|
||||
|
||||
// Date shipping was planed
|
||||
print '<td align="center" nowrap="nowrap">'.dol_print_date($db->jdate($objp->date_expedition),'day').'</td>';
|
||||
|
||||
|
||||
if ($conf->livraison_bon->enabled)
|
||||
{
|
||||
if ($objp->livraison_id)
|
||||
{
|
||||
// Ref
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/livraison/fiche.php?id='.$objp->livraison_id.'">'.img_object($langs->trans("ShowSending"),'sending').' '.$objp->livraison_ref.'<a></td>';
|
||||
// Qty received
|
||||
print '<td align="center">'.$objp->qty_received.'</td>';
|
||||
// Date shipping real
|
||||
print '<td>'.dol_print_date($objp->date_delivery,'day').'</td>';
|
||||
}
|
||||
else
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
|
||||
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be>
|
||||
* Copyright (C) 2005-2010 Regis Houssin <regis@dolibarr.fr>
|
||||
@ -470,12 +470,12 @@ else
|
||||
print '</tr>';
|
||||
|
||||
// Date
|
||||
print '<tr><td>'.$langs->trans("Date").'</td>';
|
||||
print '<tr><td>'.$langs->trans("DateCreation").'</td>';
|
||||
print '<td colspan="3">'.dol_print_date($delivery->date_creation,'daytext')."</td>\n";
|
||||
print '</tr>';
|
||||
|
||||
// Date delivery planned
|
||||
print '<tr><td>'.$langs->trans("DateDeliveryPlanned").'</td>';
|
||||
// Date delivery real / Received
|
||||
print '<tr><td>'.$langs->trans("DateReceived").'</td>';
|
||||
print '<td colspan="3">'.dol_print_date($delivery->date_delivery,'daytext')."</td>\n";
|
||||
print '</tr>';
|
||||
|
||||
|
||||
@ -117,31 +117,33 @@ class FormProduct
|
||||
}
|
||||
print '</select>';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief Selection des unites de mesure
|
||||
* \param name Nom champ html
|
||||
* \param measuring_style Le style de mesure : weight, volume,...
|
||||
* \param default Forcage de l'unite
|
||||
* \brief Output a combo box with list of units
|
||||
* \param name Name of HTML field
|
||||
* \param measuring_style Unit to show: weight, size, surface, volume
|
||||
* \param default Force unit
|
||||
* \param adddefault Add empty unit called "Default"
|
||||
* \remarks pour l'instant on ne definit pas les unites dans la base
|
||||
*/
|
||||
function select_measuring_units($name='measuring_units', $measuring_style='', $default='0', $adddefault=0)
|
||||
{
|
||||
print $this->load_measuring_units($name, $measuring_style, $default, $adddefault);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief Selection des unites de mesure
|
||||
* \param name Nom champ html
|
||||
* \param measuring_style Le style de mesure : weight, volume,...
|
||||
* \param default Forcage de l'unite
|
||||
* \brief Return a combo box with list of units
|
||||
* \param name Name of HTML field
|
||||
* \param measuring_style Unit to show: weight, size, surface, volume
|
||||
* \param default Force unit
|
||||
* \param adddefault Add empty unit called "Default"
|
||||
* \remarks pour l'instant on ne definit pas les unites dans la base
|
||||
*/
|
||||
function load_measuring_units($name='measuring_units', $measuring_style='', $default='0', $adddefault=0)
|
||||
{
|
||||
global $langs,$conf,$mysoc;
|
||||
$langs->load("other");
|
||||
|
||||
|
||||
$return='';
|
||||
|
||||
if ($measuring_style == 'weight')
|
||||
@ -186,7 +188,7 @@ class FormProduct
|
||||
$return.= '>'.$value.'</option>';
|
||||
}
|
||||
$return.= '</select>';
|
||||
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user