28 require_once DOL_DOCUMENT_ROOT.
'/core/modules/import/modules_import.php';
51 public $errors = array();
69 public $version =
'dolibarr';
81 public $cacheconvert = array();
83 public $cachefieldtable = array();
101 $this->separator = (
GETPOST(
'separator') ?
GETPOST(
'separator') : (empty($conf->global->IMPORT_CSV_SEPARATOR_TO_USE) ?
',' : $conf->global->IMPORT_CSV_SEPARATOR_TO_USE));
102 $this->enclosure =
'"';
106 $this->label =
'Csv';
107 $this->desc = $langs->trans(
"CSVFormatDesc", $this->separator, $this->enclosure, $this->escape);
108 $this->extension =
'csv';
109 $this->picto =
'mime/other';
110 $this->version =
'1.34';
113 $this->label_lib =
'Dolibarr';
114 $this->version_lib = DOL_VERSION;
116 $this->datatoimport = $datatoimport;
117 if (preg_match(
'/^societe_/', $datatoimport)) $this->thirpartyobject =
new Societe($this->
db);
145 $s = join($this->separator, array_map(
'cleansep', $headerlinefields));
160 $s = join($this->separator, array_map(
'cleansep', $contentlinevalues));
191 dol_syslog(get_class($this).
"::open_file file=".$file);
193 ini_set(
'auto_detect_line_endings', 1);
198 $langs->load(
"errors");
199 $this->error = $langs->trans(
"ErrorFailToOpenFile", $file);
247 $arrayres = fgetcsv($this->handle, 100000, $this->separator, $this->enclosure, $this->escape);
250 if ($arrayres ===
false)
return false;
254 $newarrayres = array();
255 if ($arrayres && is_array($arrayres))
257 foreach ($arrayres as $key => $val)
259 if (!empty($conf->global->IMPORT_CSV_FORCE_CHARSET))
261 if (strtolower($conf->global->IMPORT_CSV_FORCE_CHARSET) ==
'utf8')
263 $newarrayres[$key][
'val'] = $val;
264 $newarrayres[$key][
'type'] = (
dol_strlen($val) ? 1 : -1);
266 $newarrayres[$key][
'val'] = utf8_encode($val);
267 $newarrayres[$key][
'type'] = (
dol_strlen($val) ? 1 : -1);
273 $newarrayres[$key][
'val'] = $val;
274 $newarrayres[$key][
'type'] = (
dol_strlen($val) ? 1 : -1);
276 $newarrayres[$key][
'val'] = utf8_encode($val);
277 $newarrayres[$key][
'type'] = (
dol_strlen($val) ? 1 : -1);
282 $this->col = count($newarrayres);
297 fclose($this->handle);
314 public function import_insert($arrayrecord, $array_match_file_to_database, $objimport, $maxfields, $importid, $updatekeys)
317 global $langs, $conf, $user;
318 global $thirdparty_static;
319 global $tablewithentity_cache;
323 $this->errors = array();
324 $this->warnings = array();
330 $array_match_database_to_file = array_flip($array_match_file_to_database);
331 $sort_array_match_file_to_database = $array_match_file_to_database;
332 ksort($sort_array_match_file_to_database);
336 if (count($arrayrecord) == 0 || (count($arrayrecord) == 1 && empty($arrayrecord[0][
'val'])))
339 $this->warnings[$warning][
'lib'] = $langs->trans(
'EmptyLine');
340 $this->warnings[$warning][
'type'] =
'EMPTY';
343 $last_insert_id_array = array();
347 foreach ($objimport->array_import_tables[0] as $alias => $tablename)
351 $listfields = array();
352 $listvalues = array();
354 $errorforthistable = 0;
357 if (!isset($tablewithentity_cache[$tablename]))
359 dol_syslog(
"Check if table ".$tablename.
" has an entity field");
360 $resql = $this->
db->DDLDescTable($tablename,
'entity');
363 $obj = $this->
db->fetch_object(
$resql);
364 if ($obj) $tablewithentity_cache[$tablename] = 1;
365 else $tablewithentity_cache[$tablename] = 0;
372 $arrayfield = array();
373 foreach ($sort_array_match_file_to_database as $key => $val) {
374 $arrayfield[$val] = ($key - 1);
378 foreach ($sort_array_match_file_to_database as $key => $val)
380 $fieldalias = preg_replace(
'/\..*$/i',
'', $val);
381 $fieldname = preg_replace(
'/^.*\./i',
'', $val);
383 if ($alias != $fieldalias)
continue;
385 if ($key <= $maxfields)
389 if ($arrayrecord[($key - 1)][
'type'] > 0) $newval = $arrayrecord[($key - 1)][
'val'];
394 if (preg_match(
'/\*/', $objimport->array_import_fields[0][$val]) && ((string) $newval ==
''))
396 $this->errors[$error][
'lib'] = $langs->trans(
'ErrorMissingMandatoryValue', $key);
397 $this->errors[$error][
'type'] =
'NOTNULL';
398 $errorforthistable++;
404 if (!empty($objimport->array_import_convertvalue[0][$val]))
407 if ($objimport->array_import_convertvalue[0][$val][
'rule'] ==
'fetchidfromcodeid'
408 || $objimport->array_import_convertvalue[0][$val][
'rule'] ==
'fetchidfromref'
409 || $objimport->array_import_convertvalue[0][$val][
'rule'] ==
'fetchidfromcodeorlabel'
414 if (!is_numeric($newval) && $newval !=
'' && !preg_match(
'/^id:/i', $newval)) $isidorref =
'ref';
416 $newval = preg_replace(
'/^(id|ref):/i',
'', $newval);
419 if ($isidorref ==
'ref') {
420 $file = (empty($objimport->array_import_convertvalue[0][$val][
'classfile']) ? $objimport->array_import_convertvalue[0][$val][
'file'] : $objimport->array_import_convertvalue[0][$val][
'classfile']);
421 $class = $objimport->array_import_convertvalue[0][$val][
'class'];
422 $method = $objimport->array_import_convertvalue[0][$val][
'method'];
423 if ($this->cacheconvert[$file.
'_'.$class.
'_'.$method.
'_'][$newval] !=
'')
425 $newval = $this->cacheconvert[$file.
'_'.$class.
'_'.$method.
'_'][$newval];
428 if (empty($resultload))
430 dol_print_error(
'',
'Error trying to call file='.$file.
', class='.$class.
', method='.$method);
433 $classinstance =
new $class($this->
db);
435 $param_array = array(
'', $newval);
436 if ($class ==
'AccountingAccount') {
449 $param_array = array(
'', $newval, 0, $arrayrecord[0][
'val']);
452 call_user_func_array(array($classinstance, $method), $param_array);
454 if (!($classinstance->id !=
'') && $objimport->array_import_convertvalue[0][$val][
'rule'] ==
'fetchidfromcodeorlabel')
456 $param_array = array(
'',
'', $newval);
457 call_user_func_array(array($classinstance, $method), $param_array);
459 $this->cacheconvert[$file.
'_'.$class.
'_'.$method.
'_'][$newval] = $classinstance->id;
461 if ($classinstance->id !=
'')
463 $newval = $classinstance->id;
465 if (!empty($objimport->array_import_convertvalue[0][$val][
'dict'])) $this->errors[$error][
'lib'] = $langs->trans(
'ErrorFieldValueNotIn', $key, $newval,
'code', $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val][
'dict']));
466 elseif (!empty($objimport->array_import_convertvalue[0][$val][
'element'])) $this->errors[$error][
'lib'] = $langs->trans(
'ErrorFieldRefNotIn', $key, $newval, $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val][
'element']));
467 else $this->errors[$error][
'lib'] =
'ErrorBadDefinitionOfImportProfile';
468 $this->errors[$error][
'type'] =
'FOREIGNKEY';
469 $errorforthistable++;
474 } elseif ($objimport->array_import_convertvalue[0][$val][
'rule'] ==
'fetchidfromcodeandlabel') {
476 if (!is_numeric($newval) && $newval !=
'' && !preg_match(
'/^id:/i', $newval)) $isidorref =
'ref';
477 $newval = preg_replace(
'/^(id|ref):/i',
'', $newval);
479 if ($isidorref ==
'ref') {
480 $file = (empty($objimport->array_import_convertvalue[0][$val][
'classfile']) ? $objimport->array_import_convertvalue[0][$val][
'file'] : $objimport->array_import_convertvalue[0][$val][
'classfile']);
481 $class = $objimport->array_import_convertvalue[0][$val][
'class'];
482 $method = $objimport->array_import_convertvalue[0][$val][
'method'];
483 $codefromfield = $objimport->array_import_convertvalue[0][$val][
'codefromfield'];
484 $code = $arrayrecord[$arrayfield[$codefromfield]][
'val'];
485 if ($this->cacheconvert[$file.
'_'.$class.
'_'.$method.
'_'.$code][$newval] !=
'') {
486 $newval = $this->cacheconvert[$file.
'_'.$class.
'_'.$method.
'_'.$code][$newval];
489 if (empty($resultload)) {
490 dol_print_error(
'',
'Error trying to call file='.$file.
', class='.$class.
', method='.$method.
', code='.$code);
493 $classinstance =
new $class($this->
db);
495 $param_array = array(
'', $newval, $code);
496 call_user_func_array(array($classinstance, $method), $param_array);
497 $this->cacheconvert[$file.
'_'.$class.
'_'.$method.
'_'.$code][$newval] = $classinstance->id;
498 if ($classinstance->id > 0)
500 $newval = $classinstance->id;
502 if (!empty($objimport->array_import_convertvalue[0][$val][
'dict'])) $this->errors[$error][
'lib'] = $langs->trans(
'ErrorFieldValueNotIn', $key, $newval,
'scale', $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val][
'dict']));
503 else $this->errors[$error][
'lib'] =
'ErrorFieldValueNotIn';
504 $this->errors[$error][
'type'] =
'FOREIGNKEY';
505 $errorforthistable++;
510 } elseif ($objimport->array_import_convertvalue[0][$val][
'rule'] ==
'zeroifnull') {
511 if (empty($newval)) $newval =
'0';
512 } elseif ($objimport->array_import_convertvalue[0][$val][
'rule'] ==
'fetchidfromcodeunits' || $objimport->array_import_convertvalue[0][$val][
'rule'] ==
'fetchscalefromcodeunits') {
513 $file = (empty($objimport->array_import_convertvalue[0][$val][
'classfile']) ? $objimport->array_import_convertvalue[0][$val][
'file'] : $objimport->array_import_convertvalue[0][$val][
'classfile']);
514 $class = $objimport->array_import_convertvalue[0][$val][
'class'];
515 $method = $objimport->array_import_convertvalue[0][$val][
'method'];
516 $units = $objimport->array_import_convertvalue[0][$val][
'units'];
517 if ($this->cacheconvert[$file.
'_'.$class.
'_'.$method.
'_'.$units][$newval] !=
'')
519 $newval = $this->cacheconvert[$file.
'_'.$class.
'_'.$method.
'_'.$units][$newval];
522 if (empty($resultload))
524 dol_print_error(
'',
'Error trying to call file='.$file.
', class='.$class.
', method='.$method.
', units='.$units);
527 $classinstance =
new $class($this->
db);
529 call_user_func_array(array($classinstance, $method), array(
'',
'', $newval, $units));
530 $scaleorid = (($objimport->array_import_convertvalue[0][$val][
'rule'] ==
'fetchidfromcodeunits') ? $classinstance->id : $classinstance->scale);
531 $this->cacheconvert[$file.
'_'.$class.
'_'.$method.
'_'.$units][$newval] = $scaleorid;
533 if ($classinstance->id > 0)
535 $newval = $scaleorid ? $scaleorid : 0;
537 if (!empty($objimport->array_import_convertvalue[0][$val][
'dict'])) $this->errors[$error][
'lib'] = $langs->trans(
'ErrorFieldValueNotIn', $key, $newval,
'scale', $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val][
'dict']));
538 else $this->errors[$error][
'lib'] =
'ErrorFieldValueNotIn';
539 $this->errors[$error][
'type'] =
'FOREIGNKEY';
540 $errorforthistable++;
544 } elseif ($objimport->array_import_convertvalue[0][$val][
'rule'] ==
'getcustomercodeifauto') {
545 if (strtolower($newval) ==
'auto')
547 $this->thirpartyobject->get_codeclient(0, 0);
548 $newval = $this->thirpartyobject->code_client;
551 if (empty($newval)) $arrayrecord[($key - 1)][
'type'] = -1;
552 } elseif ($objimport->array_import_convertvalue[0][$val][
'rule'] ==
'getsuppliercodeifauto') {
553 if (strtolower($newval) ==
'auto')
555 $newval = $this->thirpartyobject->get_codefournisseur(0, 1);
556 $newval = $this->thirpartyobject->code_fournisseur;
559 if (empty($newval)) $arrayrecord[($key - 1)][
'type'] = -1;
560 } elseif ($objimport->array_import_convertvalue[0][$val][
'rule'] ==
'getcustomeraccountancycodeifauto') {
561 if (strtolower($newval) ==
'auto')
563 $this->thirpartyobject->get_codecompta(
'customer');
564 $newval = $this->thirpartyobject->code_compta;
567 if (empty($newval)) $arrayrecord[($key - 1)][
'type'] = -1;
568 } elseif ($objimport->array_import_convertvalue[0][$val][
'rule'] ==
'getsupplieraccountancycodeifauto') {
569 if (strtolower($newval) ==
'auto')
571 $this->thirpartyobject->get_codecompta(
'supplier');
572 $newval = $this->thirpartyobject->code_compta_fournisseur;
573 if (empty($newval)) $arrayrecord[($key - 1)][
'type'] = -1;
576 if (empty($newval)) $arrayrecord[($key - 1)][
'type'] = -1;
577 } elseif ($objimport->array_import_convertvalue[0][$val][
'rule'] ==
'getrefifauto') {
580 $obj = empty($conf->global->PROJECT_TASK_ADDON) ?
'mod_task_simple' : $conf->global->PROJECT_TASK_ADDON;
581 if (!empty($conf->global->PROJECT_TASK_ADDON) && is_readable(DOL_DOCUMENT_ROOT.
"/core/modules/project/task/".$conf->global->PROJECT_TASK_ADDON.
".php"))
583 require_once DOL_DOCUMENT_ROOT.
"/core/modules/project/task/".$conf->global->PROJECT_TASK_ADDON.
'.php';
585 $defaultref = $modTask->getNextValue(null, null);
587 if (is_numeric($defaultref) && $defaultref <= 0) $defaultref =
'';
588 $newval = $defaultref;
589 } elseif ($objimport->array_import_convertvalue[0][$val][
'rule'] ==
'compute') {
590 $file = (empty($objimport->array_import_convertvalue[0][$val][
'classfile']) ? $objimport->array_import_convertvalue[0][$val][
'file'] : $objimport->array_import_convertvalue[0][$val][
'classfile']);
591 $class = $objimport->array_import_convertvalue[0][$val][
'class'];
592 $method = $objimport->array_import_convertvalue[0][$val][
'method'];
594 if (empty($resultload))
596 dol_print_error(
'',
'Error trying to call file='.$file.
', class='.$class.
', method='.$method);
599 $classinstance =
new $class($this->
db);
600 $res = call_user_func_array(array($classinstance, $method), array(&$arrayrecord));
602 if (!empty($objimport->array_import_convertvalue[0][$val][
'dict'])) $this->errors[$error][
'lib'] = $langs->trans(
'ErrorFieldValueNotIn', $key, $newval,
'code', $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val][
'dict']));
603 else $this->errors[$error][
'lib'] =
'ErrorFieldValueNotIn';
604 $this->errors[$error][
'type'] =
'FOREIGNKEY';
605 $errorforthistable++;
608 $newval = $arrayrecord[($key - 1)][
'val'];
610 } elseif ($objimport->array_import_convertvalue[0][$val][
'rule'] ==
'numeric') {
618 if (!empty($objimport->array_import_regex[0][$val]) && ($newval !=
''))
622 if (preg_match(
'/^(.+)@([^:]+)(:.+)?$/', $objimport->array_import_regex[0][$val], $reg))
626 $filter = !empty($reg[3]) ?substr($reg[3], 1) :
'';
628 $cachekey = $field.
'@'.$table;
629 if (!empty($filter)) $cachekey .=
':'.$filter;
632 if (!is_array($this->cachefieldtable[$cachekey]))
634 $sql =
"SELECT ".$field.
" as aliasfield FROM ".$table;
637 $sql .=
' WHERE '.$filter;
647 $obj = $this->
db->fetch_object(
$resql);
648 if ($obj) $this->cachefieldtable[$cachekey][] = $obj->aliasfield;
657 if (!is_array($this->cachefieldtable[$cachekey]) || !in_array($newval, $this->cachefieldtable[$cachekey]))
659 $tableforerror = $table;
660 if (!empty($filter)) $tableforerror .=
':'.$filter;
661 $this->errors[$error][
'lib'] = $langs->transnoentitiesnoconv(
'ErrorFieldValueNotIn', $key, $newval, $field, $tableforerror);
662 $this->errors[$error][
'type'] =
'FOREIGNKEY';
663 $errorforthistable++;
668 elseif (!preg_match(
'/'.$objimport->array_import_regex[0][$val].
'/i', $newval)) {
670 $this->errors[$error][
'lib'] = $langs->transnoentitiesnoconv(
'ErrorWrongValueForField', $key, $newval, $objimport->array_import_regex[0][$val]);
671 $this->errors[$error][
'type'] =
'REGEX';
672 $errorforthistable++;
682 $listfields[] = $fieldname;
685 if (empty($newval) && $arrayrecord[($key - 1)][
'type'] < 0) {
686 $listvalues[] = ($newval ==
'0' ? $newval :
"null");
687 } elseif (empty($newval) && $arrayrecord[($key - 1)][
'type'] == 0) {
688 $listvalues[] =
"''";
690 $listvalues[] =
"'".$this->db->escape($newval).
"'";
697 if (!empty($listfields) && is_array($objimport->array_import_fieldshidden[0]))
700 foreach ($objimport->array_import_fieldshidden[0] as $key => $val)
702 if (!preg_match(
'/^'.preg_quote($alias,
'/').
'\./', $key))
continue;
703 if ($val ==
'user->id')
705 $listfields[] = preg_replace(
'/^'.preg_quote($alias,
'/').
'\./',
'', $key);
706 $listvalues[] = $user->id;
707 } elseif (preg_match(
'/^lastrowid-/', $val))
709 $tmp = explode(
'-', $val);
710 $lastinsertid = (isset($last_insert_id_array[$tmp[1]])) ? $last_insert_id_array[$tmp[1]] : 0;
711 $keyfield = preg_replace(
'/^'.preg_quote($alias,
'/').
'\./',
'', $key);
712 $listfields[] = $keyfield;
713 $listvalues[] = $lastinsertid;
715 } elseif (preg_match(
'/^const-/', $val))
717 $tmp = explode(
'-', $val, 2);
718 $listfields[] = preg_replace(
'/^'.preg_quote($alias,
'/').
'\./',
'', $key);
719 $listvalues[] =
"'".$tmp[1].
"'";
721 $this->errors[$error][
'lib'] =
'Bad value of profile setup '.$val.
' for array_import_fieldshidden';
722 $this->errors[$error][
'type'] =
'Import profile setup';
731 if (!$errorforthistable)
734 if (!empty($listfields))
739 if (!empty($updatekeys)) {
742 if (empty($lastinsertid)) {
743 $sqlSelect =
'SELECT rowid FROM '.$tablename;
745 $data = array_combine($listfields, $listvalues);
748 foreach ($updatekeys as $key) {
749 $col = $objimport->array_import_updatekeys[0][$key];
750 $key = preg_replace(
'/^.*\./i',
'', $key);
751 $where[] = $key.
' = '.$data[$key];
752 $filters[] = $col.
' = '.$data[$key];
754 $sqlSelect .=
' WHERE '.implode(
' AND ', $where);
756 $resql = $this->
db->query($sqlSelect);
758 $res = $this->
db->fetch_object(
$resql);
759 if (
$resql->num_rows == 1) {
760 $lastinsertid = $res->rowid;
761 $last_insert_id_array[$tablename] = $lastinsertid;
762 } elseif (
$resql->num_rows > 1) {
763 $this->errors[$error][
'lib'] = $langs->trans(
'MultipleRecordFoundWithTheseFilters', implode(
', ', $filters));
764 $this->errors[$error][
'type'] =
'SQL';
771 $this->errors[$error][
'lib'] = $this->
db->lasterror();
772 $this->errors[$error][
'type'] =
'SQL';
781 $sqlSelect =
'SELECT rowid FROM '.$tablename;
783 if (empty($keyfield)) $keyfield =
'rowid';
784 $sqlSelect .=
' WHERE '.$keyfield.
' = '.$lastinsertid;
786 $resql = $this->
db->query($sqlSelect);
788 $res = $this->
db->fetch_object(
$resql);
789 if (
$resql->num_rows == 1) {
798 $this->errors[$error][
'lib'] = $this->
db->lasterror();
799 $this->errors[$error][
'type'] =
'SQL';
804 if (!empty($lastinsertid)) {
806 $sqlstart =
'UPDATE '.$tablename;
808 $data = array_combine($listfields, $listvalues);
810 foreach ($data as $key => $val) {
811 $set[] = $key.
' = '.$val;
813 $sqlstart .=
' SET '.implode(
', ', $set);
815 if (empty($keyfield)) $keyfield =
'rowid';
816 $sqlend =
' WHERE '.$keyfield.
' = '.$lastinsertid;
818 $sql = $sqlstart.$sqlend;
827 $this->errors[$error][
'lib'] = $this->
db->lasterror();
828 $this->errors[$error][
'type'] =
'SQL';
835 if (!$error && !$updatedone) {
837 $sqlstart =
'INSERT INTO '.$tablename.
'('.implode(
', ', $listfields).
', import_key';
838 $sqlend =
') VALUES('.implode(
', ', $listvalues).
", '".$this->
db->escape($importid).
"'";
839 if (!empty($tablewithentity_cache[$tablename])) {
840 $sqlstart .=
', entity';
841 $sqlend .=
', '.$conf->entity;
843 if (!empty($objimport->array_import_tables_creator[0][$alias])) {
844 $sqlstart .=
', '.$objimport->array_import_tables_creator[0][$alias];
845 $sqlend .=
', '.$user->id;
847 $sql = $sqlstart.$sqlend.
')';
856 $last_insert_id_array[$tablename] = $this->
db->last_insert_id($tablename);
860 $this->errors[$error][
'lib'] = $this->
db->lasterror();
861 $this->errors[$error][
'type'] =
'SQL';
876 if ($updatedone) $this->nbupdate++;
877 if ($insertdone) $this->nbinsert++;
892 return str_replace(array(
',',
';'),
'/', $value);
if(!function_exists('dol_getprefix')) dol_include_once($relpath, $classname= '')
Make an include_once using default root and alternate root if it fails.
dol_osencode($str)
Return a string encoded into OS filesystem encoding.
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
write_footer_example($outputlangs)
Output footer of an example file for this format.
import_insert($arrayrecord, $array_match_file_to_database, $objimport, $maxfields, $importid, $updatekeys)
Insert a record into database.
cleansep($value)
Clean a string from separator.
import_close_file()
Close file handle.
__construct($db, $datatoimport)
Constructor.
$conf db
API class for accounts.
import_get_nb_of_lines($file)
Return nb of records.
import_read_record()
Return array of next record in input file.
Class to manage third parties objects (customers, suppliers, prospects...)
dol_strlen($string, $stringencoding= 'UTF-8')
Make a strlen call.
price2num($amount, $rounding= '', $option=0)
Function that return a number with universal decimal format (decimal separator is '...
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename= '', $restricttologhandler= '', $logcontext=null)
Write log message into outputs.
utf8_check($str)
Check if a string is in UTF8.
dol_count_nb_of_line($file)
Count number of lines in a file.
Class to import CSV files.
write_header_example($outputlangs)
Output header of an example file for this format.
Parent class for import file readers.
write_title_example($outputlangs, $headerlinefields)
Output title line of an example file for this format.
write_record_example($outputlangs, $contentlinevalues)
Output record of an example file for this format.
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.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
import_open_file($file)
Open input file.
import_read_header()
Input header line from file.