Skip to content
Snippets Groups Projects
Commit 8e1c9d66 authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

Calcul plus fin des tableaux de bord

parent dafbaa39
No related branches found
No related tags found
No related merge requests found
...@@ -289,7 +289,26 @@ class WorkflowService extends AbstractService ...@@ -289,7 +289,26 @@ class WorkflowService extends AbstractService
*/ */
public function calculerTousTableauxBord() public function calculerTousTableauxBord()
{ {
return $this->getEntityManager()->getConnection()->exec('BEGIN OSE_DIVERS.CALCULER_TABLEAUX_BORD; END;'); $sql = "SELECT tbl_name FROM tbl WHERE tbl_name <> 'formule' ORDER BY ordre";
$tbls = $this->getEntityManager()->getConnection()->fetchAll($sql);
$errors = [];
foreach( $tbls as $tbl ){
$tbl = $tbl['TBL_NAME'];
$sql = 'BEGIN UNICAEN_TBL.CALCULER(\''.$tbl.'\'); END;';
try{
$this->getEntityManager()->getConnection()->exec($sql);
echo "Tableau de bord $tbl recalculé\n";
}catch(\Exception $e){
$errors[$tbl] = $e->getMessage();
}
}
if ($errors){
$msg = "Erreur de calcul sur des tableaux de bord : \n";
foreach( $errors as $tbl => $error){
$msg .= $tbl.' : '.$error."\n";
}
throw new Exception($msg);
}
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment