|
@@ -273,9 +273,9 @@ class Reception extends CommonObject
|
|
|
$sql .= ", ".($this->shipping_method_id > 0 ? ((int) $this->shipping_method_id) : "null");
|
|
|
$sql .= ", '".$this->db->escape($this->tracking_number)."'";
|
|
|
$sql .= ", ".(is_null($this->weight) ? "NULL" : ((double) $this->weight));
|
|
|
- $sql .= ", ".(is_null($this->sizeS) ? "NULL" : ((double) $this->sizeS)); // TODO Should use this->trueDepth
|
|
|
- $sql .= ", ".(is_null($this->sizeW) ? "NULL" : ((double) $this->sizeW)); // TODO Should use this->trueWidth
|
|
|
- $sql .= ", ".(is_null($this->sizeH) ? "NULL" : ((double) $this->sizeH)); // TODO Should use this->trueHeight
|
|
|
+ $sql .= ", ".(is_null($this->trueDepth) ? "NULL" : ((double) $this->trueDepth));
|
|
|
+ $sql .= ", ".(is_null($this->trueWidth) ? "NULL" : ((double) $this->trueWidth));
|
|
|
+ $sql .= ", ".(is_null($this->trueHeight) ? "NULL" : ((double) $this->trueHeight));
|
|
|
$sql .= ", ".(is_null($this->weight_units) ? "NULL" : ((double) $this->weight_units));
|
|
|
$sql .= ", ".(is_null($this->size_units) ? "NULL" : ((double) $this->size_units));
|
|
|
$sql .= ", ".(!empty($this->note_private) ? "'".$this->db->escape($this->note_private)."'" : "null");
|
|
@@ -744,7 +744,6 @@ class Reception extends CommonObject
|
|
|
|
|
|
if (!empty($this->origin) && $this->origin_id > 0 && ($this->origin == 'order_supplier' || $this->origin == 'commandeFournisseur')) {
|
|
|
if (empty($this->commandeFournisseur)) {
|
|
|
- $this->commandeFournisseur = null;
|
|
|
$this->fetch_origin();
|
|
|
if (empty($this->commandeFournisseur->lines)) {
|
|
|
$res = $this->commandeFournisseur->fetch_lines();
|
|
@@ -1485,70 +1484,6 @@ class Reception extends CommonObject
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
|
|
- /**
|
|
|
- * Update/create delivery method.
|
|
|
- *
|
|
|
- * @param string $id id method to activate
|
|
|
- *
|
|
|
- * @return void
|
|
|
- */
|
|
|
- public function update_delivery_method($id = '')
|
|
|
- {
|
|
|
- // phpcs:enable
|
|
|
- if ($id == '') {
|
|
|
- $sql = "INSERT INTO ".MAIN_DB_PREFIX."c_shipment_mode (code, libelle, description, tracking)";
|
|
|
- $sql .= " VALUES ('".$this->db->escape($this->update['code'])."','".$this->db->escape($this->update['libelle'])."','".$this->db->escape($this->update['description'])."','".$this->db->escape($this->update['tracking'])."')";
|
|
|
- $resql = $this->db->query($sql);
|
|
|
- } else {
|
|
|
- $sql = "UPDATE ".MAIN_DB_PREFIX."c_shipment_mode SET";
|
|
|
- $sql .= " code='".$this->db->escape($this->update['code'])."'";
|
|
|
- $sql .= ",libelle='".$this->db->escape($this->update['libelle'])."'";
|
|
|
- $sql .= ",description='".$this->db->escape($this->update['description'])."'";
|
|
|
- $sql .= ",tracking='".$this->db->escape($this->update['tracking'])."'";
|
|
|
- $sql .= " WHERE rowid=".((int) $id);
|
|
|
- $resql = $this->db->query($sql);
|
|
|
- }
|
|
|
- if ($resql < 0) {
|
|
|
- dol_print_error($this->db, '');
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
|
|
- /**
|
|
|
- * Activate delivery method.
|
|
|
- *
|
|
|
- * @param int $id id method to activate
|
|
|
- *
|
|
|
- * @return void
|
|
|
- */
|
|
|
- public function activ_delivery_method($id)
|
|
|
- {
|
|
|
- // phpcs:enable
|
|
|
- $sql = 'UPDATE '.MAIN_DB_PREFIX.'c_shipment_mode SET active=1';
|
|
|
- $sql .= " WHERE rowid = ".((int) $id);
|
|
|
-
|
|
|
- $resql = $this->db->query($sql);
|
|
|
- }
|
|
|
-
|
|
|
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
|
|
- /**
|
|
|
- * DesActivate delivery method.
|
|
|
- *
|
|
|
- * @param int $id id method to desactivate
|
|
|
- *
|
|
|
- * @return void
|
|
|
- */
|
|
|
- public function disable_delivery_method($id)
|
|
|
- {
|
|
|
- // phpcs:enable
|
|
|
- $sql = 'UPDATE '.MAIN_DB_PREFIX.'c_shipment_mode SET active=0';
|
|
|
- $sql .= " WHERE rowid = ".((int) $id);
|
|
|
-
|
|
|
- $resql = $this->db->query($sql);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
* Forge an set tracking url
|
|
|
*
|