<?php

use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\CoreExtension;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;

/* clients/intervention/_facturation.html.twig */
class __TwigTemplate_011fd0bd8bb104fd244bac7ab70c7c4e6caa0f9840fd02d9b6a0339aaf006062 extends Template
{
    private $source;
    private $macros = [];

    public function __construct(Environment $env)
    {
        parent::__construct($env);

        $this->source = $this->getSourceContext();

        $this->parent = false;

        $this->blocks = [
        ];
    }

    protected function doDisplay(array $context, array $blocks = [])
    {
        $macros = $this->macros;
        $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
        $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "clients/intervention/_facturation.html.twig"));

        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "clients/intervention/_facturation.html.twig"));

        // line 1
        $context["ligne_mo"] = CoreExtension::getAttribute($this->env, $this->source, (isset($context["intervention"]) || array_key_exists("intervention", $context) ? $context["intervention"] : (function () { throw new RuntimeError('Variable "intervention" does not exist.', 1, $this->source); })()), "getLigneMO", [], "any", false, false, false, 1);
        // line 2
        $context["ligne_deplacement"] = CoreExtension::getAttribute($this->env, $this->source, (isset($context["intervention"]) || array_key_exists("intervention", $context) ? $context["intervention"] : (function () { throw new RuntimeError('Variable "intervention" does not exist.', 2, $this->source); })()), "getLigneDeplacement", [], "any", false, false, false, 2);
        // line 3
        $context["ligne_mo_ttc"] = 0;
        // line 4
        $context["ligne_deplacement_ttc"] = 0;
        // line 5
        $context["tva_totaux"] = [];
        // line 6
        $context["paiements"] = [];
        // line 7
        $context["total_ht"] = 0;
        // line 8
        $context["total_ttc"] = 0;
        // line 9
        $context["total_tva"] = 0;
        // line 10
        $context["total_paiement"] = 0;
        // line 11
        $context["total_accompte"] = 0;
        // line 12
        $context["restant_du"] = 0;
        // line 13
        $context["facture_a_envoyer"] = false;
        // line 14
        if ((array_key_exists("ligne_mo", $context) && (isset($context["ligne_mo"]) || array_key_exists("ligne_mo", $context) ? $context["ligne_mo"] : (function () { throw new RuntimeError('Variable "ligne_mo" does not exist.', 14, $this->source); })()))) {
            // line 15
            yield "    ";
            $context["tva"] = ((CoreExtension::getAttribute($this->env, $this->source, (isset($context["ligne_mo"]) || array_key_exists("ligne_mo", $context) ? $context["ligne_mo"] : (function () { throw new RuntimeError('Variable "ligne_mo" does not exist.', 15, $this->source); })()), "getTauxTva", [], "any", false, false, false, 15)) ? (CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["ligne_mo"]) || array_key_exists("ligne_mo", $context) ? $context["ligne_mo"] : (function () { throw new RuntimeError('Variable "ligne_mo" does not exist.', 15, $this->source); })()), "getTauxTva", [], "any", false, false, false, 15), "getTaux", [], "any", false, false, false, 15)) : (0));
            // line 16
            yield "    ";
            $context["tva_key"] = ((isset($context["tva"]) || array_key_exists("tva", $context) ? $context["tva"] : (function () { throw new RuntimeError('Variable "tva" does not exist.', 16, $this->source); })()) . "_tva");
            // line 17
            yield "    ";
            $context["montant"] = CoreExtension::getAttribute($this->env, $this->source, (isset($context["ligne_mo"]) || array_key_exists("ligne_mo", $context) ? $context["ligne_mo"] : (function () { throw new RuntimeError('Variable "ligne_mo" does not exist.', 17, $this->source); })()), "getPrixTotalHt", [], "any", false, false, false, 17);
            // line 18
            yield "    ";
            $context["ligne_mo_ttc"] = ((isset($context["montant"]) || array_key_exists("montant", $context) ? $context["montant"] : (function () { throw new RuntimeError('Variable "montant" does not exist.', 18, $this->source); })()) + (((isset($context["montant"]) || array_key_exists("montant", $context) ? $context["montant"] : (function () { throw new RuntimeError('Variable "montant" does not exist.', 18, $this->source); })()) * (isset($context["tva"]) || array_key_exists("tva", $context) ? $context["tva"] : (function () { throw new RuntimeError('Variable "tva" does not exist.', 18, $this->source); })())) / 100));
            // line 19
            yield "    ";
            $context["tva_totaux"] = Twig\Extension\CoreExtension::merge((isset($context["tva_totaux"]) || array_key_exists("tva_totaux", $context) ? $context["tva_totaux"] : (function () { throw new RuntimeError('Variable "tva_totaux" does not exist.', 19, $this->source); })()), [(isset($context["tva_key"]) || array_key_exists("tva_key", $context) ? $context["tva_key"] : (function () { throw new RuntimeError('Variable "tva_key" does not exist.', 19, $this->source); })()) => (((CoreExtension::getAttribute($this->env, $this->source, ($context["tva_totaux"] ?? null), (isset($context["tva_key"]) || array_key_exists("tva_key", $context) ? $context["tva_key"] : (function () { throw new RuntimeError('Variable "tva_key" does not exist.', 19, $this->source); })()), [], "array", true, true, false, 19)) ? (Twig\Extension\CoreExtension::default(CoreExtension::getAttribute($this->env, $this->source, ($context["tva_totaux"] ?? null), (isset($context["tva_key"]) || array_key_exists("tva_key", $context) ? $context["tva_key"] : (function () { throw new RuntimeError('Variable "tva_key" does not exist.', 19, $this->source); })()), [], "array", false, false, false, 19), 0)) : (0)) + (isset($context["montant"]) || array_key_exists("montant", $context) ? $context["montant"] : (function () { throw new RuntimeError('Variable "montant" does not exist.', 19, $this->source); })()))]);
        }
        // line 21
        yield "
";
        // line 23
        if ((array_key_exists("ligne_deplacement", $context) && (isset($context["ligne_deplacement"]) || array_key_exists("ligne_deplacement", $context) ? $context["ligne_deplacement"] : (function () { throw new RuntimeError('Variable "ligne_deplacement" does not exist.', 23, $this->source); })()))) {
            // line 24
            yield "    ";
            $context["tva"] = ((CoreExtension::getAttribute($this->env, $this->source, (isset($context["ligne_deplacement"]) || array_key_exists("ligne_deplacement", $context) ? $context["ligne_deplacement"] : (function () { throw new RuntimeError('Variable "ligne_deplacement" does not exist.', 24, $this->source); })()), "getTauxTva", [], "any", false, false, false, 24)) ? (CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["ligne_deplacement"]) || array_key_exists("ligne_deplacement", $context) ? $context["ligne_deplacement"] : (function () { throw new RuntimeError('Variable "ligne_deplacement" does not exist.', 24, $this->source); })()), "getTauxTva", [], "any", false, false, false, 24), "getTaux", [], "any", false, false, false, 24)) : (0));
            // line 25
            yield "    ";
            $context["tva_key"] = ((isset($context["tva"]) || array_key_exists("tva", $context) ? $context["tva"] : (function () { throw new RuntimeError('Variable "tva" does not exist.', 25, $this->source); })()) . "_tva");
            // line 26
            yield "    ";
            $context["montant"] = CoreExtension::getAttribute($this->env, $this->source, (isset($context["ligne_deplacement"]) || array_key_exists("ligne_deplacement", $context) ? $context["ligne_deplacement"] : (function () { throw new RuntimeError('Variable "ligne_deplacement" does not exist.', 26, $this->source); })()), "getPrixTotalHt", [], "any", false, false, false, 26);
            // line 27
            yield "    ";
            $context["ligne_deplacement_ttc"] = ((isset($context["montant"]) || array_key_exists("montant", $context) ? $context["montant"] : (function () { throw new RuntimeError('Variable "montant" does not exist.', 27, $this->source); })()) + (((isset($context["montant"]) || array_key_exists("montant", $context) ? $context["montant"] : (function () { throw new RuntimeError('Variable "montant" does not exist.', 27, $this->source); })()) * (isset($context["tva"]) || array_key_exists("tva", $context) ? $context["tva"] : (function () { throw new RuntimeError('Variable "tva" does not exist.', 27, $this->source); })())) / 100));
            // line 28
            yield "    ";
            $context["tva_totaux"] = Twig\Extension\CoreExtension::merge((isset($context["tva_totaux"]) || array_key_exists("tva_totaux", $context) ? $context["tva_totaux"] : (function () { throw new RuntimeError('Variable "tva_totaux" does not exist.', 28, $this->source); })()), [(isset($context["tva_key"]) || array_key_exists("tva_key", $context) ? $context["tva_key"] : (function () { throw new RuntimeError('Variable "tva_key" does not exist.', 28, $this->source); })()) => (((CoreExtension::getAttribute($this->env, $this->source, ($context["tva_totaux"] ?? null), (isset($context["tva_key"]) || array_key_exists("tva_key", $context) ? $context["tva_key"] : (function () { throw new RuntimeError('Variable "tva_key" does not exist.', 28, $this->source); })()), [], "array", true, true, false, 28)) ? (Twig\Extension\CoreExtension::default(CoreExtension::getAttribute($this->env, $this->source, ($context["tva_totaux"] ?? null), (isset($context["tva_key"]) || array_key_exists("tva_key", $context) ? $context["tva_key"] : (function () { throw new RuntimeError('Variable "tva_key" does not exist.', 28, $this->source); })()), [], "array", false, false, false, 28), 0)) : (0)) + (isset($context["montant"]) || array_key_exists("montant", $context) ? $context["montant"] : (function () { throw new RuntimeError('Variable "montant" does not exist.', 28, $this->source); })()))]);
        }
        // line 30
        yield "<div class=\"container-fluid\">
    <div style=\"max-height: 130.5px; overflow: auto;border-bottom: 1px solid #ccc\" class=\" mb-2\">
        <table class=\"table table-responsive   table-sm table-inverse-color-datagrid mb-0 \" id=\"tableau-produit-facture\">
            <thead>
            <th>Référence</th>
            <th>Désignation</th>
            <th>P.U HT</th>
            <th>Qté</th>
            <th>Total HT</th>
            <th>TVA</th>
            <th>Aff.</th>
            </thead>
            <tbody style=\"height: 100px;\">
            ";
        // line 43
        if ((1 === CoreExtension::compare(Twig\Extension\CoreExtension::length($this->env->getCharset(), CoreExtension::getAttribute($this->env, $this->source, (isset($context["intervention"]) || array_key_exists("intervention", $context) ? $context["intervention"] : (function () { throw new RuntimeError('Variable "intervention" does not exist.', 43, $this->source); })()), "factures", [], "any", false, false, false, 43)), 0))) {
            // line 44
            yield "                ";
            $context["nb_line"] = 0;
            // line 45
            yield "                ";
            $context['_parent'] = $context;
            $context['_seq'] = CoreExtension::ensureTraversable(CoreExtension::getAttribute($this->env, $this->source, (isset($context["intervention"]) || array_key_exists("intervention", $context) ? $context["intervention"] : (function () { throw new RuntimeError('Variable "intervention" does not exist.', 45, $this->source); })()), "factures", [], "any", false, false, false, 45));
            foreach ($context['_seq'] as $context["_key"] => $context["factures"]) {
                // line 46
                yield "                    ";
                $context['_parent'] = $context;
                $context['_seq'] = CoreExtension::ensureTraversable(CoreExtension::getAttribute($this->env, $this->source, $context["factures"], "getFactureLignes", [], "any", false, false, false, 46));
                foreach ($context['_seq'] as $context["_key"] => $context["factureLigne"]) {
                    // line 47
                    yield "                        ";
                    if ((( !CoreExtension::getAttribute($this->env, $this->source, $context["factureLigne"], "getProduit", [], "any", false, false, false, 47) || (0 === CoreExtension::compare(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["factureLigne"], "getProduit", [], "any", false, false, false, 47), "getProduitType", [], "any", false, false, false, 47), "getId", [], "method", false, false, false, 47), 1))) || (0 === CoreExtension::compare(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["factureLigne"], "getProduit", [], "any", false, false, false, 47), "getProduitType", [], "any", false, false, false, 47), "getId", [], "method", false, false, false, 47), 2)))) {
                        // line 48
                        yield "                            ";
                        $context["nb_line"] = ((isset($context["nb_line"]) || array_key_exists("nb_line", $context) ? $context["nb_line"] : (function () { throw new RuntimeError('Variable "nb_line" does not exist.', 48, $this->source); })()) + 1);
                        // line 49
                        yield "                            ";
                        $context["tva"] = ((CoreExtension::getAttribute($this->env, $this->source, $context["factureLigne"], "getTauxTva", [], "any", false, false, false, 49)) ? (CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["factureLigne"], "getTauxTva", [], "any", false, false, false, 49), "getTaux", [], "any", false, false, false, 49)) : (0));
                        // line 50
                        yield "                            ";
                        $context["tva_key"] = ((isset($context["tva"]) || array_key_exists("tva", $context) ? $context["tva"] : (function () { throw new RuntimeError('Variable "tva" does not exist.', 50, $this->source); })()) . "_tva");
                        // line 51
                        yield "                            ";
                        if ((0 === CoreExtension::compare(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["factureLigne"], "getProduitFactureAffectation", [], "any", false, false, false, 51), "libelleCourt", [], "any", false, false, false, 51), "F"))) {
                            // line 52
                            yield "                                ";
                            $context["montant"] = CoreExtension::getAttribute($this->env, $this->source, $context["factureLigne"], "getPrixTotalHt", [], "any", false, false, false, 52);
                            // line 53
                            yield "                                ";
                            $context["tva_totaux"] = Twig\Extension\CoreExtension::merge((isset($context["tva_totaux"]) || array_key_exists("tva_totaux", $context) ? $context["tva_totaux"] : (function () { throw new RuntimeError('Variable "tva_totaux" does not exist.', 53, $this->source); })()), [(isset($context["tva_key"]) || array_key_exists("tva_key", $context) ? $context["tva_key"] : (function () { throw new RuntimeError('Variable "tva_key" does not exist.', 53, $this->source); })()) => (((CoreExtension::getAttribute($this->env, $this->source, ($context["tva_totaux"] ?? null), (isset($context["tva_key"]) || array_key_exists("tva_key", $context) ? $context["tva_key"] : (function () { throw new RuntimeError('Variable "tva_key" does not exist.', 53, $this->source); })()), [], "array", true, true, false, 53)) ? (Twig\Extension\CoreExtension::default(CoreExtension::getAttribute($this->env, $this->source, ($context["tva_totaux"] ?? null), (isset($context["tva_key"]) || array_key_exists("tva_key", $context) ? $context["tva_key"] : (function () { throw new RuntimeError('Variable "tva_key" does not exist.', 53, $this->source); })()), [], "array", false, false, false, 53), 0)) : (0)) + (isset($context["montant"]) || array_key_exists("montant", $context) ? $context["montant"] : (function () { throw new RuntimeError('Variable "montant" does not exist.', 53, $this->source); })()))]);
                            // line 54
                            yield "                            ";
                        }
                        // line 55
                        yield "                            <tr >
                                <td class=\"text-center\">";
                        // line 56
                        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["factureLigne"], "getProduit", [], "any", false, false, false, 56), "getCode", [], "any", false, false, false, 56), "html", null, true);
                        yield "</td>
                                <td class=\"text-center\">";
                        // line 57
                        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["factureLigne"], "getProduit", [], "any", false, false, false, 57), "designation", [], "any", false, false, false, 57), "html", null, true);
                        yield "</td>
                                <td class=\"text-center\">";
                        // line 58
                        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((CoreExtension::getAttribute($this->env, $this->source, $context["factureLigne"], "getPuHt", [], "any", false, false, false, 58) . "€"), "html", null, true);
                        yield "</td>
                                <td class=\"text-center\">";
                        // line 59
                        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["factureLigne"], "getQuantite", [], "any", false, false, false, 59), "html", null, true);
                        yield "</td>
                                <td class=\"text-center\">";
                        // line 60
                        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((CoreExtension::getAttribute($this->env, $this->source, $context["factureLigne"], "getPrixTotalHt", [], "any", false, false, false, 60) . "€"), "html", null, true);
                        yield "</td>
                                <td class=\"text-center\">";
                        // line 61
                        ((CoreExtension::getAttribute($this->env, $this->source, $context["factureLigne"], "getTauxTva", [], "any", false, false, false, 61)) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["factureLigne"], "getTauxTva", [], "any", false, false, false, 61), "getTaux", [], "any", false, false, false, 61) . "%"), "html", null, true)) : (yield ""));
                        yield "</td>
                                <td class=\"text-center\">";
                        // line 62
                        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["factureLigne"], "getProduitFactureAffectation", [], "any", false, false, false, 62), "libelleCourt", [], "any", false, false, false, 62), "html", null, true);
                        yield "</td>
                            </tr>
                        ";
                    }
                    // line 65
                    yield "                    ";
                }
                $_parent = $context['_parent'];
                unset($context['_seq'], $context['_iterated'], $context['_key'], $context['factureLigne'], $context['_parent'], $context['loop']);
                $context = array_intersect_key($context, $_parent) + $_parent;
                // line 66
                yield "                    ";
                $context['_parent'] = $context;
                $context['_seq'] = CoreExtension::ensureTraversable(CoreExtension::getAttribute($this->env, $this->source, $context["factures"], "getPaiements", [], "any", false, false, false, 66));
                foreach ($context['_seq'] as $context["_key"] => $context["paiement"]) {
                    // line 67
                    yield "                        ";
                    $context["paiements"] = Twig\Extension\CoreExtension::merge((isset($context["paiements"]) || array_key_exists("paiements", $context) ? $context["paiements"] : (function () { throw new RuntimeError('Variable "paiements" does not exist.', 67, $this->source); })()), [$context["paiement"]]);
                    // line 68
                    yield "                        ";
                    $context["total_paiement"] = ((isset($context["total_paiement"]) || array_key_exists("total_paiement", $context) ? $context["total_paiement"] : (function () { throw new RuntimeError('Variable "total_paiement" does not exist.', 68, $this->source); })()) + CoreExtension::getAttribute($this->env, $this->source, $context["paiement"], "montantTtc", [], "any", false, false, false, 68));
                    // line 69
                    yield "                    ";
                }
                $_parent = $context['_parent'];
                unset($context['_seq'], $context['_iterated'], $context['_key'], $context['paiement'], $context['_parent'], $context['loop']);
                $context = array_intersect_key($context, $_parent) + $_parent;
                // line 70
                yield "                    ";
                $context["total_ht"] = ((isset($context["total_ht"]) || array_key_exists("total_ht", $context) ? $context["total_ht"] : (function () { throw new RuntimeError('Variable "total_ht" does not exist.', 70, $this->source); })()) + CoreExtension::getAttribute($this->env, $this->source, $context["factures"], "montantHt", [], "any", false, false, false, 70));
                // line 71
                yield "                    ";
                $context["total_ttc"] = ((isset($context["total_ttc"]) || array_key_exists("total_ttc", $context) ? $context["total_ttc"] : (function () { throw new RuntimeError('Variable "total_ttc" does not exist.', 71, $this->source); })()) + CoreExtension::getAttribute($this->env, $this->source, $context["factures"], "montantTtc", [], "any", false, false, false, 71));
                // line 72
                yield "                    ";
                if (CoreExtension::getAttribute($this->env, $this->source, $context["factures"], "getFactureAcompte", [], "any", false, false, false, 72)) {
                    // line 73
                    yield "                        ";
                    $context['_parent'] = $context;
                    $context['_seq'] = CoreExtension::ensureTraversable(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["factures"], "getFactureAcompte", [], "any", false, false, false, 73), "getPaiements", [], "any", false, false, false, 73));
                    foreach ($context['_seq'] as $context["_key"] => $context["paiement"]) {
                        // line 74
                        yield "                            ";
                        $context["total_accompte"] = ((isset($context["total_accompte"]) || array_key_exists("total_accompte", $context) ? $context["total_accompte"] : (function () { throw new RuntimeError('Variable "total_accompte" does not exist.', 74, $this->source); })()) + CoreExtension::getAttribute($this->env, $this->source, $context["paiement"], "montantTTC", [], "any", false, false, false, 74));
                        // line 75
                        yield "                        ";
                    }
                    $_parent = $context['_parent'];
                    unset($context['_seq'], $context['_iterated'], $context['_key'], $context['paiement'], $context['_parent'], $context['loop']);
                    $context = array_intersect_key($context, $_parent) + $_parent;
                    // line 76
                    yield "                    ";
                }
                // line 77
                yield "                ";
            }
            $_parent = $context['_parent'];
            unset($context['_seq'], $context['_iterated'], $context['_key'], $context['factures'], $context['_parent'], $context['loop']);
            $context = array_intersect_key($context, $_parent) + $_parent;
            // line 78
            yield "                ";
            $context["emptyRows"] = (4 - (isset($context["nb_line"]) || array_key_exists("nb_line", $context) ? $context["nb_line"] : (function () { throw new RuntimeError('Variable "nb_line" does not exist.', 78, $this->source); })()));
            // line 79
            yield "                ";
            if ((1 === CoreExtension::compare((isset($context["emptyRows"]) || array_key_exists("emptyRows", $context) ? $context["emptyRows"] : (function () { throw new RuntimeError('Variable "emptyRows" does not exist.', 79, $this->source); })()), 0))) {
                // line 80
                yield "                    ";
                $context['_parent'] = $context;
                $context['_seq'] = CoreExtension::ensureTraversable(range(1, (isset($context["emptyRows"]) || array_key_exists("emptyRows", $context) ? $context["emptyRows"] : (function () { throw new RuntimeError('Variable "emptyRows" does not exist.', 80, $this->source); })())));
                foreach ($context['_seq'] as $context["_key"] => $context["i"]) {
                    // line 81
                    yield "                        <tr style=\"height: 25px\"><td colspan=\"7\"></td></tr>
                    ";
                }
                $_parent = $context['_parent'];
                unset($context['_seq'], $context['_iterated'], $context['_key'], $context['i'], $context['_parent'], $context['loop']);
                $context = array_intersect_key($context, $_parent) + $_parent;
                // line 83
                yield "                ";
            }
            // line 84
            yield "            ";
        } else {
            // line 85
            yield "                <tr style=\"height: 25px\"><td colspan=\"7\" ></td></tr>
                <tr style=\"height: 25px\"><td colspan=\"7\" ></td></tr>
                <tr style=\"height: 25px\"><td colspan=\"7\" ></td></tr>
                <tr style=\"height: 25px\"><td colspan=\"7\" ></td></tr>
            ";
        }
        // line 90
        yield "            </tbody>
        </table>
    </div>
    ";
        // line 93
        $context["nb_line"] = 0;
        // line 94
        yield "    <div class=\"d-flex\">
        <table class=\"table table-responsive   table-sm table-inverse-color-datagrid mb-2 me-2\"  style=\"width: 230px;border: 1px solid #E0E0E0;\" >
            <thead  align=\"center\" style=\"vertical-align: middle!important;\"><th>Base HT</th><th>Taux</th><th>Montant</th></thead>
            <tbody style=\"height: 75px;\">
            ";
        // line 98
        if ((isset($context["tva_totaux"]) || array_key_exists("tva_totaux", $context) ? $context["tva_totaux"] : (function () { throw new RuntimeError('Variable "tva_totaux" does not exist.', 98, $this->source); })())) {
            // line 99
            yield "                ";
            $context['_parent'] = $context;
            $context['_seq'] = CoreExtension::ensureTraversable((isset($context["tva_totaux"]) || array_key_exists("tva_totaux", $context) ? $context["tva_totaux"] : (function () { throw new RuntimeError('Variable "tva_totaux" does not exist.', 99, $this->source); })()));
            foreach ($context['_seq'] as $context["tva_key"] => $context["montant"]) {
                // line 100
                yield "                    ";
                $context["taux"] = Twig\Extension\CoreExtension::replace($context["tva_key"], ["_tva" => ""]);
                // line 101
                yield "                    <tr>
                        <td class=\"text-center\">";
                // line 102
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extension\CoreExtension']->formatNumber($context["montant"], 2, ".", " "), "html", null, true);
                yield " €</td>
                        <td class=\"text-center\">";
                // line 103
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["taux"]) || array_key_exists("taux", $context) ? $context["taux"] : (function () { throw new RuntimeError('Variable "taux" does not exist.', 103, $this->source); })()), "html", null, true);
                yield "%</td>
                        <td class=\"text-center\">";
                // line 104
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extension\CoreExtension']->formatNumber((($context["montant"] * (isset($context["taux"]) || array_key_exists("taux", $context) ? $context["taux"] : (function () { throw new RuntimeError('Variable "taux" does not exist.', 104, $this->source); })())) / 100), 2, ".", " "), "html", null, true);
                yield "€</td>
                    </tr>
                    ";
                // line 106
                $context["nb_line"] = ((isset($context["nb_line"]) || array_key_exists("nb_line", $context) ? $context["nb_line"] : (function () { throw new RuntimeError('Variable "nb_line" does not exist.', 106, $this->source); })()) + 1);
                // line 107
                yield "                    ";
                $context["total_tva"] = ((isset($context["total_tva"]) || array_key_exists("total_tva", $context) ? $context["total_tva"] : (function () { throw new RuntimeError('Variable "total_tva" does not exist.', 107, $this->source); })()) + (($context["montant"] * (isset($context["taux"]) || array_key_exists("taux", $context) ? $context["taux"] : (function () { throw new RuntimeError('Variable "taux" does not exist.', 107, $this->source); })())) / 100));
                // line 108
                yield "                ";
            }
            $_parent = $context['_parent'];
            unset($context['_seq'], $context['_iterated'], $context['tva_key'], $context['montant'], $context['_parent'], $context['loop']);
            $context = array_intersect_key($context, $_parent) + $_parent;
            // line 109
            yield "                ";
            $context["emptyRows"] = (3 - (isset($context["nb_line"]) || array_key_exists("nb_line", $context) ? $context["nb_line"] : (function () { throw new RuntimeError('Variable "nb_line" does not exist.', 109, $this->source); })()));
            // line 110
            yield "                ";
            $context['_parent'] = $context;
            $context['_seq'] = CoreExtension::ensureTraversable(range(1, (isset($context["emptyRows"]) || array_key_exists("emptyRows", $context) ? $context["emptyRows"] : (function () { throw new RuntimeError('Variable "emptyRows" does not exist.', 110, $this->source); })())));
            foreach ($context['_seq'] as $context["_key"] => $context["i"]) {
                // line 111
                yield "                    <tr style=\"height: 25px\"><td colspan=\"3\"></td></tr>
                ";
            }
            $_parent = $context['_parent'];
            unset($context['_seq'], $context['_iterated'], $context['_key'], $context['i'], $context['_parent'], $context['loop']);
            $context = array_intersect_key($context, $_parent) + $_parent;
            // line 113
            yield "            ";
        } else {
            // line 114
            yield "                <tr style=\"height: 25px\"><td colspan=\"3\" ></td></tr>
                <tr style=\"height: 25px\"><td colspan=\"3\" ></td></tr>
                <tr style=\"height: 25px\"><td colspan=\"3\" ></td></tr>
            ";
        }
        // line 118
        yield "            </tbody>
        </table>
        <div class=\"ms-auto\">
            <div class=\"d-flex\">
                <div class=\"titre-small color-orange ";
        // line 122
        yield (((isset($context["facture_a_envoyer"]) || array_key_exists("facture_a_envoyer", $context) ? $context["facture_a_envoyer"] : (function () { throw new RuntimeError('Variable "facture_a_envoyer" does not exist.', 122, $this->source); })())) ? ("mt-2") : ("mt-3"));
        yield "\" style=\"width:253px;\">Déplacement</div>
                <div class=\"titre-small color-orange ";
        // line 123
        yield (((isset($context["facture_a_envoyer"]) || array_key_exists("facture_a_envoyer", $context) ? $context["facture_a_envoyer"] : (function () { throw new RuntimeError('Variable "facture_a_envoyer" does not exist.', 123, $this->source); })())) ? ("mt-2") : ("mt-3"));
        yield "\">Main d'oeuvre</div>
            </div>
            <div class=\"d-flex mb-1\">
                <div class=\"d-flex align-items-center  me-2\">
                    <label style=\"width:33px;\">Qté</label>
                    <input type=\"text\" style=\"width:50px\" disabled class=\"form-control\" value=\"";
        // line 128
        (((isset($context["ligne_deplacement"]) || array_key_exists("ligne_deplacement", $context) ? $context["ligne_deplacement"] : (function () { throw new RuntimeError('Variable "ligne_deplacement" does not exist.', 128, $this->source); })())) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["ligne_deplacement"]) || array_key_exists("ligne_deplacement", $context) ? $context["ligne_deplacement"] : (function () { throw new RuntimeError('Variable "ligne_deplacement" does not exist.', 128, $this->source); })()), "quantite", [], "any", false, false, false, 128), "html", null, true)) : (yield ""));
        yield "\">
                </div>
                <div class=\"d-flex align-items-center  me-2\">
                    <label class=\" ms-2\" style=\"width:59px;\">Prix HT</label>
                    <input type=\"text\" style=\"width:80px\" disabled class=\"form-control\" value=\"";
        // line 132
        (((isset($context["ligne_deplacement"]) || array_key_exists("ligne_deplacement", $context) ? $context["ligne_deplacement"] : (function () { throw new RuntimeError('Variable "ligne_deplacement" does not exist.', 132, $this->source); })())) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((CoreExtension::getAttribute($this->env, $this->source, (isset($context["ligne_deplacement"]) || array_key_exists("ligne_deplacement", $context) ? $context["ligne_deplacement"] : (function () { throw new RuntimeError('Variable "ligne_deplacement" does not exist.', 132, $this->source); })()), "getPrixTotalHt", [], "any", false, false, false, 132) . "€"), "html", null, true)) : (yield ""));
        yield "\">
                </div>
                <div class=\"d-flex align-items-center  me-2\">
                    <label class=\" ms-2\" style=\"margin-right: 11px;\">Qté</label>
                    <input type=\"text\" style=\"width:50px\" disabled class=\"form-control\" value=\"";
        // line 136
        (((isset($context["ligne_mo"]) || array_key_exists("ligne_mo", $context) ? $context["ligne_mo"] : (function () { throw new RuntimeError('Variable "ligne_mo" does not exist.', 136, $this->source); })())) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["ligne_mo"]) || array_key_exists("ligne_mo", $context) ? $context["ligne_mo"] : (function () { throw new RuntimeError('Variable "ligne_mo" does not exist.', 136, $this->source); })()), "quantite", [], "any", false, false, false, 136), "html", null, true)) : (yield ""));
        yield "\">
                </div>
                <div class=\"d-flex align-items-center\">
                    <label class=\"ms-2\" style=\"margin-right: 15px;\">Prix HT</label>
                    <input type=\"text\" style=\"width:80px\" disabled class=\"form-control\" value=\"";
        // line 140
        (((isset($context["ligne_mo"]) || array_key_exists("ligne_mo", $context) ? $context["ligne_mo"] : (function () { throw new RuntimeError('Variable "ligne_mo" does not exist.', 140, $this->source); })())) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((CoreExtension::getAttribute($this->env, $this->source, (isset($context["ligne_mo"]) || array_key_exists("ligne_mo", $context) ? $context["ligne_mo"] : (function () { throw new RuntimeError('Variable "ligne_mo" does not exist.', 140, $this->source); })()), "getPrixTotalHt", [], "any", false, false, false, 140) . "€"), "html", null, true)) : (yield ""));
        yield "\">
                </div>
            </div>
            <div class=\"d-flex\">
                <div class=\"d-flex align-items-center  me-2\">
                    <label style=\"width:33px;\">TVA</label>
                    <input type=\"text\" style=\"width:50px\" disabled class=\"form-control\" value=\"";
        // line 146
        (((isset($context["ligne_deplacement"]) || array_key_exists("ligne_deplacement", $context) ? $context["ligne_deplacement"] : (function () { throw new RuntimeError('Variable "ligne_deplacement" does not exist.', 146, $this->source); })())) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["ligne_deplacement"]) || array_key_exists("ligne_deplacement", $context) ? $context["ligne_deplacement"] : (function () { throw new RuntimeError('Variable "ligne_deplacement" does not exist.', 146, $this->source); })()), "getTauxTva", [], "any", false, false, false, 146), "taux", [], "any", false, false, false, 146) . "%"), "html", null, true)) : (yield ""));
        yield "\">
                </div>
                <div class=\"d-flex align-items-center  me-2\">
                    <label class=\"ms-2\" style=\"width:60px;\">Prix TTC</label>
                    <input type=\"text\" style=\"width:80px\" disabled class=\"form-control\" value=\"";
        // line 150
        (((isset($context["ligne_deplacement"]) || array_key_exists("ligne_deplacement", $context) ? $context["ligne_deplacement"] : (function () { throw new RuntimeError('Variable "ligne_deplacement" does not exist.', 150, $this->source); })())) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["ligne_deplacement_ttc"]) || array_key_exists("ligne_deplacement_ttc", $context) ? $context["ligne_deplacement_ttc"] : (function () { throw new RuntimeError('Variable "ligne_deplacement_ttc" does not exist.', 150, $this->source); })()), "html", null, true)) : (yield ""));
        yield "\">
                </div>
                <div class=\"d-flex align-items-center  me-2\">
                    <label class=\"me-2 ms-2\">TVA</label>
                    <input type=\"text\" style=\"width:50px\" disabled class=\"form-control\" value=\"";
        // line 154
        (((isset($context["ligne_mo"]) || array_key_exists("ligne_mo", $context) ? $context["ligne_mo"] : (function () { throw new RuntimeError('Variable "ligne_mo" does not exist.', 154, $this->source); })())) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["ligne_mo"]) || array_key_exists("ligne_mo", $context) ? $context["ligne_mo"] : (function () { throw new RuntimeError('Variable "ligne_mo" does not exist.', 154, $this->source); })()), "getTauxTva", [], "any", false, false, false, 154), "taux", [], "any", false, false, false, 154) . "%"), "html", null, true)) : (yield ""));
        yield "\">
                </div>
                <div class=\"d-flex align-items-center\">
                    <label class=\"ms-2\" style=\"margin-right: 9px;\">Prix TTC</label>
                    <input type=\"text\" style=\"width:80px\" disabled class=\"form-control\" value=\"";
        // line 158
        (((isset($context["ligne_mo"]) || array_key_exists("ligne_mo", $context) ? $context["ligne_mo"] : (function () { throw new RuntimeError('Variable "ligne_mo" does not exist.', 158, $this->source); })())) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["ligne_mo_ttc"]) || array_key_exists("ligne_mo_ttc", $context) ? $context["ligne_mo_ttc"] : (function () { throw new RuntimeError('Variable "ligne_mo_ttc" does not exist.', 158, $this->source); })()), "html", null, true)) : (yield ""));
        yield "\">
                </div>
            </div>
            ";
        // line 161
        if ((isset($context["facture_a_envoyer"]) || array_key_exists("facture_a_envoyer", $context) ? $context["facture_a_envoyer"] : (function () { throw new RuntimeError('Variable "facture_a_envoyer" does not exist.', 161, $this->source); })())) {
            // line 162
            yield "            <div class=\"color-rouge w-100 text-center mb-2\">Facture à envoyer</div>
            ";
        }
        // line 164
        yield "        </div>
    </div>
    ";
        // line 166
        $context["nb_line"] = 0;
        // line 167
        yield "    <div class=\"d-flex\">
        <div style=\"max-height: 105.5px; overflow: auto;width: 547px;margin-right: 2rem;\" class=\" mb-2\">
            <table class=\"table table-responsive  table-sm table-inverse-color-datagrid mb-0\"  style=\"border: 1px solid #E0E0E0;\">
                <thead>
                <th>Date</th>
                <th>Montant</th>
                <th>Date prévue enc.</th>
                <th>Mode paiement</th>
                <th>Date enc.</th>
                </thead>
                <tbody style=\"height: 74px\">
                ";
        // line 178
        $context['_parent'] = $context;
        $context['_seq'] = CoreExtension::ensureTraversable((isset($context["paiements"]) || array_key_exists("paiements", $context) ? $context["paiements"] : (function () { throw new RuntimeError('Variable "paiements" does not exist.', 178, $this->source); })()));
        $context['_iterated'] = false;
        foreach ($context['_seq'] as $context["_key"] => $context["paiement"]) {
            // line 179
            yield "                    ";
            $context["nb_line"] = ((isset($context["nb_line"]) || array_key_exists("nb_line", $context) ? $context["nb_line"] : (function () { throw new RuntimeError('Variable "nb_line" does not exist.', 179, $this->source); })()) + 1);
            // line 180
            yield "                    <tr>
                        <td  class=\"text-center\">";
            // line 181
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extension\CoreExtension']->formatDate(CoreExtension::getAttribute($this->env, $this->source, $context["paiement"], "date", [], "any", false, false, false, 181), "d/m/Y"), "html", null, true);
            yield "</td>
                        <td  class=\"text-center\">";
            // line 182
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extension\CoreExtension']->formatNumber(CoreExtension::getAttribute($this->env, $this->source, $context["paiement"], "montantTtc", [], "any", false, false, false, 182), 2, ".", " "), "html", null, true);
            yield " €</td>
                        <td  class=\"text-center\">";
            // line 183
            ((CoreExtension::getAttribute($this->env, $this->source, $context["paiement"], "datePrevisionnelle", [], "any", false, false, false, 183)) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extension\CoreExtension']->formatDate(CoreExtension::getAttribute($this->env, $this->source, $context["paiement"], "datePrevisionnelle", [], "any", false, false, false, 183), "d/m/Y"), "html", null, true)) : (yield ""));
            yield "</td>
                        <td  class=\"text-center\">";
            // line 184
            ((CoreExtension::getAttribute($this->env, $this->source, $context["paiement"], "moyenPaiement", [], "any", false, false, false, 184)) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["paiement"], "moyenPaiement", [], "any", false, false, false, 184), "libelleCourt", [], "any", false, false, false, 184), "html", null, true)) : (yield ""));
            yield "</td>
                        <td  class=\"text-center\"></td>
                    </tr>
                ";
            $context['_iterated'] = true;
        }
        if (!$context['_iterated']) {
            // line 188
            yield "                    <tr style=\"height: 25px\"><td colspan=\"5\" ></td></tr>
                    <tr style=\"height: 25px\"><td colspan=\"5\" ></td></tr>
                    <tr style=\"height: 25px\"><td colspan=\"5\" ></td></tr>
                ";
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['paiement'], $context['_parent'], $context['loop']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 192
        yield "                ";
        if ((isset($context["nb_line"]) || array_key_exists("nb_line", $context) ? $context["nb_line"] : (function () { throw new RuntimeError('Variable "nb_line" does not exist.', 192, $this->source); })())) {
            // line 193
            yield "                    ";
            $context["emptyRows"] = (3 - (isset($context["nb_line"]) || array_key_exists("nb_line", $context) ? $context["nb_line"] : (function () { throw new RuntimeError('Variable "nb_line" does not exist.', 193, $this->source); })()));
            // line 194
            yield "                    ";
            $context['_parent'] = $context;
            $context['_seq'] = CoreExtension::ensureTraversable(range(1, (isset($context["emptyRows"]) || array_key_exists("emptyRows", $context) ? $context["emptyRows"] : (function () { throw new RuntimeError('Variable "emptyRows" does not exist.', 194, $this->source); })())));
            foreach ($context['_seq'] as $context["_key"] => $context["i"]) {
                // line 195
                yield "                        <tr style=\"height: 25px\"><td colspan=\"5\"></td></tr>
                    ";
            }
            $_parent = $context['_parent'];
            unset($context['_seq'], $context['_iterated'], $context['_key'], $context['i'], $context['_parent'], $context['loop']);
            $context = array_intersect_key($context, $_parent) + $_parent;
            // line 197
            yield "                ";
        }
        // line 198
        yield "                </tbody>
            </table>
        </div>
        <div class=\"ms-auto\">
            <div class=\"d-flex mb-2\">
                <div class=\"d-flex flex-column\" style=\"margin-right: 16px;\">
                    <div class=\"titre-small color-orange mt-2\">Total HT</div>
                    <input type=\"text\" style=\"width:80px\" disabled class=\"form-control\" value=\"";
        // line 205
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["total_ht"]) || array_key_exists("total_ht", $context) ? $context["total_ht"] : (function () { throw new RuntimeError('Variable "total_ht" does not exist.', 205, $this->source); })()), "html", null, true);
        yield "€\"  id=\"total_ht\">
                </div>
                <div class=\"d-flex flex-column\">
                    <div class=\"titre-small color-orange mt-2\" >Total TTC</div>
                    <input type=\"text\" style=\"width:80px\" disabled class=\"form-control\" value=\"";
        // line 209
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["total_ttc"]) || array_key_exists("total_ttc", $context) ? $context["total_ttc"] : (function () { throw new RuntimeError('Variable "total_ttc" does not exist.', 209, $this->source); })()), "html", null, true);
        yield "€\" id=\"total_ttc\">
                </div>
            </div>
            <div class=\"d-flex\">
                <div class=\"d-flex flex-column\" style=\"margin-right: 16px;\">
                    <div class=\"titre-small color-orange mt-0\">Total TVA</div>
                    <input type=\"text\" style=\"width:80px\" disabled class=\"form-control\" value=\"";
        // line 215
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extension\CoreExtension']->formatNumber((isset($context["total_tva"]) || array_key_exists("total_tva", $context) ? $context["total_tva"] : (function () { throw new RuntimeError('Variable "total_tva" does not exist.', 215, $this->source); })()), 2, ".", " "), "html", null, true);
        yield "€\"  id=\"total_tva\">
                </div>
                <div class=\"d-flex flex-column\">
                    <div class=\"titre-small color-orange mt-0\">Restant dû</div>
                    <input type=\"text\" style=\"width:80px\" disabled class=\"form-control\" value=\"";
        // line 219
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(((isset($context["total_ttc"]) || array_key_exists("total_ttc", $context) ? $context["total_ttc"] : (function () { throw new RuntimeError('Variable "total_ttc" does not exist.', 219, $this->source); })()) - ((isset($context["total_paiement"]) || array_key_exists("total_paiement", $context) ? $context["total_paiement"] : (function () { throw new RuntimeError('Variable "total_paiement" does not exist.', 219, $this->source); })()) + (isset($context["total_accompte"]) || array_key_exists("total_accompte", $context) ? $context["total_accompte"] : (function () { throw new RuntimeError('Variable "total_accompte" does not exist.', 219, $this->source); })()))), "html", null, true);
        yield "€\"  id=\"total_restant_du\">
                </div>
            </div>
        </div>
    </div>
</div>";
        
        $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);

        
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);

        return; yield '';
    }

    /**
     * @codeCoverageIgnore
     */
    public function getTemplateName()
    {
        return "clients/intervention/_facturation.html.twig";
    }

    /**
     * @codeCoverageIgnore
     */
    public function isTraitable()
    {
        return false;
    }

    /**
     * @codeCoverageIgnore
     */
    public function getDebugInfo()
    {
        return array (  550 => 219,  543 => 215,  534 => 209,  527 => 205,  518 => 198,  515 => 197,  508 => 195,  503 => 194,  500 => 193,  497 => 192,  488 => 188,  479 => 184,  475 => 183,  471 => 182,  467 => 181,  464 => 180,  461 => 179,  456 => 178,  443 => 167,  441 => 166,  437 => 164,  433 => 162,  431 => 161,  425 => 158,  418 => 154,  411 => 150,  404 => 146,  395 => 140,  388 => 136,  381 => 132,  374 => 128,  366 => 123,  362 => 122,  356 => 118,  350 => 114,  347 => 113,  340 => 111,  335 => 110,  332 => 109,  326 => 108,  323 => 107,  321 => 106,  316 => 104,  312 => 103,  308 => 102,  305 => 101,  302 => 100,  297 => 99,  295 => 98,  289 => 94,  287 => 93,  282 => 90,  275 => 85,  272 => 84,  269 => 83,  262 => 81,  257 => 80,  254 => 79,  251 => 78,  245 => 77,  242 => 76,  236 => 75,  233 => 74,  228 => 73,  225 => 72,  222 => 71,  219 => 70,  213 => 69,  210 => 68,  207 => 67,  202 => 66,  196 => 65,  190 => 62,  186 => 61,  182 => 60,  178 => 59,  174 => 58,  170 => 57,  166 => 56,  163 => 55,  160 => 54,  157 => 53,  154 => 52,  151 => 51,  148 => 50,  145 => 49,  142 => 48,  139 => 47,  134 => 46,  129 => 45,  126 => 44,  124 => 43,  109 => 30,  105 => 28,  102 => 27,  99 => 26,  96 => 25,  93 => 24,  91 => 23,  88 => 21,  84 => 19,  81 => 18,  78 => 17,  75 => 16,  72 => 15,  70 => 14,  68 => 13,  66 => 12,  64 => 11,  62 => 10,  60 => 9,  58 => 8,  56 => 7,  54 => 6,  52 => 5,  50 => 4,  48 => 3,  46 => 2,  44 => 1,);
    }

    public function getSourceContext()
    {
        return new Source("{% set ligne_mo = intervention.getLigneMO %}
{% set ligne_deplacement = intervention.getLigneDeplacement %}
{% set ligne_mo_ttc = 0 %}
{% set ligne_deplacement_ttc = 0 %}
{% set tva_totaux = {} %}
{% set paiements = [] %}
{% set total_ht = 0 %}
{% set total_ttc = 0 %}
{% set total_tva = 0 %}
{% set total_paiement = 0 %}
{% set total_accompte = 0 %}
{% set restant_du = 0 %}
{% set facture_a_envoyer = false %}
{% if ligne_mo is defined and ligne_mo %}
    {% set tva = ligne_mo.getTauxTva ? ligne_mo.getTauxTva.getTaux : 0 %}
    {% set tva_key = (tva ~ '_tva') %}
    {% set montant = ligne_mo.getPrixTotalHt %}
    {% set ligne_mo_ttc = montant + (montant*tva)/100 %}
    {% set tva_totaux = tva_totaux|merge({ (tva_key): (tva_totaux[tva_key]|default(0) + montant) }) %}
{% endif %}

{# 3. Ajout de la ligne déplacement si elle existe #}
{% if ligne_deplacement is defined and ligne_deplacement %}
    {% set tva = ligne_deplacement.getTauxTva ? ligne_deplacement.getTauxTva.getTaux : 0 %}
    {% set tva_key = (tva ~ '_tva') %}
    {% set montant = ligne_deplacement.getPrixTotalHt %}
    {% set ligne_deplacement_ttc = montant + (montant*tva)/100 %}
    {% set tva_totaux = tva_totaux|merge({ (tva_key): (tva_totaux[tva_key]|default(0) + montant) }) %}
{% endif %}
<div class=\"container-fluid\">
    <div style=\"max-height: 130.5px; overflow: auto;border-bottom: 1px solid #ccc\" class=\" mb-2\">
        <table class=\"table table-responsive   table-sm table-inverse-color-datagrid mb-0 \" id=\"tableau-produit-facture\">
            <thead>
            <th>Référence</th>
            <th>Désignation</th>
            <th>P.U HT</th>
            <th>Qté</th>
            <th>Total HT</th>
            <th>TVA</th>
            <th>Aff.</th>
            </thead>
            <tbody style=\"height: 100px;\">
            {% if intervention.factures|length > 0 %}
                {% set nb_line = 0 %}
                {% for factures in intervention.factures %}
                    {%  for factureLigne in factures.getFactureLignes %}
                        {% if not factureLigne.getProduit or factureLigne.getProduit.getProduitType.getId() == 1 or factureLigne.getProduit.getProduitType.getId() == 2 %}
                            {% set nb_line = nb_line + 1 %}
                            {% set tva = factureLigne.getTauxTva ? factureLigne.getTauxTva.getTaux : 0 %}
                            {% set tva_key = (tva ~ '_tva') %}
                            {% if factureLigne.getProduitFactureAffectation.libelleCourt == 'F' %}
                                {% set montant = factureLigne.getPrixTotalHt %}
                                {% set tva_totaux = tva_totaux|merge({ (tva_key): (tva_totaux[tva_key]|default(0) + montant) }) %}
                            {% endif %}
                            <tr >
                                <td class=\"text-center\">{{ factureLigne.getProduit.getCode }}</td>
                                <td class=\"text-center\">{{ factureLigne.getProduit.designation }}</td>
                                <td class=\"text-center\">{{ factureLigne.getPuHt ~ '€' }}</td>
                                <td class=\"text-center\">{{ factureLigne.getQuantite }}</td>
                                <td class=\"text-center\">{{ factureLigne.getPrixTotalHt ~ '€' }}</td>
                                <td class=\"text-center\">{{ factureLigne.getTauxTva ? factureLigne.getTauxTva.getTaux ~ '%' }}</td>
                                <td class=\"text-center\">{{ factureLigne.getProduitFactureAffectation.libelleCourt }}</td>
                            </tr>
                        {% endif %}
                    {% endfor %}
                    {% for paiement in factures.getPaiements %}
                        {% set paiements = paiements|merge([paiement]) %}
                        {% set total_paiement = total_paiement + paiement.montantTtc  %}
                    {% endfor %}
                    {% set total_ht = total_ht + factures.montantHt %}
                    {% set total_ttc = total_ttc + factures.montantTtc %}
                    {% if factures.getFactureAcompte %}
                        {% for paiement in factures.getFactureAcompte.getPaiements %}
                            {% set total_accompte = total_accompte + paiement.montantTTC %}
                        {% endfor %}
                    {% endif %}
                {% endfor %}
                {% set emptyRows = 4 - nb_line %}
                {% if emptyRows > 0 %}
                    {% for i in 1..emptyRows %}
                        <tr style=\"height: 25px\"><td colspan=\"7\"></td></tr>
                    {% endfor %}
                {% endif %}
            {% else %}
                <tr style=\"height: 25px\"><td colspan=\"7\" ></td></tr>
                <tr style=\"height: 25px\"><td colspan=\"7\" ></td></tr>
                <tr style=\"height: 25px\"><td colspan=\"7\" ></td></tr>
                <tr style=\"height: 25px\"><td colspan=\"7\" ></td></tr>
            {% endif %}
            </tbody>
        </table>
    </div>
    {% set nb_line = 0 %}
    <div class=\"d-flex\">
        <table class=\"table table-responsive   table-sm table-inverse-color-datagrid mb-2 me-2\"  style=\"width: 230px;border: 1px solid #E0E0E0;\" >
            <thead  align=\"center\" style=\"vertical-align: middle!important;\"><th>Base HT</th><th>Taux</th><th>Montant</th></thead>
            <tbody style=\"height: 75px;\">
            {% if tva_totaux %}
                {% for tva_key, montant in tva_totaux %}
                    {% set taux = tva_key|replace({'_tva':''}) %}
                    <tr>
                        <td class=\"text-center\">{{ montant|number_format(2, '.', ' ') }} €</td>
                        <td class=\"text-center\">{{ taux }}%</td>
                        <td class=\"text-center\">{{ ((montant * taux)/100)|number_format(2, '.', ' ') }}€</td>
                    </tr>
                    {% set nb_line = nb_line +1  %}
                    {% set total_tva =  total_tva + ((montant * taux)/100) %}
                {% endfor %}
                {% set emptyRows = 3 - nb_line %}
                {% for i in 1..emptyRows %}
                    <tr style=\"height: 25px\"><td colspan=\"3\"></td></tr>
                {% endfor %}
            {% else %}
                <tr style=\"height: 25px\"><td colspan=\"3\" ></td></tr>
                <tr style=\"height: 25px\"><td colspan=\"3\" ></td></tr>
                <tr style=\"height: 25px\"><td colspan=\"3\" ></td></tr>
            {% endif %}
            </tbody>
        </table>
        <div class=\"ms-auto\">
            <div class=\"d-flex\">
                <div class=\"titre-small color-orange {{ facture_a_envoyer ? 'mt-2' : 'mt-3' }}\" style=\"width:253px;\">Déplacement</div>
                <div class=\"titre-small color-orange {{ facture_a_envoyer ? 'mt-2' : 'mt-3' }}\">Main d'oeuvre</div>
            </div>
            <div class=\"d-flex mb-1\">
                <div class=\"d-flex align-items-center  me-2\">
                    <label style=\"width:33px;\">Qté</label>
                    <input type=\"text\" style=\"width:50px\" disabled class=\"form-control\" value=\"{{ ligne_deplacement ? ligne_deplacement.quantite }}\">
                </div>
                <div class=\"d-flex align-items-center  me-2\">
                    <label class=\" ms-2\" style=\"width:59px;\">Prix HT</label>
                    <input type=\"text\" style=\"width:80px\" disabled class=\"form-control\" value=\"{{ ligne_deplacement ? ligne_deplacement.getPrixTotalHt ~ '€' }}\">
                </div>
                <div class=\"d-flex align-items-center  me-2\">
                    <label class=\" ms-2\" style=\"margin-right: 11px;\">Qté</label>
                    <input type=\"text\" style=\"width:50px\" disabled class=\"form-control\" value=\"{{ ligne_mo ? ligne_mo.quantite }}\">
                </div>
                <div class=\"d-flex align-items-center\">
                    <label class=\"ms-2\" style=\"margin-right: 15px;\">Prix HT</label>
                    <input type=\"text\" style=\"width:80px\" disabled class=\"form-control\" value=\"{{ ligne_mo ? ligne_mo.getPrixTotalHt ~ '€' }}\">
                </div>
            </div>
            <div class=\"d-flex\">
                <div class=\"d-flex align-items-center  me-2\">
                    <label style=\"width:33px;\">TVA</label>
                    <input type=\"text\" style=\"width:50px\" disabled class=\"form-control\" value=\"{{ ligne_deplacement ? ligne_deplacement.getTauxTva.taux ~ '%' }}\">
                </div>
                <div class=\"d-flex align-items-center  me-2\">
                    <label class=\"ms-2\" style=\"width:60px;\">Prix TTC</label>
                    <input type=\"text\" style=\"width:80px\" disabled class=\"form-control\" value=\"{{ ligne_deplacement ? ligne_deplacement_ttc }}\">
                </div>
                <div class=\"d-flex align-items-center  me-2\">
                    <label class=\"me-2 ms-2\">TVA</label>
                    <input type=\"text\" style=\"width:50px\" disabled class=\"form-control\" value=\"{{ ligne_mo ? ligne_mo.getTauxTva.taux ~ '%' }}\">
                </div>
                <div class=\"d-flex align-items-center\">
                    <label class=\"ms-2\" style=\"margin-right: 9px;\">Prix TTC</label>
                    <input type=\"text\" style=\"width:80px\" disabled class=\"form-control\" value=\"{{ ligne_mo ? ligne_mo_ttc }}\">
                </div>
            </div>
            {% if facture_a_envoyer %}
            <div class=\"color-rouge w-100 text-center mb-2\">Facture à envoyer</div>
            {% endif %}
        </div>
    </div>
    {% set nb_line = 0 %}
    <div class=\"d-flex\">
        <div style=\"max-height: 105.5px; overflow: auto;width: 547px;margin-right: 2rem;\" class=\" mb-2\">
            <table class=\"table table-responsive  table-sm table-inverse-color-datagrid mb-0\"  style=\"border: 1px solid #E0E0E0;\">
                <thead>
                <th>Date</th>
                <th>Montant</th>
                <th>Date prévue enc.</th>
                <th>Mode paiement</th>
                <th>Date enc.</th>
                </thead>
                <tbody style=\"height: 74px\">
                {% for paiement in paiements %}
                    {% set nb_line = nb_line +1  %}
                    <tr>
                        <td  class=\"text-center\">{{ paiement.date|date('d/m/Y') }}</td>
                        <td  class=\"text-center\">{{ paiement.montantTtc|number_format(2, '.', ' ') }} €</td>
                        <td  class=\"text-center\">{{ paiement.datePrevisionnelle ? paiement.datePrevisionnelle|date('d/m/Y') }}</td>
                        <td  class=\"text-center\">{{ paiement.moyenPaiement ? paiement.moyenPaiement.libelleCourt : '' }}</td>
                        <td  class=\"text-center\"></td>
                    </tr>
                {% else %}
                    <tr style=\"height: 25px\"><td colspan=\"5\" ></td></tr>
                    <tr style=\"height: 25px\"><td colspan=\"5\" ></td></tr>
                    <tr style=\"height: 25px\"><td colspan=\"5\" ></td></tr>
                {% endfor %}
                {% if nb_line %}
                    {% set emptyRows = 3 - nb_line %}
                    {% for i in 1..emptyRows %}
                        <tr style=\"height: 25px\"><td colspan=\"5\"></td></tr>
                    {% endfor %}
                {% endif %}
                </tbody>
            </table>
        </div>
        <div class=\"ms-auto\">
            <div class=\"d-flex mb-2\">
                <div class=\"d-flex flex-column\" style=\"margin-right: 16px;\">
                    <div class=\"titre-small color-orange mt-2\">Total HT</div>
                    <input type=\"text\" style=\"width:80px\" disabled class=\"form-control\" value=\"{{ total_ht }}€\"  id=\"total_ht\">
                </div>
                <div class=\"d-flex flex-column\">
                    <div class=\"titre-small color-orange mt-2\" >Total TTC</div>
                    <input type=\"text\" style=\"width:80px\" disabled class=\"form-control\" value=\"{{ total_ttc }}€\" id=\"total_ttc\">
                </div>
            </div>
            <div class=\"d-flex\">
                <div class=\"d-flex flex-column\" style=\"margin-right: 16px;\">
                    <div class=\"titre-small color-orange mt-0\">Total TVA</div>
                    <input type=\"text\" style=\"width:80px\" disabled class=\"form-control\" value=\"{{ total_tva|number_format(2, '.', ' ') }}€\"  id=\"total_tva\">
                </div>
                <div class=\"d-flex flex-column\">
                    <div class=\"titre-small color-orange mt-0\">Restant dû</div>
                    <input type=\"text\" style=\"width:80px\" disabled class=\"form-control\" value=\"{{  total_ttc - (total_paiement + total_accompte) }}€\"  id=\"total_restant_du\">
                </div>
            </div>
        </div>
    </div>
</div>", "clients/intervention/_facturation.html.twig", "/builds/dev/refonte_sav/templates/clients/intervention/_facturation.html.twig");
    }
}
