40 public $label_incoterms;
46 public $location_incoterms;
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;
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);
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();
getIncotermsForPDF()
Return incoterms informations for pdf display.
trait CommonIncoterm
Superclass for incoterm classes.
display_incoterms()
Return incoterms informations TODO Use a cache for label get.
setIncoterms($id_incoterm, $location)
Define incoterms values of current object.
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
$conf db
API class for accounts.