27require
'../../main.inc.php';
28require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
29require_once DOL_DOCUMENT_ROOT.
'/product/stock/class/entrepot.class.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/class/html.form.class.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
32require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.commande.class.php';
33require_once DOL_DOCUMENT_ROOT.
'/product/class/html.formproduct.class.php';
34require_once DOL_DOCUMENT_ROOT.
'/core/modules/import/import_csv.modules.php';
35require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
36require_once DOL_DOCUMENT_ROOT.
'/core/lib/import.lib.php';
38$confirm =
GETPOST(
'confirm',
'alpha');
39$filetoimport =
GETPOST(
'filetoimport');
42$langs->loadLangs(array(
'products',
'stocks',
'orders',
'productbatch'));
45$hookmanager->initHooks(array(
'massstockmove'));
49 $socid = $user->socid;
55$action =
GETPOST(
'action',
'aZ09');
56$id_product =
GETPOST(
'productid',
'int');
57$id_sw =
GETPOST(
'id_sw',
'int');
58$id_tw =
GETPOST(
'id_tw',
'int');
63$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
64$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
65$page = GETPOSTISSET(
'pageplusone') ? (
GETPOST(
'pageplusone') - 1) :
GETPOST(
"page",
'int');
66if (empty($page) || $page == -1) {
77$limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
78$offset = $limit * $page;
81 unset($_SESSION[
'massstockmove']);
84if (!empty($_SESSION[
'massstockmove'])) {
85 $listofdata = json_decode($_SESSION[
'massstockmove'],
true);
93if ($action ==
'addline' && !empty($user->rights->stock->mouvement->creer)) {
103 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"WarehouseTarget")),
null,
'errors');
105 if ($id_sw > 0 && $id_tw == $id_sw) {
107 $langs->load(
"errors");
108 setEventMessages($langs->trans(
"ErrorWarehouseMustDiffers"),
null,
'errors');
110 if (!($id_product > 0)) {
112 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Product")),
null,
'errors');
116 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Qty")),
null,
'errors');
121 $producttmp =
new Product($db);
122 $producttmp->fetch($id_product);
123 if ($producttmp->hasbatch()) {
126 $langs->load(
"errors");
127 setEventMessages($langs->trans(
"ErrorTryToMakeMoveOnProductRequiringBatchData", $producttmp->ref),
null,
'errors');
136 if ($producttmp->hasbatch()) {
143 if (count(array_keys($listofdata)) > 0) {
144 $id = max(array_keys($listofdata)) + 1;
148 $listofdata[$id] = array(
'id'=>$id,
'id_product'=>$id_product,
'qty'=>$qty,
'id_sw'=>$id_sw,
'id_tw'=>$id_tw,
'batch'=>$batch);
149 $_SESSION[
'massstockmove'] = json_encode($listofdata);
159if ($action ==
'delline' && $idline !=
'' && !empty($user->rights->stock->mouvement->creer)) {
160 if (!empty($listofdata[$idline])) {
161 unset($listofdata[$idline]);
163 if (count($listofdata) > 0) {
164 $_SESSION[
'massstockmove'] = json_encode($listofdata);
166 unset($_SESSION[
'massstockmove']);
170if ($action ==
'createmovements' && !empty($user->rights->stock->mouvement->creer)) {
175 setEventMessages($langs->trans(
"ErrorFieldRequired"), $langs->transnoentitiesnoconv(
"MovementLabel"),
null,
'errors');
183 foreach ($listofdata as $key => $val) {
185 $id_product = $val[
'id_product'];
186 $id_sw = $val[
'id_sw'];
187 $id_tw = $val[
'id_tw'];
189 $batch = $val[
'batch'];
193 if (!$error && $id_sw <> $id_tw && is_numeric($qty) && $id_product) {
194 $result = $product->fetch($id_product);
196 $product->load_stock(
'novirtual');
200 if (!empty($product->pmp)) {
201 $pricesrc = $product->pmp;
203 $pricedest = $pricesrc;
207 if (empty($conf->productbatch->enabled) || !$product->hasbatch()) {
210 $result1 = $product->correct_stock(
226 $result2 = $product->correct_stock(
240 $arraybatchinfo = $product->loadBatchInfo($batch);
241 if (count($arraybatchinfo) > 0) {
242 $firstrecord = array_shift($arraybatchinfo);
243 $dlc = $firstrecord[
'eatby'];
244 $dluo = $firstrecord[
'sellby'];
257 $result1 = $product->correct_stock_batch(
276 $result2 = $product->correct_stock_batch(
302 unset($_SESSION[
'massstockmove']);
306 header(
"Location: ".DOL_URL_ROOT.
'/product/stock/index.php');
314if ($action ==
'importCSV' && !empty($user->rights->stock->mouvement->creer)) {
318 $fullpath = $conf->stock->dir_temp.
"/".$user->id.
'-csvfiletotimport.csv';
320 dol_syslog(
"File ".$fullpath.
" was added for import");
323 $langs->load(
"errors");
328 $importcsv =
new ImportCsv($db,
'massstocklist');
331 $nblinesrecord = $importcsv->import_get_nb_of_lines($fullpath)-1;
332 $importcsv->import_open_file($fullpath);
333 $labelsrecord = $importcsv->import_read_record();
335 if ($nblinesrecord < 1) {
336 setEventMessages($langs->trans(
"BadNumberOfLinesMustHaveAtLeastOneLinePlusTitle"),
null,
'errors');
340 $productstatic =
new Product($db);
341 $warehousestatics =
new Entrepot($db);
342 $warehousestatict =
new Entrepot($db);
345 while (($i < $nblinesrecord) && !$error) {
346 $newrecord = $importcsv->import_read_record();
348 $data[$i] = $newrecord;
349 if (count($data[$i]) == 1) {
356 $tmp_id_sw = $data[$i][0][
'val'];
357 $tmp_id_tw = $data[$i][1][
'val'];
358 $tmp_id_product = $data[$i][2][
'val'];
359 $tmp_qty = $data[$i][3][
'val'];
360 $tmp_batch = $data[$i][4][
'val'];
362 $errorforproduct = 0;
364 if (!is_numeric($tmp_id_product) && $tmp_id_product !=
'' && preg_match(
'/^id:/i', $tmp_id_product)) {
367 $tmp_id_product = preg_replace(
'/^(id|ref):/i',
'', $tmp_id_product);
369 if ($isidorref ===
'ref') {
370 $tmp_id_product = preg_replace(
'/^ref:/',
'', $tmp_id_product);
371 $result =
fetchref($productstatic, $tmp_id_product);
372 if ($result === -2) {
374 $errorforproduct = 1;
375 $langs->load(
"errors");
376 setEventMessages($langs->trans(
"ErrorMultipleRecordFoundFromRef", $tmp_id_product),
null,
'errors');
377 } elseif ($result <= 0) {
379 $errorforproduct = 1;
380 $langs->load(
"errors");
381 setEventMessages($langs->trans(
"ErrorRefNotFound", $tmp_id_product),
null,
'errors');
383 $tmp_id_product = $result;
385 $data[$i][2][
'val'] = $tmp_id_product;
386 if (!$errorforproduct && !($tmp_id_product > 0)) {
388 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Product")),
null,
'errors');
391 if ($tmp_id_sw !==
'') {
393 $errorforwarehouses = 0;
395 if (!is_numeric($tmp_id_sw) && $tmp_id_sw !=
'' && preg_match(
'/^id:/i', $tmp_id_sw)) {
398 $tmp_id_sw = preg_replace(
'/^(id|ref):/i',
'', $tmp_id_sw);
399 if ($isidorref ===
'ref') {
400 $tmp_id_sw = preg_replace(
'/^ref:/',
'', $tmp_id_sw);
401 $result =
fetchref($warehousestatics, $tmp_id_sw);
402 if ($result === -2) {
404 $errorforwarehouses = 1;
405 $langs->load(
"errors");
406 setEventMessages($langs->trans(
"ErrorMultipleRecordFoundFromRef", $tmp_id_sw),
null,
'errors');
407 } elseif ($result <= 0) {
409 $errorforwarehouses = 1;
410 $langs->load(
"errors");
411 setEventMessages($langs->trans(
"ErrorRefNotFound", $tmp_id_sw),
null,
'errors');
413 $tmp_id_sw = $result;
415 $data[$i][0][
'val'] = $tmp_id_sw;
416 if (!$errorforwarehouses && !($tmp_id_sw > 0)) {
418 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"WarehouseSource")),
null,
'errors');
422 $errorforwarehouset = 0;
424 if (!is_numeric($tmp_id_tw) && $tmp_id_tw !=
'' && preg_match(
'/^id:/i', $tmp_id_tw)) {
427 $tmp_id_tw = preg_replace(
'/^(id|ref):/i',
'', $tmp_id_tw);
428 if ($isidorref ===
'ref') {
429 $tmp_id_tw = preg_replace(
'/^ref:/',
'', $tmp_id_tw);
430 $result =
fetchref($warehousestatict, $tmp_id_tw);
431 if ($result === -2) {
433 $errorforwarehouset = 1;
434 $langs->load(
"errors");
435 setEventMessages($langs->trans(
"ErrorMultipleRecordFoundFromRef", $tmp_id_tw),
null,
'errors');
436 } elseif ($result <= 0) {
438 $errorforwarehouset = 1;
439 $langs->load(
"errors");
440 setEventMessages($langs->trans(
"ErrorRefNotFound", $tmp_id_tw),
null,
'errors');
442 $tmp_id_tw = $result;
444 $data[$i][1][
'val'] = $tmp_id_tw;
445 if (!$errorforwarehouset && !($tmp_id_tw > 0)) {
447 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"WarehouseTarget")),
null,
'errors');
451 if ($tmp_id_sw > 0 && $tmp_id_tw == $tmp_id_sw) {
453 $langs->load(
"errors");
454 setEventMessages($langs->trans(
"ErrorWarehouseMustDiffers"),
null,
'errors');
458 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Qty")),
null,
'errors');
463 $producttmp =
new Product($db);
464 $producttmp->fetch($tmp_id_product);
465 if ($producttmp->hasbatch()) {
466 if (empty($tmp_batch)) {
468 $langs->load(
"errors");
469 setEventMessages($langs->trans(
"ErrorTryToMakeMoveOnProductRequiringBatchData", $producttmp->ref),
null,
'errors');
478 foreach ($data as $key => $value) {
479 if (count(array_keys($listofdata)) > 0) {
480 $id = max(array_keys($listofdata)) + 1;
484 $tmp_id_sw = $data[$key][0][
'val'];
485 $tmp_id_tw = $data[$key][1][
'val'];
486 $tmp_id_product = $data[$key][2][
'val'];
487 $tmp_qty = $data[$key][3][
'val'];
488 $tmp_batch = $data[$key][4][
'val'];
489 $listofdata[$key] = array(
'id'=>$key,
'id_sw'=>$tmp_id_sw,
'id_tw'=>$tmp_id_tw,
'id_product'=>$tmp_id_product,
'qty'=>$tmp_qty,
'batch'=>$tmp_batch);
495 $listofdata = array();
498 $_SESSION[
'massstockmove'] = json_encode($listofdata);
501if ($action ==
'confirm_deletefile' && $confirm ==
'yes') {
502 $langs->load(
"other");
504 $param =
'&datatoimport='.urlencode($datatoimport).
'&format='.urlencode($format);
505 if ($excludefirstline) {
506 $param .=
'&excludefirstline='.urlencode($excludefirstline);
509 $param .=
'&endatlinenb='.urlencode($endatlinenb);
512 $file = $conf->stock->dir_temp.
'/'.
GETPOST(
'urlfile');
519 Header(
'Location: '.$_SERVER[
"PHP_SELF"]);
531$form =
new Form($db);
533$productstatic =
new Product($db);
534$warehousestatics =
new Entrepot($db);
535$warehousestatict =
new Entrepot($db);
537$help_url =
'EN:Module_Stocks_En|FR:Module_Stock|ES:Módulo_Stocks|DE:Modul_Bestände';
539$title = $langs->trans(
'MassMovement');
543print
load_fiche_titre($langs->trans(
"MassStockTransferShort"),
'',
'stock');
545$titletoadd = $langs->trans(
"Select");
546$buttonrecord = $langs->trans(
"RecordMovements");
547$titletoaddnoent = $langs->transnoentitiesnoconv(
"Select");
548$buttonrecordnoent = $langs->transnoentitiesnoconv(
"RecordMovements");
549print
'<span class="opacitymedium">'.$langs->trans(
"SelectProductInAndOutWareHouse", $titletoaddnoent, $buttonrecordnoent).
'</span>';
555print
'<form name="userfile" action="'.$_SERVER[
"PHP_SELF"].
'" enctype="multipart/form-data" METHOD="POST">';
556print
'<input type="hidden" name="token" value="'.newToken().
'">';
557print
'<input type="hidden" name="action" value="importCSV">';
558if (!empty($conf->dol_optimize_smallscreen)) {
561print
'<span class="opacitymedium">';
562print $langs->trans(
"or");
564$importcsv =
new ImportCsv($db,
'massstocklist');
565print $form->textwithpicto($langs->trans(
'SelectAStockMovementFileToImport'), $langs->transnoentitiesnoconv(
"InfoTemplateImport", $importcsv->separator));
569$maxmin = $maxfilesizearray[
'maxmin'];
571 print
'<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).
'">';
573print
'<input type="file" name="userfile" size="20" maxlength="80"> ';
574$out = (empty($conf->global->MAIN_UPLOAD_DOC) ?
' disabled' :
'');
575print
'<input type="submit" class="button small smallpaddingimp" value="'.$langs->trans(
"ImportFromCSV").
'"'.$out.
' name="sendit">';
577if (!empty($conf->global->MAIN_UPLOAD_DOC)) {
578 $max = $conf->global->MAIN_UPLOAD_DOC;
579 $maxphp = @ini_get(
'upload_max_filesize');
580 if (preg_match(
'/k$/i', $maxphp)) {
581 $maxphp = preg_replace(
'/k$/i',
'', $maxphp);
582 $maxphp = $maxphp * 1;
584 if (preg_match(
'/m$/i', $maxphp)) {
585 $maxphp = preg_replace(
'/m$/i',
'', $maxphp);
586 $maxphp = $maxphp * 1024;
588 if (preg_match(
'/g$/i', $maxphp)) {
589 $maxphp = preg_replace(
'/g$/i',
'', $maxphp);
590 $maxphp = $maxphp * 1024 * 1024;
592 if (preg_match(
'/t$/i', $maxphp)) {
593 $maxphp = preg_replace(
'/t$/i',
'', $maxphp);
594 $maxphp = $maxphp * 1024 * 1024 * 1024;
596 $maxphp2 = @ini_get(
'post_max_size');
597 if (preg_match(
'/k$/i', $maxphp2)) {
598 $maxphp2 = preg_replace(
'/k$/i',
'', $maxphp2);
599 $maxphp2 = $maxphp2 * 1;
601 if (preg_match(
'/m$/i', $maxphp2)) {
602 $maxphp2 = preg_replace(
'/m$/i',
'', $maxphp2);
603 $maxphp2 = $maxphp2 * 1024;
605 if (preg_match(
'/g$/i', $maxphp2)) {
606 $maxphp2 = preg_replace(
'/g$/i',
'', $maxphp2);
607 $maxphp2 = $maxphp2 * 1024 * 1024;
609 if (preg_match(
'/t$/i', $maxphp2)) {
610 $maxphp2 = preg_replace(
'/t$/i',
'', $maxphp2);
611 $maxphp2 = $maxphp2 * 1024 * 1024 * 1024;
615 $maxphptoshow = $maxphptoshowparam =
'';
617 $maxmin = min($max, $maxphp);
618 $maxphptoshow = $maxphp;
619 $maxphptoshowparam =
'upload_max_filesize';
622 $maxmin = min($max, $maxphp2);
623 if ($maxphp2 < $maxphp) {
624 $maxphptoshow = $maxphp2;
625 $maxphptoshowparam =
'post_max_size';
629 $langs->load(
'other');
631 $out .=
info_admin($langs->trans(
"ThisLimitIsDefinedInSetup", $max, $maxphptoshow), 1);
633 $out .=
' ('.$langs->trans(
"UploadDisabled").
')';
642print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST" name="formulaire">';
643print
'<input type="hidden" name="token" value="'.newToken().
'">';
644print
'<input type="hidden" name="action" value="addline">';
647print
'<div class="div-table-responsive-no-min">';
648print
'<table class="liste centpercent">';
652print
'<tr class="liste_titre">';
653print
getTitleFieldOfList($langs->trans(
'WarehouseSource'), 0, $_SERVER[
"PHP_SELF"],
'', $param,
'',
'', $sortfield, $sortorder,
'tagtd maxwidthonsmartphone ');
654print
getTitleFieldOfList($langs->trans(
'WarehouseTarget'), 0, $_SERVER[
"PHP_SELF"],
'', $param,
'',
'', $sortfield, $sortorder,
'tagtd maxwidthonsmartphone ');
655print
getTitleFieldOfList($langs->trans(
'Product'), 0, $_SERVER[
"PHP_SELF"],
'', $param,
'',
'', $sortfield, $sortorder,
'tagtd maxwidthonsmartphone ');
656if (isModEnabled(
'productbatch')) {
657 print
getTitleFieldOfList($langs->trans(
'Batch'), 0, $_SERVER[
"PHP_SELF"],
'', $param,
'',
'', $sortfield, $sortorder,
'tagtd maxwidthonsmartphone ');
659print
getTitleFieldOfList($langs->trans(
'Qty'), 0, $_SERVER[
"PHP_SELF"],
'', $param,
'',
'', $sortfield, $sortorder,
'right tagtd maxwidthonsmartphone ');
663print
'<tr class="oddeven">';
665print
'<td class="nowraponall">';
666print
img_picto($langs->trans(
"WarehouseSource"),
'stock',
'class="paddingright"').$formproduct->selectWarehouses($id_sw,
'id_sw',
'warehouseopen,warehouseinternal', 1, 0, 0,
'', 0, 0, array(),
'minwidth200imp maxwidth200');
669print
'<td class="nowraponall">';
670print
img_picto($langs->trans(
"WarehouseTarget"),
'stock',
'class="paddingright"').$formproduct->selectWarehouses($id_tw,
'id_tw',
'warehouseopen,warehouseinternal', 1, 0, 0,
'', 0, 0, array(),
'minwidth200imp maxwidth200');
673print
'<td class="nowraponall">';
675if (!empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
678if ($conf->global->PRODUIT_LIMIT_SIZE <= 0) {
681 $limit = $conf->global->PRODUIT_LIMIT_SIZE;
684print
img_picto($langs->trans(
"Product"),
'product',
'class="paddingright"');
685print $form->select_produits($id_product,
'productid', $filtertype, $limit, 0, -1, 2,
'', 1, array(), 0,
'1', 0,
'minwidth200imp maxwidth300', 1,
'',
null, 1);
688if (isModEnabled(
'productbatch')) {
689 print
'<td class="nowraponall">';
690 print
img_picto($langs->trans(
"LotSerial"),
'lot',
'class="paddingright"');
691 print
'<input type="text" name="batch" class="flat maxwidth75" value="'.dol_escape_htmltag($batch).
'">';
695print
'<td class="right"><input type="text" class="flat maxwidth50 right" name="qty" value="'.price2num((
float) $qty,
'MS').
'"></td>';
697print
'<td class="right"><input type="submit" class="button" name="addline" value="'.dol_escape_htmltag($titletoadd).
'"></td>';
701foreach ($listofdata as $key => $val) {
702 $productstatic->id = 0;
703 $productstatic->fetch($val[
'id_product']);
705 $warehousestatics->id = 0;
706 if ($val[
'id_sw'] > 0) {
707 $warehousestatics->fetch($val[
'id_sw']);
709 $warehousestatict->id = 0;
710 if ($val[
'id_tw'] > 0) {
711 $warehousestatict->fetch($val[
'id_tw']);
714 if ($productstatic->id <= 0) {
716 setEventMessages($langs->trans(
"ObjectNotFound", $langs->transnoentitiesnoconv(
"Product").
' (id='.$val[
'id_product'].
')'),
null,
'errors');
718 if ($warehousestatics->id < 0) {
720 setEventMessages($langs->trans(
"ObjectNotFound", $langs->transnoentitiesnoconv(
"WarehouseSource").
' (id='.$val[
'id_sw'].
')'),
null,
'errors');
722 if ($warehousestatict->id <= 0) {
724 setEventMessages($langs->trans(
"ObjectNotFound", $langs->transnoentitiesnoconv(
"WarehouseTarget").
' (id='.$val[
'id_tw'].
')'),
null,
'errors');
728 print
'<tr class="oddeven">';
730 if ($warehousestatics->id > 0) {
731 print $warehousestatics->getNomUrl(1);
733 print
'<span class="opacitymedium">';
734 print $langs->trans(
"None");
739 print $warehousestatict->getNomUrl(1);
744 if (isModEnabled(
'productbatch')) {
749 print
'<td class="right">'.price2num((
float) $val[
'qty'],
'MS').
'</td>';
750 print
'<td class="right"><a href="'.$_SERVER[
"PHP_SELF"].
'?action=delline&token='.newToken().
'&idline='.$val[
'id'].
'">'.
img_delete($langs->trans(
"Remove")).
'</a></td>';
763if (count($listofdata)) {
764 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST" name="formulaire2" class="formconsumeproduce">';
765 print
'<input type="hidden" name="token" value="'.newToken().
'">';
766 print
'<input type="hidden" name="action" value="createmovements">';
770 $labelmovement =
GETPOST(
"label") ?
GETPOST(
'label') : $langs->trans(
"MassStockTransferShort").
' '.
dol_print_date($now,
'%Y-%m-%d %H:%M');
772 print
'<div class="center">';
773 print
'<span class="fieldrequired">'.$langs->trans(
"InventoryCode").
':</span> ';
774 print
'<input type="text" name="codemove" class="maxwidth300" value="'.dol_escape_htmltag($codemove).
'"> ';
775 print
'<span class="clearbothonsmartphone"></span>';
776 print $langs->trans(
"MovementLabel").
': ';
777 print
'<input type="text" name="label" class="minwidth300" value="'.dol_escape_htmltag($labelmovement).
'"><br>';
780 print
'<div class="center"><input type="submit" class="button" name="valid" value="'.dol_escape_htmltag($buttonrecord).
'"></div>';
788if ($action ==
'delete') {
789 print $form->formconfirm($_SERVER[
"PHP_SELF"].
'?urlfile='.urlencode(
GETPOST(
'urlfile')).
'&step=3'.$param, $langs->trans(
'DeleteFile'), $langs->trans(
'ConfirmDeleteFile'),
'confirm_deletefile',
'', 0, 1);
806 $length = strlen($needle);
807 return substr($haystack, 0, $length) === $needle;
820 $tmp_ref = str_replace(
'ref:',
'', $tmp_ref);
822 $static_object->id = 0;
823 $static_object->fetch(
'', $tmp_ref);
824 return $static_object->id;
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage warehouses.
Class to import CSV files.
Class to manage products or services.
dol_delete_file($file, $disableglob=0, $nophperrors=0, $nohook=0, $object=null, $allowdotdot=false, $indexdatabase=1, $nolog=0)
Remove a file or several files with a mask.
dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disablevirusscan=0, $uploaderrorcode=0, $nohook=0, $varfiles='addedfile', $upload_dir='')
Make control on an uploaded file from an GUI page and move it to final destination.
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_delete($titlealt='default', $other='class="pictodelete"', $morecss='')
Show delete logo.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_now($mode='auto')
Return date for now.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip='', $forcenowrapcolumntitle=0)
Get title line of an array.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='')
Show information for admin users or standard users.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
dol_mkdir($dir, $dataroot='', $newmask='')
Creation of a directory (this can create recursive subdir)
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
startsWith($haystack, $needle)
Verify if $haystack startswith $needle.
fetchref($static_object, $tmp_ref)
Fetch object with ref.
getMaxFileSizeArray()
Return the max allowed for file upload.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.