61 $this->label_incoterms =
'';
62 if (!empty($this->fk_incoterms)) {
63 $sql =
"SELECT code FROM ".$this->db->prefix().
"c_incoterms WHERE rowid = ".(int) $this->fk_incoterms;
64 $result = $this->db->query($sql);
66 $res = $this->db->fetch_object($result);
73 $out .= (($out && $this->location_incoterms) ?
' - ' :
'').$this->location_incoterms;
85 $sql =
"SELECT code FROM ".$this->db->prefix().
"c_incoterms WHERE rowid = ".(int) $this->fk_incoterms;
86 $resql = $this->db->query($sql);
88 $num = $this->db->num_rows($resql);
90 $res = $this->db->fetch_object($resql);
92 return 'Incoterm : '.$res->code.
' - '.$this->location_incoterms;
100 $this->errors[] = $this->db->lasterror();
114 if ($this->
id && $this->table_element) {
115 $sql =
"UPDATE ".$this->db->prefix().$this->table_element;
116 $sql .=
" SET fk_incoterms = ".($id_incoterm > 0 ? ((int) $id_incoterm) :
"null");
117 $sql .=
", location_incoterms = ".($id_incoterm > 0 ?
"'".$this->db->escape($location).
"'" :
"null");
118 $sql .=
" WHERE rowid = ".((int) $this->
id);
119 dol_syslog(get_class($this).
'::setIncoterms', LOG_DEBUG);
120 $resql = $this->db->query($sql);
122 $this->fk_incoterms = $id_incoterm;
123 $this->location_incoterms = $location;
125 $sql =
"SELECT libelle as label_incoterms FROM ".$this->db->prefix().
"c_incoterms WHERE rowid = ".(int) $this->fk_incoterms;
126 $res = $this->db->query($sql);
128 $obj = $this->db->fetch_object($res);
129 $this->label_incoterms = $obj->label_incoterms;
133 $this->errors[] = $this->db->lasterror();
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.