From 926a88ff51810667029a382524983f9c59fba15e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 22 Feb 2021 21:00:24 +0100 Subject: [PATCH] Update propal.class.php --- htdocs/comm/propal/class/propal.class.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index b14c7c31431..061d06092c3 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -1463,7 +1463,9 @@ class Propal extends CommonObject if ($ref) { $sql .= " WHERE p.entity IN (".getEntity('propal').")"; // Dont't use entity if you use rowid $sql .= " AND p.ref='".$this->db->escape($ref)."'"; - } else $sql .= " WHERE p.rowid=".$rowid; + } else { + $sql .= " WHERE p.rowid=".$rowid; + } dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql = $this->db->query($sql); @@ -1480,11 +1482,11 @@ class Propal extends CommonObject $this->remise_percent = $obj->remise_percent; $this->remise_absolue = $obj->remise_absolue; $this->total = $obj->total_ttc; // TODO deprecated + $this->total_ttc = $obj->total_ttc; $this->total_ht = $obj->total_ht; $this->total_tva = $obj->total_tva; $this->total_localtax1 = $obj->localtax1; $this->total_localtax2 = $obj->localtax2; - $this->total_ttc = $obj->total_ttc; $this->socid = $obj->fk_soc; $this->thirdparty = null; // Clear if another value was already set by fetch_thirdparty @@ -1535,8 +1537,8 @@ class Propal extends CommonObject $this->extraparams = (array) json_decode($obj->extraparams, true); $this->user_author_id = $obj->fk_user_author; - $this->user_valid_id = $obj->fk_user_valid; - $this->user_close_id = $obj->fk_user_cloture; + $this->user_valid_id = $obj->fk_user_valid; + $this->user_close_id = $obj->fk_user_cloture; //Incoterms $this->fk_incoterms = $obj->fk_incoterms; @@ -1548,8 +1550,8 @@ class Propal extends CommonObject $this->multicurrency_code = $obj->multicurrency_code; $this->multicurrency_tx = $obj->multicurrency_tx; $this->multicurrency_total_ht = $obj->multicurrency_total_ht; - $this->multicurrency_total_tva = $obj->multicurrency_total_tva; - $this->multicurrency_total_ttc = $obj->multicurrency_total_ttc; + $this->multicurrency_total_tva = $obj->multicurrency_total_tva; + $this->multicurrency_total_ttc = $obj->multicurrency_total_ttc; if ($obj->fk_statut == self::STATUS_DRAFT) { $this->brouillon = 1; @@ -1565,8 +1567,7 @@ class Propal extends CommonObject // Lines $result = $this->fetch_lines(); - if ($result < 0) - { + if ($result < 0) { return -3; }