Ajout infos de debug
This commit is contained in:
parent
7706ae2fe2
commit
fe3ed511ea
@ -167,9 +167,11 @@ class FacturationImportCdr {
|
||||
if ( $this->_verif($this->db, $xfile, $fichiers) == 0)
|
||||
{
|
||||
dolibarr_syslog("FacturationImportCdr::Import Lecture du fichier $xfile", LOG_DEBUG);
|
||||
|
||||
array_push($this->messages,array('info',"Fichier ".basename($xfile)." : utilisation format ".$cdrformat->nom));
|
||||
$cdrformat->ReadFile($xfile);
|
||||
|
||||
$this->messages=array_merge($this->messages, $cdrformat->messages);
|
||||
|
||||
$error = 0;
|
||||
$line = 0;
|
||||
$line_inserted = 0;
|
||||
@ -239,21 +241,24 @@ class FacturationImportCdr {
|
||||
}
|
||||
|
||||
dolibarr_syslog("FacturationImportCdr::Import $line lignes traitées dans le fichier", LOG_INFO);
|
||||
$level = ($line > 0) ? 'info':'warning';
|
||||
array_push($this->messages,array($level,"Fichier ".basename($xfile)." : $line lignes traitées dans le fichier"));
|
||||
dolibarr_syslog("FacturationImportCdr::Import $line_inserted insert effectués", LOG_INFO);
|
||||
array_push($this->messages,"$line_inserted ajout dans la table des CDR a traiter");
|
||||
$level = ($line_inserted > 0) ? 'info':'warning';
|
||||
array_push($this->messages,array($level,"Fichier ".basename($xfile)." : $line_inserted ajout dans la table des CDR a traiter"));
|
||||
|
||||
if (sizeof($this->message_bad_file_format))
|
||||
{
|
||||
foreach ($this->message_bad_file_format as $key => $value)
|
||||
{
|
||||
array_push($this->messages,"$value ligne(s) au mauvais format dans $key");
|
||||
array_push($this->messages,array('warning',"$value ligne(s) au mauvais format dans $key"));
|
||||
}
|
||||
}
|
||||
|
||||
if ($error == 0)
|
||||
{
|
||||
$this->db->query("COMMIT");
|
||||
array_push($this->messages, array('info',"Fichier ".basename($xfile)." importation reussie"));
|
||||
array_push($this->messages, array('info',"Fichier ".basename($xfile)." : importation reussie"));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -33,6 +33,7 @@ class CdrFormatFructidor
|
||||
{
|
||||
$this->nom = "Fructidor";
|
||||
$this->datas = array();
|
||||
$this->messages = array();
|
||||
}
|
||||
|
||||
function showSample()
|
||||
@ -48,8 +49,9 @@ class CdrFormatFructidor
|
||||
|
||||
function ReadFile($file)
|
||||
{
|
||||
$this->messages = array();
|
||||
dolibarr_syslog("CdrFormatFructidor::ReadFile($file)", LOG_DEBUG);
|
||||
|
||||
$badformat = 0;
|
||||
$error = 0;
|
||||
$i = 0;
|
||||
$line = 1;
|
||||
@ -77,12 +79,17 @@ class CdrFormatFructidor
|
||||
else
|
||||
{
|
||||
dolibarr_syslog("CdrFormatFructidor::ReadFile Mauvais format de fichier ligne $line", LOG_ERR);
|
||||
$badformat++;
|
||||
}
|
||||
}
|
||||
$line++;
|
||||
}
|
||||
fclose($hf);
|
||||
|
||||
array_push($this->messages,array('info',"Fichier ".basename($file)." : $line lignes lues dans le fichier"));
|
||||
if ($badformat > 0)
|
||||
{
|
||||
array_push($this->messages,array('error',"Fichier ".basename($file)." : $badformat lignes ont un mauvais format dans le fichier"));
|
||||
}
|
||||
dolibarr_syslog("CdrFormatFructidor::ReadFile read $i lines", LOG_DEBUG);
|
||||
}
|
||||
}
|
||||
|
||||
@ -33,6 +33,7 @@ class CdrFormatMessidor
|
||||
{
|
||||
$this->nom = "Messidor";
|
||||
$this->datas = array();
|
||||
$this->messages = array();
|
||||
}
|
||||
|
||||
function ShowSample()
|
||||
@ -82,7 +83,7 @@ class CdrFormatMessidor
|
||||
$line++;
|
||||
}
|
||||
fclose($hf);
|
||||
|
||||
array_push($this->messages,array('info',"Fichier ".basename($file)." : $line lignes lues dans le fichier"));
|
||||
dolibarr_syslog("CdrFormatMessidor::ReadFile read $i lines", LOG_DEBUG);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user