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;
234 public $subprice_ttc;
244 public $fk_multicurrency;
249 public $multicurrency_code;
254 public $multicurrency_subprice;
259 public $multicurrency_subprice_ttc;
264 public $multicurrency_total_ht;
269 public $multicurrency_total_tva;
274 public $multicurrency_total_localtax1;
279 public $multicurrency_total_localtax2;
284 public $multicurrency_total_ttc;
306 public function getLabelOfUnit($type =
'long', $outputlangs =
null, $noentities = 0)
310 if (empty($this->fk_unit)) {
313 if (empty($outputlangs)) {
314 $outputlangs = $langs;
317 $outputlangs->load(
'products');
320 $sql =
"SELECT code, label, short_label FROM ".$this->db->prefix().
"c_units where rowid = ".((int) $this->fk_unit);
322 $resql = $this->db->query($sql);
324 $this->error = $this->db->error();
325 dol_syslog(get_class($this).
"::getLabelOfUnit Error ".$this->error, LOG_ERR);
327 } elseif ($this->db->num_rows($resql) > 0 && $res = $this->db->fetch_array($resql)) {
328 if ($type ==
'short') {
330 $label = $outputlangs->transnoentitiesnoconv($res[
'short_label']);
332 $label = $outputlangs->trans($res[
'short_label']);
334 } elseif ($type ==
'code') {
335 $label = $res[
'code'];
337 if ($outputlangs->trans(
'unit'.$res[
'code']) ==
'unit'.$res[
'code']) {
339 $label = $res[
'label'];
343 $label = $outputlangs->transnoentitiesnoconv(
'unit'.$res[
'code']);
345 $label = $outputlangs->trans(
'unit'.$res[
'code']);
350 $this->db->free($resql);
367 public function fetchAll($sortorder =
'', $sortfield =
'', $limit = 0, $offset = 0, $filter =
'', $filtermode =
'AND')
380 public function getNomUrl($withpicto = 0)
382 $parentattribute = $this->fk_parent_attribute;
393 $parent_classname = $parent_element_properties[
'classname'];
394 $parent_element =
new $parent_classname($this->db);
396 $parentattribute = $this->fk_parent_attribute;
397 if ($parentattribute && method_exists($parent_element,
'fetch')) {
398 $parent_element->fetch($this->$parentattribute);
401 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.