70 $this->label_incoterms =
'';
71 if (!empty($this->fk_incoterms)) {
72 $sql =
"SELECT code FROM ".$this->db->prefix().
"c_incoterms WHERE rowid = ".(int) $this->fk_incoterms;
73 $result = $this->db->query($sql);
75 $res = $this->db->fetch_object($result);
82 $out .= (($out && $this->location_incoterms) ?
' - ' :
'').$this->location_incoterms;
96 $sql =
"SELECT code FROM ".$this->db->prefix().
"c_incoterms WHERE rowid = ".(int) $this->fk_incoterms;
97 $resql = $this->db->query($sql);
99 $num = $this->db->num_rows($resql);
101 $res = $this->db->fetch_object($resql);
103 return $langs->trans(
"IncotermLabel").
': '.$res->code.
' - '.$this->location_incoterms;
111 $this->errors[] = $this->db->lasterror();
125 if ($this->
id && $this->table_element) {
126 $sql =
"UPDATE ".$this->db->prefix().$this->table_element;
127 $sql .=
" SET fk_incoterms = ".($id_incoterm > 0 ? ((int) $id_incoterm) :
"null");
128 $sql .=
", location_incoterms = ".($id_incoterm > 0 ?
"'".$this->db->escape($location).
"'" :
"null");
129 $sql .=
" WHERE rowid = ".((int) $this->
id);
130 dol_syslog(get_class($this).
'::setIncoterms', LOG_DEBUG);
131 $resql = $this->db->query($sql);
133 $this->fk_incoterms = $id_incoterm;
134 $this->location_incoterms = $location;
136 $sql =
"SELECT libelle as label_incoterms FROM ".$this->db->prefix().
"c_incoterms WHERE rowid = ".(int) $this->fk_incoterms;
137 $res = $this->db->query($sql);
139 $obj = $this->db->fetch_object($res);
140 $this->label_incoterms = $obj->label_incoterms;
144 $this->errors[] = $this->db->lasterror();
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.