Clean code. Merge/Close #33995 manually.

This commit is contained in:
ldestailleur 2025-05-05 02:04:55 +02:00
parent 2736a4b382
commit 6d89c2c033
2 changed files with 4 additions and 5 deletions

View file

@ -100,8 +100,6 @@ class CommandeStats extends Stats
*/
public function __construct($db, $socid, $mode, $userid = 0, $typentid = 0, $categid = 0)
{
global $user, $conf;
$this->db = $db;
$this->socid = ($socid > 0 ? $socid : 0);

View file

@ -409,8 +409,6 @@ class Expedition extends CommonObject
*/
public function create($user, $notrigger = 0)
{
global $conf, $hookmanager;
$now = dol_now();
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
@ -421,6 +419,9 @@ class Expedition extends CommonObject
if (empty($this->fk_project)) {
$this->fk_project = 0;
}
if (empty($this->date_creation)) {
$this->date_creation = $now;
}
if (empty($this->date_shipping) && !empty($this->date_expedition)) {
$this->date_shipping = $this->date_expedition;
}
@ -460,7 +461,7 @@ class Expedition extends CommonObject
$sql .= ", ".((int) $this->entity);
$sql .= ", ".($this->ref_customer ? "'".$this->db->escape($this->ref_customer)."'" : "null");
$sql .= ", ".($this->ref_ext ? "'".$this->db->escape($this->ref_ext)."'" : "null");
$sql .= ", '".$this->db->idate($now)."'";
$sql .= ", '".$this->db->idate($this->date_creation)."'";
$sql .= ", ".((int) $user->id);
$sql .= ", ".($this->date_shipping > 0 ? "'".$this->db->idate($this->date_shipping)."'" : "null");
$sql .= ", ".($this->date_delivery > 0 ? "'".$this->db->idate($this->date_delivery)."'" : "null");