src/Controller/GestionComerciale/FabricationSimplifieController.php line 41

Open in your IDE?
  1. <?php
  2. namespace App\Controller\GestionComerciale;
  3. use App\Entity\Articles\Article;
  4. use App\Entity\Articles\Type;
  5. use App\Entity\Etiquettes\Etiquette;
  6. use App\Entity\GestionComerciale\Commande;
  7. use App\Entity\GestionComerciale\Fabrication;
  8. use App\Entity\Rangements\NiveauDeux;
  9. use App\Entity\Rangements\NiveauQuatre;
  10. use App\Entity\Rangements\NiveauTrois;
  11. use App\Entity\Rangements\NiveauUn;
  12. use App\Entity\Utilisateur\Utilisateur;
  13. use App\Library\Datatable\Util\Datatable;
  14. use App\Service\GestionComerciale\FabricationService;
  15. use Doctrine\ORM\EntityManagerInterface;
  16. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  17. use Symfony\Component\HttpFoundation\Request;
  18. use Symfony\Component\HttpFoundation\JsonResponse;
  19. use Symfony\Component\HttpFoundation\Response;
  20. use Symfony\Component\Form\Extension\Validator\ViolationMapper\ViolationMapper;
  21. use Symfony\Component\Routing\Annotation\Route;
  22. use Symfony\Component\Validator\Validation;
  23. use Symfony\Component\Validator\ConstraintViolation;
  24. use Symfony\Component\Form\FormError;
  25. use Symfony\Component\HttpFoundation\RedirectResponse;
  26. use Symfony\Component\Validator\Validator\ValidatorInterface;
  27. use Symfony\Contracts\Translation\TranslatorInterface;
  28. class FabricationSimplifieController extends AbstractController
  29. {
  30.     /**
  31.      * @Route("/fabrication-simplifie/liste", name="dtc_fabrication_simplifie_liste")
  32.      */
  33.     public function listerAction(Request   $request$fabricationParente ''$fabricationMultiple ''$prestation ''$commandeFournisseur ''EntityManagerInterface $em,
  34.                                  Datatable $datatableTranslatorInterface $translator
  35.     ) {
  36.         $this->datatable($request$datatable$translator);
  37.         $tableauClassColonne = [];
  38.         $tableauClassColonne   = [];
  39.         $tableauClassColonne[] = ["className" => "colonne_id""targets" => [0], "visible" => false"orderable" => false];
  40.         $tableauClassColonne[] = ["className" => "colonne_id text-center""targets" => [1], "visible" => true"orderable" => false];
  41.         $tableauClassColonne[] = ["className" => "colonne_id text-center""targets" => [2], "visible" => true"orderable" => true];
  42.         $tableauClassColonne[] = ["className" => "colonne_id""targets" => [3], "visible" => true"orderable" => true];
  43.         $tableauClassColonne[] = ["className" => "colonne_id""targets" => [4], "visible" => true"orderable" => true];
  44.         $tableauClassColonne[] = ["className" => "colonne_id""targets" => [5], "visible" => true"orderable" => true];
  45.         $tableauClassColonne[] = ["className" => "colonne_id text-center""targets" => [6], "visible" => true"orderable" => true];
  46.         $tableauClassColonne[] = ["className" => "colonne_id text-center""targets" => [7], "visible" => true"orderable" => true];
  47.         $tableauClassColonne[] = ["className" => "colonne_id text-center""targets" => [8], "visible" => true"orderable" => true];
  48.         $tableauClassColonne[] = ["className" => "colonne_id text-left""targets" => [9], "visible" => true"orderable" => true];
  49.         $tableauClassColonne[] = ["className" => "colonne_id""targets" => [10], "visible" => true"orderable" => false];
  50.         $prestationId        $request->query->get('prestationId');
  51.         $ref_bloquante       $request->query->get('ref_bloquante');
  52.         $ref_bloquante_label $request->query->get('ref_bloquante_label');
  53.         $fabricable          $request->query->get('fabricable');
  54.         $type                $request->query->get('type');
  55.         //if($fabricable == 1) $fabricable = 0; else $fabricable = 1;
  56.         $repo_article      $em->getRepository(Article::class);
  57.         $repo_type_article $em->getRepository(Type::class);
  58.         if ($fabricationParente != '' || $fabricationMultiple != '' || $prestation != '' || $commandeFournisseur != '') {
  59.             $template 'GestionComerciale/FabricationSimplifie/lister-datatable.html.twig';
  60.         } else {
  61.             $template 'GestionComerciale/FabricationSimplifie/lister.html.twig';
  62.         }
  63.         return $this->render($template, [
  64.             'tableauClassColonne' => $tableauClassColonne,
  65.             'fabricationParente'  => $fabricationParente,
  66.             'fabricationMultiple' => $fabricationMultiple,
  67.             'typePrestations'     => $repo_article->findBy(['prestation' => 1], ['libelle' => 'ASC']),
  68.             'prestationId'        => $prestationId,
  69.             'prestation'          => $prestation,
  70.             'commandeFournisseur' => $commandeFournisseur,
  71.             'ref_bloquante'       => $ref_bloquante,
  72.             'ref_bloquante_label' => $ref_bloquante_label,
  73.             'fabricable'          => $fabricable,
  74.             'type'                => $type,
  75.             'typesArticle'        => $repo_type_article->findAll(),
  76.         ]);
  77.     }
  78.     /**
  79.      * Grid action
  80.      * @return Response
  81.      */
  82.     /**
  83.      * @Route("/fabrication-simplifie/grid", name="dtc_fabrication_simplifie_liste_grid")
  84.      */
  85.     public function gridAction(Request $requestDatatable $datatableTranslatorInterface $translator)
  86.     {
  87.         $fabricationParente  $request->query->get('fabricationParente');
  88.         $fabricationMultiple $request->query->get('fabricationMultiple');
  89.         $prestationId        $request->query->get('prestationId');
  90.         $prestation          $request->query->get('prestation');
  91.         $commandeFournisseur $request->query->get('commandeFournisseur');
  92.         $ref_bloquante       $request->query->get('ref_bloquante');
  93.         $fabricable          $request->query->get('fabricable');
  94.         $type                $request->query->get('type');
  95.         return $this->datatable(
  96.             $request,
  97.             $datatable,
  98.             $translator,
  99.             $fabricationParente,
  100.             $fabricationMultiple,
  101.             $prestationId,
  102.             $prestation,
  103.             $commandeFournisseur,
  104.             $ref_bloquante,
  105.             $fabricable,
  106.             $type
  107.         )->execute();
  108.     }
  109.     /**
  110.      * set datatable configs
  111.      *
  112.      * @return \App\Library\Datatable\Util\Datatable
  113.      */
  114.     private function datatable(Request $requestDatatable $datatableTranslatorInterface $translator$fabricationParente ''$fabricationMultiple ''$prestationId '',
  115.                                        $prestation ''$commandeFournisseur ''$ref_bloquante ''$fabricable '',
  116.                                        $type ''
  117.     ) {
  118.         $get $request->query->all();
  119.         //print_r($get);
  120.         $parameters = [];
  121.         $datatable->setEntity(Fabrication::class, "f")
  122.                   ->setFields(
  123.                       [
  124.                           $translator->trans("Actions")             => 'f.id',
  125.                           $translator->trans("Date de fabrication") => 'f.dateFabrication',
  126.                           $translator->trans("Réf")                 => "f.reference",
  127.                           $translator->trans("Réf article")         => "a.reference",
  128.                           $translator->trans("Libellé")             => "a.libelle",
  129.                           $translator->trans("Refs bloquantes")     => "a.id",
  130.                           $translator->trans("RàF")                 => "a.id",
  131.                           $translator->trans("Qté fabricable")      => "f.quantiteFabriquable",
  132.                           $translator->trans("Statut")  => 's.libelle',
  133.                           $translator->trans("Atelier") => 'at.libelle',
  134.                           "_identifier_" => 'f.id',
  135.                       ]
  136.                   )
  137.             //->addJoin('ac.commande', 'c', \Doctrine\ORM\Query\Expr\Join::LEFT_JOIN)
  138.                   ->addJoin('f.statutFabrication''s'\Doctrine\ORM\Query\Expr\Join::LEFT_JOIN)
  139.                   ->addJoin('f.article''a'\Doctrine\ORM\Query\Expr\Join::LEFT_JOIN)
  140.                   ->addJoin('f.fabricationMultiple''fm'\Doctrine\ORM\Query\Expr\Join::LEFT_JOIN)
  141.                   ->addJoin('a.type''t'\Doctrine\ORM\Query\Expr\Join::LEFT_JOIN)
  142.                   ->addJoin('f.atelier''at'\Doctrine\ORM\Query\Expr\Join::LEFT_JOIN)
  143.                   ->setRenderers(
  144.                       [
  145.                           => [
  146.                               'view'   => 'FO/DataTable/actions-interface-simplifie.html.twig',
  147.                               'params' => [
  148.                                   'afficher_icone_reception' => false,
  149.                                   'edit_route'               => 'dtc_fabrication_simplifie_reception',
  150.                                   //'supprimer_route'    => 'dtc_fabrication_supprimer',
  151.                                   'objet'                    => Fabrication::class,
  152.                                   'fabrication'              => true,
  153.                                   'commandeFournisseur'      => $commandeFournisseur,
  154.                                   'fabricationMultiple'      => $fabricationMultiple,
  155.                               ],
  156.                           ],
  157.                           => [
  158.                               'view' => 'FO/DataTable/date.html.twig'//'DTCFO/DataTable/choix_fournisseur_controller.html.twig'
  159.                           ],
  160.                           => [
  161.                               'view'   => 'FO/DataTable/avec_lien_edit_route.html.twig',
  162.                               'params' => ['edit_route' => 'dtc_fabrication_simplifie_reception''nouvelOnglet' => false],
  163.                           ],
  164.                           => [
  165.                               'view'   => 'FO/DataTable/refs_bloquantes.html.twig',
  166.                               'params' => ['lien' => false],
  167.                           ],
  168.                           => [
  169.                               'view' => 'FO/DataTable/raf-of.html.twig',
  170.                           ],
  171.                           /*
  172.                           2 => array(
  173.                               'view' => 'FOBundle:DataTable:date.html.twig'//'DTCFO/DataTable/choix_fournisseur_controller.html.twig'
  174.                           ),
  175.                           3 => array(
  176.                               'view' => 'FO/DataTable/avec_lien_edit_route.html.twig',
  177.                               'params' => array('edit_route'=>'dtc_fabrication_simplifie_reception'),
  178.                           ),
  179.                           8 => array(
  180.                               'view' => 'FO/DataTable/ajout_class.html.twig',
  181.                               'params' => array('class'=>'text-center'),
  182.                           ),
  183.                           9 => array(
  184.                               'view' => 'FO/DataTable/ajout_class.html.twig',
  185.                               'params' => array('class'=>'text-center'),
  186.                           ),
  187.                           */
  188.                       ]
  189.                   )
  190.                   ->setSearch(true)
  191.             //->setSearchFields(array(3,4,5,7,8,9,10,11))
  192.                   ->setSearchFields([])
  193.                   ->setOrder('f.dateFabrication''ASC')
  194.                   ->setMultiple(
  195.                       [
  196.                           'reception-multiple' => [
  197.                               'title' => 'Réception multiple',
  198.                               'route' => 'dtc_fabrication_reception_multiple',
  199.                           ],
  200.                           'ordre-prestation'   => [
  201.                               'title' => 'Créer un ordre de prestation',
  202.                               'route' => 'dtc_fabrication_prestation_ajouter',
  203.                           ],
  204.                       ]
  205.                   );
  206.         $where 's.ordre IN (2,3)';
  207.         //$parametres['article']= 'test';
  208.         if (array_key_exists('atelier'$get) && $get["atelier"] != "") {
  209.             if ($get["atelier"] == "0") {
  210.                 $where .= ' AND at.id is NULL';
  211.             } else {
  212.                 $where                 .= ' AND at.id = :atelier';
  213.                 $parameters['atelier'] = $get["atelier"];
  214.             }
  215.         } else {
  216.             $where .= ' AND at.id IS NULL';
  217.         }
  218.         if ($fabricable != '') {
  219.             $where .= ' AND f.fabriquable = 2';
  220.         }
  221.         if ($type != '') {
  222.             $where              .= ' AND t.id = :type';
  223.             $parameters['type'] = $type;
  224.         }
  225.         if ($ref_bloquante != "") {
  226.             //print_r($param['article']);
  227.             $datatable->addJoin('f.articleCommande''ac'\Doctrine\ORM\Query\Expr\Join::LEFT_JOIN);
  228.             $datatable->addJoin('ac.article''aca'\Doctrine\ORM\Query\Expr\Join::LEFT_JOIN);
  229.             $where                       .= " AND aca.id = :ref_bloquante";
  230.             $parameters['ref_bloquante'] = $ref_bloquante;
  231.         }
  232.         if ($fabricationParente != '') {
  233.             $datatable->addJoin('f.fabricationParente''fp'\Doctrine\ORM\Query\Expr\Join::LEFT_JOIN);
  234.             $where 'fp.id = '.$fabricationParente;
  235.         }
  236.         if ($fabricationMultiple != '') {
  237.             //$datatable->addJoin('f.fabricationMultiple', 'fm', \Doctrine\ORM\Query\Expr\Join::LEFT_JOIN);
  238.             $where 'fm.id = '.$fabricationMultiple;
  239.         }
  240.         if ($commandeFournisseur != '') {
  241.             $datatable->addJoin('f.commandeFournisseur''cf'\Doctrine\ORM\Query\Expr\Join::LEFT_JOIN);
  242.             $ordre '';
  243.             $where 's.ordre IN (1,2,3,4) AND cf.id = '.$commandeFournisseur;
  244.         }
  245.         if ($prestationId != '') {
  246.             $datatable->addJoin('f.articleCommande''ac'\Doctrine\ORM\Query\Expr\Join::LEFT_JOIN)
  247.                       ->addJoin('ac.article''aca'\Doctrine\ORM\Query\Expr\Join::LEFT_JOIN);
  248.             $where 's.ordre IN (1,2,3) AND aca.id = '.$prestationId;
  249.         }
  250.         if ($prestation != '') {
  251.             $where 's.ordre IN (1,2,3) AND f.prestation = '.$prestation;
  252.         }
  253.         //print_r($where.' / '.$parameters['article']);
  254.         if ($where != '') {
  255.             $datatable->setWhere($where$parameters);
  256.         }
  257.         return $datatable;
  258.     }
  259.     /**
  260.      * @Route("/fabrication-simplifie/reception/{id}", name="dtc_fabrication_simplifie_reception")
  261.      */
  262.     public function receptionnerAction(Request $requestFabrication $fabricationEntityManagerInterface $emTranslatorInterface $translatorFabricationService $fabricationService)
  263.     {
  264.         $pid getmypid();
  265.         $user $this->getUser();
  266.         //$fabrication->setUtilisateur($user);
  267.         $errors           "";
  268.         $repo_utilisateur $em->getRepository(Utilisateur::class);
  269.         $repo_commande    $em->getRepository(Commande::class);
  270.         $utilisateurs     $repo_utilisateur->findAll();
  271.         if ($request->isMethod('POST')) {
  272.             $post $request->request->all();
  273.             $articles = [
  274.                 'ids'          => $request->request->get('ids'),
  275.                 'commentaires' => $request->request->get('commentaires'),
  276.                 'qtes'         => $request->request->get('qtes'),
  277.                 'qtesCmdes'    => $request->request->get('qtesCmdes'),
  278.                 'pumps'        => $request->request->get('pumps'),
  279.                 'cumps'        => $request->request->get('cumps'),
  280.                 'typesMvt'     => $request->request->get('typesMvt'),
  281.                 'emplacement'  => $request->request->get('emplacement'),
  282.             ];
  283.             $valeurs  = [
  284.                 "articles"     => $articles,
  285.                 'niveauUn'     => $request->request->get('niveauUn'),
  286.                 'niveauDeux'   => $request->request->get('niveauDeux'),
  287.                 'niveauTrois'  => $request->request->get('niveauTrois'),
  288.                 'niveauQuatre' => $request->request->get('niveauQuatre'),
  289.             ];
  290.             $equipier $repo_utilisateur->find($request->request->get('equipier'));
  291.             //Tester si la fabrication a été modifiée à la réception
  292.             // Si la fabrication a été modifiée on crée une nouvelle fabrication correspondant à cette réception et on modifie la réception existante
  293.             $newFabrication false;
  294.             foreach ($fabrication->getArticleCommande() as $ac) {
  295.                 $articleId $ac->getArticle()->getId();
  296.                 if ( ! in_array($articleId$articles['ids'])) {
  297.                     $newFabrication true;
  298.                 }
  299.             }
  300.             if ($newFabrication == true) {
  301.                 //Création de la nouvelle fabrication
  302.                 $valeurs['receptionnee'] = true;
  303.                 $newFabrication          $fabricationService->modifierFabricationEtCreerNewFabrication($fabrication$articles$equipier);
  304.                 $this->addFlash('notice'$translator->trans('Nouvel ordre de fabrication créé !'));
  305.                 $url $this->generateUrl('dtc_fabrication_modifier', ["id" => $newFabrication->getId(), 'tabs' => '#fabrications']);
  306.                 //$url = $this->generateUrl('dtc_fabrication_modifier',array("id"=>$fabrication->getId(), 'tabs'=>'#fabrications'));
  307.                 return new JsonResponse(['rendu' => '''valide' => '1''url' => $url]);
  308.             } else {
  309.                 $fabricationService->creerMvtStock($fabrication$valeurs''$equipier);
  310.                 //echo 'test';
  311.                 //$this->addFlash('notice', 'Réception de la fabrication '.$fabrication->getReference().' réalisée avec succès !' );
  312.                 $url $this->generateUrl('dtc_fabrication_modifier', ["id" => $fabrication->getId()]);
  313.                 if ($request->query->get('commandeFournisseur') != '') {
  314.                     $url $this->generateUrl('dtc_commande_fournisseur_modifier', ["id" => $request->query->get('commandeFournisseur'), 'tabs' => '#fabrications']);
  315.                 } elseif ($request->query->get('fabricationMultiple') != '') {
  316.                     $url $this->generateUrl('dtc_fabrication_multiple_modifier', ["id" => $request->query->get('fabricationMultiple'), 'tabs' => '#fabrications']);
  317.                 }
  318.                 //$url = $this->generateUrl('dtc_fabrication_simplifie_liste',array());
  319.                 $url $this->generateUrl('dtcfo_interface_simplifie_validation', []);
  320.                 $route   $this->generateUrl('dtc_fabrication_simplifie_liste', []);
  321.                 $message '<br/>Fabrication réceptionné avec succès ! <br/> Vous allez être automatiquement redirigé dans 5 secondes. <br/> <div style="text-align:center;margin-top:5px;"><a id="lien_suivant" href="'.$route.'">Ne pas attendre</a></div>';
  322.                 $this->addFlash('notice'$translator->trans($message));
  323.                 // TODO refactor commande
  324. //                $builder = new ProcessBuilder();
  325. //                $builder->setArguments(['php', '../app/console', 'articlesComposesModifierCondHa:maj']);
  326. //                $builder->getProcess()->start();
  327.                 //exit;
  328.                 return new JsonResponse(['rendu' => '''valide' => '1''url' => $url]);
  329.             }
  330.         }
  331.         $etiquettes  $repo_commande $em->getRepository(Etiquette::class)->findAll();
  332.         $titre_modal $translator->trans('Voulez-vous générer les mouvements de stock ?');
  333.         return $this->render(
  334.             'GestionComerciale/FabricationSimplifie/reception.html.twig',
  335.             ['pid' => $pid'errors' => $errors'fabrication' => $fabrication'user' => $user'utilisateurs' => $utilisateurs'etiquettes' => $etiquettes]
  336.         );//'form' => $form->createView(),
  337.         //$rendu = $this->renderView('GestionComerciale/FabricationSimplifie/reception.html.twig', array('errors'=>$errors,'fabrication'=>$fabrication,'user'=>$user, 'utilisateurs'=>$utilisateurs, 'etiquettes'=>$etiquettes));//'form' => $form->createView(),
  338.         //return new Response(json_encode(array('rendu'=>$rendu,'valide'=>'0','url'=>'','titre'=>$titre_modal)), 200, array('Content-Type'=>'application/json'));
  339.     }
  340.     /**
  341.      * @Route("", name="")
  342.      */
  343.     public function ____receptionnerEmplacementAction(Request $requestFabrication $fabricationEntityManagerInterface $emTranslatorInterface $translatorValidatorInterface $validator)
  344.     {
  345.         //$emplacement = $objet;
  346.         $titre_modal $translator->trans("Ou allez-vous déposer la marchandise fabriquée ?");
  347.         $get         $request->query->all();
  348.         $user        $this->getUser();
  349.         //$rendu = $this->renderView('Rangements/Rangement/ajouter.html.twig', array('fabrication' => $fabrication));
  350.         $rendu $this->renderView('GestionComerciale/FabricationSimplifie/reception-emplacement.html.twig', ['fabrication' => $fabrication]);
  351.         return new Response(json_encode(['rendu' => $rendu'valide' => '0''url' => '''titre' => $titre_modal]));
  352.     }
  353.     /**
  354.      * @Route("/fabrication-simplifie-emplacement/reception/{id}", name="dtc_fabrication_simplifie_reception_emplacement")
  355.      */
  356.     public function receptionnerEmplacementAction(Request $requestFabrication $fabricationEntityManagerInterface $emTranslatorInterface $translator)
  357.     {
  358.         $titre_modal $translator->trans("Ou allez-vous déposer la marchandise fabriquée ?");
  359.         $get         $request->query->all();
  360.         $user        $this->getUser();
  361.         $codeBarre   trim($request->request->get('codeBarre'));
  362.         if ($request->isMethod('post')) {
  363.             if ( ! empty($request->request->get('codeBarre'))) {
  364.                 $niveau      1;
  365.                 $emplacement $em->getRepository(NiveauUn::class)->findOneBy(['codeBarres' => $codeBarre]);
  366.                 if ( ! is_object($emplacement)) {
  367.                     $emplacement $em->getRepository(NiveauDeux::class)->findOneBy(['codeBarres' => $codeBarre]);
  368.                     $niveau++;
  369.                 }
  370.                 if ( ! is_object($emplacement)) {
  371.                     $emplacement $em->getRepository(NiveauTrois::class)->findOneBy(['codeBarres' => $codeBarre]);
  372.                     $niveau++;
  373.                 }
  374.                 if ( ! is_object($emplacement)) {
  375.                     $emplacement $em->getRepository(NiveauQuatre::class)->findOneBy(['codeBarres' => $codeBarre]);
  376.                     $niveau++;
  377.                 }
  378.                 if (is_object($emplacement)) {
  379.                     $donneesEmplacement = [
  380.                         'niveauUn'     => '',
  381.                         'niveauDeux'   => '',
  382.                         'niveauTrois'  => '',
  383.                         'niveauQuatre' => '',
  384.                     ];
  385.                     if ($niveau == 1) {
  386.                         $donneesEmplacement['niveauUn'] = $emplacement->getId();
  387.                     }
  388.                     if ($niveau == 2) {
  389.                         if (is_object($emplacement->getNiveauUn())) {
  390.                             $donneesEmplacement['niveauUn'] = $emplacement->getNiveauUn()->getId();
  391.                         }
  392.                         $donneesEmplacement['niveauDeux'] = $emplacement->getId();
  393.                     }
  394.                     if ($niveau == 3) {
  395.                         if (is_object($emplacement->getNiveauUn())) {
  396.                             $donneesEmplacement['niveauUn'] = $emplacement->getNiveauUn()->getId();
  397.                         }
  398.                         if (is_object($emplacement->getNiveauDeux())) {
  399.                             $donneesEmplacement['niveauDeux'] = $emplacement->getNiveauDeux()->getId();
  400.                         }
  401.                         $donneesEmplacement['niveauTrois'] = $emplacement->getId();
  402.                     }
  403.                     if ($niveau == 4) {
  404.                         if (is_object($emplacement->getNiveauUn())) {
  405.                             $donneesEmplacement['niveauUn'] = $emplacement->getNiveauUn()->getId();
  406.                         }
  407.                         if (is_object($emplacement->getNiveauDeux())) {
  408.                             $donneesEmplacement['niveauDeux'] = $emplacement->getNiveauDeux()->getId();
  409.                         }
  410.                         if (is_object($emplacement->getNiveauTrois())) {
  411.                             $donneesEmplacement['niveauTrois'] = $emplacement->getNiveauTrois()->getId();
  412.                         }
  413.                         $donneesEmplacement['niveauQuatre'] = $emplacement->getId();
  414.                     }
  415.                     return new JsonResponse(
  416.                         [
  417.                             'rendu'       => '',
  418.                             'valide'      => '0',
  419.                             'url'         => '',
  420.                             'titre'       => '',
  421.                             'type'        => 'callBackEmplacementFabrication',
  422.                             'emplacement' => $donneesEmplacement,
  423.                         ]
  424.                     );
  425.                 }
  426.             }
  427.             $this->addFlash('warning''Emplacement non reconnu ('.$request->request->get('codeBarre').').');
  428.         }
  429.         $rendu $this->renderView('GestionComerciale/FabricationSimplifie/reception-emplacement.html.twig', ['fabrication' => $fabrication]);
  430.         return new JsonResponse(['rendu' => $rendu'valide' => '0''url' => '''titre' => $titre_modal]);
  431.     }
  432. }