26require_once DOL_DOCUMENT_ROOT.
'/product/stock/class/entrepot.class.php';
48 public $cache_warehouses = array();
52 public $cache_lot = array();
56 public $cache_workstations = array();
87 public function loadWarehouses($fk_product = 0, $batch =
'', $status =
'', $sumStock =
true, $exclude = array(), $stockMin =
false, $orderBy =
'e.ref')
91 if (empty($fk_product) && count($this->cache_warehouses)) {
95 $warehouseStatus = array();
97 if (preg_match(
'/warehouseclosed/', $status)) {
100 if (preg_match(
'/warehouseopen/', $status)) {
103 if (preg_match(
'/warehouseinternal/', $status)) {
107 $sql =
"SELECT e.rowid, e.ref as label, e.description, e.fk_parent";
108 if (!empty($fk_product) && $fk_product > 0) {
109 if (!empty($batch)) {
110 $sql .=
", pb.qty as stock";
112 $sql .=
", ps.reel as stock";
114 } elseif ($sumStock) {
115 $sql .=
", sum(ps.reel) as stock";
117 $sql .=
" FROM ".$this->db->prefix().
"entrepot as e";
118 $sql .=
" LEFT JOIN ".$this->db->prefix().
"product_stock as ps on ps.fk_entrepot = e.rowid";
119 if (!empty($fk_product) && $fk_product > 0) {
120 $sql .=
" AND ps.fk_product = ".((int) $fk_product);
121 if (!empty($batch)) {
122 $sql .=
" LEFT JOIN ".$this->db->prefix().
"product_batch as pb on pb.fk_product_stock = ps.rowid AND pb.batch = '".$this->db->escape($batch).
"'";
125 $sql .=
" WHERE e.entity IN (".getEntity(
'stock').
")";
126 if (count($warehouseStatus)) {
127 $sql .=
" AND e.statut IN (".$this->db->sanitize(implode(
',', $warehouseStatus)).
")";
129 $sql .=
" AND e.statut = 1";
132 if (is_array($exclude) && !empty($exclude)) {
133 $sql .=
' AND e.rowid NOT IN('.$this->db->sanitize(implode(
',', $exclude)).
')';
137 if ($stockMin !==
false) {
138 if (!empty($fk_product) && $fk_product > 0) {
139 if (!empty($batch)) {
140 $sql .=
" AND pb.qty > ".((float) $stockMin);
142 $sql .=
" AND ps.reel > ".((float) $stockMin);
147 if ($sumStock && empty($fk_product)) {
148 $sql .=
" GROUP BY e.rowid, e.ref, e.description, e.fk_parent";
151 if ($stockMin !==
false) {
152 $sql .=
" HAVING sum(ps.reel) > ".((float) $stockMin);
155 $sql .=
" ORDER BY ".$orderBy;
157 dol_syslog(get_class($this).
'::loadWarehouses', LOG_DEBUG);
158 $resql = $this->db->query($sql);
160 $num = $this->db->num_rows($resql);
163 $obj = $this->db->fetch_object($resql);
167 $this->cache_warehouses[$obj->rowid][
'id'] = $obj->rowid;
168 $this->cache_warehouses[$obj->rowid][
'label'] = $obj->label;
169 $this->cache_warehouses[$obj->rowid][
'parent_id'] = $obj->fk_parent;
170 $this->cache_warehouses[$obj->rowid][
'description'] = $obj->description;
171 $this->cache_warehouses[$obj->rowid][
'stock'] = $obj->stock;
176 foreach ($this->cache_warehouses as $obj_rowid => $tab) {
177 $this->cache_warehouses[$obj_rowid][
'full_label'] = $this->
get_parent_path($tab);
199 global
$conf, $langs;
201 if (empty($fk_product) && count($this->cache_workstations)) {
205 $sql =
"SELECT w.rowid, w.ref as ref, w.label as label, w.type, w.nb_operators_required,w.thm_operator_estimated,w.thm_machine_estimated";
206 $sql .=
" FROM ".$this->db->prefix().
"workstation_workstation as w";
207 $sql .=
" WHERE 1 = 1";
208 if (!empty($fk_product) && $fk_product > 0) {
209 $sql .=
" AND w.fk_product = ".((int) $fk_product);
211 $sql .=
" AND w.entity IN (".getEntity(
'workstation').
")";
213 if (is_array($exclude) && !empty($exclude)) {
214 $sql .=
' AND w.rowid NOT IN('.$this->db->sanitize(implode(
',', $exclude)).
')';
217 $sql .=
" ORDER BY ".$orderBy;
219 dol_syslog(get_class($this).
'::loadWorkstations', LOG_DEBUG);
220 $resql = $this->db->query($sql);
222 $num = $this->db->num_rows($resql);
225 $obj = $this->db->fetch_object($resql);
227 $this->cache_workstations[$obj->rowid][
'id'] = $obj->rowid;
228 $this->cache_workstations[$obj->rowid][
'ref'] = $obj->ref;
229 $this->cache_workstations[$obj->rowid][
'label'] = $obj->label;
230 $this->cache_workstations[$obj->rowid][
'type'] = $obj->type;
231 $this->cache_workstations[$obj->rowid][
'nb_operators_required'] = $obj->nb_operators_required;
232 $this->cache_workstations[$obj->rowid][
'thm_operator_estimated'] = $obj->thm_operator_estimated;
233 $this->cache_workstations[$obj->rowid][
'thm_machine_estimated'] = $obj->thm_machine_estimated;
258 if (empty($final_label)) {
259 $final_label = $tab[
'label'];
262 if (empty($tab[
'parent_id']) ||
getDolGlobalInt(
'MAIN_WAREHOUSE_LIST_DISPLAY_MODE') === 1) {
265 if (!empty($this->cache_warehouses[$tab[
'parent_id']])) {
266 if (
getDolGlobalInt(
'MAIN_WAREHOUSE_LIST_DISPLAY_MODE') !== 2 || (
getDolGlobalInt(
'MAIN_WAREHOUSE_LIST_DISPLAY_MODE') === 2 && empty($this->cache_warehouses[$tab[
'parent_id']][
'parent_id']))) {
267 $final_label = $this->cache_warehouses[$tab[
'parent_id']][
'label'] .
' >> ' . $final_label;
270 return $this->
get_parent_path($this->cache_warehouses[$tab[
'parent_id']], $final_label);
303 public function selectWarehouses($selected =
'', $htmlname =
'idwarehouse', $filterstatus =
'', $empty = 0, $disabled = 0, $fk_product = 0, $empty_label =
'', $showstock = 0, $forcecombo = 0, $events = array(), $morecss =
'minwidth200', $exclude = array(), $showfullpath = 1, $stockMin =
false, $orderBy =
'e.ref', $multiselect = 0)
305 global
$conf, $langs, $user, $hookmanager;
307 dol_syslog(get_class($this).
"::selectWarehouses " . (is_array($selected) ?
'selected is array' : $selected) .
", $htmlname, $filterstatus, $empty, $disabled, $fk_product, $empty_label, $showstock, $forcecombo, $morecss", LOG_DEBUG);
310 if ((!
getDolGlobalString(
'ENTREPOT_EXTRA_STATUS')) && ($filterstatus===
"warehouseinternal")) {
313 if (!empty($fk_product) && $fk_product > 0) {
314 $this->cache_warehouses = array();
317 $this->
loadWarehouses($fk_product,
'', $filterstatus,
true, $exclude, $stockMin, $orderBy);
318 $nbofwarehouses = count($this->cache_warehouses);
320 if (
$conf->use_javascript_ajax && !$forcecombo) {
321 include_once DOL_DOCUMENT_ROOT.
'/core/lib/ajax.lib.php';
323 $out .= $comboenhancement;
326 if (strpos($htmlname,
'search_') !== 0) {
327 if (empty($user->fk_warehouse) || $user->fk_warehouse == -1) {
328 if (is_scalar($selected) && ($selected ==
'-2' || $selected ==
'ifone') &&
getDolGlobalString(
'MAIN_DEFAULT_WAREHOUSE')) {
332 if (is_scalar($selected) && ($selected ==
'-2' || $selected ==
'ifone') &&
getDolGlobalString(
'MAIN_DEFAULT_WAREHOUSE_USER')) {
333 $selected = $user->fk_warehouse;
338 $out .=
'<select '.($multiselect ?
'multiple ' :
'').
'class="flat'.($morecss ?
' '.$morecss :
'').
'"'.($disabled ?
' disabled' :
'');
339 $out .=
' id="'.$htmlname.
'" name="'.($htmlname.($multiselect ?
'[]' :
'').($disabled ?
'_disabled' :
'')).
'"';
343 $out .=
'<option value="-1">'.($empty_label ? $empty_label :
' ').
'</option>';
345 foreach ($this->cache_warehouses as
$id => $arraytypes) {
348 $label .= $arraytypes[
'full_label'];
350 $label .= $arraytypes[
'label'];
352 if (($fk_product || ($showstock > 0)) && ($arraytypes[
'stock'] != 0 || ($showstock > 0))) {
353 if ($arraytypes[
'stock'] <= 0) {
354 $label .=
' <span class="text-warning">('.$langs->trans(
"Stock").
':'.$arraytypes[
'stock'].
')</span>';
356 $label .=
' <span class="opacitymedium">('.$langs->trans(
"Stock").
':'.$arraytypes[
'stock'].
')</span>';
360 $out .=
'<option value="'.$id.
'"';
361 if (is_array($selected)) {
362 if (in_array(
$id, $selected)) {
366 if ($selected ==
$id || (!empty($selected) && preg_match(
'/^ifone/', $selected) && $nbofwarehouses == 1)) {
370 $out .=
' data-html="'.dol_escape_htmltag($label).
'"';
377 $out .=
'<input type="hidden" name="'.$htmlname.
'" value="'.(($selected > 0) ? $selected :
'').
'">';
381 'selected' => $selected,
382 'htmlname' => $htmlname,
383 'filterstatus' => $filterstatus,
385 'disabled ' => $disabled,
386 'fk_product' => $fk_product,
387 'empty_label' => $empty_label,
388 'showstock' => $showstock,
389 'forcecombo' => $forcecombo,
391 'morecss' => $morecss,
392 'exclude' => $exclude,
393 'showfullpath' => $showfullpath,
394 'stockMin' => $stockMin,
395 'orderBy' => $orderBy
398 $reshook = $hookmanager->executeHooks(
'selectWarehouses', $parameters, $this);
400 $out = $hookmanager->resPrint;
401 } elseif ($reshook == 0) {
402 $out .= $hookmanager->resPrint;
427 public function selectWorkstations($selected =
'', $htmlname =
'idworkstations', $empty = 0, $disabled = 0, $fk_product = 0, $empty_label =
'', $forcecombo = 0, $events = array(), $morecss =
'minwidth200', $exclude = array(), $showfullpath = 1, $orderBy =
'e.ref')
429 global
$conf, $langs, $user, $hookmanager;
431 dol_syslog(get_class($this).
"::selectWorkstations $selected, $htmlname, $empty, $disabled, $fk_product, $empty_label, $forcecombo, $morecss", LOG_DEBUG);
435 if (!empty($fk_product) && $fk_product > 0) {
436 $this->cache_workstations = array();
440 $nbofworkstations = count($this->cache_workstations);
442 if (
$conf->use_javascript_ajax && !$forcecombo) {
443 include_once DOL_DOCUMENT_ROOT.
'/core/lib/ajax.lib.php';
445 $out .= $comboenhancement;
448 if (strpos($htmlname,
'search_') !== 0) {
449 if (empty($user->fk_workstation) || $user->fk_workstation == -1) {
450 if (($selected ==
'-2' || $selected ==
'ifone') &&
getDolGlobalString(
'MAIN_DEFAULT_WORKSTATION')) {
454 if (($selected ==
'-2' || $selected ==
'ifone') &&
getDolGlobalString(
'MAIN_DEFAULT_WORKSTATION')) {
455 $selected = $user->fk_workstation;
460 $out .=
'<select class="flat'.($morecss ?
' '.$morecss :
'').
'"'.($disabled ?
' disabled' :
'').
' id="'.$htmlname.
'" name="'.($htmlname.($disabled ?
'_disabled' :
'')).
'">';
462 $out .=
'<option value="-1">'.($empty_label ? $empty_label :
' ').
'</option>';
464 foreach ($this->cache_workstations as
$id => $arraytypes) {
465 $label = $arraytypes[
'label'];
467 $out .=
'<option value="'.$id.
'"';
468 if ($selected ==
$id || (preg_match(
'/^ifone/', $selected) && $nbofworkstations == 1)) {
471 $out .=
' data-html="'.dol_escape_htmltag($label).
'"';
478 $out .=
'<input type="hidden" name="'.$htmlname.
'" value="'.(($selected > 0) ? $selected :
'').
'">';
482 'selected' => $selected,
483 'htmlname' => $htmlname,
484 'filterstatus' => $filterstatus,
486 'disabled ' => $disabled,
487 'fk_product' => $fk_product,
488 'empty_label' => $empty_label,
489 'forcecombo' => $forcecombo,
491 'morecss' => $morecss,
492 'exclude' => $exclude,
493 'showfullpath' => $showfullpath,
494 'orderBy' => $orderBy
497 $reshook = $hookmanager->executeHooks(
'selectWorkstations', $parameters, $this);
499 $out = $hookmanager->resPrint;
500 } elseif ($reshook == 0) {
501 $out .= $hookmanager->resPrint;
519 if ($htmlname !=
"none") {
520 print
'<form method="POST" action="'.$page.
'">';
521 print
'<input type="hidden" name="action" value="setwarehouse">';
522 print
'<input type="hidden" name="token" value="'.newToken().
'">';
523 print
'<table class="nobordernopadding">';
527 print
'<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans(
"Modify").
'"></td>';
528 print
'</tr></table></form>';
531 require_once DOL_DOCUMENT_ROOT.
'/product/stock/class/entrepot.class.php';
532 $warehousestatic =
new Entrepot($this->db);
533 $warehousestatic->fetch($selected);
534 print $warehousestatic->getNomUrl();
554 public function select_measuring_units($name =
'measuring_units', $measuring_style =
'', $selected =
'0', $adddefault = 0, $mode = 0)
572 public function selectMeasuringUnits($name =
'measuring_units', $measuring_style =
'', $selected =
'0', $adddefault = 0, $mode = 0, $morecss =
'minwidth75 maxwidth125')
576 $langs->load(
"other");
579 $placeholderID = ($mode == 2 ?
'99999999' :
'-1');
582 require_once DOL_DOCUMENT_ROOT.
'/core/class/cunits.class.php';
583 $measuringUnits =
new CUnits($db);
586 $filter[
't.active'] = 1;
587 if ($measuring_style) {
588 $filter[
't.unit_type'] = $measuring_style;
591 $result = $measuringUnits->fetchAll(
602 $return .=
'<select class="flat'.($morecss ?
' '.$morecss :
'').
'" name="'.$name.
'" id="'.$name.
'">';
603 if ($adddefault || $adddefault ===
'') {
604 $return .=
'<option value="0"'.($selected ===
'0' ?
' selected' :
'').
'>'.($adddefault ?
'('.$langs->trans(
"Default").
')' :
'').
'</option>';
607 foreach ($measuringUnits->records as $lines) {
608 $return .=
'<option value="';
610 $return .= $lines->short_label;
611 } elseif ($mode == 2) {
612 $return .= $lines->scale;
614 $return .= $lines->id;
617 if ($mode == 1 && $lines->short_label == $selected) {
618 $return .=
' selected';
619 } elseif ($mode == 2 && $lines->scale == $selected) {
620 $return .=
' selected';
621 } elseif ($mode == 0 && $lines->id == $selected) {
622 $return .=
' selected';
625 if ($measuring_style ==
'time') {
626 $return .= $langs->trans(ucfirst($lines->label));
628 $return .= $langs->trans($lines->label);
630 $return .=
'</option>';
632 $return .=
'</select>';
635 $return .=
ajax_combobox($name, [], 0, 0,
'resolve', $placeholderID);
654 $langs->load(
'products');
659 require_once DOL_DOCUMENT_ROOT.
'/core/class/cproductnature.class.php';
663 $filter[
't.active'] = 1;
665 $result = $productNature->fetchAll(
'',
'', 0, 0, $filter);
671 $return .=
'<select class="flat" name="'.$name.
'" id="'.$name.
'">';
672 if ($showempty || ($selected ==
'' || $selected ==
'-1')) {
673 $return .=
'<option value="-1"';
674 if ($selected ==
'' || $selected ==
'-1') {
675 $return .=
' selected';
677 $return .=
'></option>';
679 if (!empty($productNature->records) && is_array($productNature->records)) {
680 foreach ($productNature->records as $lines) {
681 $return .=
'<option value="';
683 $return .= $lines->label;
685 $return .= $lines->code;
690 if ($mode == 1 && $lines->label == $selected) {
691 $return .=
' selected';
692 } elseif ($lines->code == $selected) {
693 $return .=
' selected';
697 $return .= $langs->trans($lines->label);
698 $return .=
'</option>';
701 $return .=
'</select>';
727 public function selectLotStock($selected =
'', $htmlname =
'batch_id', $filterstatus =
'', $empty = 0, $disabled = 0, $fk_product = 0, $fk_entrepot = 0, $objectLines = array(), $empty_label =
'', $forcecombo = 0, $events = array(), $morecss =
'minwidth200')
729 global
$conf, $langs;
731 dol_syslog(get_class($this).
"::selectLotStock $selected, $htmlname, $filterstatus, $empty, $disabled, $fk_product, $fk_entrepot, $empty_label, $forcecombo, $morecss", LOG_DEBUG);
734 $productIdArray = array();
735 if (!is_array($objectLines) || !count($objectLines)) {
736 if (!empty($fk_product) && $fk_product > 0) {
737 $productIdArray[] = (int) $fk_product;
740 foreach ($objectLines as $line) {
741 if ($line->fk_product) {
742 $productIdArray[] = $line->fk_product;
749 if (
$conf->use_javascript_ajax && !$forcecombo) {
750 include_once DOL_DOCUMENT_ROOT.
'/core/lib/ajax.lib.php';
752 $out .= $comboenhancement;
755 $out .=
'<select class="flat'.($morecss ?
' '.$morecss :
'').
'"'.($disabled ?
' disabled' :
'').
' id="'.$htmlname.
'" name="'.($htmlname.($disabled ?
'_disabled' :
'')).
'">';
757 $out .=
'<option value="-1">'.($empty_label ? $empty_label :
' ').
'</option>';
759 if (!empty($fk_product) && $fk_product > 0) {
760 $productIdArray = array((
int) $fk_product);
762 foreach ($this->cache_lot as $key => $value) {
763 $productIdArray[] = $key;
767 foreach ($productIdArray as $productId) {
768 foreach ($this->cache_lot[$productId] as
$id => $arraytypes) {
769 if (empty($fk_entrepot) || $fk_entrepot == $arraytypes[
'entrepot_id']) {
770 $label = $arraytypes[
'entrepot_label'].
' - ';
771 $label .= $arraytypes[
'batch'];
772 if ($arraytypes[
'qty'] <= 0) {
773 $label .=
' <span class=\'text-warning\'>('.$langs->trans(
"Stock").
' '.$arraytypes[
'qty'].
')</span>';
775 $label .=
' <span class=\'opacitymedium\'>('.$langs->trans(
"Stock").
' '.$arraytypes[
'qty'].
')</span>';
778 $out .=
'<option value="'.$id.
'"';
780 if ($selected ==
$id || ($selected ==
'ifone' && $nboflot == 1)) {
783 $out .=
' data-html="'.dol_escape_htmltag($label).
'"';
792 $out .=
'<input type="hidden" name="'.$htmlname.
'" value="'.(($selected > 0) ? $selected :
'').
'">';
810 public function selectLotDataList($htmlname =
'batch_id', $empty = 0, $fk_product = 0, $fk_entrepot = 0, $objectLines = array())
812 global
$conf, $langs, $hookmanager;
814 dol_syslog(get_class($this).
"::selectLotDataList $htmlname, $empty, $fk_product, $fk_entrepot", LOG_DEBUG);
817 $productIdArray = array();
818 if (!is_array($objectLines) || !count($objectLines)) {
819 if (!empty($fk_product) && $fk_product > 0) {
820 $productIdArray[] = (int) $fk_product;
823 foreach ($objectLines as $line) {
824 if ($line->fk_product) {
825 $productIdArray[] = $line->fk_product;
832 if (!empty($fk_product) && $fk_product > 0) {
833 $productIdArray = array((
int) $fk_product);
835 foreach ($this->cache_lot as $key => $value) {
836 $productIdArray[] = $key;
840 if (empty($hookmanager)) {
841 include_once DOL_DOCUMENT_ROOT .
'/core/class/hookmanager.class.php';
844 $hookmanager->initHooks(array(
'productdao'));
845 $parameters = array(
'productIdArray' => $productIdArray,
'htmlname' => $htmlname);
846 $reshook = $hookmanager->executeHooks(
'selectLotDataList', $parameters, $this);
848 return $hookmanager->error;
849 } elseif ($reshook > 0) {
850 return $hookmanager->resPrint;
852 $out .= $hookmanager->resPrint;
855 $out .=
'<datalist id="'.$htmlname.
'" >';
856 foreach ($productIdArray as $productId) {
857 if (array_key_exists($productId, $this->cache_lot)) {
858 foreach ($this->cache_lot[$productId] as
$id => $arraytypes) {
859 if (empty($fk_entrepot) || $fk_entrepot == $arraytypes[
'entrepot_id']) {
860 $label = $arraytypes[
'entrepot_label'] .
' - ';
861 $label .= $arraytypes[
'batch'];
863 $out .=
'<option data-warehouse="'.dol_escape_htmltag($label).
'" value="' . $arraytypes[
'batch'] .
'">' . (
$conf->browser->name ===
'chrome' ?
'' : $arraytypes[
'batch']) .
' (' . $langs->trans(
'Stock Total') .
': ' . $arraytypes[
'qty'] .
')</option>';
868 $out .=
'</datalist>';
883 global
$conf, $langs;
885 $cacheLoaded =
false;
886 if (empty($productIdArray)) {
888 $this->cache_lot = array();
891 if (count($productIdArray) && count($this->cache_lot)) {
893 foreach ($productIdArray as $productId) {
894 $cacheLoaded = !empty($this->cache_lot[$productId]);
898 return count($this->cache_lot);
901 $this->cache_lot = array();
902 $productIdList = implode(
',', $productIdArray);
906 if (empty($hookmanager)) {
907 include_once DOL_DOCUMENT_ROOT .
'/core/class/hookmanager.class.php';
910 $hookmanager->initHooks(array(
'productdao'));
911 $parameters = array(
'productIdList' => $productIdList);
912 $reshook = $hookmanager->executeHooks(
'loadLotStock', $parameters, $this);
914 $this->error = $hookmanager->error;
917 if (!empty($hookmanager->resArray[
'batch_list']) && is_array($hookmanager->resArray[
'batch_list'])) {
918 $this->cache_lot = $hookmanager->resArray[
'batch_list'];
919 $batch_count = (int) $hookmanager->resArray[
'batch_count'];
925 $sql =
"SELECT pb.batch, pb.rowid, ps.fk_entrepot, pb.qty, e.ref as label, ps.fk_product";
926 $sql .=
" FROM ".$this->db->prefix().
"product_batch as pb";
927 $sql .=
" LEFT JOIN ".$this->db->prefix().
"product_stock as ps on ps.rowid = pb.fk_product_stock";
928 $sql .=
" LEFT JOIN ".$this->db->prefix().
"entrepot as e on e.rowid = ps.fk_entrepot AND e.entity IN (".
getEntity(
'stock').
")";
929 if (!empty($productIdList)) {
930 $sql .=
" WHERE ps.fk_product IN (".$this->db->sanitize($productIdList).
")";
932 $sql .=
" ORDER BY e.ref, pb.batch";
934 dol_syslog(get_class($this).
'::loadLotStock', LOG_DEBUG);
935 $resql = $this->db->query($sql);
937 $num = $this->db->num_rows($resql);
940 $obj = $this->db->fetch_object($resql);
941 $this->cache_lot[$obj->fk_product][$obj->rowid][
'id'] = $obj->rowid;
942 $this->cache_lot[$obj->fk_product][$obj->rowid][
'batch'] = $obj->batch;
943 $this->cache_lot[$obj->fk_product][$obj->rowid][
'entrepot_id'] = $obj->fk_entrepot;
944 $this->cache_lot[$obj->fk_product][$obj->rowid][
'entrepot_label'] = $obj->label;
945 $this->cache_lot[$obj->fk_product][$obj->rowid][
'qty'] = $obj->qty;
949 return $batch_count + $num;
ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $forcefocus=0, $widthTypeOfAutocomplete='resolve', $idforemptyvalue='-1', $morecss='')
Convert a html select field into an ajax combobox.
Class of dictionary of nature of product (used by imports)
Class of dictionary type of thirdparty (used by imports)
Class to manage warehouses.
const STATUS_OPEN_INTERNAL
Warehouse open and only operations for stock transfers/corrections allowed (not for customer shipping...
const STATUS_OPEN_ALL
Warehouse open and any operations are allowed (customer shipping, supplier dispatch,...
const STATUS_CLOSED
Warehouse closed, inactive.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
getEntity($element, $shared=1, $currentobject=null)
Get list of entity id to use.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...