src/Controller/Widget/WidgetPrestashopController.php line 28

Open in your IDE?
  1. <?php
  2. namespace App\Controller\Widget;
  3. use App\Entity\Clients\Client;
  4. use App\Entity\FO\Cron;
  5. use App\Entity\FO\TacheCron;
  6. use App\Entity\GestionComerciale\Commande;
  7. use App\Entity\GestionComerciale\StatutCommande;
  8. use App\Entity\MarketPlace\CompteMarketPlace;
  9. use App\Model\GestionCommerciale\TypeDocumentCommercial;
  10. use App\Form\Clients\ClientType;
  11. use Doctrine\ORM\EntityManagerInterface;
  12. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  13. use Symfony\Component\HttpFoundation\JsonResponse;
  14. use Symfony\Component\HttpFoundation\Request;
  15. use Symfony\Component\Routing\Annotation\Route;
  16. use Symfony\Component\Validator\Validator\ValidatorInterface;
  17. use Symfony\Contracts\Translation\TranslatorInterface;
  18. class WidgetPrestashopController extends AbstractController
  19. {
  20.     /**
  21.      * @Route("/prestashop/{script}/pourcentage-traitement", name="dtc_calcul_pourcentage_traitement_prestashop")
  22.      */
  23.     public function pourcentageTraitementAction(Request $request$script ""EntityManagerInterface $em)
  24.     {
  25.         $domaine_prestashop $this->getParameter('domaine_prestashop');
  26.         $url_xml            "http://".$domaine_prestashop."/67PHEAuaps4P4h3/avancement.php?s=".trim($script);
  27.         //echo $url_xml;
  28.         //$pourcentageTraitement = $service->pourcentageTraitementCalculCump($cron);
  29.         $pourcentageTraitement "";
  30.         $total                 "";
  31.         $traite                "";
  32.         $xml_execution = @simplexml_load_file($url_xml);
  33.         if (isset($xml_execution->execution)) {
  34.             $execution $xml_execution->execution;
  35.             $total     = (string)$execution->total;
  36.             $traite    = (string)$execution->traite;
  37.             //echo "TOTAL ".$total;
  38.             //echo "TRAITE ".$traite;
  39.             if ($total == $traite or $total == 0) {
  40.                 $pourcentageTraitement 100;
  41.             } else {
  42.                 $pourcentageTraitement round($traite 100 $total);
  43.             }
  44.         }
  45.         $response = new JsonResponse();
  46.         $response->setData([
  47.                                'pourcentageTraitement' => $pourcentageTraitement,
  48.                                'total'                 => $total,
  49.                                'traite'                => $traite,
  50.                            ]);
  51.         return $response;
  52.     }
  53.     /**
  54.      * @Route("", name="")
  55.      */
  56.     public function widgetPrestahopCommandesAction(Request $requestEntityManagerInterface $em)        //prestashop_commandes.html
  57.     {
  58.         $repo_commande          $em->getRepository(Commande::class);
  59.         $typeDocumentCommercial TypeDocumentCommercial::COMMANDE;
  60.         $statuts                $em->getRepository(StatutCommande::class)->findBy([
  61.                                                                                         'documentCommercial' => $typeDocumentCommercial,
  62.                                                                                     ], ['ordre' => 'ASC']);
  63.         $tab_final = [];
  64.         foreach ($statuts as $s) {
  65.             //echo "<div>".$s->getLibelle()."</div>";
  66.             $where      "x.typeDocumentCommercial = :typeDocumentCommercial and x.origine=:origine";
  67.             $parameters = ['typeDocumentCommercial' => TypeDocumentCommercial::COMMANDE"origine" => "prestashop"];
  68.             $statutIds   = [];
  69.             $statutIds[] = $s->getId();
  70.             if ($where != "") {
  71.                 $where .= " AND ";
  72.             }
  73.             $where                 .= "x.statutCommande IN (:statuts)";
  74.             $parameters['statuts'] = $statutIds;
  75.             $nombre $repo_commande->getNombreCommandeInternet($where$parameters);
  76.             //$nombre = 0;
  77.             $tab_final[$s->getLibelle()] = $nombre;
  78.         }
  79.         //recréation d'un tableau car on veut en attente en 2eme position plutot qu'en 3eme de base
  80.         $tab["Annulée"] = $tab_final["Annulée"];
  81.         $tab["En attente de validation"] = $tab_final["En attente de validation"];
  82.         $tab["Acceptée"]                 = $tab_final["Acceptée"];
  83.         $tab["En attente"]               = $tab_final["En attente"];
  84.         $tab["Partiel préparé"]          = $tab_final["Partiel préparé"];
  85.         $tab["Préparée"]                 = $tab_final["Préparée"];
  86.         $tab["Partiellement livrée"]     = $tab_final["Partiellement livrée"];
  87.         $tab["Livrée"]                   = $tab_final["Livrée"];
  88.         $tab_final $tab;
  89.         return $this->render('Widget/Widget/prestashop_commandes.html.twig', ["tab_status" => $tab_final]);
  90.     }
  91. //_________________________________________________________//fonction test, n'est pas appelé
  92.     /**
  93.      * @Route("", name="")
  94.      */
  95.     public function _____widgetPrestahopCommandesAction(Request $requestEntityManagerInterface $emTranslatorInterface $translatorValidatorInterface $validator)
  96.     {
  97.         $typeDocumentCommercial TypeDocumentCommercial::COMMANDE;
  98.         $statuts                $em->getRepository(StatutCommande::class)->findBy([
  99.                                                                                         'documentCommercial' => $typeDocumentCommercial,
  100.                                                                                     ], ['ordre' => 'ASC']);
  101.         $tab_final = [];
  102.         //dump($statuts);
  103.         /*foreach($statuts as $key => $value)
  104.         {
  105.               dump($statuts);
  106.               echo $key;
  107.               echo $value;
  108.               dump($statuts[$key]);
  109.               $statuts2=$statuts[$key];
  110.               dump($statuts2);
  111.               // foreach($statuts2 as $key2 => $value2)
  112.               // {
  113.               //     echo"v2:";
  114.               //     echo$key2;
  115.               //     echo$value2;
  116.               // }
  117.               if ($statuts[$key] === "Acceptée")
  118.               {
  119.                   dump("oui");
  120.                   $statuts[$key]['ordre'] = 2;
  121.               }
  122.               if ($statuts[$key] === "En attente")
  123.               {
  124.                   dump("oui");
  125.                   $statuts[$key]['ordre'] = 1;
  126.               }
  127.         }*/
  128.         foreach ($statuts as $s) {
  129.             //echo "<div>".$s->getLibelle()."</div>";
  130.             $where      "x.typeDocumentCommercial = :typeDocumentCommercial and x.origine=:origine";
  131.             $parameters = ['typeDocumentCommercial' => TypeDocumentCommercial::COMMANDE"origine" => "prestashop"];
  132.             $statutIds   = [];
  133.             $statutIds[] = $s->getId();
  134.             if ($where != "") {
  135.                 $where .= " AND ";
  136.             }
  137.             $where                 .= "x.statutCommande IN (:statuts)";
  138.             $parameters['statuts'] = $statutIds;
  139.             $repo_commande $em->getRepository(Commande::class);
  140.             $nombre        $repo_commande->getNombreCommandeInternet($where$parameters);
  141.             //$nombre = 0;
  142.             $tab_final[$s->getLibelle()] = $nombre;
  143.             // $where = "x.typeDocumentCommercial = :typeDocumentCommercial and x.origine=:origine AND s.ordre NOT IN (0) AND (x.valideManuellement IS NULL OR x.valideManuellement=0)";
  144.             // $parameters = array('typeDocumentCommercial' => TypeDocumentCommercial::COMMANDE,"origine"=>"prestashop");
  145.             //     $attente_validation = $repo_commande->getNombreCommandeAttenteValidation($where,$parameters);
  146.             // $tab_final['En attente de validation']=$attente_validation;
  147.         }
  148.         /*
  149.         function replace_key($arr, $oldkey, $newkey) 
  150.         {
  151.              if(array_key_exists( $oldkey, $arr)) 
  152.              {
  153.                 $keys = array_keys($arr);
  154.                  $keys[array_search($oldkey, $keys)] = $newkey;
  155.                  return array_combine($keys, $arr); 
  156.              }
  157.             return $arr;    
  158.         }
  159.         
  160.         $tab_final["En attente"]=50;
  161.         $a=$tab_final["Acceptée"];
  162.         // $tab_final["Acceptée"]=$tab_final["En attente"];
  163.         // $tab_final["En attente"]=$a;
  164.        
  165.            // $tab_final=replace_key($tab_final, "Acceptée", "En attente");
  166.            $tab_final["En attente"]=
  167.         */
  168.         //dump($tab_final2);
  169.         // for($t=0; $t<=count($tab_final); t++) 
  170.         // {
  171.         //     if(key($tab_final[$t])==="En attente")
  172.         //     {
  173.         //         //dump("good");
  174.         //     }
  175.         // }
  176.         // //array_push($tab_final, var)    
  177.         // foreach($tab_final as $s) 
  178.         // {
  179.         //  $current=current($tab_final);
  180.         //  dump($current);
  181.         //  // if(key($current)=="En attente")
  182.         //  // {
  183.         //  //         dump("good");
  184.         //     // }
  185.         // } 
  186.         //       foreach( $tab_final as $key=>$value)
  187.         // {
  188.         //    echo " Key ". $key;
  189.         //    if($key =="En attente")
  190.         //           {
  191.         //                //dump("good");
  192.         //           }
  193.         // }
  194.         return $this->render('Widget/Widget/prestashop_commandes.html.twig', ["tab_status" => $tab_final]);
  195.     }
  196. //_________________________________________________________//fonction test, n'est pas appelé
  197.     /**
  198.      * @Route("", name="")
  199.      */
  200.     public function widgetPrestashopAction(Request $requestEntityManagerInterface $em)
  201.     {
  202.         $repo_client     $em->getRepository(Client::class);
  203.         $repo_cron       $em->getRepository(Cron::class);
  204.         $repo_tache_cron $em->getRepository(TacheCron::class);
  205.         $repo_compte_market_place $em->getRepository(CompteMarketPlace::class);
  206.         //$clients = $repo_client->findAll();
  207.         //$clients = $repo_client->getDerniersClient();
  208.         $domaine_prestashop $this->getParameter('domaine_prestashop');
  209.         $compte $repo_compte_market_place->find(16);
  210.         $url_xml            "http://".$compte->getIdentifiant()."/".$compte->getSecret()."/executions.php";
  211.         $tab_date = [];
  212.         $tab_date['clients']            = "";
  213.         $tab_date['remises']            = "";
  214.         $tab_date['cra']                = "";
  215.         $tab_date['crc']                = "";
  216.         $tab_date['cc']                 = "";
  217.         $tab_date['categories']         = "";
  218.         $tab_date['articles']           = "";
  219.         $tab_date['articles-ref-appel'] = "";
  220.         $tab_date['articles_stock']="";
  221.         $tab_date['transporteurs']      = "";
  222.         $tab_date['zones']              = "";
  223.         $tab_date['tranches']           = "";
  224.         $tab_date['fraisport']          = "";
  225.         $tab_date['vehicules']          = "";
  226.         $tab_date['commandes']          = "";
  227.         $tab_date['applications']       = "";
  228.         $tab_date['marques']            = "";
  229.         $tab_date['clients_erp']        = "";
  230.         $tab_date['commandes_erp']      = "";
  231.         $tache $repo_tache_cron->find(83);
  232.         if(is_object($tache)){
  233.             $derniersCron $repo_cron->findBy(array('tacheCron'=>$tache), array('date'=>'DESC'), 10);
  234.             if(isset($derniersCron[0]) && is_object($derniersCron[0]) && $derniersCron[0]->getDateFin() != '') {
  235.                 $tab_date['articles_stock'] = $derniersCron[0]->getDateFin()->format("d/m/Y à H:i:s");
  236.             } else if(isset($derniersCron[0]) && is_object($derniersCron[0]) && $derniersCron[0]->getDateDebut() != '') {
  237.                 $tab_date['articles_stock'] = "En cours depuis ".$derniersCron[0]->getDateDebut()->format("d/m/Y à H:i:s");
  238.             }
  239.         }
  240.         /*
  241.         $tache = $repo_tache_cron->find(12);
  242.         if (is_object($tache)) {
  243.             $derniersCron = $repo_cron->findBy(['tacheCron' => $tache], ['date' => 'DESC'], 1, 0);
  244.             if (isset($derniersCron[0]) && is_object($derniersCron[0]) && $derniersCron[0]->getDateFin() != '') {
  245.                 $tab_date['clients_erp'] = $derniersCron[0]->getDateFin()->format("d/m/Y à H:i:s");
  246.             } elseif (isset($derniersCron[0]) && is_object($derniersCron[0]) && $derniersCron[0]->getDateDebut() != '') {
  247.                 $tab_date['clients_erp'] = "En cours depuis ".$derniersCron[0]->getDateDebut()->format("d/m/Y à H:i:s");
  248.             }
  249.         }
  250.         */
  251.         $tache $repo_tache_cron->find(14);
  252.         if (is_object($tache)) {
  253.             $derniersCron $repo_cron->findBy(['tacheCron' => $tache], ['date' => 'DESC'], 10);
  254.             if (isset($derniersCron[0]) && is_object($derniersCron[0]) && $derniersCron[0]->getDateFin() != '') {
  255.                 $tab_date['commandes_erp'] = $derniersCron[0]->getDateFin()->format("d/m/Y à H:i:s");
  256.             } elseif (isset($derniersCron[0]) && is_object($derniersCron[0]) && $derniersCron[0]->getDateDebut() != '') {
  257.                 $tab_date['commandes_erp'] = "En cours depuis ".$derniersCron[0]->getDateDebut()->format("d/m/Y à H:i:s");
  258.             }
  259.         }
  260.         $tab_avancement = [];
  261.         $tab_avancement['clients']            = ["total" => """traite" => ""];
  262.         $tab_avancement['remises']            = ["total" => """traite" => ""];
  263.         $tab_avancement['cra']                = ["total" => """traite" => ""];
  264.         $tab_avancement['crc']                = ["total" => """traite" => ""];
  265.         $tab_avancement['cc']                 = ["total" => """traite" => ""];
  266.         $tab_avancement['categories']         = ["total" => """traite" => ""];
  267.         $tab_avancement['articles']           = ["total" => """traite" => ""];
  268.         $tab_avancement['articles-ref-appel'] = ["total" => """traite" => ""];
  269.         $tab_avancement['transporteurs']      = ["total" => """traite" => ""];
  270.         $tab_avancement['zones']              = ["total" => """traite" => ""];
  271.         $tab_avancement['tranches']           = ["total" => """traite" => ""];
  272.         $tab_avancement['fraisport']          = ["total" => """traite" => ""];
  273.         $tab_avancement['vehicules']          = ["total" => """traite" => ""];
  274.         $tab_avancement['commandes']          = ["total" => """traite" => ""];
  275.         $tab_avancement['applications']       = ["total" => """traite" => ""];
  276.         $tab_avancement['marques']            = ["total" => """traite" => ""];
  277.         $xml_execution = @simplexml_load_file($url_xml);
  278.         if (isset($xml_execution->execution)) {
  279.             foreach ($xml_execution->execution as $execution) {
  280.                 if ($execution->libelle == "clients") {
  281.                     if ($execution->date_fin == "") {
  282.                         $date                = new \Datetime((string)$execution->date_debut);
  283.                         $tab_date['clients'] = "En cours depuis ".$date->format("d/m/Y à H:i:s");
  284.                         $tab_avancement['clients'] = ["total" => (string)$execution->total"traite" => (string)$execution->traite];
  285.                     } else {
  286.                         $date                = new \Datetime((string)$execution->date_fin);
  287.                         $tab_date['clients'] = $date->format("d/m/Y à H:i:s");
  288.                     }
  289.                 }
  290.                 if ($execution->libelle == "remises") {
  291.                     if ($execution->date_fin == "") {
  292.                         $date                = new \Datetime((string)$execution->date_debut);
  293.                         $tab_date['remises'] = "En cours depuis ".$date->format("d/m/Y à H:i:s");
  294.                         $tab_avancement['remises'] = ["total" => (string)$execution->total"traite" => (string)$execution->traite];
  295.                     } else {
  296.                         $date                = new \Datetime((string)$execution->date_fin);
  297.                         $tab_date['remises'] = $date->format("d/m/Y à H:i:s");
  298.                     }
  299.                 }
  300.                 if ($execution->libelle == "cra") {
  301.                     if ($execution->date_fin == "") {
  302.                         $date            = new \Datetime((string)$execution->date_debut);
  303.                         $tab_date['cra'] = "En cours depuis ".$date->format("d/m/Y à H:i:s");
  304.                         $tab_avancement['cra'] = ["total" => (string)$execution->total"traite" => (string)$execution->traite];
  305.                     } else {
  306.                         $date            = new \Datetime((string)$execution->date_fin);
  307.                         $tab_date['cra'] = $date->format("d/m/Y à H:i:s");
  308.                     }
  309.                 }
  310.                 if ($execution->libelle == "crc") {
  311.                     if ($execution->date_fin == "") {
  312.                         $date            = new \Datetime((string)$execution->date_debut);
  313.                         $tab_date['crc'] = "En cours depuis ".$date->format("d/m/Y à H:i:s");
  314.                         $tab_avancement['crc'] = ["total" => (string)$execution->total"traite" => (string)$execution->traite];
  315.                     } else {
  316.                         $date            = new \Datetime((string)$execution->date_fin);
  317.                         $tab_date['crc'] = $date->format("d/m/Y à H:i:s");
  318.                     }
  319.                 }
  320.                 if ($execution->libelle == "cc") {
  321.                     if ($execution->date_fin == "") {
  322.                         $date           = new \Datetime((string)$execution->date_debut);
  323.                         $tab_date['cc'] = "En cours depuis ".$date->format("d/m/Y à H:i:s");
  324.                         $tab_avancement['cc'] = ["total" => (string)$execution->total"traite" => (string)$execution->traite];
  325.                     } else {
  326.                         $date           = new \Datetime((string)$execution->date_fin);
  327.                         $tab_date['cc'] = $date->format("d/m/Y à H:i:s");
  328.                     }
  329.                 }
  330.                 if ($execution->libelle == "categories") {
  331.                     if ($execution->date_fin == "") {
  332.                         $date                   = new \Datetime((string)$execution->date_debut);
  333.                         $tab_date['categories'] = "En cours depuis ".$date->format("d/m/Y à H:i:s");
  334.                         $tab_avancement['categories'] = ["total" => (string)$execution->total"traite" => (string)$execution->traite];
  335.                     } else {
  336.                         $date                   = new \Datetime((string)$execution->date_fin);
  337.                         $tab_date['categories'] = $date->format("d/m/Y à H:i:s");
  338.                     }
  339.                 }
  340.                 if ($execution->libelle == "articles") {
  341.                     if ($execution->date_fin == "") {
  342.                         $date                 = new \Datetime((string)$execution->date_debut);
  343.                         $tab_date['articles'] = "En cours depuis ".$date->format("d/m/Y à H:i:s");
  344.                         $tab_avancement['articles'] = ["total" => (string)$execution->total"traite" => (string)$execution->traite];
  345.                     } else {
  346.                         $date                 = new \Datetime((string)$execution->date_fin);
  347.                         $tab_date['articles'] = $date->format("d/m/Y à H:i:s");
  348.                     }
  349.                 }
  350.                 if ($execution->libelle == "articles-ref-appel") {
  351.                     if ($execution->date_fin == "") {
  352.                         $date                           = new \Datetime((string)$execution->date_debut);
  353.                         $tab_date['articles-ref-appel'] = "En cours depuis ".$date->format("d/m/Y à H:i:s");
  354.                         $tab_avancement['articles-ref-appel'] = ["total" => (string)$execution->total"traite" => (string)$execution->traite];
  355.                     } else {
  356.                         $date                           = new \Datetime((string)$execution->date_fin);
  357.                         $tab_date['articles-ref-appel'] = $date->format("d/m/Y à H:i:s");
  358.                     }
  359.                 }
  360.                 if ($execution->libelle == "transporteurs") {
  361.                     if ($execution->date_fin == "") {
  362.                         $date                      = new \Datetime((string)$execution->date_debut);
  363.                         $tab_date['transporteurs'] = "En cours depuis ".$date->format("d/m/Y à H:i:s");
  364.                         $tab_avancement['transporteurs'] = ["total" => (string)$execution->total"traite" => (string)$execution->traite];
  365.                     } else {
  366.                         $date                      = new \Datetime((string)$execution->date_fin);
  367.                         $tab_date['transporteurs'] = $date->format("d/m/Y à H:i:s");
  368.                     }
  369.                 }
  370.                 if ($execution->libelle == "zones") {
  371.                     if ($execution->date_fin == "") {
  372.                         $date              = new \Datetime((string)$execution->date_debut);
  373.                         $tab_date['zones'] = "En cours depuis ".$date->format("d/m/Y à H:i:s");
  374.                         $tab_avancement['zones'] = ["total" => (string)$execution->total"traite" => (string)$execution->traite];
  375.                     } else {
  376.                         $date              = new \Datetime((string)$execution->date_fin);
  377.                         $tab_date['zones'] = $date->format("d/m/Y à H:i:s");
  378.                     }
  379.                 }
  380.                 if ($execution->libelle == "tranches") {
  381.                     if ($execution->date_fin == "") {
  382.                         $date                 = new \Datetime((string)$execution->date_debut);
  383.                         $tab_date['tranches'] = "En cours depuis ".$date->format("d/m/Y à H:i:s");
  384.                         $tab_avancement['tranches'] = ["total" => (string)$execution->total"traite" => (string)$execution->traite];
  385.                     } else {
  386.                         $date                 = new \Datetime((string)$execution->date_fin);
  387.                         $tab_date['tranches'] = $date->format("d/m/Y à H:i:s");
  388.                     }
  389.                 }
  390.                 if ($execution->libelle == "fraisport") {
  391.                     if ($execution->date_fin == "") {
  392.                         $date                  = new \Datetime((string)$execution->date_debut);
  393.                         $tab_date['fraisport'] = "En cours depuis ".$date->format("d/m/Y à H:i:s");
  394.                         $tab_avancement['fraisport'] = ["total" => (string)$execution->total"traite" => (string)$execution->traite];
  395.                     } else {
  396.                         $date                  = new \Datetime((string)$execution->date_fin);
  397.                         $tab_date['fraisport'] = $date->format("d/m/Y à H:i:s");
  398.                     }
  399.                 }
  400.                 if ($execution->libelle == "vehicules") {
  401.                     if ($execution->date_fin == "") {
  402.                         $date                  = new \Datetime((string)$execution->date_debut);
  403.                         $tab_date['vehicules'] = "En cours depuis ".$date->format("d/m/Y à H:i:s");
  404.                         $tab_avancement['vehicules'] = ["total" => (string)$execution->total"traite" => (string)$execution->traite];
  405.                     } else {
  406.                         $date                  = new \Datetime((string)$execution->date_fin);
  407.                         $tab_date['vehicules'] = $date->format("d/m/Y à H:i:s");
  408.                     }
  409.                 }
  410.                 if ($execution->libelle == "commandes") {
  411.                     if ($execution->date_fin == "") {
  412.                         $date                  = new \Datetime((string)$execution->date_debut);
  413.                         $tab_date['commandes'] = "En cours depuis ".$date->format("d/m/Y à H:i:s");
  414.                         $tab_avancement['commandes'] = ["total" => (string)$execution->total"traite" => (string)$execution->traite];
  415.                     } else {
  416.                         $date                  = new \Datetime((string)$execution->date_fin);
  417.                         $tab_date['commandes'] = $date->format("d/m/Y à H:i:s");
  418.                     }
  419.                 }
  420.                 if ($execution->libelle == "applications") {
  421.                     if ($execution->date_fin == "") {
  422.                         $date                     = new \Datetime((string)$execution->date_debut);
  423.                         $tab_date['applications'] = "En cours depuis ".$date->format("d/m/Y à H:i:s");
  424.                         $tab_avancement['applications'] = ["total" => (string)$execution->total"traite" => (string)$execution->traite];
  425.                     } else {
  426.                         $date                     = new \Datetime((string)$execution->date_fin);
  427.                         $tab_date['applications'] = $date->format("d/m/Y à H:i:s");
  428.                     }
  429.                 }
  430.                 if ($execution->libelle == "marques") {
  431.                     if ($execution->date_fin == "") {
  432.                         $date                = new \Datetime((string)$execution->date_debut);
  433.                         $tab_date['marques'] = "En cours depuis ".$date->format("d/m/Y à H:i:s");
  434.                         $tab_avancement['marques'] = ["total" => (string)$execution->total"traite" => (string)$execution->traite];
  435.                     } else {
  436.                         $date                = new \Datetime((string)$execution->date_fin);
  437.                         $tab_date['marques'] = $date->format("d/m/Y à H:i:s");
  438.                     }
  439.                 }
  440.             }
  441.         }
  442.         //print_r($tab_avancement);
  443.         return $this->render('Widget/Widget/prestashop.html.twig', ["tab_date" => $tab_date"tab_avancement" => $tab_avancement"cle" => $this->getParameter('cle_xml')]);
  444.     }
  445. }