From 2a1a5e74c61eb1288ec74507f56b235b4756b11e Mon Sep 17 00:00:00 2001 From: phf Date: Tue, 10 Feb 2015 11:46:09 +0100 Subject: [PATCH] =?UTF-8?q?[CORE]=20mise=20=C3=A0=20jour=20de=20l'objet=20?= =?UTF-8?q?pour=20l'info=20bulle=20apr=C3=A8s=20modification=20de=20l'inco?= =?UTF-8?q?term=20(#incoterm).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/core/class/commonobject.class.php | 34 ++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index ad87502fe1b..5f2a3db5fae 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2376,6 +2376,32 @@ abstract class CommonObject } } + + /** + * Return incoterms informations + * + * @return string Bank number + */ + function display_incoterms() + { + $out = ''; + $this->incoterms_libelle = ''; + if (!empty($this->fk_incoterms)) + { + $sql = 'SELECT code FROM '.MAIN_DB_PREFIX.'c_incoterms WHERE rowid = '.(int) $this->fk_incoterms; + $result = $this->db->query($sql); + if ($result) + { + $res = $this->db->fetch_object($result); + $out .= $res->code; + } + } + + $out .= ' - '.$this->location_incoterms; + + return $out; + } + /** * Define incoterms values of current object * @@ -2397,6 +2423,14 @@ abstract class CommonObject { $this->fk_incoterms = $id_incoterm; $this->location_incoterms = $location; + + $sql = 'SELECT libelle FROM '.MAIN_DB_PREFIX.'c_incoterms WHERE rowid = '.(int) $this->fk_incoterms; + $res = $this->db->query($sql); + if ($res) + { + $obj = $this->db->fetch_object($res); + $this->libelle_incoterms = $obj->libelle; + } return 1; } else