Creation d'un batch uniquement si des lignes sont a traiter
This commit is contained in:
parent
b3609938ca
commit
c3554cb40b
@ -105,28 +105,6 @@ else
|
|||||||
dolibarr_syslog("Erreur ".$error);
|
dolibarr_syslog("Erreur ".$error);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**********************************************************
|
|
||||||
*
|
|
||||||
* Création d'un batch de facturation
|
|
||||||
*
|
|
||||||
***********************************************************/
|
|
||||||
|
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."telephonie_facturation_batch";
|
|
||||||
$sql .= " (date_batch) VALUES (now())";
|
|
||||||
$resql = $db->query($sql);
|
|
||||||
|
|
||||||
if ( $resql )
|
|
||||||
{
|
|
||||||
$batch_id = $db->last_insert_id(MAIN_DB_PREFIX."telephonie_facturation_batch");
|
|
||||||
|
|
||||||
dolibarr_syslog("Batch ID ".$batch_id);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$error = 20;
|
|
||||||
dolibarr_syslog("Erreur ".$error);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Lectures des différentes lignes dans la table d'import
|
* Lectures des différentes lignes dans la table d'import
|
||||||
@ -167,6 +145,34 @@ if (!$error)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**********************************************************
|
||||||
|
*
|
||||||
|
* Création d'un batch de facturation
|
||||||
|
*
|
||||||
|
***********************************************************/
|
||||||
|
|
||||||
|
if (sizeof($lines_keys) > 0)
|
||||||
|
{
|
||||||
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."telephonie_facturation_batch";
|
||||||
|
$sql .= " (date_batch) VALUES (now())";
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
|
||||||
|
if ( $resql )
|
||||||
|
{
|
||||||
|
$batch_id = $db->last_insert_id(MAIN_DB_PREFIX."telephonie_facturation_batch");
|
||||||
|
|
||||||
|
dolibarr_syslog("Batch ID ".$batch_id);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$error = 20;
|
||||||
|
dolibarr_syslog("Erreur ".$error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* ***************************************************** */
|
/* ***************************************************** */
|
||||||
/* */
|
/* */
|
||||||
/* Traitements */
|
/* Traitements */
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user