Commit c782905c authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

Problème : on lancait le calcul des formules avant leur build...

parent 002feb16
Loading
Loading
Loading
Loading
Loading
+7 −0
Changes for module/Administration/src/Command/UpdateBddCommand.php: 7 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -19,6 +19,8 @@ use Unicaen\BddAdmin\BddAwareTrait;
 */
class UpdateBddCommand extends Command
{
    public static bool $needCalculFormules = false;

    use BddAwareTrait;
    use AdministrationServiceAwareTrait;
    use StructureServiceAwareTrait;
@@ -53,6 +55,11 @@ class UpdateBddCommand extends Command
            // On reconstruit les formules
            $this->runCommand($output, 'build-formules');

            // On recalcule toutes les formules
            if (self::$needCalculFormules) {
                $this->runCommand($output, 'formule-calcul');
            }

            // Enfin on calcule les TBLs
            $this->runCommand($output, 'calcul-tableaux-bord');

+3 −6
Changes for module/Administration/src/Migration/v24Formules.php: 3 added lines, 6 removed lines.
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@

namespace Administration\Migration;

use Administration\Command\UpdateBddCommand;
use Formule\Service\FormuleServiceAwareTrait;
use Unicaen\BddAdmin\Migration\MigrationAction;

@@ -80,12 +81,8 @@ class v24Formules extends MigrationAction
          WHERE p.heures_payees_aa + p.heures_payees_ac > 0
        )");

        // On calcule toutes les formules
        $this->logBegin('Calcul des formules pour toutes les fiches de service');
        $this->logMsg('/!\ Ce traitement peut prendre plusieurs heures /!\\');
        $sTbl = $this->getServiceFormule()->getServiceTableauBord();
        $sTbl->calculer('formule', []);
        $this->logEnd('Toutes les fiches de service sont recalculées');
        // On demande le recalcul de toutes les formules
        UpdateBddCommand::$needCalculFormules = true;

        // Mise à jour des états de sortie pour renommer HEURES_COMPL_FC_MAJOREES en HEURES_PRIMES
        $sql = "UPDATE etat_sortie SET