40 public $label_incoterms;
46 public $location_incoterms;
61 $this->label_incoterms =
'';
62 if (!empty($this->fk_incoterms))
64 $sql =
'SELECT code FROM '.MAIN_DB_PREFIX.
'c_incoterms WHERE rowid = '.(int) $this->fk_incoterms;
65 $result = $this->
db->query($sql);
68 $res = $this->
db->fetch_object($result);
73 $out .= (($out && $this->location_incoterms) ?
' - ' :
'').$this->location_incoterms;
85 $sql =
'SELECT code FROM '.MAIN_DB_PREFIX.
'c_incoterms WHERE rowid = '.(int) $this->fk_incoterms;
92 $res = $this->
db->fetch_object(
$resql);
93 return 'Incoterm : '.$res->code.
' - '.$this->location_incoterms;
98 $this->errors[] = $this->
db->lasterror();
112 if ($this->
id && $this->table_element)
114 $sql =
"UPDATE ".MAIN_DB_PREFIX.$this->table_element;
115 $sql .=
" SET fk_incoterms = ".($id_incoterm > 0 ? $id_incoterm :
"null");
116 $sql .=
", location_incoterms = ".($id_incoterm > 0 ?
"'".$this->db->escape($location).
"'" :
"null");
117 $sql .=
" WHERE rowid = ".$this->id;
118 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_incotermsFROM '.MAIN_DB_PREFIX.
'c_incoterms WHERE rowid = '.(int) $this->fk_incoterms;
126 $res = $this->
db->query($sql);
129 $obj = $this->
db->fetch_object($res);
130 $this->label_incoterms = $obj->label_incoterms;
134 $this->errors[] = $this->
db->lasterror();
display_incoterms()
Return incoterms informations TODO Use a cache for label get.
getIncotermsForPDF()
Return incoterms informations for pdf display.
$conf db
API class for accounts.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename= '', $restricttologhandler= '', $logcontext=null)
Write log message into outputs.
trait CommonIncoterm
Superclass for incoterm classes.
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
setIncoterms($id_incoterm, $location)
Define incoterms values of current object.