39 public $parent_element =
'';
44 public $fk_parent_attribute =
'';
63 public $picto =
'line';
75 public $date_debut_prevue;
79 public $date_debut_reel;
83 public $date_fin_prevue;
87 public $date_fin_reel;
106 public $length_units;
122 public $height_units;
130 public $surface_units;
138 public $volume_units;
147 public $product_type;
181 public $product_label;
186 public $product_barcode;
191 public $product_desc;
196 public $fk_product_type;
209 public $remise_percent;
222 public $special_code;
237 public $fk_multicurrency;
242 public $multicurrency_code;
247 public $multicurrency_subprice;
252 public $multicurrency_subprice_ttc;
257 public $multicurrency_total_ht;
262 public $multicurrency_total_tva;
267 public $multicurrency_total_ttc;
289 public function getLabelOfUnit($type =
'long', $outputlangs =
null, $noentities = 0)
293 if (empty($this->fk_unit)) {
296 if (empty($outputlangs)) {
297 $outputlangs = $langs;
300 $outputlangs->load(
'products');
303 $sql =
"SELECT code, label, short_label FROM ".$this->db->prefix().
"c_units where rowid = ".((int) $this->fk_unit);
305 $resql = $this->db->query($sql);
307 $this->error = $this->db->error();
308 dol_syslog(get_class($this).
"::getLabelOfUnit Error ".$this->error, LOG_ERR);
310 } elseif ($this->db->num_rows($resql) > 0 && $res = $this->db->fetch_array($resql)) {
311 if ($type ==
'short') {
313 $label = $outputlangs->transnoentitiesnoconv($res[
'short_label']);
315 $label = $outputlangs->trans($res[
'short_label']);
317 } elseif ($type ==
'code') {
318 $label = $res[
'code'];
320 if ($outputlangs->trans(
'unit'.$res[
'code']) ==
'unit'.$res[
'code']) {
322 $label = $res[
'label'];
326 $label = $outputlangs->transnoentitiesnoconv(
'unit'.$res[
'code']);
328 $label = $outputlangs->trans(
'unit'.$res[
'code']);
333 $this->db->free($resql);
350 public function fetchAll($sortorder =
'', $sortfield =
'', $limit = 0, $offset = 0, $filter =
'', $filtermode =
'AND')
363 public function getNomUrl($withpicto = 0)
365 $parentattribute = $this->fk_parent_attribute;
376 $parent_classname = $parent_element_properties[
'classname'];
377 $parent_element =
new $parent_classname($this->db);
379 $parentattribute = $this->fk_parent_attribute;
380 if ($parentattribute && method_exists($parent_element,
'fetch')) {
381 $parent_element->fetch($this->$parentattribute);
384 return $parent_element->getNomUrl($withpicto).
' - Line #'.$this->id;
Parent class of all other business classes (invoices, contracts, proposals, orders,...
Parent class for class inheritance lines of business objects This class is useless for the moment so ...
fetchAll($sortorder='', $sortfield='', $limit=0, $offset=0, $filter='', $filtermode='AND')
Empty function to prevent errors on call of this function.
getLabelOfUnit($type='long', $outputlangs=null, $noentities=0)
Reads the units dictionary to return the translation code of a unit (if type='code'),...
__construct($db)
Constructor.
getElementProperties($elementType)
Get an array with properties of an element.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.