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;
94 $sql =
"SELECT code FROM ".$this->db->prefix().
"c_incoterms WHERE rowid = ".(int) $this->fk_incoterms;
95 $resql = $this->db->query($sql);
97 $num = $this->db->num_rows($resql);
99 $res = $this->db->fetch_object($resql);
101 return 'Incoterm : '.$res->code.
' - '.$this->location_incoterms;
109 $this->errors[] = $this->db->lasterror();
123 if ($this->
id && $this->table_element) {
124 $sql =
"UPDATE ".$this->db->prefix().$this->table_element;
125 $sql .=
" SET fk_incoterms = ".($id_incoterm > 0 ? ((int) $id_incoterm) :
"null");
126 $sql .=
", location_incoterms = ".($id_incoterm > 0 ?
"'".$this->db->escape($location).
"'" :
"null");
127 $sql .=
" WHERE rowid = ".((int) $this->
id);
128 dol_syslog(get_class($this).
'::setIncoterms', LOG_DEBUG);
129 $resql = $this->db->query($sql);
131 $this->fk_incoterms = $id_incoterm;
132 $this->location_incoterms = $location;
134 $sql =
"SELECT libelle as label_incoterms FROM ".$this->db->prefix().
"c_incoterms WHERE rowid = ".(int) $this->fk_incoterms;
135 $res = $this->db->query($sql);
137 $obj = $this->db->fetch_object($res);
138 $this->label_incoterms = $obj->label_incoterms;
142 $this->errors[] = $this->db->lasterror();
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.