74 if (!$this->fk_unit) {
78 $langs->load(
'products');
80 $label_type =
'label';
82 $label_type =
'label';
83 if ($type ==
'short') $label_type =
'short_label';
84 elseif ($type ==
'code') $label_type =
'code';
86 $sql =
'select '.$label_type.
', code from '.MAIN_DB_PREFIX.
'c_units where rowid='.$this->fk_unit;
89 $res = $this->
db->fetch_array(
$resql);
90 if ($label_type ==
'code') $label =
'unit'.$res[
'code'];
91 else $label = $res[$label_type];
95 $this->error = $this->
db->error().
' sql='.$sql;
96 dol_syslog(get_class($this).
"::getLabelOfUnit Error ".$this->error, LOG_ERR);
__construct($db)
Constructor.
getLabelOfUnit($type= 'long')
Returns the label, shot_label or code found in units dictionary from ->fk_unit.
$conf db
API class for accounts.
Parent class for class inheritance lines of business objects This class is useless for the moment so ...
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename= '', $restricttologhandler= '', $logcontext=null)
Write log message into outputs.
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.
Parent class of all other business classes (invoices, contracts, proposals, orders, ...)