Skip to content

Commit

Permalink
Merge pull request #8827 from ATM-Marc/FIX_shipment_fk_project
Browse files Browse the repository at this point in the history
FIX: shipment: fk_proje(c)t not handled in fetch() and update() methods
  • Loading branch information
eldy committed May 25, 2018
2 parents b25c7e4 + c9222ad commit 131ddd6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion htdocs/expedition/class/expedition.class.php
Expand Up @@ -481,7 +481,7 @@ function fetch($id, $ref='', $ref_ext='', $ref_int='')
// Check parameters
if (empty($id) && empty($ref) && empty($ref_ext) && empty($ref_int)) return -1;

$sql = "SELECT e.rowid, e.ref, e.fk_soc as socid, e.date_creation, e.ref_customer, e.ref_ext, e.ref_int, e.fk_user_author, e.fk_statut";
$sql = "SELECT e.rowid, e.ref, e.fk_soc as socid, e.date_creation, e.ref_customer, e.ref_ext, e.ref_int, e.fk_user_author, e.fk_statut, e.fk_projet";
$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_address, e.date_delivery";
$sql.= ", e.fk_shipping_method, e.tracking_number";
Expand Down Expand Up @@ -513,6 +513,7 @@ function fetch($id, $ref='', $ref_ext='', $ref_int='')
$this->ref_ext = $obj->ref_ext;
$this->ref_int = $obj->ref_int;
$this->statut = $obj->fk_statut;
$this->fk_project = $obj->fk_projet;
$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 deprecated
Expand Down Expand Up @@ -1052,6 +1053,7 @@ function update($user=null, $notrigger=0)
$sql.= " fk_shipping_method=".((isset($this->shipping_method_id) && $this->shipping_method_id > 0)?$this->shipping_method_id:"null").",";
$sql.= " tracking_number=".(isset($this->tracking_number)?"'".$this->db->escape($this->tracking_number)."'":"null").",";
$sql.= " fk_statut=".(isset($this->statut)?$this->statut:"null").",";
$sql.= " fk_projet=".(isset($this->fk_project)?$this->fk_project:"null").",";
$sql.= " height=".(($this->trueHeight != '')?$this->trueHeight:"null").",";
$sql.= " width=".(($this->trueWidth != '')?$this->trueWidth:"null").",";
$sql.= " size_units=".(isset($this->size_units)?$this->size_units:"null").",";
Expand Down

0 comments on commit 131ddd6

Please sign in to comment.