var/cache/dev/twig/8d/8dfcacd25e925e89e3cb593343e20bb56c486a5b93ac313e9c37081b8bfd1d68.php line 647

Open in your IDE?
  1. <?php
  2. use Twig\Environment;
  3. use Twig\Error\LoaderError;
  4. use Twig\Error\RuntimeError;
  5. use Twig\Extension\SandboxExtension;
  6. use Twig\Markup;
  7. use Twig\Sandbox\SecurityError;
  8. use Twig\Sandbox\SecurityNotAllowedTagError;
  9. use Twig\Sandbox\SecurityNotAllowedFilterError;
  10. use Twig\Sandbox\SecurityNotAllowedFunctionError;
  11. use Twig\Source;
  12. use Twig\Template;
  13. /* base.html.twig */
  14. class __TwigTemplate_f34ebf69db0fa088bba5ff0111a8e497945612ca93fc9035141f4a0f47708ae4 extends Template
  15. {
  16.     private $source;
  17.     private $macros = [];
  18.     public function __construct(Environment $env)
  19.     {
  20.         parent::__construct($env);
  21.         $this->source $this->getSourceContext();
  22.         $this->parent false;
  23.         $this->blocks = [
  24.             'seo' => [$this'block_seo'],
  25.             'title' => [$this'block_title'],
  26.             'css' => [$this'block_css'],
  27.             'menu1' => [$this'block_menu1'],
  28.             'menu2' => [$this'block_menu2'],
  29.             'breadcrumb' => [$this'block_breadcrumb'],
  30.             'content' => [$this'block_content'],
  31.             'js_import' => [$this'block_js_import'],
  32.             'javascript' => [$this'block_javascript'],
  33.             'javascript_script' => [$this'block_javascript_script'],
  34.         ];
  35.     }
  36.     protected function doDisplay(array $context, array $blocks = [])
  37.     {
  38.         $macros $this->macros;
  39.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  40.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""base.html.twig"));
  41.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  42.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""base.html.twig"));
  43.         // line 1
  44.         echo "
  45. ";
  46.         // line 3
  47.         $context["emailComptableConfig"] = $this->env->getRuntime('Symfony\Bridge\Twig\Extension\HttpKernelRuntime')->renderFragment(Symfony\Bridge\Twig\Extension\HttpKernelExtension::controller("App\\Controller\\MetaConfigController::getConfigMeta", ["key" => "cabinet_comptable"]));
  48.         // line 4
  49.         $context["baseUrl"] = $this->env->getRuntime('Symfony\Bridge\Twig\Extension\HttpKernelRuntime')->renderFragment(Symfony\Bridge\Twig\Extension\HttpKernelExtension::controller("App\\Controller\\HomeController::getBaseUrl", []));
  50.         // line 5
  51.         echo "
  52. ";
  53.         // line 6
  54.         $context["base_api_ocr_url"] = "https://dockeo.fr";
  55.         // line 7
  56.         echo "
  57. <!DOCTYPE html>
  58. <html>
  59. <head>
  60.     <meta charset=\"utf-8\">
  61.     <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">
  62.     <link rel=\"icon\" type=\"image/ico\" href=\"";
  63.         // line 15
  64.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("favicon.ico"), "html"nulltrue);
  65.         echo "\"/>
  66.     ";
  67.         // line 17
  68.         $this->displayBlock('seo'$context$blocks);
  69.         // line 21
  70.         echo "
  71.     <link rel=\"stylesheet\" href=\"https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css\" integrity=\"sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu\" crossorigin=\"anonymous\">
  72.     <link href=\"";
  73.         // line 23
  74.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("vendor/@fortawesome/fontawesome-free/css/fontawesome.css"), "html"nulltrue);
  75.         echo "\" rel=\"stylesheet\">
  76.     <link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.3/photoswipe.min.css\"/>
  77.     <link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.3/default-skin/default-skin.css\"/>
  78.     <link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/limonte-sweetalert2/11.1.9/sweetalert2.min.css\" referrerpolicy=\"no-referrer\" />
  79.     <link href=\"";
  80.         // line 27
  81.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("vendor/iCheck/custom.css"), "html"nulltrue);
  82.         echo "\" rel=\"stylesheet\">
  83.     <link href=\"";
  84.         // line 28
  85.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("vendor/animate.css/animate.css"), "html"nulltrue);
  86.         echo "\" rel=\"stylesheet\">
  87.     <link href=\"";
  88.         // line 29
  89.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("css/style.css"), "html"nulltrue);
  90.         echo "\" rel=\"stylesheet\">
  91.     <link rel=\"stylesheet\" href=\"";
  92.         // line 30
  93.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("vendor/toastr/toastr.min.css"), "html"nulltrue);
  94.         echo "\"/>
  95.     <script src=\"";
  96.         // line 31
  97.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("js/jquery-3.1.1.min.js"), "html"nulltrue);
  98.         echo "\"></script>
  99.     <style type=\"text/css\">
  100.         
  101.         .sf-minitoolbar, .sf-toolbarreset{display:none}
  102.         .inline-text{
  103.           overflow: hidden;
  104.           text-overflow: ellipsis;
  105.           white-space: nowrap;
  106.         }
  107.         body::-webkit-scrollbar {
  108.             width: .75rem;
  109.         }
  110.         *::-webkit-scrollbar-track {
  111.             background-color: #edf2f7;
  112.         }
  113.         *::-webkit-scrollbar-thumb {
  114.             background-color: #718096;
  115.             border-radius: 9999px;
  116.         }
  117.         body {
  118.             scrollbar-width: thin;
  119.             /* The color of thumb and track areas */
  120.             scrollbar-color: #718096 #edf2f7;
  121.         }
  122.         .modal-body {
  123.             padding: 20px 60px 57px 60px;
  124.         }
  125.         .pagination-block{
  126.             text-align: center;
  127.             margin-bottom: 40px;
  128.         }
  129.         .entreprise-list{
  130.             margin-top: 38px;
  131.         }
  132.         .loader-container{display: none;align-items: center;justify-content: center;}
  133.         .switch-entreprise.entreprise-item {
  134.             display: flex;
  135.             align-items: center;
  136.             justify-content: space-between;
  137.             border: 1px solid #dcdcdc;
  138.             padding: 4px 12px;
  139.             font-size: 11px;
  140.             border-radius: 5px;
  141.             margin-top: 7px;
  142.             color: #888;
  143.             font-weight: bold;
  144.         }
  145.         .switch-entreprise.entreprise-item.active, .switch-entreprise.entreprise-item:hover {
  146.             border-color: #14c179;
  147.             background: #14c179;
  148.             color: #fff;
  149.         }
  150.         .entreprise-img{
  151.             width: 35px;
  152.             height: 35px;
  153.             border-radius: 100%;
  154.             margin-right: 8px;
  155.             /*background-color: #18a689;*/
  156.             object-fit: cover;
  157.             border: 2px solid #18a689;
  158.         }
  159.         .navbar-top-links {
  160.             text-align: right;
  161.             margin-right: 8px;
  162.             margin-top: 8px;
  163.         }
  164.         .showDocument{cursor: pointer;}
  165.         .main-logo{
  166.             object-fit: contain;
  167.             width: 174px;
  168.             margin: auto;
  169.             display: block;
  170.         }
  171.         .footer{position: fixed;}
  172.         .nav.navbar-top-links > li > a.admin-btn:hover, .nav.navbar-top-links > li > a.admin-btn:focus{
  173.             background-color: #1ab394;
  174.             border-color: #1ab394;
  175.         }
  176.         .custom-dropdown {
  177.           display: inline-block;
  178.           position: relative;
  179.         }
  180.         .custom-dropdown .dd-button {
  181.           display: inline-block;
  182.           border: 1px solid gray;
  183.           border-radius: 4px;
  184.           padding: 7px 28px 7px 4px;
  185.           background-color: #ffffff;
  186.           cursor: pointer;
  187.           white-space: nowrap;
  188.         }
  189.         .dd-button:after {
  190.           content: '';
  191.           position: absolute;
  192.           top: 50%;
  193.           right: 15px;
  194.           transform: translateY(-50%);
  195.           width: 0; 
  196.           height: 0; 
  197.           border-left: 5px solid transparent;
  198.           border-right: 5px solid transparent;
  199.           border-top: 5px solid black;
  200.         }
  201.         .dd-button:hover {
  202.           background-color: #eeeeee;
  203.         }
  204.         .dd-input {
  205.           display: none;
  206.         }
  207.         .dd-menu {
  208.           position: absolute;
  209.           top: 100%;
  210.           border: 1px solid #ccc;
  211.           border-radius: 4px;
  212.           padding: 0;
  213.           margin: 2px 0 0 0;
  214.           box-shadow: 0 0 6px 0 rgba(0,0,0,0.1);
  215.           background-color: #ffffff;
  216.           list-style-type: none;
  217.         }
  218.         .dd-input + .dd-menu {
  219.           display: none;
  220.         } 
  221.         .dd-input:checked + .dd-menu {
  222.           display: block;
  223.         } 
  224.         .dd-menu li {
  225.           padding: 10px 20px;
  226.           cursor: pointer;
  227.           white-space: nowrap;
  228.           cursor: pointer;
  229.         }
  230.         .dd-menu li:hover {
  231.           background-color: #f6f6f6;
  232.         }
  233.         .btn-config-colonne{
  234.             cursor: pointer;
  235.             font-size: 20px;
  236.         }
  237.         .column-container {
  238.             position: absolute;
  239.             border: 1px solid #ccc;
  240.             padding: 13px;
  241.             border-radius: 5px;
  242.             width: 260px;
  243.             top: 59px;
  244.             box-shadow: 0px 1px 1px 3px rgb(183 183 190 / 20%);
  245.             background: #fff;
  246.             left: 0;
  247.             z-index: 9;
  248.             display: none;
  249.         }
  250.         .column-item label.column-label{
  251.             display: flex;
  252.             margin-bottom: 10px;
  253.         }
  254.         .column-item .column-libelle{
  255.             margin-left: 14px;
  256.         }
  257.     </style>
  258.     ";
  259.         // line 204
  260.         $this->displayBlock('css'$context$blocks);
  261.         // line 206
  262.         echo "</head>
  263. <body style=\"-webkit-print-color-adjust: exact;\">
  264. <!-- Root element of PhotoSwipe. Must have class pswp. -->
  265. <div class=\"pswp\" tabindex=\"-1\" role=\"dialog\" aria-hidden=\"true\">
  266.   <!-- Background of PhotoSwipe. 
  267.            It's a separate element as animating opacity is faster than rgba(). -->
  268.   <div class=\"pswp__bg\"></div>
  269.   <!-- Slides wrapper with overflow:hidden. -->
  270.   <div class=\"pswp__scroll-wrap\">
  271.     <!-- Container that holds slides. 
  272.               PhotoSwipe keeps only 3 of them in the DOM to save memory.
  273.               Don't modify these 3 pswp__item elements, data is added later on. -->
  274.     <div class=\"pswp__container\">
  275.       <div class=\"pswp__item\"></div>
  276.       <div class=\"pswp__item\"></div>
  277.       <div class=\"pswp__item\"></div>
  278.     </div>
  279.     <!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
  280.     <div class=\"pswp__ui pswp__ui--hidden\">
  281.       <div class=\"pswp__top-bar\">
  282.         <!--  Controls are self-explanatory. Order can be changed. -->
  283.         <div class=\"pswp__counter\"></div>
  284.         <button class=\"pswp__button pswp__button--close\" title=\"Fermer (Esc)\"></button>
  285.         <button class=\"pswp__button pswp__button--share\" title=\"Partager\"></button>
  286.         <button class=\"pswp__button pswp__button--fs\" title=\"Plein Ã©cran\"></button>
  287.         <button class=\"pswp__button pswp__button--zoom\" title=\"Zoom +/-\"></button>
  288.         <!-- Preloader demo https://codepen.io/dimsemenov/pen/yyBWoR -->
  289.         <!-- element will get class pswp__preloader--active when preloader is running -->
  290.         <div class=\"pswp__preloader\">
  291.           <div class=\"pswp__preloader__icn\">
  292.             <div class=\"pswp__preloader__cut\">
  293.               <div class=\"pswp__preloader__donut\"></div>
  294.             </div>
  295.           </div>
  296.         </div>
  297.       </div>
  298.       <div class=\"pswp__share-modal pswp__share-modal--hidden pswp__single-tap\">
  299.         <div class=\"pswp__share-tooltip\"></div>
  300.       </div>
  301.       <button class=\"pswp__button pswp__button--arrow--left\" title=\"Précedent\">
  302.       </button>
  303.       <button class=\"pswp__button pswp__button--arrow--right\" title=\"Suivant\">
  304.       </button>
  305.       <div class=\"pswp__caption\">
  306.         <div class=\"pswp__caption__center\"></div>
  307.       </div>
  308.     </div>
  309.   </div>
  310. </div>
  311. <div id=\"wrapper\">
  312.     ";
  313.         // line 258
  314.         $this->displayBlock('menu1'$context$blocks);
  315.         // line 281
  316.         echo "
  317.         <div id=\"page-wrapper\" class=\"gray-bg\">
  318.             <div class=\"row border-bottom\">
  319.                 <nav class=\"navbar navbar-static-top\" role=\"navigation\" style=\"margin-bottom: 0\">
  320.                     <div class=\"navbar-header\">
  321.                         <a class=\"navbar-minimalize minimalize-styl-2 btn btn-primary \" href=\"#\"><i class=\"fa fa-bars\"></i> </a>
  322.                     </div>
  323.                     <div class=\"navbar-header\">
  324.                     </div>
  325.                     ";
  326.         // line 290
  327.         $this->displayBlock('menu2'$context$blocks);
  328.         // line 332
  329.         echo "                </nav>
  330.             </div>
  331.             ";
  332.         // line 334
  333.         $this->displayBlock('breadcrumb'$context$blocks);
  334.         // line 341
  335.         echo "            <div class=\"wrapper wrapper-content animated fadeInRight\">
  336.                 ";
  337.         // line 342
  338.         $this->displayBlock('content'$context$blocks);
  339.         // line 344
  340.         echo "            </div>
  341.             <div class=\"footer\">
  342.                 <div class=\"float-right\">
  343.                 </div>
  344.                 <div>
  345.                     <strong>Copyright</strong> FMDA &copy; 2020
  346.                 </div>
  347.             </div>
  348.             <div class=\"modal-entreprise-container\">
  349.                 <div id=\"modalEntreprise\" class=\"modal fade\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"myModalLabel\">
  350.                     <div class=\"modal-dialog\" role=\"document\">
  351.                         <div class=\"modal-content\">
  352.                             <div class=\"modal-header\" style=\"border: none;\">
  353.                                 ";
  354.         // line 357
  355.         if (twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'357$this->source); })()), "session", [], "any"falsefalsefalse357), "get", [=> "entreprise_session_id"], "method"falsefalsefalse357)) {
  356.             echo 
  357.                                     <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\"><span aria-hidden=\"true\" style=\"position: absolute;right: 14px;top: 10px;\">&times;</span></button>
  358.                                 ";
  359.         }
  360.         // line 360
  361.         echo "                            </div>
  362.                             <div class=\"modal-body row entreprise-container\">
  363.                                 <div class=\"loader-container\">
  364.                                     <img src=\"";
  365.         // line 363
  366.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("images/loading.gif"), "html"nulltrue);
  367.         echo "\" style=\"width: 54px;\">
  368.                                 </div>
  369.                             </div>
  370.                         </div>
  371.                     </div>
  372.                 </div>
  373.             </div>
  374.             <div id=\"modalDocumentShow\" class=\"modal fade bs-example-modal-lg\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"myLargeModalLabel\">
  375.                 <div class=\"modal-dialog modal-lg\" role=\"document\">
  376.                     <div class=\"modal-content\">
  377.                         <div class=\"modal-header\" style=\"border: none;\">
  378.                             <!-- <div class=\"text-center\">
  379.                                 <label class=\"custom-dropdown\" id=\"btnRotation\" style=\"display: none;z-index: 10\">
  380.                                   <div class=\"dd-button\">&nbsp
  381.                                     Orientation <i class=\"fad fa-redo\"></i>&nbsp
  382.                                   </div>
  383.                                   <input type=\"checkbox\" class=\"dd-input\" id=\"test\">
  384.                                   <ul class=\"dd-menu\">
  385.                                     <li class=\"rotationChoice\" data-rotation=\"90\" data-pdf=\"\">rotation 90</li>
  386.                                     <li class=\"rotationChoice\" data-rotation=\"180\" data-pdf=\"\">rotation 180</li>
  387.                                     <li class=\"rotationChoice\" data-rotation=\"270\" data-pdf=\"\">rotation 270</li>
  388.                                   </ul>
  389.                                 </label>
  390.                             </div> -->
  391.                             <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\" style=\"position: absolute;top: 11px; right: 15px;\"><span aria-hidden=\"true\">&times;</span></button>
  392.                         </div>
  393.                         <div class=\"modal-body text-center\">
  394.                             <h3 class=\"text-center no-document\" style=\"display: none;\">Aucun document rattaché.</h3>
  395.                             <div class=\"documentFile-container\" style=\"display: none;\">
  396.                             </div>
  397.                         </div>
  398.                     </div>
  399.                 </div>
  400.             </div>
  401.             <div id=\"modalScoreIa\" class=\"modal fade bs-example-modal-sm modal-center\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"mySmallModalLabel\">
  402.               <div class=\"modal-dialog modal-sm\" role=\"document\">
  403.                 <div class=\"modal-content\">
  404.                     <div class=\"modal-header\" style=\"border: none;\">
  405.                         <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button>
  406.                         <h4 class=\"modal-title text-center\" id=\"gridSystemModalLabel\" style=\"padding-top: 27px;\">
  407.                           <span style=\"color: red\">ATTENTION RECONNAISSANCE INFERIEUR A 20% !!!</span> <br><br>Ce document est succeptible de n'avoir aucun modèle de reconnaissance IA enregistré. <br>Vous devrez selectionner manuellement les champs sur ce document
  408.                         </h4>
  409.                     </div>
  410.                     <div class=\"modal-body text-center\">
  411.                         <button type=\"button\" class=\"btn btn-primary\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\">OK</button>
  412.                     </div>
  413.                 </div>
  414.               </div>
  415.             </div>
  416.         </div>
  417. </div>
  418. <!-- Mainly scripts -->
  419. <script src=\"";
  420.         // line 420
  421.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("vendor/popper.js/dist/umd/popper.js"), "html"nulltrue);
  422.         echo "\"></script>
  423. <script src=\"https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js\" integrity=\"sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd\" crossorigin=\"anonymous\"></script>
  424. <script src=\"";
  425.         // line 422
  426.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("vendor/metisMenu/jquery.metisMenu.js"), "html"nulltrue);
  427.         echo "\"></script>
  428. <script src=\"";
  429.         // line 423
  430.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("vendor/slimscroll/jquery.slimscroll.min.js"), "html"nulltrue);
  431.         echo "\"></script>
  432. <script src=\"";
  433.         // line 424
  434.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("vendor/peity/jquery.peity.min.js"), "html"nulltrue);
  435.         echo "\"></script>
  436. <script src=\"";
  437.         // line 425
  438.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("vendor/toastr/toastr.min.js"), "html"nulltrue);
  439.         echo "\"></script>
  440. <script src=\"https://cdn.jsdelivr.net/npm/sweetalert2@11.4.10/dist/sweetalert2.all.min.js\"></script>
  441. <!-- Custom and plugin javascript -->
  442. <script src=\"";
  443.         // line 429
  444.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("js/inspinia.js"), "html"nulltrue);
  445.         echo "\"></script>
  446. <script src=\"";
  447.         // line 430
  448.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("vendor/pace/pace.min.js"), "html"nulltrue);
  449.         echo "\"></script>
  450. <script type=\"text/javascript\" src=\"https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.15.6/xlsx.core.min.js\"></script>
  451. <script type=\"text/javascript\" src=\"";
  452.         // line 433
  453.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("vendor/excelplus-2.5.min.js"), "html"nulltrue);
  454.         echo "\"></script>
  455. <!-- iCheck --> 
  456. <script src=\"";
  457.         // line 436
  458.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("vendor/iCheck/icheck.min.js"), "html"nulltrue);
  459.         echo "\"></script>
  460. <script type=\"text/javascript\">
  461.     var currentRotation = 0;
  462.     \$(document).ready(function(){
  463.         \$(\".btn-config-colonne\").click(function(){
  464.             \$(\".column-container\").slideToggle();
  465.         });
  466.     });
  467.     \$(document).mouseup(function(e) {
  468.       var containerConfigColumns = \$(\".column-container\");
  469.         if (!containerConfigColumns.is(e.target) && containerConfigColumns.has(e.target).length === 0){ 
  470.           \$('.column-container').hide();
  471.         }
  472.     })
  473.     \$.fn.isInViewport = function() {
  474.         var elementTop = \$(this).offset().top;
  475.         var elementBottom = elementTop + \$(this).outerHeight();
  476.         var viewportTop = \$(window).scrollTop();
  477.         var viewportBottom = viewportTop + \$(window).height();
  478.         return elementBottom > viewportTop && elementTop < viewportBottom;
  479.     };
  480.     function isElementInViewport (el) {
  481.     // Special bonus for those using jQuery
  482.         if (typeof jQuery === \"function\" && el instanceof jQuery) {
  483.             el = el[0];
  484.         }
  485.         var rect = el.getBoundingClientRect();
  486.         return (
  487.             rect.top >= 0 &&
  488.             rect.left >= 0 &&
  489.             rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && /* or \$(window).height() */
  490.             rect.right <= (window.innerWidth || document.documentElement.clientWidth) /* or \$(window).width() */
  491.         );
  492.     }
  493.     function isElementPartiallyInViewport(el)
  494.         {
  495.             // Special bonus for those using jQuery
  496.             if (typeof jQuery !== 'undefined' && el instanceof jQuery) 
  497.                 el = el[0];
  498.             var rect = el.getBoundingClientRect();
  499.             // DOMRect { x: 8, y: 8, width: 100, height: 100, top: 8, right: 108, bottom: 108, left: 8 }
  500.             var windowHeight = (window.innerHeight || document.documentElement.clientHeight);
  501.             var windowWidth = (window.innerWidth || document.documentElement.clientWidth);
  502.             // http://stackoverflow.com/questions/325933/determine-whether-two-date-ranges-overlap
  503.             var vertInView = (rect.top <= windowHeight) && ((rect.top + rect.height) >= 0);
  504.             var horInView = (rect.left <= windowWidth) && ((rect.left + rect.width) >= 0);
  505.             return (vertInView && horInView);
  506.         }
  507. </script>
  508. <!-- Peity
  509. <script src=\"js/demo/peity-demo.js\"></script>
  510. -->
  511. ";
  512.         // line 501
  513.         $this->displayBlock('js_import'$context$blocks);
  514.         // line 503
  515.         echo "
  516. <script>
  517.     \$(document).ready(function(){
  518.         \$('.i-checks').iCheck({
  519.             checkboxClass: 'icheckbox_square-green',
  520.             radioClass: 'iradio_square-green',
  521.         });
  522.     });
  523.     jQuery(document).ready(function() { 
  524.         ";
  525.         // line 512
  526.         $context['_parent'] = $context;
  527.         $context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'512$this->source); })()), "flashes", [=> "success"], "method"falsefalsefalse512));
  528.         foreach ($context['_seq'] as $context["label"] => $context["message"]) {
  529.             // line 513
  530.             echo "            toastr.success(\"";
  531.             echo twig_escape_filter($this->env$context["message"], "html"nulltrue);
  532.             echo "\");
  533.         ";
  534.         }
  535.         $_parent $context['_parent'];
  536.         unset($context['_seq'], $context['_iterated'], $context['label'], $context['message'], $context['_parent'], $context['loop']);
  537.         $context array_intersect_key($context$_parent) + $_parent;
  538.         // line 515
  539.         echo "        ";
  540.         $context['_parent'] = $context;
  541.         $context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'515$this->source); })()), "flashes", [=> "error"], "method"falsefalsefalse515));
  542.         foreach ($context['_seq'] as $context["_key"] => $context["message"]) {
  543.             // line 516
  544.             echo "            toastr.error(\"";
  545.             echo twig_escape_filter($this->env$context["message"], "html"nulltrue);
  546.             echo "\");
  547.         ";
  548.         }
  549.         $_parent $context['_parent'];
  550.         unset($context['_seq'], $context['_iterated'], $context['_key'], $context['message'], $context['_parent'], $context['loop']);
  551.         $context array_intersect_key($context$_parent) + $_parent;
  552.         // line 518
  553.         echo "        ";
  554.         $context['_parent'] = $context;
  555.         $context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'518$this->source); })()), "flashes", [=> "infos"], "method"falsefalsefalse518));
  556.         foreach ($context['_seq'] as $context["_key"] => $context["message"]) {
  557.             // line 519
  558.             echo "            toastr.infos(\"";
  559.             echo twig_escape_filter($this->env$context["message"], "html"nulltrue);
  560.             echo "\");
  561.         ";
  562.         }
  563.         $_parent $context['_parent'];
  564.         unset($context['_seq'], $context['_iterated'], $context['_key'], $context['message'], $context['_parent'], $context['loop']);
  565.         $context array_intersect_key($context$_parent) + $_parent;
  566.         // line 521
  567.         echo "        ";
  568.         $context['_parent'] = $context;
  569.         $context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'521$this->source); })()), "flashes", [=> "warning"], "method"falsefalsefalse521));
  570.         foreach ($context['_seq'] as $context["_key"] => $context["message"]) {
  571.             // line 522
  572.             echo "            toastr.warning(\"";
  573.             echo twig_escape_filter($this->env$context["message"], "html"nulltrue);
  574.             echo "\");
  575.         ";
  576.         }
  577.         $_parent $context['_parent'];
  578.         unset($context['_seq'], $context['_iterated'], $context['_key'], $context['message'], $context['_parent'], $context['loop']);
  579.         $context array_intersect_key($context$_parent) + $_parent;
  580.         // line 524
  581.         echo "    });
  582.     isObjectEmpty = function(obj) {
  583.         for(var key in obj) {
  584.             if(obj.hasOwnProperty(key))
  585.                 return false;
  586.         }
  587.         return true;
  588.     };
  589.     ";
  590.         // line 532
  591.         $this->displayBlock('javascript'$context$blocks);
  592.         // line 534
  593.         echo "</script>
  594. <script type=\"text/javascript\">
  595.     if(\"";
  596.         // line 537
  597.         echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'537$this->source); })()), "user", [], "any"falsefalsefalse537), "role", [], "any"falsefalsefalse537), "html"nulltrue);
  598.         echo "\" == \"administrateur\" && !\"";
  599.         echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'537$this->source); })()), "session", [], "any"falsefalsefalse537), "get", [=> "entreprise_session_id"], "method"falsefalsefalse537), "html"nulltrue);
  600.         echo "\"){
  601.         loadEntreprise();
  602.     }
  603.     \$('.openEntrepriseModal').click(function(){
  604.         loadEntreprise();        
  605.     })
  606.     function loadEntreprise(){
  607.         \$('#modalEntreprise').modal({
  608.           backdrop: 'static'
  609.         });
  610.         \$('.loader-container').css('display','flex');
  611.         \$.ajax({
  612.             url: \"";
  613.         // line 550
  614.         echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("entreprise_load_xhr");
  615.         echo "\",
  616.             type: \"GET\",
  617.             async: true,
  618.             dataType: \"json\",
  619.             data: {},
  620.             success:function(response) {
  621.               if(response.status == 200){
  622.                 \$('#modalEntreprise .entreprise-container').html(response.datas);
  623.               }
  624.               else if(response.status == 500){
  625.                 toastr.error(response.message);
  626.               }
  627.               \$('.loader-container').css('display','none');
  628.             },
  629.             error:function(){
  630.               toastr.error(\"Ooops... Quelque chose s'est mal passée\");
  631.               \$('.loader-container').css('display','none');
  632.             }
  633.         });
  634.     }
  635.     function loadMenu(){
  636.         \$.ajax({
  637.             url: \"";
  638.         // line 573
  639.         echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("menu_load_xhr");
  640.         echo "\",
  641.             type: \"GET\",
  642.             async: true,
  643.             dataType: \"json\",
  644.             data: {},
  645.             success:function(response) {
  646.               if(response.status == 200){
  647.                 \$('#side-menu').html(response.datas);
  648.               }
  649.               else if(response.status == 500){
  650.                 toastr.error(response.message);
  651.               }
  652.             },
  653.             error:function(){
  654.               toastr.error(\"Ooops... Quelque chose s'est mal passée\");
  655.             }
  656.         });
  657.     }
  658.     if( \"";
  659.         // line 592
  660.         echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'592$this->source); })()), "session", [], "any"falsefalsefalse592), "get", [=> "entreprise_session_id"], "method"falsefalsefalse592), "html"nulltrue);
  661.         echo "\" )
  662.         loadMenu();
  663.     \$(document).on('click', '.menu-item', function(){
  664.         if(\$(this).hasClass('active')){
  665.             \$(this).removeClass('active');
  666.             \$(this).find('.sub-nav').addClass('collapse');
  667.         }
  668.         else{
  669.             \$('.menu-item').removeClass('active');
  670.             \$('.menu-item .sub-nav').addClass('collapse');
  671.             \$(this).addClass('active');
  672.             \$(this).find('.sub-nav').removeClass('collapse');
  673.         }
  674.         
  675.     })
  676.     function switchEntreprise(el){
  677.         var url = el.getAttribute(\"data-href\");
  678.         \$('.loader-container').css('display','flex');
  679.         \$.ajax({
  680.             url: url,
  681.             type: \"GET\",
  682.             dataType: \"json\",
  683.             async: true,
  684.             data: {},
  685.             success: function(response) {
  686.                 if(response.status == 200){
  687.                     location.reload();
  688.                 }
  689.                 else if(response.status == 500){
  690.                     toastr.error(response.message);
  691.                 }
  692.                 \$('.loader-container').css('display','none');
  693.             },
  694.             error: function(xhr, textStatus, errorThrown) {
  695.               console.log(errorThrown);
  696.               \$('.loader-container').css('display','none');
  697.             }
  698.         });
  699.     }
  700.     \$(document).ready( function () {
  701.         \$('body').on('click', ' .showDocument', function(){
  702.             \$documentFile = \$(this).attr('data-file');
  703.             \$('#modalDocumentShow').modal('show');
  704.             if(\$documentFile != \"\"){
  705.                 \$('.no-document').css('display','none');
  706.                 \$('.documentFile-container').css('display','block');
  707.                 if(\$documentFile.substr(\$documentFile.length - 3).toLowerCase() == \"pdf\"){
  708.                     // \$('#btnRotation').css('display', 'inline-block');
  709.                     // \$('#btnRotation .rotationChoice').attr('data-pdf', \$documentFile);
  710.                     \$('.lien-document').attr('href', \$documentFile);
  711.                     \$('.documentFile-container').html('<object class=\"documentPdf\" data=\"\" type=\"application/pdf\" width=\"100%\" height=\"980px\"></object>');
  712.                 }
  713.                 else{
  714.                     \$('.documentFile-container').html('<object class=\"documentPdf\" data=\"\" ></object>');
  715.                 }
  716.                 \$('.documentPdf').attr('data', \$documentFile);
  717.             }
  718.             else{
  719.                 \$('.documentFile-container').css('display','none');
  720.                 \$('.no-document').css('display','block');
  721.             }
  722.         })
  723.         \$('body').on('click', ' .rotationChoice', function(){
  724.             var pdf = \$(this).attr('data-pdf');
  725.             var rotation = \$(this).attr('data-rotation');
  726.             var dossier = \$(this).attr('data-dossier');
  727.             // currentRotation = parseInt(currentRotation) + parseInt(rotation);
  728.             // \$('.data-ocr-container').css('transform', \"rotate(\"+currentRotation+\"deg)\");
  729.             // console.log(currentRotation);
  730.             \$.ajax({
  731.                 url: \"";
  732.         // line 668
  733.         echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("document_rotation");
  734.         echo "\",
  735.                 type: \"GET\",
  736.                 dataType: \"json\",
  737.                 async: true,
  738.                 data: {
  739.                     pdf:pdf,
  740.                     rotation:rotation,
  741.                     dossier:dossier
  742.                 },
  743.                 success: function(response, status) {
  744.                   if(response.status == 200){
  745.                     window.open(response.datas.redirect,'_blank');
  746.                     window.close();
  747.                   }
  748.                   else if(response.status == 400){
  749.                         toastr.error(response.message);
  750.                   }
  751.                 },
  752.                 error: function(xhr, textStatus, errorThrown) {
  753.                   toastr.error(\"Ooops..., Quelque chose s'est mal passée\");
  754.                 }
  755.             });
  756.         })
  757.     } );
  758.     // \$(document).on('click', '#rotationCss', function(){
  759.     //     let angle = \$(this).val();
  760.     //     \$('.data-ocr-container').css('transform', \"rotate(\"+angle+\"deg)\");
  761.     //     console.log(angle);
  762.     //     console.log('deg');
  763.     //     console.log(angle+'deg');
  764.     // })
  765.     \$(document).on(\"blur\", \".field-number\", function () {
  766.         if(\$(this).val()){
  767.             var content = \$(this).val();
  768.             
  769.             if (content.indexOf(',') > -1 && content.indexOf('.') > -1){
  770.                 content = content.replace(\",\", '');
  771.             }
  772.             var valeur = content.replace(/[\\,]+/g, '.');
  773.             var valString = valeur.toString(); 
  774.             valString = valString.toLowerCase();
  775.             valString = valString.replace(\"euro\", '');
  776.             valString = valString.replace(\"eur\", '');
  777.             valString = valString.replace(\"€\", '');
  778.             valString = valString.replace(\" \", '');
  779.             valeur = parseFloat(valString);
  780.             \$(this).val(valeur);
  781.         }
  782.     });
  783.     function ajustePrice(content){
  784.         
  785.         if(content != \"\"){
  786.             if (content.indexOf(',') > -1 && content.indexOf('.') > -1){
  787.                 content = content.replace(\",\", '');
  788.             }
  789.             var valeur = content.replace(/[\\,]+/g, '.');
  790.             var valString = valeur.toString(); 
  791.             valString = valString.toLowerCase();
  792.             valString = valString.replace(\"euro\", '');
  793.             valString = valString.replace(\"eur\", '');
  794.             valString = valString.replace(\"€\", '');
  795.             valString = valString.replace(\" \", '');
  796.             valeur = parseFloat(valString);
  797.             return valeur;
  798.         }
  799.         return \"\";
  800.     }
  801. </script>
  802. <script type=\"text/javascript\">
  803.         jQuery.extend( jQuery.fn.dataTableExt.oSort, {
  804.             \"num-html-pre\": function ( a ) {
  805.                 var x = String(a).replace( /<[\\s\\S]*?>/g, \"\" );
  806.                 return parseFloat( x );
  807.             },
  808.          
  809.             \"num-html-asc\": function ( a, b ) {
  810.                 return ((a < b) ? -1 : ((a > b) ? 1 : 0));
  811.             },
  812.          
  813.             \"num-html-desc\": function ( a, b ) {
  814.                 return ((a < b) ? 1 : ((a > b) ? -1 : 0));
  815.             }
  816.         } );
  817. </script>
  818. ";
  819.         // line 762
  820.         $this->displayBlock('javascript_script'$context$blocks);
  821.         // line 1161
  822.         echo "
  823.   <script type=\"text/javascript\">
  824.     \$(document).ready( function () {
  825.       \$('.removeColumn').remove();
  826.     })
  827.   </script>
  828. </body>
  829. </html>
  830. ";
  831.         
  832.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
  833.         
  834.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
  835.     }
  836.     // line 17
  837.     public function block_seo($context, array $blocks = [])
  838.     {
  839.         $macros $this->macros;
  840.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  841.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""seo"));
  842.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  843.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""seo"));
  844.         // line 18
  845.         echo "        <title>";
  846.         $this->displayBlock('title'$context$blocks);
  847.         echo "</title>
  848.         <meta name=\"description\" content=\"\"/>
  849.     ";
  850.         
  851.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
  852.         
  853.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
  854.     }
  855.     public function block_title($context, array $blocks = [])
  856.     {
  857.         $macros $this->macros;
  858.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  859.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""title"));
  860.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  861.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""title"));
  862.         echo " ";
  863.         echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'18$this->source); })()), "session", [], "any"falsefalsefalse18), "get", [=> "entreprise_session_name"], "method"falsefalsefalse18), "html"nulltrue);
  864.         echo "  ";
  865.         
  866.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
  867.         
  868.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
  869.     }
  870.     // line 204
  871.     public function block_css($context, array $blocks = [])
  872.     {
  873.         $macros $this->macros;
  874.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  875.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""css"));
  876.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  877.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""css"));
  878.         // line 205
  879.         echo "    ";
  880.         
  881.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
  882.         
  883.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
  884.     }
  885.     // line 258
  886.     public function block_menu1($context, array $blocks = [])
  887.     {
  888.         $macros $this->macros;
  889.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  890.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""menu1"));
  891.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  892.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""menu1"));
  893.         // line 259
  894.         echo "        <nav class=\"navbar-default navbar-static-side\" role=\"navigation\" style=\"margin-bottom: 49px;\">
  895.             <div class=\"sidebar-collapse\">
  896.                 <ul class=\"nav metismenu\" id=\"side-menu\">
  897.                     <li class=\"nav-header\">
  898.                         <div class=\"profile-element\">
  899.                             <a href=\"";
  900.         // line 264
  901.         echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("home");
  902.         echo "\">
  903.                                 ";
  904.         // line 265
  905.         if (twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'265$this->source); })()), "session", [], "any"falsefalsefalse265), "get", [=> "entreprise_session_logo"], "method"falsefalsefalse265)) {
  906.             // line 266
  907.             echo "                                    <img alt=\"FDMA\" class=\"main-logo img-fluid\" src=\"/logo/";
  908.             echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'266$this->source); })()), "session", [], "any"falsefalsefalse266), "get", [=> "entreprise_session_logo"], "method"falsefalsefalse266), "html"nulltrue);
  909.             echo "\">
  910.                                 ";
  911.         } else {
  912.             // line 267
  913.             echo 
  914.                                     <img src=\"";
  915.             // line 268
  916.             echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("images/logo-admin.png"), "html"nulltrue);
  917.             echo "\"  alt=\"FDMA\" class=\"main-logo img-fluid\">
  918.                                 ";
  919.         }
  920.         // line 270
  921.         echo "                            </a>
  922.                         </div>
  923.                         <div class=\"logo-element\">
  924.                             FDMA
  925.                         </div>
  926.                     </li>
  927.                 </ul>
  928.             </div>
  929.         </nav>
  930.     ";
  931.         
  932.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
  933.         
  934.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
  935.     }
  936.     // line 290
  937.     public function block_menu2($context, array $blocks = [])
  938.     {
  939.         $macros $this->macros;
  940.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  941.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""menu2"));
  942.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  943.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""menu2"));
  944.         // line 291
  945.         echo "                    <ul class=\"nav navbar-top-links navbar-right\">
  946.                         <li>
  947.                             <span class=\"m-r-sm text-muted welcome-message\">Bienvenue sur l'admin FMDA</span>
  948.                         </li>
  949.                         <li style=\"display: none;\">
  950.                             <a href=\"";
  951.         // line 296
  952.         echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("admin_control");
  953.         echo "\" class=\"btn btn-primary admin-btn\" style=\"padding: 12px 19px;display: inline;color: #fff; margin-right: 0;\">ADMINISTRATION</a>
  954.                         </li>
  955.                         <li class=\"dropdown\">
  956.                             <button class=\"btn btn-default dropdown-toggle\" type=\"button\" id=\"dropdownMenu1\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"true\">
  957.                             ";
  958.         // line 300
  959.         if (twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'300$this->source); })()), "session", [], "any"falsefalsefalse300), "get", [=> "entreprise_session_id"], "method"falsefalsefalse300)) {
  960.             // line 301
  961.             echo "                                <span>
  962.                                     ";
  963.             // line 302
  964.             if (twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'302$this->source); })()), "session", [], "any"falsefalsefalse302), "get", [=> "entreprise_session_logo"], "method"falsefalsefalse302)) {
  965.                 // line 303
  966.                 echo "                                        <img class=\"entreprise-img\" src=\"/logo/";
  967.                 echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'303$this->source); })()), "session", [], "any"falsefalsefalse303), "get", [=> "entreprise_session_logo"], "method"falsefalsefalse303), "html"nulltrue);
  968.                 echo "\">
  969.                                     ";
  970.             } else {
  971.                 // line 304
  972.                 echo 
  973.                                         <img class=\"entreprise-img\" src=\"";
  974.                 // line 305
  975.                 echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("images/logotransfmda.png"), "html"nulltrue);
  976.                 echo "\">
  977.                                     ";
  978.             }
  979.             // line 307
  980.             echo "                                </span>
  981.                                 ";
  982.             // line 308
  983.             echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'308$this->source); })()), "session", [], "any"falsefalsefalse308), "get", [=> "entreprise_session_name"], "method"falsefalsefalse308), "html"nulltrue);
  984.             echo "
  985.                             ";
  986.         }
  987.         // line 310
  988.         echo "                            <span class=\"caret\"></span>
  989.                             </button>
  990.                             <ul class=\"dropdown-menu\" aria-labelledby=\"dropdownMenu1\">
  991.                                 ";
  992.         // line 313
  993.         if (( !(null === twig_get_attribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'313$this->source); })()), "user", [], "any"falsefalsefalse313)) && === twig_compare(twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'313$this->source); })()), "user", [], "any"falsefalsefalse313), "role", [], "any"falsefalsefalse313), "administrateur"))) {
  994.             // line 314
  995.             echo "                                    <li>
  996.                                         ";
  997.             // line 315
  998.             if (twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'315$this->source); })()), "session", [], "any"falsefalsefalse315), "get", [=> "entreprise_session_id"], "method"falsefalsefalse315)) {
  999.                 // line 316
  1000.                 echo "                                            <a href=\"javascript:void()\" class=\"openEntrepriseModal\">
  1001.                                             <span>Changer de Société</span> &nbsp <i class=\"fal fa-chevron-right\"></i>
  1002.                                             </a>
  1003.                                         ";
  1004.             }
  1005.             // line 320
  1006.             echo "                                    </li>
  1007.                                     <li role=\"separator\" class=\"divider\"></li>
  1008.                                 ";
  1009.         }
  1010.         // line 323
  1011.         echo "                                <li>
  1012.                                     <a href=\"";
  1013.         // line 324
  1014.         echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("security_logout");
  1015.         echo "\">
  1016.                                         <i class=\"fa fa-sign-out\"></i> Déconnexion
  1017.                                     </a>
  1018.                                 </li>
  1019.                             </ul>
  1020.                         </li>
  1021.                     </ul>
  1022.                     ";
  1023.         
  1024.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
  1025.         
  1026.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
  1027.     }
  1028.     // line 334
  1029.     public function block_breadcrumb($context, array $blocks = [])
  1030.     {
  1031.         $macros $this->macros;
  1032.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  1033.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""breadcrumb"));
  1034.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  1035.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""breadcrumb"));
  1036.         // line 335
  1037.         echo "            <div class=\"row wrapper border-bottom white-bg page-heading\">
  1038.                 <div class=\"col-lg-10\">
  1039.                     <h2>Accueil</h2>
  1040.                 </div>
  1041.             </div>
  1042.             ";
  1043.         
  1044.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
  1045.         
  1046.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
  1047.     }
  1048.     // line 342
  1049.     public function block_content($context, array $blocks = [])
  1050.     {
  1051.         $macros $this->macros;
  1052.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  1053.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""content"));
  1054.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  1055.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""content"));
  1056.         // line 343
  1057.         echo "                ";
  1058.         
  1059.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
  1060.         
  1061.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
  1062.     }
  1063.     // line 501
  1064.     public function block_js_import($context, array $blocks = [])
  1065.     {
  1066.         $macros $this->macros;
  1067.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  1068.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""js_import"));
  1069.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  1070.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""js_import"));
  1071.         
  1072.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
  1073.         
  1074.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
  1075.     }
  1076.     // line 532
  1077.     public function block_javascript($context, array $blocks = [])
  1078.     {
  1079.         $macros $this->macros;
  1080.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  1081.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""javascript"));
  1082.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  1083.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""javascript"));
  1084.         // line 533
  1085.         echo "    ";
  1086.         
  1087.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
  1088.         
  1089.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
  1090.     }
  1091.     // line 762
  1092.     public function block_javascript_script($context, array $blocks = [])
  1093.     {
  1094.         $macros $this->macros;
  1095.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  1096.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""javascript_script"));
  1097.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  1098.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""javascript_script"));
  1099.         // line 763
  1100.         echo "    <script type=\"text/javascript\">
  1101.         // our updatable variable objects to use globally
  1102.         let img = {};
  1103.         let position = {};
  1104.         let fieldsOcr = [
  1105.             {field:'document_id', type:'text'},
  1106.             {field:'facturedAt', type:'date'},
  1107.             {field:'dueAt', type:'date'},
  1108.             {field:'prixttc', type:'text'},
  1109.             {field:'prixht', type:'text'},
  1110.             {field:'tva', type:'select'},
  1111.             {field:'devise', type:'select'},
  1112.             {field:'fournisseur', type:'select'},
  1113.             {field:'client', type:'select'},
  1114.             {field:'chantier', type:'select'},
  1115.             {field:'devis', type:'select'},
  1116.             {field:'lot', type:'text'},
  1117.             {field:'rossum_document_id', type:'text'},
  1118.             {field:'status', type:'select'},
  1119.             {field:'code_compta', type:'text'},
  1120.             {field:'utilisateur', type:'select'},
  1121.             {field:'conges_paye', type:'text'},
  1122.             {field:'heure_sup_1', type:'text'},
  1123.             {field:'heure_sup_2', type:'text'},
  1124.             {field:'heure_normale', type:'text'},
  1125.             {field:'trajet', type:'text'},
  1126.             {field:'panier', type:'text'},
  1127.             {field:'cout_global', type:'text'},
  1128.             {field:'salaire_net', type:'text'},
  1129.             {field:'date_paie', type:'text'},
  1130.         ];
  1131.         let moisObject = [
  1132.             {mois:'janvier', num:'01'},
  1133.             {mois:'fevrier', num:'02'},
  1134.             {mois:'mars', num:'03'},
  1135.             {mois:'avril', num:'04'},
  1136.             {mois:'mai', num:'05'},
  1137.             {mois:'juin', num:'06'},
  1138.             {mois:'juillet', num:'07'},
  1139.             {mois:'août', num:'08'},
  1140.             {mois:'septembre', num:'09'},
  1141.             {mois:'octobre', num:'10'},
  1142.             {mois:'novembre', num:'11'},
  1143.             {mois:'decembre', num:'12'},
  1144.         ];
  1145.         let tabDay = ['lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi', 'dimanche'];
  1146.         \$fieldPreference = [];
  1147.         ";
  1148.         // line 814
  1149.         if ((isset($context["fieldPreference"]) || array_key_exists("fieldPreference"$context))) {
  1150.             // line 815
  1151.             echo "            \$fieldPreference = ";
  1152.             echo json_encode((isset($context["fieldPreference"]) || array_key_exists("fieldPreference"$context) ? $context["fieldPreference"] : (function () { throw new RuntimeError('Variable "fieldPreference" does not exist.'815$this->source); })()));
  1153.             echo ";
  1154.         ";
  1155.         }
  1156.         // line 817
  1157.         echo "
  1158.         // image matrix function to update img object variable
  1159.         function imgMatrix() {
  1160.           // our image object inside area
  1161.           let \$img = \$('.document-container');
  1162.           // offset data of image
  1163.           let offset = \$img.offset();
  1164.           // add/update object key data
  1165.           img.width = \$img.outerWidth();
  1166.           img.height = \$img.outerHeight();
  1167.           img.offsetX = offset.left - \$(document).scrollLeft();
  1168.           img.offsetY = offset.top - \$(document).scrollTop();
  1169.         }
  1170.         // position matrix function to update position object variable
  1171.         function positionMatrix(e, mousedown = false) {
  1172.           // if mousedown param is true... for use in 
  1173.           if (mousedown) {
  1174.             // set the top/left position object data with percentage position
  1175.             position.top = (100 / img.height) * ( (e.pageY - \$(document).scrollTop()) - img.offsetY);
  1176.             position.left = (100 / img.width) * ( (e.pageX - \$(document).scrollLeft()) - img.offsetX);
  1177.           }
  1178.           // set the right/bottom position object data with percentage position
  1179.           position.right = 100 - ((100 / img.width) * ((e.pageX - \$(document).scrollLeft()) - img.offsetX));
  1180.           position.bottom = 100 - ((100 / img.height) * ((e.pageY - \$(document).scrollTop()) - img.offsetY));
  1181.         }
  1182.         // mouse move event function in area div
  1183.         \$(document).on('mousemove', '.document-container', function(e) {
  1184.           // / update img object variable data upon this mousemove event
  1185.           imgMatrix();
  1186.           // if this area has draw class
  1187.           if (\$(this).hasClass('draw')) {
  1188.             // update position object variable data passing current event data
  1189.             positionMatrix(e);
  1190.             // if image x cursor drag position percent is negative to mousedown x position
  1191.             if ((100 - position.bottom) < position.top) {
  1192.               // update rectange x negative positions css
  1193.               \$('.rect', this).css({
  1194.                 top: (100 - position.bottom) + '%',
  1195.                 bottom: (100 - position.top) + '%'
  1196.               });
  1197.               // else if image x cursor drag position percent is positive to mousedown x position
  1198.             } else {
  1199.               // update rectange x positive positions css
  1200.               \$('.rect', this).css({
  1201.                 bottom: position.bottom + '%',
  1202.                 top: position.top + '%',
  1203.               });
  1204.             }
  1205.             // if image y cursor drag position percent is negative to mousedown y position
  1206.             if ((100 - position.right) < position.left) {
  1207.               // update rectange y negative positions css
  1208.               \$('.rect', this).css({
  1209.                 left: (100 - position.right) + '%',
  1210.                 right: (100 - position.left) + '%'
  1211.               });
  1212.               // else if image y cursor drag position percent is positive to mousedown y position
  1213.             } else {
  1214.               // update rectange y positive positions css
  1215.               \$('.rect', this).css({
  1216.                 right: position.right + '%',
  1217.                 left: position.left + '%'
  1218.               });
  1219.             }
  1220.           }
  1221.         });
  1222.         function lineDistance(x, y, x0, y0){
  1223.             return Math.sqrt((x -= x0) * x + (y -= y0) * y);
  1224.         };
  1225.         // mouse down event function in area div
  1226.         \$(document).on('mousedown', '.doc-img', function(e) {
  1227.             \$('.rect').css('display', 'block');
  1228.             var parent = \$(this).parent('.document-container').get(0);
  1229.           // remove the drawn class
  1230.           \$(parent).removeClass('drawn');
  1231.           // update img object variable data upon this mousedown event
  1232.           imgMatrix();
  1233.           // update position object variable data passing current event data and mousedown param as true 
  1234.           positionMatrix(e, true);
  1235.           // update rectange xy positions css
  1236.           \$('.rect', parent).css({
  1237.             left: position.left + '%',
  1238.             top: position.top + '%',
  1239.             right: position.right + '%',
  1240.             bottom: position.bottom + '%'
  1241.           });
  1242.           // add draw class to area div to reveal rectangle
  1243.           \$(parent).addClass('draw');
  1244.         });
  1245.         // mouse up event function in area div
  1246.         \$(document).on('mouseup', '.document-container', function(e) {
  1247.           // update img object variable data upon this mouseup event
  1248.           imgMatrix();
  1249.           // if this area had draw class
  1250.           if (\$(this).hasClass('draw')) {
  1251.             // update position object variable data passing current event
  1252.             positionMatrix(e);
  1253.             // math trunc on position values if x and y values are equal, basically no drawn rectangle on mouseup event
  1254.             if ((Math.trunc(position.left) === Math.trunc(100 - position.right)) && (Math.trunc(position.top) === Math.trunc(100 - position.bottom))) {
  1255.               
  1256.               // remove draw and drawn classes
  1257.               \$(this).removeClass('draw drawn');
  1258.             // else if x and y values are not equal, basically a rectange has been drawn
  1259.             } else {
  1260.               // add drawn class and remove draw class
  1261.               \$(this).addClass('drawn').removeClass('draw');
  1262.             }
  1263.           }
  1264.             \$parentContent = \$('.document-container').get(0).getBoundingClientRect();
  1265.             \$rect = \$('.rect').get(0).getBoundingClientRect();
  1266.             position.left = convertToPourcentage(\$parentContent.width, (\$rect.left - \$parentContent.left));
  1267.             position.top = convertToPourcentage(\$parentContent.height, (\$rect.top - \$parentContent.top));
  1268.             position.width = convertToPourcentage(\$parentContent.width, \$rect.width);
  1269.             position.height = convertToPourcentage(\$parentContent.height, \$rect.height);
  1270.             /*if( convertToPourcentage(\$parentContent.width, \$rect.width) > convertToPourcentage(\$parentContent.width, 20)){*/
  1271.             if(true){
  1272.                 /*\$('#popTextExtract').modal('show');*/
  1273.                 groupTextByPosition(position);
  1274.                 \$('.btn-ajuster').css('display', 'inline-block');
  1275.             }
  1276.         });
  1277.         // on window resize function
  1278.         \$(window).on('resize', function(e) {
  1279.           // update img object variable data upon this window resize event
  1280.           imgMatrix();
  1281.         });
  1282.         \$('.ocr-field').click(function(e){
  1283.             \$('.ocr-field').removeClass('active');
  1284.             \$(this).addClass('active');
  1285.         });
  1286.         
  1287.         function convertToPourcentage(parentContent, toConvert){
  1288.             return (toConvert*100) / parentContent ;
  1289.         }
  1290.         function appendText(data, position = {}, dossier = \"\"){
  1291.             \$parentfieldSelect = \$('.ocr-field.active');
  1292.             index = fieldsOcr.findIndex(x => x.field === \$parentfieldSelect.data('field'));
  1293.             \$fieldSelect = \$parentfieldSelect.find('.field');
  1294.             var cordonnee =  position.left+'-'+position.top+'-'+position.width+'-'+position.height;
  1295.             var type = \"\";
  1296.             if( index > -1 ){
  1297.                 type = fieldsOcr[index]['type'];
  1298.             }
  1299.             if(type == 'text'){
  1300.                 \$fieldSelect.val(data);
  1301.                 \$( \".field-number\" ).trigger( \"blur\" );
  1302.             }
  1303.             else if(type == 'date'){
  1304.                 \$field = fieldsOcr[index]['field'];
  1305.                 console.log([index, \$field, \$fieldPreference]);
  1306.                 dateFormat = \$fieldPreference[\$field].type;
  1307.                 formattedDate = rebuildDate(data, dateFormat);
  1308.                 if(formattedDate != \"\")
  1309.                     \$fieldSelect.val(formattedDate);
  1310.             }
  1311.             else if(type == 'select'){
  1312.                 \$('.row-suggession').css('display', 'none');
  1313.                 \$field = fieldsOcr[index]['field'];
  1314.                 if(\$field == \"fournisseur\"){
  1315.                     \$('#achat_fournisseur').val(data.fournisseur);
  1316.                     \$('#achat_code_compta').val(data.code_compta);
  1317.                     \$('#achat_lot').val(data.lot);
  1318.                     \$('.row-suggession').css('display', 'block');
  1319.                     \$listSuggestion = \"\";
  1320.                     \$.each(data.fournisseurfound, function( index, value ) {
  1321.                       \$listSuggestion += \"<option>\"+value.nom+\"</option>\";
  1322.                     });
  1323.                     \$('.field-suggession').html(\$listSuggestion);
  1324.                 }
  1325.                 if(\$field == \"client\"){
  1326.                     \$('#vente_client').val(data.client);
  1327.                     \$('#vente_lot').val(data.lot);
  1328.                     \$('.row-suggession').css('display', 'block');
  1329.                     \$listSuggestion = \"\";
  1330.                     \$.each(data.fournisseurfound, function( index, value ) {
  1331.                       \$listSuggestion += \"<option>\"+value.nom+\"</option>\";
  1332.                     });
  1333.                     \$('.field-suggession').html(\$listSuggestion);
  1334.                 }
  1335.                 if(\$field == \"utilisateur\"){
  1336.                     \$fieldSelect.val(data.utilisateur);
  1337.                 }
  1338.                 else if(\$field == \"chantier\"){
  1339.                     \$fieldSelect.val(data.chantier);
  1340.                     if(dossier == \"achat\"){
  1341.                         \$.ajax({
  1342.                             url: \"";
  1343.         // line 1059
  1344.         echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("devis_client_get_by_chantier_import");
  1345.         echo "\",
  1346.                             type: \"POST\",
  1347.                             dataType: \"json\",
  1348.                             async: true,
  1349.                             data: {
  1350.                                 chantier_id: data.chantier
  1351.                             },
  1352.                             success: function(response) {
  1353.                                 if(response.status == 200){
  1354.                                     console.log(response.devis);
  1355.                                     var OPTIONS = \"<option></option>\";
  1356.                                     \$.each(response.devis, function( index, value ) {
  1357.                                         OPTIONS += \"<option value=\"+value.id+\">\"+value.label+\"</option>\";
  1358.                                     });
  1359.                                     \$('#achat_devis').html(OPTIONS);
  1360.                                 }
  1361.                                 else if(response.status == 500){
  1362.                                     toastr.error(response.message);
  1363.                                 }
  1364.                                 \$('.loader-container').css('display','none');
  1365.                             },
  1366.                             error: function(xhr, textStatus, errorThrown) {
  1367.                               console.log(errorThrown);
  1368.                               \$('.loader-container').css('display','none');
  1369.                             }
  1370.                         });
  1371.                     }
  1372.                 }
  1373.                 else if(\$field == \"devise\"){
  1374.                     \$fieldSelect.val(data.devise);
  1375.                 }
  1376.                 else if(\$field == \"tva\"){
  1377.                     \$fieldSelect.val(data.tva);
  1378.                 }
  1379.             }
  1380.             \$parentfieldSelect.find('input.field_identite').val(cordonnee);
  1381.         }
  1382.         function rebuildDate(text, dateFormat){
  1383.             text = replaceAll(text, ',', '');
  1384.             if (text.indexOf('/') <= -1){
  1385.                 text = replaceAll(text, '.', '/');
  1386.                 text = replaceAll(text, '-', '/');
  1387.                 text = replaceAll(text, ' ', '/');
  1388.             }
  1389.             else{
  1390.                 text = replaceAll(text, '.', '');
  1391.                 text = replaceAll(text, '-', '');
  1392.                 text = replaceAll(text, ' ', '');
  1393.             }
  1394.             
  1395.             var dateTab = text.split('/');
  1396.             var formattedDate = \"\";
  1397.             
  1398.             if(dateTab.length >= 3){
  1399.                 if(tabDay.includes(dateTab[0].toLowerCase())){
  1400.                     dateTab.shift(); 
  1401.                     var day = pad2(dateTab[0]);
  1402.                     indexMois = moisObject.findIndex(x => x.mois === (dateTab[1]).toLowerCase());
  1403.                     if( indexMois > -1 ){
  1404.                         var month = moisObject[indexMois]['num'];
  1405.                     }
  1406.                 }
  1407.                 else{
  1408.                     var day = pad2(dateTab[0]); 
  1409.                     indexMois = moisObject.findIndex(x => x.mois === (dateTab[1]).toLowerCase());
  1410.                     if( indexMois > -1 ){
  1411.                         var month = moisObject[indexMois]['num'];
  1412.                     }
  1413.                     else{
  1414.                         var month = pad2(dateTab[1]);
  1415.                     }
  1416.                 }
  1417.                 var year = dateTab[2];
  1418.                 if(year.length  == 2)
  1419.                     year = \"20\"+year;
  1420.                 
  1421.                 formattedDate =  year+\"-\"+month+\"-\"+day;
  1422.             }
  1423.             return formattedDate;
  1424.         }
  1425.         function replaceAll(str, find, replace) {
  1426.             var escapedFind=find.replace(/([.*+?^=!:\${}()|\\[\\]\\/\\\\])/g, \"\\\\\$1\");
  1427.             return str.replace(new RegExp(escapedFind, 'g'), replace);
  1428.         }
  1429.         function pad2(n) {
  1430.             return (n.length  < 2 ? '0' : '') + n;
  1431.         }
  1432.         \$(document).on('input', 'input.float', function() {
  1433.             this.value = this.value.replace(/[^0-9.,]/g, '').replace(/(\\..*?)\\..*/g, '\$1');
  1434.             this.value = this.value.replace(',', '.');
  1435.         });
  1436.     </script>
  1437. ";
  1438.         
  1439.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
  1440.         
  1441.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
  1442.     }
  1443.     public function getTemplateName()
  1444.     {
  1445.         return "base.html.twig";
  1446.     }
  1447.     public function isTraitable()
  1448.     {
  1449.         return false;
  1450.     }
  1451.     public function getDebugInfo()
  1452.     {
  1453.         return array (  1526 => 1059,  1282 => 817,  1276 => 815,  1274 => 814,  1221 => 763,  1211 => 762,  1201 => 533,  1191 => 532,  1173 => 501,  1163 => 343,  1153 => 342,  1138 => 335,  1128 => 334,  1110 => 324,  1107 => 323,  1102 => 320,  1096 => 316,  1094 => 315,  1091 => 314,  1089 => 313,  1084 => 310,  1079 => 308,  1076 => 307,  1071 => 305,  1068 => 304,  1062 => 303,  1060 => 302,  1057 => 301,  1055 => 300,  1048 => 296,  1041 => 291,  1031 => 290,  1011 => 270,  1006 => 268,  1003 => 267,  997 => 266,  995 => 265,  991 => 264,  984 => 259,  974 => 258,  964 => 205,  954 => 204,  920 => 18,  910 => 17,  891 => 1161,  889 => 762,  792 => 668,  713 => 592,  691 => 573,  665 => 550,  647 => 537,  642 => 534,  640 => 532,  630 => 524,  621 => 522,  616 => 521,  607 => 519,  602 => 518,  593 => 516,  588 => 515,  579 => 513,  575 => 512,  564 => 503,  562 => 501,  494 => 436,  488 => 433,  482 => 430,  478 => 429,  471 => 425,  467 => 424,  463 => 423,  459 => 422,  454 => 420,  394 => 363,  389 => 360,  383 => 357,  368 => 344,  366 => 342,  363 => 341,  361 => 334,  357 => 332,  355 => 290,  344 => 281,  342 => 258,  288 => 206,  286 => 204,  110 => 31,  106 => 30,  102 => 29,  98 => 28,  94 => 27,  87 => 23,  83 => 21,  81 => 17,  76 => 15,  66 => 7,  64 => 6,  61 => 5,  59 => 4,  57 => 3,  53 => 1,);
  1454.     }
  1455.     public function getSourceContext()
  1456.     {
  1457.         return new Source("
  1458. {% set emailComptableConfig = render(controller('App\\\\Controller\\\\MetaConfigController::getConfigMeta', { 'key': 'cabinet_comptable' })) %}
  1459. {% set baseUrl = render(controller('App\\\\Controller\\\\HomeController::getBaseUrl', {})) %}
  1460. {% set base_api_ocr_url = \"https://dockeo.fr\" %}
  1461. <!DOCTYPE html>
  1462. <html>
  1463. <head>
  1464.     <meta charset=\"utf-8\">
  1465.     <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">
  1466.     <link rel=\"icon\" type=\"image/ico\" href=\"{{ asset('favicon.ico') }}\"/>
  1467.     {% block seo %}
  1468.         <title>{% block title %} {{ app.session.get('entreprise_session_name') }}  {% endblock %}</title>
  1469.         <meta name=\"description\" content=\"\"/>
  1470.     {% endblock %}
  1471.     <link rel=\"stylesheet\" href=\"https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css\" integrity=\"sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu\" crossorigin=\"anonymous\">
  1472.     <link href=\"{{ asset('vendor/@fortawesome/fontawesome-free/css/fontawesome.css') }}\" rel=\"stylesheet\">
  1473.     <link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.3/photoswipe.min.css\"/>
  1474.     <link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.3/default-skin/default-skin.css\"/>
  1475.     <link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/limonte-sweetalert2/11.1.9/sweetalert2.min.css\" referrerpolicy=\"no-referrer\" />
  1476.     <link href=\"{{ asset('vendor/iCheck/custom.css') }}\" rel=\"stylesheet\">
  1477.     <link href=\"{{ asset('vendor/animate.css/animate.css') }}\" rel=\"stylesheet\">
  1478.     <link href=\"{{ asset('css/style.css') }}\" rel=\"stylesheet\">
  1479.     <link rel=\"stylesheet\" href=\"{{ asset('vendor/toastr/toastr.min.css') }}\"/>
  1480.     <script src=\"{{ asset('js/jquery-3.1.1.min.js') }}\"></script>
  1481.     <style type=\"text/css\">
  1482.         
  1483.         .sf-minitoolbar, .sf-toolbarreset{display:none}
  1484.         .inline-text{
  1485.           overflow: hidden;
  1486.           text-overflow: ellipsis;
  1487.           white-space: nowrap;
  1488.         }
  1489.         body::-webkit-scrollbar {
  1490.             width: .75rem;
  1491.         }
  1492.         *::-webkit-scrollbar-track {
  1493.             background-color: #edf2f7;
  1494.         }
  1495.         *::-webkit-scrollbar-thumb {
  1496.             background-color: #718096;
  1497.             border-radius: 9999px;
  1498.         }
  1499.         body {
  1500.             scrollbar-width: thin;
  1501.             /* The color of thumb and track areas */
  1502.             scrollbar-color: #718096 #edf2f7;
  1503.         }
  1504.         .modal-body {
  1505.             padding: 20px 60px 57px 60px;
  1506.         }
  1507.         .pagination-block{
  1508.             text-align: center;
  1509.             margin-bottom: 40px;
  1510.         }
  1511.         .entreprise-list{
  1512.             margin-top: 38px;
  1513.         }
  1514.         .loader-container{display: none;align-items: center;justify-content: center;}
  1515.         .switch-entreprise.entreprise-item {
  1516.             display: flex;
  1517.             align-items: center;
  1518.             justify-content: space-between;
  1519.             border: 1px solid #dcdcdc;
  1520.             padding: 4px 12px;
  1521.             font-size: 11px;
  1522.             border-radius: 5px;
  1523.             margin-top: 7px;
  1524.             color: #888;
  1525.             font-weight: bold;
  1526.         }
  1527.         .switch-entreprise.entreprise-item.active, .switch-entreprise.entreprise-item:hover {
  1528.             border-color: #14c179;
  1529.             background: #14c179;
  1530.             color: #fff;
  1531.         }
  1532.         .entreprise-img{
  1533.             width: 35px;
  1534.             height: 35px;
  1535.             border-radius: 100%;
  1536.             margin-right: 8px;
  1537.             /*background-color: #18a689;*/
  1538.             object-fit: cover;
  1539.             border: 2px solid #18a689;
  1540.         }
  1541.         .navbar-top-links {
  1542.             text-align: right;
  1543.             margin-right: 8px;
  1544.             margin-top: 8px;
  1545.         }
  1546.         .showDocument{cursor: pointer;}
  1547.         .main-logo{
  1548.             object-fit: contain;
  1549.             width: 174px;
  1550.             margin: auto;
  1551.             display: block;
  1552.         }
  1553.         .footer{position: fixed;}
  1554.         .nav.navbar-top-links > li > a.admin-btn:hover, .nav.navbar-top-links > li > a.admin-btn:focus{
  1555.             background-color: #1ab394;
  1556.             border-color: #1ab394;
  1557.         }
  1558.         .custom-dropdown {
  1559.           display: inline-block;
  1560.           position: relative;
  1561.         }
  1562.         .custom-dropdown .dd-button {
  1563.           display: inline-block;
  1564.           border: 1px solid gray;
  1565.           border-radius: 4px;
  1566.           padding: 7px 28px 7px 4px;
  1567.           background-color: #ffffff;
  1568.           cursor: pointer;
  1569.           white-space: nowrap;
  1570.         }
  1571.         .dd-button:after {
  1572.           content: '';
  1573.           position: absolute;
  1574.           top: 50%;
  1575.           right: 15px;
  1576.           transform: translateY(-50%);
  1577.           width: 0; 
  1578.           height: 0; 
  1579.           border-left: 5px solid transparent;
  1580.           border-right: 5px solid transparent;
  1581.           border-top: 5px solid black;
  1582.         }
  1583.         .dd-button:hover {
  1584.           background-color: #eeeeee;
  1585.         }
  1586.         .dd-input {
  1587.           display: none;
  1588.         }
  1589.         .dd-menu {
  1590.           position: absolute;
  1591.           top: 100%;
  1592.           border: 1px solid #ccc;
  1593.           border-radius: 4px;
  1594.           padding: 0;
  1595.           margin: 2px 0 0 0;
  1596.           box-shadow: 0 0 6px 0 rgba(0,0,0,0.1);
  1597.           background-color: #ffffff;
  1598.           list-style-type: none;
  1599.         }
  1600.         .dd-input + .dd-menu {
  1601.           display: none;
  1602.         } 
  1603.         .dd-input:checked + .dd-menu {
  1604.           display: block;
  1605.         } 
  1606.         .dd-menu li {
  1607.           padding: 10px 20px;
  1608.           cursor: pointer;
  1609.           white-space: nowrap;
  1610.           cursor: pointer;
  1611.         }
  1612.         .dd-menu li:hover {
  1613.           background-color: #f6f6f6;
  1614.         }
  1615.         .btn-config-colonne{
  1616.             cursor: pointer;
  1617.             font-size: 20px;
  1618.         }
  1619.         .column-container {
  1620.             position: absolute;
  1621.             border: 1px solid #ccc;
  1622.             padding: 13px;
  1623.             border-radius: 5px;
  1624.             width: 260px;
  1625.             top: 59px;
  1626.             box-shadow: 0px 1px 1px 3px rgb(183 183 190 / 20%);
  1627.             background: #fff;
  1628.             left: 0;
  1629.             z-index: 9;
  1630.             display: none;
  1631.         }
  1632.         .column-item label.column-label{
  1633.             display: flex;
  1634.             margin-bottom: 10px;
  1635.         }
  1636.         .column-item .column-libelle{
  1637.             margin-left: 14px;
  1638.         }
  1639.     </style>
  1640.     {% block css %}
  1641.     {% endblock %}
  1642. </head>
  1643. <body style=\"-webkit-print-color-adjust: exact;\">
  1644. <!-- Root element of PhotoSwipe. Must have class pswp. -->
  1645. <div class=\"pswp\" tabindex=\"-1\" role=\"dialog\" aria-hidden=\"true\">
  1646.   <!-- Background of PhotoSwipe. 
  1647.            It's a separate element as animating opacity is faster than rgba(). -->
  1648.   <div class=\"pswp__bg\"></div>
  1649.   <!-- Slides wrapper with overflow:hidden. -->
  1650.   <div class=\"pswp__scroll-wrap\">
  1651.     <!-- Container that holds slides. 
  1652.               PhotoSwipe keeps only 3 of them in the DOM to save memory.
  1653.               Don't modify these 3 pswp__item elements, data is added later on. -->
  1654.     <div class=\"pswp__container\">
  1655.       <div class=\"pswp__item\"></div>
  1656.       <div class=\"pswp__item\"></div>
  1657.       <div class=\"pswp__item\"></div>
  1658.     </div>
  1659.     <!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
  1660.     <div class=\"pswp__ui pswp__ui--hidden\">
  1661.       <div class=\"pswp__top-bar\">
  1662.         <!--  Controls are self-explanatory. Order can be changed. -->
  1663.         <div class=\"pswp__counter\"></div>
  1664.         <button class=\"pswp__button pswp__button--close\" title=\"Fermer (Esc)\"></button>
  1665.         <button class=\"pswp__button pswp__button--share\" title=\"Partager\"></button>
  1666.         <button class=\"pswp__button pswp__button--fs\" title=\"Plein Ã©cran\"></button>
  1667.         <button class=\"pswp__button pswp__button--zoom\" title=\"Zoom +/-\"></button>
  1668.         <!-- Preloader demo https://codepen.io/dimsemenov/pen/yyBWoR -->
  1669.         <!-- element will get class pswp__preloader--active when preloader is running -->
  1670.         <div class=\"pswp__preloader\">
  1671.           <div class=\"pswp__preloader__icn\">
  1672.             <div class=\"pswp__preloader__cut\">
  1673.               <div class=\"pswp__preloader__donut\"></div>
  1674.             </div>
  1675.           </div>
  1676.         </div>
  1677.       </div>
  1678.       <div class=\"pswp__share-modal pswp__share-modal--hidden pswp__single-tap\">
  1679.         <div class=\"pswp__share-tooltip\"></div>
  1680.       </div>
  1681.       <button class=\"pswp__button pswp__button--arrow--left\" title=\"Précedent\">
  1682.       </button>
  1683.       <button class=\"pswp__button pswp__button--arrow--right\" title=\"Suivant\">
  1684.       </button>
  1685.       <div class=\"pswp__caption\">
  1686.         <div class=\"pswp__caption__center\"></div>
  1687.       </div>
  1688.     </div>
  1689.   </div>
  1690. </div>
  1691. <div id=\"wrapper\">
  1692.     {% block menu1 %}
  1693.         <nav class=\"navbar-default navbar-static-side\" role=\"navigation\" style=\"margin-bottom: 49px;\">
  1694.             <div class=\"sidebar-collapse\">
  1695.                 <ul class=\"nav metismenu\" id=\"side-menu\">
  1696.                     <li class=\"nav-header\">
  1697.                         <div class=\"profile-element\">
  1698.                             <a href=\"{{path('home')}}\">
  1699.                                 {% if app.session.get('entreprise_session_logo') %}
  1700.                                     <img alt=\"FDMA\" class=\"main-logo img-fluid\" src=\"/logo/{{app.session.get('entreprise_session_logo')}}\">
  1701.                                 {% else %} 
  1702.                                     <img src=\"{{ asset('images/logo-admin.png') }}\"  alt=\"FDMA\" class=\"main-logo img-fluid\">
  1703.                                 {% endif %}
  1704.                             </a>
  1705.                         </div>
  1706.                         <div class=\"logo-element\">
  1707.                             FDMA
  1708.                         </div>
  1709.                     </li>
  1710.                 </ul>
  1711.             </div>
  1712.         </nav>
  1713.     {% endblock %}
  1714.         <div id=\"page-wrapper\" class=\"gray-bg\">
  1715.             <div class=\"row border-bottom\">
  1716.                 <nav class=\"navbar navbar-static-top\" role=\"navigation\" style=\"margin-bottom: 0\">
  1717.                     <div class=\"navbar-header\">
  1718.                         <a class=\"navbar-minimalize minimalize-styl-2 btn btn-primary \" href=\"#\"><i class=\"fa fa-bars\"></i> </a>
  1719.                     </div>
  1720.                     <div class=\"navbar-header\">
  1721.                     </div>
  1722.                     {% block menu2 %}
  1723.                     <ul class=\"nav navbar-top-links navbar-right\">
  1724.                         <li>
  1725.                             <span class=\"m-r-sm text-muted welcome-message\">Bienvenue sur l'admin FMDA</span>
  1726.                         </li>
  1727.                         <li style=\"display: none;\">
  1728.                             <a href=\"{{path('admin_control')}}\" class=\"btn btn-primary admin-btn\" style=\"padding: 12px 19px;display: inline;color: #fff; margin-right: 0;\">ADMINISTRATION</a>
  1729.                         </li>
  1730.                         <li class=\"dropdown\">
  1731.                             <button class=\"btn btn-default dropdown-toggle\" type=\"button\" id=\"dropdownMenu1\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"true\">
  1732.                             {% if app.session.get('entreprise_session_id') %}
  1733.                                 <span>
  1734.                                     {% if app.session.get('entreprise_session_logo') %}
  1735.                                         <img class=\"entreprise-img\" src=\"/logo/{{app.session.get('entreprise_session_logo')}}\">
  1736.                                     {% else %} 
  1737.                                         <img class=\"entreprise-img\" src=\"{{asset('images/logotransfmda.png')}}\">
  1738.                                     {% endif %}
  1739.                                 </span>
  1740.                                 {{ app.session.get('entreprise_session_name') }}
  1741.                             {% endif %}
  1742.                             <span class=\"caret\"></span>
  1743.                             </button>
  1744.                             <ul class=\"dropdown-menu\" aria-labelledby=\"dropdownMenu1\">
  1745.                                 {% if app.user is not null and app.user.role == \"administrateur\" %}
  1746.                                     <li>
  1747.                                         {% if app.session.get('entreprise_session_id') %}
  1748.                                             <a href=\"javascript:void()\" class=\"openEntrepriseModal\">
  1749.                                             <span>Changer de Société</span> &nbsp <i class=\"fal fa-chevron-right\"></i>
  1750.                                             </a>
  1751.                                         {% endif %}
  1752.                                     </li>
  1753.                                     <li role=\"separator\" class=\"divider\"></li>
  1754.                                 {% endif %}
  1755.                                 <li>
  1756.                                     <a href=\"{{ path('security_logout') }}\">
  1757.                                         <i class=\"fa fa-sign-out\"></i> Déconnexion
  1758.                                     </a>
  1759.                                 </li>
  1760.                             </ul>
  1761.                         </li>
  1762.                     </ul>
  1763.                     {% endblock %}
  1764.                 </nav>
  1765.             </div>
  1766.             {% block breadcrumb %}
  1767.             <div class=\"row wrapper border-bottom white-bg page-heading\">
  1768.                 <div class=\"col-lg-10\">
  1769.                     <h2>Accueil</h2>
  1770.                 </div>
  1771.             </div>
  1772.             {% endblock %}
  1773.             <div class=\"wrapper wrapper-content animated fadeInRight\">
  1774.                 {% block content %}
  1775.                 {% endblock %}
  1776.             </div>
  1777.             <div class=\"footer\">
  1778.                 <div class=\"float-right\">
  1779.                 </div>
  1780.                 <div>
  1781.                     <strong>Copyright</strong> FMDA &copy; 2020
  1782.                 </div>
  1783.             </div>
  1784.             <div class=\"modal-entreprise-container\">
  1785.                 <div id=\"modalEntreprise\" class=\"modal fade\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"myModalLabel\">
  1786.                     <div class=\"modal-dialog\" role=\"document\">
  1787.                         <div class=\"modal-content\">
  1788.                             <div class=\"modal-header\" style=\"border: none;\">
  1789.                                 {% if app.session.get('entreprise_session_id') %} 
  1790.                                     <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\"><span aria-hidden=\"true\" style=\"position: absolute;right: 14px;top: 10px;\">&times;</span></button>
  1791.                                 {% endif %}
  1792.                             </div>
  1793.                             <div class=\"modal-body row entreprise-container\">
  1794.                                 <div class=\"loader-container\">
  1795.                                     <img src=\"{{asset('images/loading.gif')}}\" style=\"width: 54px;\">
  1796.                                 </div>
  1797.                             </div>
  1798.                         </div>
  1799.                     </div>
  1800.                 </div>
  1801.             </div>
  1802.             <div id=\"modalDocumentShow\" class=\"modal fade bs-example-modal-lg\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"myLargeModalLabel\">
  1803.                 <div class=\"modal-dialog modal-lg\" role=\"document\">
  1804.                     <div class=\"modal-content\">
  1805.                         <div class=\"modal-header\" style=\"border: none;\">
  1806.                             <!-- <div class=\"text-center\">
  1807.                                 <label class=\"custom-dropdown\" id=\"btnRotation\" style=\"display: none;z-index: 10\">
  1808.                                   <div class=\"dd-button\">&nbsp
  1809.                                     Orientation <i class=\"fad fa-redo\"></i>&nbsp
  1810.                                   </div>
  1811.                                   <input type=\"checkbox\" class=\"dd-input\" id=\"test\">
  1812.                                   <ul class=\"dd-menu\">
  1813.                                     <li class=\"rotationChoice\" data-rotation=\"90\" data-pdf=\"\">rotation 90</li>
  1814.                                     <li class=\"rotationChoice\" data-rotation=\"180\" data-pdf=\"\">rotation 180</li>
  1815.                                     <li class=\"rotationChoice\" data-rotation=\"270\" data-pdf=\"\">rotation 270</li>
  1816.                                   </ul>
  1817.                                 </label>
  1818.                             </div> -->
  1819.                             <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\" style=\"position: absolute;top: 11px; right: 15px;\"><span aria-hidden=\"true\">&times;</span></button>
  1820.                         </div>
  1821.                         <div class=\"modal-body text-center\">
  1822.                             <h3 class=\"text-center no-document\" style=\"display: none;\">Aucun document rattaché.</h3>
  1823.                             <div class=\"documentFile-container\" style=\"display: none;\">
  1824.                             </div>
  1825.                         </div>
  1826.                     </div>
  1827.                 </div>
  1828.             </div>
  1829.             <div id=\"modalScoreIa\" class=\"modal fade bs-example-modal-sm modal-center\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"mySmallModalLabel\">
  1830.               <div class=\"modal-dialog modal-sm\" role=\"document\">
  1831.                 <div class=\"modal-content\">
  1832.                     <div class=\"modal-header\" style=\"border: none;\">
  1833.                         <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button>
  1834.                         <h4 class=\"modal-title text-center\" id=\"gridSystemModalLabel\" style=\"padding-top: 27px;\">
  1835.                           <span style=\"color: red\">ATTENTION RECONNAISSANCE INFERIEUR A 20% !!!</span> <br><br>Ce document est succeptible de n'avoir aucun modèle de reconnaissance IA enregistré. <br>Vous devrez selectionner manuellement les champs sur ce document
  1836.                         </h4>
  1837.                     </div>
  1838.                     <div class=\"modal-body text-center\">
  1839.                         <button type=\"button\" class=\"btn btn-primary\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\">OK</button>
  1840.                     </div>
  1841.                 </div>
  1842.               </div>
  1843.             </div>
  1844.         </div>
  1845. </div>
  1846. <!-- Mainly scripts -->
  1847. <script src=\"{{ asset('vendor/popper.js/dist/umd/popper.js') }}\"></script>
  1848. <script src=\"https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js\" integrity=\"sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd\" crossorigin=\"anonymous\"></script>
  1849. <script src=\"{{ asset('vendor/metisMenu/jquery.metisMenu.js') }}\"></script>
  1850. <script src=\"{{ asset('vendor/slimscroll/jquery.slimscroll.min.js') }}\"></script>
  1851. <script src=\"{{ asset('vendor/peity/jquery.peity.min.js') }}\"></script>
  1852. <script src=\"{{ asset('vendor/toastr/toastr.min.js') }}\"></script>
  1853. <script src=\"https://cdn.jsdelivr.net/npm/sweetalert2@11.4.10/dist/sweetalert2.all.min.js\"></script>
  1854. <!-- Custom and plugin javascript -->
  1855. <script src=\"{{ asset('js/inspinia.js') }}\"></script>
  1856. <script src=\"{{ asset('vendor/pace/pace.min.js') }}\"></script>
  1857. <script type=\"text/javascript\" src=\"https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.15.6/xlsx.core.min.js\"></script>
  1858. <script type=\"text/javascript\" src=\"{{ asset('vendor/excelplus-2.5.min.js') }}\"></script>
  1859. <!-- iCheck --> 
  1860. <script src=\"{{ asset('vendor/iCheck/icheck.min.js') }}\"></script>
  1861. <script type=\"text/javascript\">
  1862.     var currentRotation = 0;
  1863.     \$(document).ready(function(){
  1864.         \$(\".btn-config-colonne\").click(function(){
  1865.             \$(\".column-container\").slideToggle();
  1866.         });
  1867.     });
  1868.     \$(document).mouseup(function(e) {
  1869.       var containerConfigColumns = \$(\".column-container\");
  1870.         if (!containerConfigColumns.is(e.target) && containerConfigColumns.has(e.target).length === 0){ 
  1871.           \$('.column-container').hide();
  1872.         }
  1873.     })
  1874.     \$.fn.isInViewport = function() {
  1875.         var elementTop = \$(this).offset().top;
  1876.         var elementBottom = elementTop + \$(this).outerHeight();
  1877.         var viewportTop = \$(window).scrollTop();
  1878.         var viewportBottom = viewportTop + \$(window).height();
  1879.         return elementBottom > viewportTop && elementTop < viewportBottom;
  1880.     };
  1881.     function isElementInViewport (el) {
  1882.     // Special bonus for those using jQuery
  1883.         if (typeof jQuery === \"function\" && el instanceof jQuery) {
  1884.             el = el[0];
  1885.         }
  1886.         var rect = el.getBoundingClientRect();
  1887.         return (
  1888.             rect.top >= 0 &&
  1889.             rect.left >= 0 &&
  1890.             rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && /* or \$(window).height() */
  1891.             rect.right <= (window.innerWidth || document.documentElement.clientWidth) /* or \$(window).width() */
  1892.         );
  1893.     }
  1894.     function isElementPartiallyInViewport(el)
  1895.         {
  1896.             // Special bonus for those using jQuery
  1897.             if (typeof jQuery !== 'undefined' && el instanceof jQuery) 
  1898.                 el = el[0];
  1899.             var rect = el.getBoundingClientRect();
  1900.             // DOMRect { x: 8, y: 8, width: 100, height: 100, top: 8, right: 108, bottom: 108, left: 8 }
  1901.             var windowHeight = (window.innerHeight || document.documentElement.clientHeight);
  1902.             var windowWidth = (window.innerWidth || document.documentElement.clientWidth);
  1903.             // http://stackoverflow.com/questions/325933/determine-whether-two-date-ranges-overlap
  1904.             var vertInView = (rect.top <= windowHeight) && ((rect.top + rect.height) >= 0);
  1905.             var horInView = (rect.left <= windowWidth) && ((rect.left + rect.width) >= 0);
  1906.             return (vertInView && horInView);
  1907.         }
  1908. </script>
  1909. <!-- Peity
  1910. <script src=\"js/demo/peity-demo.js\"></script>
  1911. -->
  1912. {% block js_import %}
  1913. {% endblock %}
  1914. <script>
  1915.     \$(document).ready(function(){
  1916.         \$('.i-checks').iCheck({
  1917.             checkboxClass: 'icheckbox_square-green',
  1918.             radioClass: 'iradio_square-green',
  1919.         });
  1920.     });
  1921.     jQuery(document).ready(function() { 
  1922.         {% for label, message in app.flashes('success') %}
  1923.             toastr.success(\"{{ message }}\");
  1924.         {% endfor %}
  1925.         {% for message in app.flashes('error') %}
  1926.             toastr.error(\"{{ message }}\");
  1927.         {% endfor %}
  1928.         {% for message in app.flashes('infos') %}
  1929.             toastr.infos(\"{{ message }}\");
  1930.         {% endfor %}
  1931.         {% for message in app.flashes('warning') %}
  1932.             toastr.warning(\"{{ message }}\");
  1933.         {% endfor %}
  1934.     });
  1935.     isObjectEmpty = function(obj) {
  1936.         for(var key in obj) {
  1937.             if(obj.hasOwnProperty(key))
  1938.                 return false;
  1939.         }
  1940.         return true;
  1941.     };
  1942.     {% block javascript %}
  1943.     {% endblock %}
  1944. </script>
  1945. <script type=\"text/javascript\">
  1946.     if(\"{{app.user.role}}\" == \"administrateur\" && !\"{{app.session.get('entreprise_session_id')}}\"){
  1947.         loadEntreprise();
  1948.     }
  1949.     \$('.openEntrepriseModal').click(function(){
  1950.         loadEntreprise();        
  1951.     })
  1952.     function loadEntreprise(){
  1953.         \$('#modalEntreprise').modal({
  1954.           backdrop: 'static'
  1955.         });
  1956.         \$('.loader-container').css('display','flex');
  1957.         \$.ajax({
  1958.             url: \"{{path('entreprise_load_xhr')}}\",
  1959.             type: \"GET\",
  1960.             async: true,
  1961.             dataType: \"json\",
  1962.             data: {},
  1963.             success:function(response) {
  1964.               if(response.status == 200){
  1965.                 \$('#modalEntreprise .entreprise-container').html(response.datas);
  1966.               }
  1967.               else if(response.status == 500){
  1968.                 toastr.error(response.message);
  1969.               }
  1970.               \$('.loader-container').css('display','none');
  1971.             },
  1972.             error:function(){
  1973.               toastr.error(\"Ooops... Quelque chose s'est mal passée\");
  1974.               \$('.loader-container').css('display','none');
  1975.             }
  1976.         });
  1977.     }
  1978.     function loadMenu(){
  1979.         \$.ajax({
  1980.             url: \"{{path('menu_load_xhr')}}\",
  1981.             type: \"GET\",
  1982.             async: true,
  1983.             dataType: \"json\",
  1984.             data: {},
  1985.             success:function(response) {
  1986.               if(response.status == 200){
  1987.                 \$('#side-menu').html(response.datas);
  1988.               }
  1989.               else if(response.status == 500){
  1990.                 toastr.error(response.message);
  1991.               }
  1992.             },
  1993.             error:function(){
  1994.               toastr.error(\"Ooops... Quelque chose s'est mal passée\");
  1995.             }
  1996.         });
  1997.     }
  1998.     if( \"{{app.session.get('entreprise_session_id')}}\" )
  1999.         loadMenu();
  2000.     \$(document).on('click', '.menu-item', function(){
  2001.         if(\$(this).hasClass('active')){
  2002.             \$(this).removeClass('active');
  2003.             \$(this).find('.sub-nav').addClass('collapse');
  2004.         }
  2005.         else{
  2006.             \$('.menu-item').removeClass('active');
  2007.             \$('.menu-item .sub-nav').addClass('collapse');
  2008.             \$(this).addClass('active');
  2009.             \$(this).find('.sub-nav').removeClass('collapse');
  2010.         }
  2011.         
  2012.     })
  2013.     function switchEntreprise(el){
  2014.         var url = el.getAttribute(\"data-href\");
  2015.         \$('.loader-container').css('display','flex');
  2016.         \$.ajax({
  2017.             url: url,
  2018.             type: \"GET\",
  2019.             dataType: \"json\",
  2020.             async: true,
  2021.             data: {},
  2022.             success: function(response) {
  2023.                 if(response.status == 200){
  2024.                     location.reload();
  2025.                 }
  2026.                 else if(response.status == 500){
  2027.                     toastr.error(response.message);
  2028.                 }
  2029.                 \$('.loader-container').css('display','none');
  2030.             },
  2031.             error: function(xhr, textStatus, errorThrown) {
  2032.               console.log(errorThrown);
  2033.               \$('.loader-container').css('display','none');
  2034.             }
  2035.         });
  2036.     }
  2037.     \$(document).ready( function () {
  2038.         \$('body').on('click', ' .showDocument', function(){
  2039.             \$documentFile = \$(this).attr('data-file');
  2040.             \$('#modalDocumentShow').modal('show');
  2041.             if(\$documentFile != \"\"){
  2042.                 \$('.no-document').css('display','none');
  2043.                 \$('.documentFile-container').css('display','block');
  2044.                 if(\$documentFile.substr(\$documentFile.length - 3).toLowerCase() == \"pdf\"){
  2045.                     // \$('#btnRotation').css('display', 'inline-block');
  2046.                     // \$('#btnRotation .rotationChoice').attr('data-pdf', \$documentFile);
  2047.                     \$('.lien-document').attr('href', \$documentFile);
  2048.                     \$('.documentFile-container').html('<object class=\"documentPdf\" data=\"\" type=\"application/pdf\" width=\"100%\" height=\"980px\"></object>');
  2049.                 }
  2050.                 else{
  2051.                     \$('.documentFile-container').html('<object class=\"documentPdf\" data=\"\" ></object>');
  2052.                 }
  2053.                 \$('.documentPdf').attr('data', \$documentFile);
  2054.             }
  2055.             else{
  2056.                 \$('.documentFile-container').css('display','none');
  2057.                 \$('.no-document').css('display','block');
  2058.             }
  2059.         })
  2060.         \$('body').on('click', ' .rotationChoice', function(){
  2061.             var pdf = \$(this).attr('data-pdf');
  2062.             var rotation = \$(this).attr('data-rotation');
  2063.             var dossier = \$(this).attr('data-dossier');
  2064.             // currentRotation = parseInt(currentRotation) + parseInt(rotation);
  2065.             // \$('.data-ocr-container').css('transform', \"rotate(\"+currentRotation+\"deg)\");
  2066.             // console.log(currentRotation);
  2067.             \$.ajax({
  2068.                 url: \"{{path('document_rotation')}}\",
  2069.                 type: \"GET\",
  2070.                 dataType: \"json\",
  2071.                 async: true,
  2072.                 data: {
  2073.                     pdf:pdf,
  2074.                     rotation:rotation,
  2075.                     dossier:dossier
  2076.                 },
  2077.                 success: function(response, status) {
  2078.                   if(response.status == 200){
  2079.                     window.open(response.datas.redirect,'_blank');
  2080.                     window.close();
  2081.                   }
  2082.                   else if(response.status == 400){
  2083.                         toastr.error(response.message);
  2084.                   }
  2085.                 },
  2086.                 error: function(xhr, textStatus, errorThrown) {
  2087.                   toastr.error(\"Ooops..., Quelque chose s'est mal passée\");
  2088.                 }
  2089.             });
  2090.         })
  2091.     } );
  2092.     // \$(document).on('click', '#rotationCss', function(){
  2093.     //     let angle = \$(this).val();
  2094.     //     \$('.data-ocr-container').css('transform', \"rotate(\"+angle+\"deg)\");
  2095.     //     console.log(angle);
  2096.     //     console.log('deg');
  2097.     //     console.log(angle+'deg');
  2098.     // })
  2099.     \$(document).on(\"blur\", \".field-number\", function () {
  2100.         if(\$(this).val()){
  2101.             var content = \$(this).val();
  2102.             
  2103.             if (content.indexOf(',') > -1 && content.indexOf('.') > -1){
  2104.                 content = content.replace(\",\", '');
  2105.             }
  2106.             var valeur = content.replace(/[\\,]+/g, '.');
  2107.             var valString = valeur.toString(); 
  2108.             valString = valString.toLowerCase();
  2109.             valString = valString.replace(\"euro\", '');
  2110.             valString = valString.replace(\"eur\", '');
  2111.             valString = valString.replace(\"€\", '');
  2112.             valString = valString.replace(\" \", '');
  2113.             valeur = parseFloat(valString);
  2114.             \$(this).val(valeur);
  2115.         }
  2116.     });
  2117.     function ajustePrice(content){
  2118.         
  2119.         if(content != \"\"){
  2120.             if (content.indexOf(',') > -1 && content.indexOf('.') > -1){
  2121.                 content = content.replace(\",\", '');
  2122.             }
  2123.             var valeur = content.replace(/[\\,]+/g, '.');
  2124.             var valString = valeur.toString(); 
  2125.             valString = valString.toLowerCase();
  2126.             valString = valString.replace(\"euro\", '');
  2127.             valString = valString.replace(\"eur\", '');
  2128.             valString = valString.replace(\"€\", '');
  2129.             valString = valString.replace(\" \", '');
  2130.             valeur = parseFloat(valString);
  2131.             return valeur;
  2132.         }
  2133.         return \"\";
  2134.     }
  2135. </script>
  2136. <script type=\"text/javascript\">
  2137.         jQuery.extend( jQuery.fn.dataTableExt.oSort, {
  2138.             \"num-html-pre\": function ( a ) {
  2139.                 var x = String(a).replace( /<[\\s\\S]*?>/g, \"\" );
  2140.                 return parseFloat( x );
  2141.             },
  2142.          
  2143.             \"num-html-asc\": function ( a, b ) {
  2144.                 return ((a < b) ? -1 : ((a > b) ? 1 : 0));
  2145.             },
  2146.          
  2147.             \"num-html-desc\": function ( a, b ) {
  2148.                 return ((a < b) ? 1 : ((a > b) ? -1 : 0));
  2149.             }
  2150.         } );
  2151. </script>
  2152. {% block javascript_script %}
  2153.     <script type=\"text/javascript\">
  2154.         // our updatable variable objects to use globally
  2155.         let img = {};
  2156.         let position = {};
  2157.         let fieldsOcr = [
  2158.             {field:'document_id', type:'text'},
  2159.             {field:'facturedAt', type:'date'},
  2160.             {field:'dueAt', type:'date'},
  2161.             {field:'prixttc', type:'text'},
  2162.             {field:'prixht', type:'text'},
  2163.             {field:'tva', type:'select'},
  2164.             {field:'devise', type:'select'},
  2165.             {field:'fournisseur', type:'select'},
  2166.             {field:'client', type:'select'},
  2167.             {field:'chantier', type:'select'},
  2168.             {field:'devis', type:'select'},
  2169.             {field:'lot', type:'text'},
  2170.             {field:'rossum_document_id', type:'text'},
  2171.             {field:'status', type:'select'},
  2172.             {field:'code_compta', type:'text'},
  2173.             {field:'utilisateur', type:'select'},
  2174.             {field:'conges_paye', type:'text'},
  2175.             {field:'heure_sup_1', type:'text'},
  2176.             {field:'heure_sup_2', type:'text'},
  2177.             {field:'heure_normale', type:'text'},
  2178.             {field:'trajet', type:'text'},
  2179.             {field:'panier', type:'text'},
  2180.             {field:'cout_global', type:'text'},
  2181.             {field:'salaire_net', type:'text'},
  2182.             {field:'date_paie', type:'text'},
  2183.         ];
  2184.         let moisObject = [
  2185.             {mois:'janvier', num:'01'},
  2186.             {mois:'fevrier', num:'02'},
  2187.             {mois:'mars', num:'03'},
  2188.             {mois:'avril', num:'04'},
  2189.             {mois:'mai', num:'05'},
  2190.             {mois:'juin', num:'06'},
  2191.             {mois:'juillet', num:'07'},
  2192.             {mois:'août', num:'08'},
  2193.             {mois:'septembre', num:'09'},
  2194.             {mois:'octobre', num:'10'},
  2195.             {mois:'novembre', num:'11'},
  2196.             {mois:'decembre', num:'12'},
  2197.         ];
  2198.         let tabDay = ['lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi', 'dimanche'];
  2199.         \$fieldPreference = [];
  2200.         {% if fieldPreference is defined %}
  2201.             \$fieldPreference = {{ fieldPreference|json_encode()|raw }};
  2202.         {% endif %}
  2203.         // image matrix function to update img object variable
  2204.         function imgMatrix() {
  2205.           // our image object inside area
  2206.           let \$img = \$('.document-container');
  2207.           // offset data of image
  2208.           let offset = \$img.offset();
  2209.           // add/update object key data
  2210.           img.width = \$img.outerWidth();
  2211.           img.height = \$img.outerHeight();
  2212.           img.offsetX = offset.left - \$(document).scrollLeft();
  2213.           img.offsetY = offset.top - \$(document).scrollTop();
  2214.         }
  2215.         // position matrix function to update position object variable
  2216.         function positionMatrix(e, mousedown = false) {
  2217.           // if mousedown param is true... for use in 
  2218.           if (mousedown) {
  2219.             // set the top/left position object data with percentage position
  2220.             position.top = (100 / img.height) * ( (e.pageY - \$(document).scrollTop()) - img.offsetY);
  2221.             position.left = (100 / img.width) * ( (e.pageX - \$(document).scrollLeft()) - img.offsetX);
  2222.           }
  2223.           // set the right/bottom position object data with percentage position
  2224.           position.right = 100 - ((100 / img.width) * ((e.pageX - \$(document).scrollLeft()) - img.offsetX));
  2225.           position.bottom = 100 - ((100 / img.height) * ((e.pageY - \$(document).scrollTop()) - img.offsetY));
  2226.         }
  2227.         // mouse move event function in area div
  2228.         \$(document).on('mousemove', '.document-container', function(e) {
  2229.           // / update img object variable data upon this mousemove event
  2230.           imgMatrix();
  2231.           // if this area has draw class
  2232.           if (\$(this).hasClass('draw')) {
  2233.             // update position object variable data passing current event data
  2234.             positionMatrix(e);
  2235.             // if image x cursor drag position percent is negative to mousedown x position
  2236.             if ((100 - position.bottom) < position.top) {
  2237.               // update rectange x negative positions css
  2238.               \$('.rect', this).css({
  2239.                 top: (100 - position.bottom) + '%',
  2240.                 bottom: (100 - position.top) + '%'
  2241.               });
  2242.               // else if image x cursor drag position percent is positive to mousedown x position
  2243.             } else {
  2244.               // update rectange x positive positions css
  2245.               \$('.rect', this).css({
  2246.                 bottom: position.bottom + '%',
  2247.                 top: position.top + '%',
  2248.               });
  2249.             }
  2250.             // if image y cursor drag position percent is negative to mousedown y position
  2251.             if ((100 - position.right) < position.left) {
  2252.               // update rectange y negative positions css
  2253.               \$('.rect', this).css({
  2254.                 left: (100 - position.right) + '%',
  2255.                 right: (100 - position.left) + '%'
  2256.               });
  2257.               // else if image y cursor drag position percent is positive to mousedown y position
  2258.             } else {
  2259.               // update rectange y positive positions css
  2260.               \$('.rect', this).css({
  2261.                 right: position.right + '%',
  2262.                 left: position.left + '%'
  2263.               });
  2264.             }
  2265.           }
  2266.         });
  2267.         function lineDistance(x, y, x0, y0){
  2268.             return Math.sqrt((x -= x0) * x + (y -= y0) * y);
  2269.         };
  2270.         // mouse down event function in area div
  2271.         \$(document).on('mousedown', '.doc-img', function(e) {
  2272.             \$('.rect').css('display', 'block');
  2273.             var parent = \$(this).parent('.document-container').get(0);
  2274.           // remove the drawn class
  2275.           \$(parent).removeClass('drawn');
  2276.           // update img object variable data upon this mousedown event
  2277.           imgMatrix();
  2278.           // update position object variable data passing current event data and mousedown param as true 
  2279.           positionMatrix(e, true);
  2280.           // update rectange xy positions css
  2281.           \$('.rect', parent).css({
  2282.             left: position.left + '%',
  2283.             top: position.top + '%',
  2284.             right: position.right + '%',
  2285.             bottom: position.bottom + '%'
  2286.           });
  2287.           // add draw class to area div to reveal rectangle
  2288.           \$(parent).addClass('draw');
  2289.         });
  2290.         // mouse up event function in area div
  2291.         \$(document).on('mouseup', '.document-container', function(e) {
  2292.           // update img object variable data upon this mouseup event
  2293.           imgMatrix();
  2294.           // if this area had draw class
  2295.           if (\$(this).hasClass('draw')) {
  2296.             // update position object variable data passing current event
  2297.             positionMatrix(e);
  2298.             // math trunc on position values if x and y values are equal, basically no drawn rectangle on mouseup event
  2299.             if ((Math.trunc(position.left) === Math.trunc(100 - position.right)) && (Math.trunc(position.top) === Math.trunc(100 - position.bottom))) {
  2300.               
  2301.               // remove draw and drawn classes
  2302.               \$(this).removeClass('draw drawn');
  2303.             // else if x and y values are not equal, basically a rectange has been drawn
  2304.             } else {
  2305.               // add drawn class and remove draw class
  2306.               \$(this).addClass('drawn').removeClass('draw');
  2307.             }
  2308.           }
  2309.             \$parentContent = \$('.document-container').get(0).getBoundingClientRect();
  2310.             \$rect = \$('.rect').get(0).getBoundingClientRect();
  2311.             position.left = convertToPourcentage(\$parentContent.width, (\$rect.left - \$parentContent.left));
  2312.             position.top = convertToPourcentage(\$parentContent.height, (\$rect.top - \$parentContent.top));
  2313.             position.width = convertToPourcentage(\$parentContent.width, \$rect.width);
  2314.             position.height = convertToPourcentage(\$parentContent.height, \$rect.height);
  2315.             /*if( convertToPourcentage(\$parentContent.width, \$rect.width) > convertToPourcentage(\$parentContent.width, 20)){*/
  2316.             if(true){
  2317.                 /*\$('#popTextExtract').modal('show');*/
  2318.                 groupTextByPosition(position);
  2319.                 \$('.btn-ajuster').css('display', 'inline-block');
  2320.             }
  2321.         });
  2322.         // on window resize function
  2323.         \$(window).on('resize', function(e) {
  2324.           // update img object variable data upon this window resize event
  2325.           imgMatrix();
  2326.         });
  2327.         \$('.ocr-field').click(function(e){
  2328.             \$('.ocr-field').removeClass('active');
  2329.             \$(this).addClass('active');
  2330.         });
  2331.         
  2332.         function convertToPourcentage(parentContent, toConvert){
  2333.             return (toConvert*100) / parentContent ;
  2334.         }
  2335.         function appendText(data, position = {}, dossier = \"\"){
  2336.             \$parentfieldSelect = \$('.ocr-field.active');
  2337.             index = fieldsOcr.findIndex(x => x.field === \$parentfieldSelect.data('field'));
  2338.             \$fieldSelect = \$parentfieldSelect.find('.field');
  2339.             var cordonnee =  position.left+'-'+position.top+'-'+position.width+'-'+position.height;
  2340.             var type = \"\";
  2341.             if( index > -1 ){
  2342.                 type = fieldsOcr[index]['type'];
  2343.             }
  2344.             if(type == 'text'){
  2345.                 \$fieldSelect.val(data);
  2346.                 \$( \".field-number\" ).trigger( \"blur\" );
  2347.             }
  2348.             else if(type == 'date'){
  2349.                 \$field = fieldsOcr[index]['field'];
  2350.                 console.log([index, \$field, \$fieldPreference]);
  2351.                 dateFormat = \$fieldPreference[\$field].type;
  2352.                 formattedDate = rebuildDate(data, dateFormat);
  2353.                 if(formattedDate != \"\")
  2354.                     \$fieldSelect.val(formattedDate);
  2355.             }
  2356.             else if(type == 'select'){
  2357.                 \$('.row-suggession').css('display', 'none');
  2358.                 \$field = fieldsOcr[index]['field'];
  2359.                 if(\$field == \"fournisseur\"){
  2360.                     \$('#achat_fournisseur').val(data.fournisseur);
  2361.                     \$('#achat_code_compta').val(data.code_compta);
  2362.                     \$('#achat_lot').val(data.lot);
  2363.                     \$('.row-suggession').css('display', 'block');
  2364.                     \$listSuggestion = \"\";
  2365.                     \$.each(data.fournisseurfound, function( index, value ) {
  2366.                       \$listSuggestion += \"<option>\"+value.nom+\"</option>\";
  2367.                     });
  2368.                     \$('.field-suggession').html(\$listSuggestion);
  2369.                 }
  2370.                 if(\$field == \"client\"){
  2371.                     \$('#vente_client').val(data.client);
  2372.                     \$('#vente_lot').val(data.lot);
  2373.                     \$('.row-suggession').css('display', 'block');
  2374.                     \$listSuggestion = \"\";
  2375.                     \$.each(data.fournisseurfound, function( index, value ) {
  2376.                       \$listSuggestion += \"<option>\"+value.nom+\"</option>\";
  2377.                     });
  2378.                     \$('.field-suggession').html(\$listSuggestion);
  2379.                 }
  2380.                 if(\$field == \"utilisateur\"){
  2381.                     \$fieldSelect.val(data.utilisateur);
  2382.                 }
  2383.                 else if(\$field == \"chantier\"){
  2384.                     \$fieldSelect.val(data.chantier);
  2385.                     if(dossier == \"achat\"){
  2386.                         \$.ajax({
  2387.                             url: \"{{path('devis_client_get_by_chantier_import')}}\",
  2388.                             type: \"POST\",
  2389.                             dataType: \"json\",
  2390.                             async: true,
  2391.                             data: {
  2392.                                 chantier_id: data.chantier
  2393.                             },
  2394.                             success: function(response) {
  2395.                                 if(response.status == 200){
  2396.                                     console.log(response.devis);
  2397.                                     var OPTIONS = \"<option></option>\";
  2398.                                     \$.each(response.devis, function( index, value ) {
  2399.                                         OPTIONS += \"<option value=\"+value.id+\">\"+value.label+\"</option>\";
  2400.                                     });
  2401.                                     \$('#achat_devis').html(OPTIONS);
  2402.                                 }
  2403.                                 else if(response.status == 500){
  2404.                                     toastr.error(response.message);
  2405.                                 }
  2406.                                 \$('.loader-container').css('display','none');
  2407.                             },
  2408.                             error: function(xhr, textStatus, errorThrown) {
  2409.                               console.log(errorThrown);
  2410.                               \$('.loader-container').css('display','none');
  2411.                             }
  2412.                         });
  2413.                     }
  2414.                 }
  2415.                 else if(\$field == \"devise\"){
  2416.                     \$fieldSelect.val(data.devise);
  2417.                 }
  2418.                 else if(\$field == \"tva\"){
  2419.                     \$fieldSelect.val(data.tva);
  2420.                 }
  2421.             }
  2422.             \$parentfieldSelect.find('input.field_identite').val(cordonnee);
  2423.         }
  2424.         function rebuildDate(text, dateFormat){
  2425.             text = replaceAll(text, ',', '');
  2426.             if (text.indexOf('/') <= -1){
  2427.                 text = replaceAll(text, '.', '/');
  2428.                 text = replaceAll(text, '-', '/');
  2429.                 text = replaceAll(text, ' ', '/');
  2430.             }
  2431.             else{
  2432.                 text = replaceAll(text, '.', '');
  2433.                 text = replaceAll(text, '-', '');
  2434.                 text = replaceAll(text, ' ', '');
  2435.             }
  2436.             
  2437.             var dateTab = text.split('/');
  2438.             var formattedDate = \"\";
  2439.             
  2440.             if(dateTab.length >= 3){
  2441.                 if(tabDay.includes(dateTab[0].toLowerCase())){
  2442.                     dateTab.shift(); 
  2443.                     var day = pad2(dateTab[0]);
  2444.                     indexMois = moisObject.findIndex(x => x.mois === (dateTab[1]).toLowerCase());
  2445.                     if( indexMois > -1 ){
  2446.                         var month = moisObject[indexMois]['num'];
  2447.                     }
  2448.                 }
  2449.                 else{
  2450.                     var day = pad2(dateTab[0]); 
  2451.                     indexMois = moisObject.findIndex(x => x.mois === (dateTab[1]).toLowerCase());
  2452.                     if( indexMois > -1 ){
  2453.                         var month = moisObject[indexMois]['num'];
  2454.                     }
  2455.                     else{
  2456.                         var month = pad2(dateTab[1]);
  2457.                     }
  2458.                 }
  2459.                 var year = dateTab[2];
  2460.                 if(year.length  == 2)
  2461.                     year = \"20\"+year;
  2462.                 
  2463.                 formattedDate =  year+\"-\"+month+\"-\"+day;
  2464.             }
  2465.             return formattedDate;
  2466.         }
  2467.         function replaceAll(str, find, replace) {
  2468.             var escapedFind=find.replace(/([.*+?^=!:\${}()|\\[\\]\\/\\\\])/g, \"\\\\\$1\");
  2469.             return str.replace(new RegExp(escapedFind, 'g'), replace);
  2470.         }
  2471.         function pad2(n) {
  2472.             return (n.length  < 2 ? '0' : '') + n;
  2473.         }
  2474.         \$(document).on('input', 'input.float', function() {
  2475.             this.value = this.value.replace(/[^0-9.,]/g, '').replace(/(\\..*?)\\..*/g, '\$1');
  2476.             this.value = this.value.replace(',', '.');
  2477.         });
  2478.     </script>
  2479. {% endblock %}
  2480.   <script type=\"text/javascript\">
  2481.     \$(document).ready( function () {
  2482.       \$('.removeColumn').remove();
  2483.     })
  2484.   </script>
  2485. </body>
  2486. </html>
  2487. ""base.html.twig""/var/www/fmdaOcr/templates/base.html.twig");
  2488.     }
  2489. }