src/Controller/GestionComerciale/ActionAjaxController.php line 50

Open in your IDE?
  1. <?php
  2. namespace App\Controller\GestionComerciale;
  3. use App\Entity\Adresses\Adresse;
  4. use App\Entity\Articles\Article;
  5. use App\Entity\Articles\ArticleCategorie;
  6. use App\Entity\Articles\Categorie;
  7. use App\Entity\Articles\ConditionAchat;
  8. use App\Entity\Rangements\Caisse;
  9. use App\Entity\Articles\ConditionnementAchat;
  10. use App\Entity\Articles\ConditionVente;
  11. use App\Entity\Clients\Client;
  12. use App\Entity\FO\CompteBancaire;
  13. use App\Entity\Fournisseurs\Fournisseur;
  14. use App\Entity\GestionComerciale\Acompte;
  15. use App\Entity\GestionComerciale\ArticleCommande;
  16. use App\Entity\GestionComerciale\Commande;
  17. use App\Entity\GestionComerciale\CommandeFournisseur;
  18. use App\Entity\GestionComerciale\Fabrication;
  19. use App\Entity\GestionComerciale\FabricationMultiple;
  20. use App\Model\GestionCommerciale\TypeDocumentCommercial;
  21. use App\Entity\Taxes\Taxe;
  22. use App\Entity\Traductions\Traduction;
  23. use App\Form\GestionComercialeBundle\CopiesLignesType;
  24. use App\Service\Articles\ArticleService;
  25. use App\Service\FO\DateService;
  26. use App\Service\Fournisseurs\FournisseurService;
  27. use App\Service\GestionComerciale\CommandeService;
  28. use App\Service\GestionComerciale\FabricationService;
  29. use App\Service\Utilisateur\ColonneTableauService;
  30. use Doctrine\ORM\EntityManagerInterface;
  31. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  32. use Symfony\Component\Form\FormError;
  33. use Symfony\Component\HttpFoundation\Request;
  34. use Symfony\Component\HttpFoundation\JsonResponse;
  35. use Symfony\Component\HttpFoundation\Response;
  36. use Knp\Bundle\PaginatorBundle\Pagination\SlidingPagination;
  37. use Symfony\Component\Routing\Annotation\Route;
  38. use Symfony\Component\Validator\Validator\ValidatorInterface;
  39. use Symfony\Contracts\Translation\TranslatorInterface;
  40. class ActionAjaxController extends AbstractController
  41. {
  42.     /**
  43.      * @Route("/vente/commande/ajax/detail/{id}", name="dtc_commande_detail_ajax")
  44.      */
  45.     public function detailCommandeAction(Request $requestCommande $commande,CommandeService $commandeService)
  46.     {
  47.         $get  $request->query->all();
  48.         $mode "";
  49.         if ( ! empty($get["mode"])) {
  50.             $mode $get["mode"];
  51.         }
  52.         if($commande->getOrigine() =="ERP" && $commande->getIdImport() > 0) {
  53.             //$this->commandeService->importDocumentsErp($client_tab["id"],["devis","commandes","bls","factures"],["id_doc_erp"=>359738],$cron);
  54.             $commandeService->importDocumentsErp($commande->getClient()->getId(),["devis","commandes","bls","factures"],["log"=>false,"id_doc_erp"=>$commande->getIdImport()],NULL);
  55.         }
  56.         $rendu $this->renderView('GestionComerciale/Commande/detail_datatable.html.twig', ['commande' => $commande"mode" => $mode]);
  57.         return new JsonResponse(['rendu' => $rendu]);
  58.     }
  59. }