<?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;

/* intervention/bloc_facturation.html.twig */
class __TwigTemplate_8d29367cf81cccef7680dc268807ca6c5e518e5e8989dd696ecfb50c370d104f 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", "intervention/bloc_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", "intervention/bloc_facturation.html.twig"));

        // line 2
        $context["is_readonly"] = ((array_key_exists("is_readonly", $context)) ? (Twig\Extension\CoreExtension::default((isset($context["is_readonly"]) || array_key_exists("is_readonly", $context) ? $context["is_readonly"] : (function () { throw new RuntimeError('Variable "is_readonly" does not exist.', 2, $this->source); })()), false)) : (false));
        // line 3
        yield "
<div class=\"d-flex\">
    <div class=\"d-flex flex-column position-relative ";
        // line 5
        if ((isset($context["is_readonly"]) || array_key_exists("is_readonly", $context) ? $context["is_readonly"] : (function () { throw new RuntimeError('Variable "is_readonly" does not exist.', 5, $this->source); })())) {
            yield "w-100";
        } else {
            yield "me-3";
        }
        yield "\" style=\"";
        if ( !(isset($context["is_readonly"]) || array_key_exists("is_readonly", $context) ? $context["is_readonly"] : (function () { throw new RuntimeError('Variable "is_readonly" does not exist.', 5, $this->source); })())) {
            yield "width: 972px";
        }
        yield "\">
        ";
        // line 6
        if (( !(isset($context["is_readonly"]) || array_key_exists("is_readonly", $context) ? $context["is_readonly"] : (function () { throw new RuntimeError('Variable "is_readonly" does not exist.', 6, $this->source); })()) && (0 !== CoreExtension::compare((isset($context["type"]) || array_key_exists("type", $context) ? $context["type"] : (function () { throw new RuntimeError('Variable "type" does not exist.', 6, $this->source); })()), "technique")))) {
            // line 7
            yield "                        <div class=\"d-flex\" style=\"position: absolute;top:inherit;right:13px;\">
                <i id=\"add_facture-piece\" data-disable-on-view=\"\" class=\"fa fa-lg fa-plus button-add custom-history bg-vert\" style=\"position:relative;border-color: #14a085;-webkit-text-stroke: 1px #14a085;top:inherit;right:inherit\"></i>
            </div>
        ";
        }
        // line 12
        yield "        <div class=\"d-flex flex-column\" style=\"";
        if ( !(isset($context["is_readonly"]) || array_key_exists("is_readonly", $context) ? $context["is_readonly"] : (function () { throw new RuntimeError('Variable "is_readonly" does not exist.', 12, $this->source); })())) {
            yield "width: 972px";
        }
        yield ";\">
            ";
        // line 13
        if ((isset($context["is_readonly"]) || array_key_exists("is_readonly", $context) ? $context["is_readonly"] : (function () { throw new RuntimeError('Variable "is_readonly" does not exist.', 13, $this->source); })())) {
            // line 14
            yield "                ";
            // line 15
            yield "                ";
            // line 16
            yield "                <div class=\"d-flex\">
                    <div class=\"d-flex justify-content-between w-100\">
                        <div style=\"min-height: 122px;max-height: 122px;overflow-y: auto;border: 1px solid #E0E0E0;width:802px;\">
                            <table class=\"table table-responsive table-sm table-inverse-color-datagrid mb-0\">
                                <thead align=\"center\" style=\"vertical-align: middle!important;\">
                                    <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>
                                    ";
            // line 30
            $context["facture_lignes_pieces"] = [];
            // line 31
            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.', 31, $this->source); })()), "factures", [], "any", false, false, false, 31));
            foreach ($context['_seq'] as $context["_key"] => $context["facture"]) {
                // line 32
                yield "                                        ";
                $context['_parent'] = $context;
                $context['_seq'] = CoreExtension::ensureTraversable(CoreExtension::getAttribute($this->env, $this->source, $context["facture"], "getFactureLignes", [], "any", false, false, false, 32));
                foreach ($context['_seq'] as $context["_key"] => $context["factureLigne"]) {
                    // line 33
                    yield "                                            ";
                    if (((CoreExtension::getAttribute($this->env, $this->source, $context["factureLigne"], "getProduit", [], "any", false, false, false, 33) && CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["factureLigne"], "getProduit", [], "any", false, false, false, 33), "getProduitType", [], "any", false, false, false, 33)) && (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, 33), "getProduitType", [], "any", false, false, false, 33), "id", [], "any", false, false, false, 33), 1)))) {
                        // line 34
                        yield "                                                ";
                        $context["facture_lignes_pieces"] = Twig\Extension\CoreExtension::merge((isset($context["facture_lignes_pieces"]) || array_key_exists("facture_lignes_pieces", $context) ? $context["facture_lignes_pieces"] : (function () { throw new RuntimeError('Variable "facture_lignes_pieces" does not exist.', 34, $this->source); })()), [$context["factureLigne"]]);
                        // line 35
                        yield "                                            ";
                    }
                    // line 36
                    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 37
                yield "                                    ";
            }
            $_parent = $context['_parent'];
            unset($context['_seq'], $context['_iterated'], $context['_key'], $context['facture'], $context['_parent'], $context['loop']);
            $context = array_intersect_key($context, $_parent) + $_parent;
            // line 38
            yield "                                    ";
            if ((1 === CoreExtension::compare(Twig\Extension\CoreExtension::length($this->env->getCharset(), (isset($context["facture_lignes_pieces"]) || array_key_exists("facture_lignes_pieces", $context) ? $context["facture_lignes_pieces"] : (function () { throw new RuntimeError('Variable "facture_lignes_pieces" does not exist.', 38, $this->source); })())), 0))) {
                // line 39
                yield "                                        ";
                $context['_parent'] = $context;
                $context['_seq'] = CoreExtension::ensureTraversable((isset($context["facture_lignes_pieces"]) || array_key_exists("facture_lignes_pieces", $context) ? $context["facture_lignes_pieces"] : (function () { throw new RuntimeError('Variable "facture_lignes_pieces" does not exist.', 39, $this->source); })()));
                foreach ($context['_seq'] as $context["_key"] => $context["factureLigne"]) {
                    // line 40
                    yield "                                            <tr class=\"";
                    yield (((CoreExtension::getAttribute($this->env, $this->source, $context["factureLigne"], "getProduitFactureAffectation", [], "any", false, false, false, 40) && (0 === CoreExtension::compare(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["factureLigne"], "getProduitFactureAffectation", [], "any", false, false, false, 40), "libelleCourt", [], "any", false, false, false, 40), "S")))) ? ("bg-orange-input") : (""));
                    yield "\">
                                                <td class=\"text-center\">";
                    // line 41
                    ((CoreExtension::getAttribute($this->env, $this->source, $context["factureLigne"], "getProduit", [], "any", false, false, false, 41)) ? (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, 41), "code", [], "any", false, false, false, 41), "html", null, true)) : (yield ""));
                    yield "</td>
                                                <td class=\"text-center\">";
                    // line 42
                    yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(((CoreExtension::getAttribute($this->env, $this->source, $context["factureLigne"], "getProduit", [], "any", false, false, false, 42)) ? (CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["factureLigne"], "getProduit", [], "any", false, false, false, 42), "designation", [], "any", false, false, false, 42)) : (CoreExtension::getAttribute($this->env, $this->source, $context["factureLigne"], "designation", [], "any", false, false, false, 42))), "html", null, true);
                    yield "</td>
                                                <td class=\"text-center\">";
                    // line 43
                    ((CoreExtension::getAttribute($this->env, $this->source, $context["factureLigne"], "getPuHt", [], "any", false, false, false, 43)) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($this->extensions['Twig\Extension\CoreExtension']->formatNumber(CoreExtension::getAttribute($this->env, $this->source, $context["factureLigne"], "getPuHt", [], "any", false, false, false, 43), 2, ",", " ") . "€"), "html", null, true)) : (yield ""));
                    yield "</td>
                                                <td class=\"text-center\">";
                    // line 44
                    ((CoreExtension::getAttribute($this->env, $this->source, $context["factureLigne"], "quantite", [], "any", false, false, false, 44)) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["factureLigne"], "quantite", [], "any", false, false, false, 44), "html", null, true)) : (yield ""));
                    yield "</td>
                                                <td class=\"text-center\">";
                    // line 45
                    ((CoreExtension::getAttribute($this->env, $this->source, $context["factureLigne"], "getPrixTotalHt", [], "any", false, false, false, 45)) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($this->extensions['Twig\Extension\CoreExtension']->formatNumber(CoreExtension::getAttribute($this->env, $this->source, $context["factureLigne"], "getPrixTotalHt", [], "any", false, false, false, 45), 2, ",", " ") . "€"), "html", null, true)) : (yield ""));
                    yield "</td>
                                                <td class=\"text-center\">";
                    // line 46
                    ((CoreExtension::getAttribute($this->env, $this->source, $context["factureLigne"], "getTauxTva", [], "any", false, false, false, 46)) ? (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, 46), "taux", [], "any", false, false, false, 46) . "%"), "html", null, true)) : (yield ""));
                    yield "</td>
                                                <td class=\"text-center\">";
                    // line 47
                    ((CoreExtension::getAttribute($this->env, $this->source, $context["factureLigne"], "getProduitFactureAffectation", [], "any", false, false, false, 47)) ? (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, 47), "libelleCourt", [], "any", false, false, false, 47), "html", null, true)) : (yield ""));
                    yield "</td>
                                            </tr>
                                        ";
                }
                $_parent = $context['_parent'];
                unset($context['_seq'], $context['_iterated'], $context['_key'], $context['factureLigne'], $context['_parent'], $context['loop']);
                $context = array_intersect_key($context, $_parent) + $_parent;
                // line 50
                yield "                                        ";
                $context["emptyRows"] = (3 - Twig\Extension\CoreExtension::length($this->env->getCharset(), (isset($context["facture_lignes_pieces"]) || array_key_exists("facture_lignes_pieces", $context) ? $context["facture_lignes_pieces"] : (function () { throw new RuntimeError('Variable "facture_lignes_pieces" does not exist.', 50, $this->source); })())));
                // line 51
                yield "                                        ";
                if ((1 === CoreExtension::compare((isset($context["emptyRows"]) || array_key_exists("emptyRows", $context) ? $context["emptyRows"] : (function () { throw new RuntimeError('Variable "emptyRows" does not exist.', 51, $this->source); })()), 0))) {
                    // line 52
                    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.', 52, $this->source); })())));
                    foreach ($context['_seq'] as $context["_key"] => $context["i"]) {
                        // line 53
                        yield "                                                <tr style=\"height: 25px\"><td colspan=\"9\"></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 55
                    yield "                                        ";
                }
                // line 56
                yield "                                    ";
            } else {
                // line 57
                yield "                                        <tr style=\"height: 25px\"><td colspan=\"9\"></td></tr>
                                        <tr style=\"height: 25px\"><td colspan=\"9\"></td></tr>
                                        <tr style=\"height: 25px\"><td colspan=\"9\"></td></tr>
                                    ";
            }
            // line 61
            yield "                                </tbody>
                            </table>
                        </div>
                        <div style=\"margin-left: 8px;width:273px;margin-top:-5px;\">
                            ";
            // line 66
            yield "                            <div class=\"d-flex align-items-center mb-1\">
                                <label style=\"width:115px\">Bon de commande</label>
                                <div class=\"d-flex align-items-start\">
                                    <input type=\"text\" disabled class=\"form-control bg-grey\" style=\"width:120px;\" value=\"";
            // line 69
            ((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.', 69, $this->source); })()), "numBonCommande", [], "any", false, false, false, 69)) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(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.', 69, $this->source); })()), "numBonCommande", [], "any", false, false, false, 69), "html", null, true)) : (yield ""));
            yield "\">
                                    <button type=\"button\" class=\"btn ms-2 d-flex align-items-center justify-content-center\" style=\"width:28px;height:28px;padding:0;background:white;border:1px solid #0099FF;margin-top:0;\" disabled>
                                        ";
            // line 71
            yield Twig\Extension\CoreExtension::source($this->env, ("@public_path" . $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("build/images/file-regular.svg")));
            yield "
                                    </button>
                                </div>
                            </div>
                            <table class=\"table table-responsive table-sm table-inverse-color-datagrid mb-0\" id=\"tab-recap-taux\" style=\"overflow-y: auto;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 78
            $context["tva_totaux"] = [];
            // line 79
            yield "                                    ";
            // line 80
            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.', 80, $this->source); })()), "factures", [], "any", false, false, false, 80));
            foreach ($context['_seq'] as $context["_key"] => $context["facture"]) {
                // line 81
                yield "                                        ";
                $context['_parent'] = $context;
                $context['_seq'] = CoreExtension::ensureTraversable(CoreExtension::getAttribute($this->env, $this->source, $context["facture"], "getFactureLignes", [], "any", false, false, false, 81));
                foreach ($context['_seq'] as $context["_key"] => $context["factureLigne"]) {
                    // line 82
                    yield "                                            ";
                    if (((CoreExtension::getAttribute($this->env, $this->source, $context["factureLigne"], "getProduit", [], "any", false, false, false, 82) && CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["factureLigne"], "getProduit", [], "any", false, false, false, 82), "getProduitType", [], "any", false, false, false, 82)) && (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, 82), "getProduitType", [], "any", false, false, false, 82), "id", [], "any", false, false, false, 82), 1)))) {
                        // line 83
                        yield "                                                ";
                        if ((CoreExtension::getAttribute($this->env, $this->source, $context["factureLigne"], "getProduitFactureAffectation", [], "any", false, false, false, 83) && (0 === CoreExtension::compare(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["factureLigne"], "getProduitFactureAffectation", [], "any", false, false, false, 83), "libelleCourt", [], "any", false, false, false, 83), "F")))) {
                            // line 84
                            yield "                                                    ";
                            $context["tva"] = ((CoreExtension::getAttribute($this->env, $this->source, $context["factureLigne"], "getTauxTva", [], "any", false, false, false, 84)) ? (CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["factureLigne"], "getTauxTva", [], "any", false, false, false, 84), "taux", [], "any", false, false, false, 84)) : (0));
                            // line 85
                            yield "                                                    ";
                            $context["tva_key"] = ((isset($context["tva"]) || array_key_exists("tva", $context) ? $context["tva"] : (function () { throw new RuntimeError('Variable "tva" does not exist.', 85, $this->source); })()) . "_tva");
                            // line 86
                            yield "                                                    ";
                            $context["montant"] = ((CoreExtension::getAttribute($this->env, $this->source, $context["factureLigne"], "getPrixTotalHt", [], "any", false, false, false, 86)) ? (CoreExtension::getAttribute($this->env, $this->source, $context["factureLigne"], "getPrixTotalHt", [], "any", false, false, false, 86)) : (0));
                            // line 87
                            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.', 87, $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.', 87, $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.', 87, $this->source); })()), [], "array", true, true, false, 87)) ? (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.', 87, $this->source); })()), [], "array", false, false, false, 87), 0)) : (0)) + (isset($context["montant"]) || array_key_exists("montant", $context) ? $context["montant"] : (function () { throw new RuntimeError('Variable "montant" does not exist.', 87, $this->source); })()))]);
                            // line 88
                            yield "                                                ";
                        }
                        // line 89
                        yield "                                            ";
                    }
                    // line 90
                    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 91
                yield "                                    ";
            }
            $_parent = $context['_parent'];
            unset($context['_seq'], $context['_iterated'], $context['_key'], $context['facture'], $context['_parent'], $context['loop']);
            $context = array_intersect_key($context, $_parent) + $_parent;
            // line 92
            yield "                                    ";
            // line 93
            yield "                                    ";
            if ((isset($context["ligne_mo"]) || array_key_exists("ligne_mo", $context) ? $context["ligne_mo"] : (function () { throw new RuntimeError('Variable "ligne_mo" does not exist.', 93, $this->source); })())) {
                // line 94
                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.', 94, $this->source); })()), "getTauxTva", [], "any", false, false, false, 94)) ? (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.', 94, $this->source); })()), "getTauxTva", [], "any", false, false, false, 94), "taux", [], "any", false, false, false, 94)) : (0));
                // line 95
                yield "                                        ";
                $context["tva_key"] = ((isset($context["tva"]) || array_key_exists("tva", $context) ? $context["tva"] : (function () { throw new RuntimeError('Variable "tva" does not exist.', 95, $this->source); })()) . "_tva");
                // line 96
                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.', 96, $this->source); })()), "getPrixTotalHt", [], "any", false, false, false, 96)) ? (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.', 96, $this->source); })()), "getPrixTotalHt", [], "any", false, false, false, 96)) : (0));
                // line 97
                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.', 97, $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.', 97, $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.', 97, $this->source); })()), [], "array", true, true, false, 97)) ? (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.', 97, $this->source); })()), [], "array", false, false, false, 97), 0)) : (0)) + (isset($context["montant"]) || array_key_exists("montant", $context) ? $context["montant"] : (function () { throw new RuntimeError('Variable "montant" does not exist.', 97, $this->source); })()))]);
                // line 98
                yield "                                    ";
            }
            // line 99
            yield "                                    ";
            // line 100
            yield "                                    ";
            if ((isset($context["ligne_deplacement"]) || array_key_exists("ligne_deplacement", $context) ? $context["ligne_deplacement"] : (function () { throw new RuntimeError('Variable "ligne_deplacement" does not exist.', 100, $this->source); })())) {
                // line 101
                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.', 101, $this->source); })()), "getTauxTva", [], "any", false, false, false, 101)) ? (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.', 101, $this->source); })()), "getTauxTva", [], "any", false, false, false, 101), "taux", [], "any", false, false, false, 101)) : (0));
                // line 102
                yield "                                        ";
                $context["tva_key"] = ((isset($context["tva"]) || array_key_exists("tva", $context) ? $context["tva"] : (function () { throw new RuntimeError('Variable "tva" does not exist.', 102, $this->source); })()) . "_tva");
                // line 103
                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.', 103, $this->source); })()), "getPrixTotalHt", [], "any", false, false, false, 103)) ? (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.', 103, $this->source); })()), "getPrixTotalHt", [], "any", false, false, false, 103)) : (0));
                // line 104
                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.', 104, $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.', 104, $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.', 104, $this->source); })()), [], "array", true, true, false, 104)) ? (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.', 104, $this->source); })()), [], "array", false, false, false, 104), 0)) : (0)) + (isset($context["montant"]) || array_key_exists("montant", $context) ? $context["montant"] : (function () { throw new RuntimeError('Variable "montant" does not exist.', 104, $this->source); })()))]);
                // line 105
                yield "                                    ";
            }
            // line 106
            yield "                                    ";
            if ((1 === CoreExtension::compare(Twig\Extension\CoreExtension::length($this->env->getCharset(), (isset($context["tva_totaux"]) || array_key_exists("tva_totaux", $context) ? $context["tva_totaux"] : (function () { throw new RuntimeError('Variable "tva_totaux" does not exist.', 106, $this->source); })())), 0))) {
                // line 107
                yield "                                        ";
                $context["nb_line"] = 0;
                // line 108
                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.', 108, $this->source); })()));
                foreach ($context['_seq'] as $context["tva_key"] => $context["montant"]) {
                    // line 109
                    yield "                                            ";
                    $context["taux"] = Twig\Extension\CoreExtension::replace($context["tva_key"], ["_tva" => ""]);
                    // line 110
                    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.', 110, $this->source); })()) + 1);
                    // line 111
                    yield "                                            <tr>
                                                <td class=\"text-center\">";
                    // line 112
                    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 113
                    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.', 113, $this->source); })()), "html", null, true);
                    yield "%</td>
                                                <td class=\"text-center\">";
                    // line 114
                    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.', 114, $this->source); })())) / 100), 2, ",", " "), "html", null, true);
                    yield "€</td>
                                            </tr>
                                        ";
                }
                $_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 117
                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.', 117, $this->source); })()));
                // line 118
                yield "                                        ";
                if ((1 === CoreExtension::compare((isset($context["emptyRows"]) || array_key_exists("emptyRows", $context) ? $context["emptyRows"] : (function () { throw new RuntimeError('Variable "emptyRows" does not exist.', 118, $this->source); })()), 0))) {
                    // line 119
                    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.', 119, $this->source); })())));
                    foreach ($context['_seq'] as $context["_key"] => $context["i"]) {
                        // line 120
                        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 122
                    yield "                                        ";
                }
                // line 123
                yield "                                    ";
            } else {
                // line 124
                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 128
            yield "                                </tbody>
                            </table>
                        </div>
                    </div>
                    ";
            // line 133
            yield "                </div>
                ";
            // line 135
            yield "                <div class=\"d-flex justify-content-between align-items-center\">
                    <div class=\"d-flex flex-column\">
                        <div class=\"titre-small color-orange\">Déplacement</div>
                        <div class=\"d-flex\">
                            <div class=\"d-flex align-items-center\" style=\"margin-right: 30px;\">
                                <label style=\"width: 33px;\">Qté</label>
                                <input type=\"text\" style=\"width:50px\" disabled class=\"form-control bg-grey\" value=\"";
            // line 141
            (((isset($context["ligne_deplacement"]) || array_key_exists("ligne_deplacement", $context) ? $context["ligne_deplacement"] : (function () { throw new RuntimeError('Variable "ligne_deplacement" does not exist.', 141, $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.', 141, $this->source); })()), "quantite", [], "any", false, false, false, 141), "html", null, true)) : (yield ""));
            yield "\">
                            </div>
                            <div class=\"d-flex align-items-center\">
                                <label style=\"width: 58px;\">Prix HT</label>
                                <input type=\"text\" style=\"width:80px\" disabled class=\"form-control bg-grey\" value=\"";
            // line 145
            ((((isset($context["ligne_deplacement"]) || array_key_exists("ligne_deplacement", $context) ? $context["ligne_deplacement"] : (function () { throw new RuntimeError('Variable "ligne_deplacement" does not exist.', 145, $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.', 145, $this->source); })()), "getPrixTotalHt", [], "any", false, false, false, 145))) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($this->extensions['Twig\Extension\CoreExtension']->formatNumber(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.', 145, $this->source); })()), "getPrixTotalHt", [], "any", false, false, false, 145), 2, ",", " ") . "€"), "html", null, true)) : (yield ""));
            yield "\">
                            </div>
                        </div>
                        <div class=\"d-flex mt-2\">
                            <div class=\"d-flex align-items-center\" style=\"margin-right: 30px;\">
                                <label style=\"width: 33px;\">TVA</label>
                                <input type=\"text\" style=\"width:50px\" disabled class=\"form-control bg-grey\" value=\"";
            // line 151
            ((((isset($context["ligne_deplacement"]) || array_key_exists("ligne_deplacement", $context) ? $context["ligne_deplacement"] : (function () { throw new RuntimeError('Variable "ligne_deplacement" does not exist.', 151, $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.', 151, $this->source); })()), "getTauxTva", [], "any", false, false, false, 151))) ? (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.', 151, $this->source); })()), "getTauxTva", [], "any", false, false, false, 151), "taux", [], "any", false, false, false, 151) . "%"), "html", null, true)) : (yield ""));
            yield "\">
                            </div>
                            <div class=\"d-flex align-items-center me-2\">
                                <label style=\"width: 58px;\">Prix TTC</label>
                                ";
            // line 155
            $context["deplacement_ttc"] = 0;
            // line 156
            yield "                                ";
            if ((isset($context["ligne_deplacement"]) || array_key_exists("ligne_deplacement", $context) ? $context["ligne_deplacement"] : (function () { throw new RuntimeError('Variable "ligne_deplacement" does not exist.', 156, $this->source); })())) {
                // line 157
                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.', 157, $this->source); })()), "getTauxTva", [], "any", false, false, false, 157)) ? (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.', 157, $this->source); })()), "getTauxTva", [], "any", false, false, false, 157), "taux", [], "any", false, false, false, 157)) : (0));
                // line 158
                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.', 158, $this->source); })()), "getPrixTotalHt", [], "any", false, false, false, 158)) ? (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.', 158, $this->source); })()), "getPrixTotalHt", [], "any", false, false, false, 158)) : (0));
                // line 159
                yield "                                    ";
                $context["deplacement_ttc"] = ((isset($context["montant"]) || array_key_exists("montant", $context) ? $context["montant"] : (function () { throw new RuntimeError('Variable "montant" does not exist.', 159, $this->source); })()) + (((isset($context["montant"]) || array_key_exists("montant", $context) ? $context["montant"] : (function () { throw new RuntimeError('Variable "montant" does not exist.', 159, $this->source); })()) * (isset($context["tva"]) || array_key_exists("tva", $context) ? $context["tva"] : (function () { throw new RuntimeError('Variable "tva" does not exist.', 159, $this->source); })())) / 100));
                // line 160
                yield "                                ";
            }
            // line 161
            yield "                                <input type=\"text\" style=\"width:80px\" disabled class=\"form-control bg-grey\" value=\"";
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extension\CoreExtension']->formatNumber((isset($context["deplacement_ttc"]) || array_key_exists("deplacement_ttc", $context) ? $context["deplacement_ttc"] : (function () { throw new RuntimeError('Variable "deplacement_ttc" does not exist.', 161, $this->source); })()), 2, ",", " "), "html", null, true);
            yield "€\">
                            </div>
                        </div>
                    </div>
                    <div class=\"d-flex flex-column\">
                        <div class=\"titre-small color-orange\">Main d'oeuvre</div>
                        <div class=\"d-flex\">
                            <div class=\"d-flex align-items-center\" style=\"margin-right: 30px;\">
                                <label style=\"width: 33px;\">Qté</label>
                                <input type=\"text\" style=\"width:50px\" disabled class=\"form-control bg-grey\" value=\"";
            // line 170
            (((isset($context["ligne_mo"]) || array_key_exists("ligne_mo", $context) ? $context["ligne_mo"] : (function () { throw new RuntimeError('Variable "ligne_mo" does not exist.', 170, $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.', 170, $this->source); })()), "quantite", [], "any", false, false, false, 170), "html", null, true)) : (yield ""));
            yield "\">
                            </div>
                            <div class=\"d-flex align-items-center\">
                                <label style=\"width: 58px;\">Prix HT</label>
                                <input type=\"text\" style=\"width:80px\" disabled class=\"form-control bg-grey\" value=\"";
            // line 174
            ((((isset($context["ligne_mo"]) || array_key_exists("ligne_mo", $context) ? $context["ligne_mo"] : (function () { throw new RuntimeError('Variable "ligne_mo" does not exist.', 174, $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.', 174, $this->source); })()), "getPrixTotalHt", [], "any", false, false, false, 174))) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($this->extensions['Twig\Extension\CoreExtension']->formatNumber(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.', 174, $this->source); })()), "getPrixTotalHt", [], "any", false, false, false, 174), 2, ",", " ") . "€"), "html", null, true)) : (yield ""));
            yield "\">
                            </div>
                        </div>
                        <div class=\"d-flex mt-2\">
                            <div class=\"d-flex align-items-center\" style=\"margin-right: 30px;\">
                                <label style=\"width: 33px;\">TVA</label>
                                <input type=\"text\" style=\"width:50px\" disabled class=\"form-control bg-grey\" value=\"";
            // line 180
            ((((isset($context["ligne_mo"]) || array_key_exists("ligne_mo", $context) ? $context["ligne_mo"] : (function () { throw new RuntimeError('Variable "ligne_mo" does not exist.', 180, $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.', 180, $this->source); })()), "getTauxTva", [], "any", false, false, false, 180))) ? (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.', 180, $this->source); })()), "getTauxTva", [], "any", false, false, false, 180), "taux", [], "any", false, false, false, 180) . "%"), "html", null, true)) : (yield ""));
            yield "\">
                            </div>
                            <div class=\"d-flex align-items-center\">
                                <label style=\"width: 58px;\">Prix TTC</label>
                                ";
            // line 184
            $context["mo_ttc"] = 0;
            // line 185
            yield "                                ";
            if ((isset($context["ligne_mo"]) || array_key_exists("ligne_mo", $context) ? $context["ligne_mo"] : (function () { throw new RuntimeError('Variable "ligne_mo" does not exist.', 185, $this->source); })())) {
                // line 186
                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.', 186, $this->source); })()), "getTauxTva", [], "any", false, false, false, 186)) ? (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.', 186, $this->source); })()), "getTauxTva", [], "any", false, false, false, 186), "taux", [], "any", false, false, false, 186)) : (0));
                // line 187
                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.', 187, $this->source); })()), "getPrixTotalHt", [], "any", false, false, false, 187)) ? (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.', 187, $this->source); })()), "getPrixTotalHt", [], "any", false, false, false, 187)) : (0));
                // line 188
                yield "                                    ";
                $context["mo_ttc"] = ((isset($context["montant"]) || array_key_exists("montant", $context) ? $context["montant"] : (function () { throw new RuntimeError('Variable "montant" does not exist.', 188, $this->source); })()) + (((isset($context["montant"]) || array_key_exists("montant", $context) ? $context["montant"] : (function () { throw new RuntimeError('Variable "montant" does not exist.', 188, $this->source); })()) * (isset($context["tva"]) || array_key_exists("tva", $context) ? $context["tva"] : (function () { throw new RuntimeError('Variable "tva" does not exist.', 188, $this->source); })())) / 100));
                // line 189
                yield "                                ";
            }
            // line 190
            yield "                                <input type=\"text\" style=\"width:80px\" disabled class=\"form-control bg-grey\" value=\"";
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extension\CoreExtension']->formatNumber((isset($context["mo_ttc"]) || array_key_exists("mo_ttc", $context) ? $context["mo_ttc"] : (function () { throw new RuntimeError('Variable "mo_ttc" does not exist.', 190, $this->source); })()), 2, ",", " "), "html", null, true);
            yield "€\">
                            </div>
                        </div>
                    </div>
                    <div class=\"d-flex flex-column\">
                        <div class=\"titre-small color-orange\">Pièces</div>
                        <div class=\"d-flex\">
                            <div class=\"d-flex align-items-center\" style=\"margin-right: 20px;\">
                                <label style=\"width: 68px;\">Total HT</label>
                                ";
            // line 199
            $context["total_ht_pieces"] = 0;
            // line 200
            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.', 200, $this->source); })()), "factures", [], "any", false, false, false, 200));
            foreach ($context['_seq'] as $context["_key"] => $context["facture"]) {
                // line 201
                yield "                                    ";
                $context['_parent'] = $context;
                $context['_seq'] = CoreExtension::ensureTraversable(CoreExtension::getAttribute($this->env, $this->source, $context["facture"], "getFactureLignes", [], "any", false, false, false, 201));
                foreach ($context['_seq'] as $context["_key"] => $context["factureLigne"]) {
                    // line 202
                    yield "                                        ";
                    if (((CoreExtension::getAttribute($this->env, $this->source, $context["factureLigne"], "getProduit", [], "any", false, false, false, 202) && CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["factureLigne"], "getProduit", [], "any", false, false, false, 202), "getProduitType", [], "any", false, false, false, 202)) && (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, 202), "getProduitType", [], "any", false, false, false, 202), "id", [], "any", false, false, false, 202), 1)))) {
                        // line 203
                        yield "                                            ";
                        $context["total_ht_pieces"] = ((isset($context["total_ht_pieces"]) || array_key_exists("total_ht_pieces", $context) ? $context["total_ht_pieces"] : (function () { throw new RuntimeError('Variable "total_ht_pieces" does not exist.', 203, $this->source); })()) + ((CoreExtension::getAttribute($this->env, $this->source, $context["factureLigne"], "getPrixTotalHt", [], "any", false, false, false, 203)) ? (CoreExtension::getAttribute($this->env, $this->source, $context["factureLigne"], "getPrixTotalHt", [], "any", false, false, false, 203)) : (0)));
                        // line 204
                        yield "                                        ";
                    }
                    // line 205
                    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 206
                yield "                                ";
            }
            $_parent = $context['_parent'];
            unset($context['_seq'], $context['_iterated'], $context['_key'], $context['facture'], $context['_parent'], $context['loop']);
            $context = array_intersect_key($context, $_parent) + $_parent;
            // line 207
            yield "                                <input type=\"text\" style=\"width:80px\" disabled class=\"form-control bg-grey\" value=\"";
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extension\CoreExtension']->formatNumber((isset($context["total_ht_pieces"]) || array_key_exists("total_ht_pieces", $context) ? $context["total_ht_pieces"] : (function () { throw new RuntimeError('Variable "total_ht_pieces" does not exist.', 207, $this->source); })()), 2, ",", " "), "html", null, true);
            yield "€\">
                            </div>
                            <div class=\"d-flex align-items-center\" style=\"margin-right: 20px;\">
                                <label style=\"width: 76px;\">Total TVA</label>
                                ";
            // line 211
            $context["total_tva_pieces"] = 0;
            // line 212
            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.', 212, $this->source); })()), "factures", [], "any", false, false, false, 212));
            foreach ($context['_seq'] as $context["_key"] => $context["facture"]) {
                // line 213
                yield "                                    ";
                $context['_parent'] = $context;
                $context['_seq'] = CoreExtension::ensureTraversable(CoreExtension::getAttribute($this->env, $this->source, $context["facture"], "getFactureLignes", [], "any", false, false, false, 213));
                foreach ($context['_seq'] as $context["_key"] => $context["factureLigne"]) {
                    // line 214
                    yield "                                        ";
                    if (((CoreExtension::getAttribute($this->env, $this->source, $context["factureLigne"], "getProduit", [], "any", false, false, false, 214) && CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["factureLigne"], "getProduit", [], "any", false, false, false, 214), "getProduitType", [], "any", false, false, false, 214)) && (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, 214), "getProduitType", [], "any", false, false, false, 214), "id", [], "any", false, false, false, 214), 1)))) {
                        // line 215
                        yield "                                            ";
                        $context["tva"] = ((CoreExtension::getAttribute($this->env, $this->source, $context["factureLigne"], "getTauxTva", [], "any", false, false, false, 215)) ? (CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["factureLigne"], "getTauxTva", [], "any", false, false, false, 215), "taux", [], "any", false, false, false, 215)) : (0));
                        // line 216
                        yield "                                            ";
                        $context["montant"] = ((CoreExtension::getAttribute($this->env, $this->source, $context["factureLigne"], "getPrixTotalHt", [], "any", false, false, false, 216)) ? (CoreExtension::getAttribute($this->env, $this->source, $context["factureLigne"], "getPrixTotalHt", [], "any", false, false, false, 216)) : (0));
                        // line 217
                        yield "                                            ";
                        $context["total_tva_pieces"] = ((isset($context["total_tva_pieces"]) || array_key_exists("total_tva_pieces", $context) ? $context["total_tva_pieces"] : (function () { throw new RuntimeError('Variable "total_tva_pieces" does not exist.', 217, $this->source); })()) + (((isset($context["montant"]) || array_key_exists("montant", $context) ? $context["montant"] : (function () { throw new RuntimeError('Variable "montant" does not exist.', 217, $this->source); })()) * (isset($context["tva"]) || array_key_exists("tva", $context) ? $context["tva"] : (function () { throw new RuntimeError('Variable "tva" does not exist.', 217, $this->source); })())) / 100));
                        // line 218
                        yield "                                        ";
                    }
                    // line 219
                    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 220
                yield "                                ";
            }
            $_parent = $context['_parent'];
            unset($context['_seq'], $context['_iterated'], $context['_key'], $context['facture'], $context['_parent'], $context['loop']);
            $context = array_intersect_key($context, $_parent) + $_parent;
            // line 221
            yield "                                <input type=\"text\" style=\"width:80px\" disabled class=\"form-control bg-grey\" value=\"";
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extension\CoreExtension']->formatNumber((isset($context["total_tva_pieces"]) || array_key_exists("total_tva_pieces", $context) ? $context["total_tva_pieces"] : (function () { throw new RuntimeError('Variable "total_tva_pieces" does not exist.', 221, $this->source); })()), 2, ",", " "), "html", null, true);
            yield "€\">
                            </div>
                            <div class=\"d-flex align-items-center\">
                                <label style=\"width: 75px;\">Total TTC</label>
                                ";
            // line 225
            $context["total_ttc_pieces"] = ((isset($context["total_ht_pieces"]) || array_key_exists("total_ht_pieces", $context) ? $context["total_ht_pieces"] : (function () { throw new RuntimeError('Variable "total_ht_pieces" does not exist.', 225, $this->source); })()) + (isset($context["total_tva_pieces"]) || array_key_exists("total_tva_pieces", $context) ? $context["total_tva_pieces"] : (function () { throw new RuntimeError('Variable "total_tva_pieces" does not exist.', 225, $this->source); })()));
            // line 226
            yield "                                <input type=\"text\" style=\"width:80px\" disabled class=\"form-control bg-grey\" value=\"";
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extension\CoreExtension']->formatNumber((isset($context["total_ttc_pieces"]) || array_key_exists("total_ttc_pieces", $context) ? $context["total_ttc_pieces"] : (function () { throw new RuntimeError('Variable "total_ttc_pieces" does not exist.', 226, $this->source); })()), 2, ",", " "), "html", null, true);
            yield "€\">
                            </div>
                        </div>
                    </div>
                </div>
            ";
        } else {
            // line 232
            yield "                ";
            // line 233
            yield "                <div
                    class=\"grid\"
                    data-style=\"tab\"
                    style=\"width:972px;min-height: 122px;max-height: 122px;overflow-y: auto\"
                    id=\"intervention-grid-facturation\"
                    data-columns=\"";
            // line 238
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(json_encode(CoreExtension::getAttribute($this->env, $this->source, (isset($context["facturationGrid"]) || array_key_exists("facturationGrid", $context) ? $context["facturationGrid"] : (function () { throw new RuntimeError('Variable "facturationGrid" does not exist.', 238, $this->source); })()), "columns", [], "any", false, false, false, 238)), "html", null, true);
            yield "\"
                    data-getpath=\"";
            // line 239
            ((CoreExtension::getAttribute($this->env, $this->source, ($context["facturationGrid"] ?? null), "get_path", [], "any", true, true, false, 239)) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["facturationGrid"]) || array_key_exists("facturationGrid", $context) ? $context["facturationGrid"] : (function () { throw new RuntimeError('Variable "facturationGrid" does not exist.', 239, $this->source); })()), "get_path", [], "any", false, false, false, 239), "html", null, true)) : (yield ""));
            yield "\"
                    data-createpath=\"";
            // line 240
            ((CoreExtension::getAttribute($this->env, $this->source, ($context["facturationGrid"] ?? null), "create_path", [], "any", true, true, false, 240)) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["facturationGrid"]) || array_key_exists("facturationGrid", $context) ? $context["facturationGrid"] : (function () { throw new RuntimeError('Variable "facturationGrid" does not exist.', 240, $this->source); })()), "create_path", [], "any", false, false, false, 240), "html", null, true)) : (yield ""));
            yield "\"
                    data-editing=\"";
            // line 241
            ((((0 !== CoreExtension::compare((isset($context["type"]) || array_key_exists("type", $context) ? $context["type"] : (function () { throw new RuntimeError('Variable "type" does not exist.', 241, $this->source); })()), "technique")) && CoreExtension::getAttribute($this->env, $this->source, ($context["facturationGrid"] ?? null), "editing", [], "any", true, true, false, 241))) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(json_encode(CoreExtension::getAttribute($this->env, $this->source, (isset($context["facturationGrid"]) || array_key_exists("facturationGrid", $context) ? $context["facturationGrid"] : (function () { throw new RuntimeError('Variable "facturationGrid" does not exist.', 241, $this->source); })()), "editing", [], "any", false, false, false, 241)), "html", null, true)) : (yield "{}"));
            yield "\"
                    data-deletepath=\"";
            // line 242
            ((CoreExtension::getAttribute($this->env, $this->source, ($context["facturationGrid"] ?? null), "delete_path", [], "any", true, true, false, 242)) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["facturationGrid"]) || array_key_exists("facturationGrid", $context) ? $context["facturationGrid"] : (function () { throw new RuntimeError('Variable "facturationGrid" does not exist.', 242, $this->source); })()), "delete_path", [], "any", false, false, false, 242), "html", null, true)) : (yield ""));
            yield "\"
                    data-patchpath=\"";
            // line 243
            ((CoreExtension::getAttribute($this->env, $this->source, ($context["facturationGrid"] ?? null), "patch_path", [], "any", true, true, false, 243)) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["facturationGrid"]) || array_key_exists("facturationGrid", $context) ? $context["facturationGrid"] : (function () { throw new RuntimeError('Variable "facturationGrid" does not exist.', 243, $this->source); })()), "patch_path", [], "any", false, false, false, 243), "html", null, true)) : (yield ""));
            yield "\"
                    data-searchpanel='{\"visible\":false}'
                    data-pagination='{\"visible\":false}'
                    data-rowclass=\"function(item) { return item.affectation === 'S' ? 'bg-orange-input' : ''; }\"
                    data-tooltip-field=\"motif_service\"
                    data-toolbarinvisible=\"true\"
                ></div>
            ";
        }
        // line 251
        yield "        </div>
        ";
        // line 252
        if ( !(isset($context["is_readonly"]) || array_key_exists("is_readonly", $context) ? $context["is_readonly"] : (function () { throw new RuntimeError('Variable "is_readonly" does not exist.', 252, $this->source); })())) {
            // line 253
            yield "            ";
            // line 254
            yield "            <div class=\"d-flex mt-1\">
                <div>
                    <table class=\"table table-responsive table-sm table-inverse-color-datagrid mb-0\" id=\"tab-recap-taux\" style=\"width: 230px;overflow-y: auto;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\">
                            <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>
                        </tbody>
                    </table>
                </div>
                <div class=\"ms-auto\" style=\"width:570px;overflow-y: auto\">
                    <table class=\"table table-responsive table-bordered table-sm table-inverse-color-datagrid mb-0\" style=\"width: 570px\">
                        <thead align=\"center\" style=\"vertical-align: middle!important;\">
                            <th>Date</th>
                            <th>Montant</th>
                            <th>Date prévue enc.</th>
                            <th>Mode paiement</th>
                            <th>Date enc.</th>
                            <th>Perçu</th>
                        </thead>
                        <tbody style=\"height: 75px;\">
                            ";
            // line 276
            $context["nb_line"] = 0;
            // line 277
            yield "                            ";
            if ((1 === CoreExtension::compare(Twig\Extension\CoreExtension::length($this->env->getCharset(), (isset($context["liste_paiement"]) || array_key_exists("liste_paiement", $context) ? $context["liste_paiement"] : (function () { throw new RuntimeError('Variable "liste_paiement" does not exist.', 277, $this->source); })())), 0))) {
                // line 278
                yield "                                ";
                $context['_parent'] = $context;
                $context['_seq'] = CoreExtension::ensureTraversable((isset($context["liste_paiement"]) || array_key_exists("liste_paiement", $context) ? $context["liste_paiement"] : (function () { throw new RuntimeError('Variable "liste_paiement" does not exist.', 278, $this->source); })()));
                foreach ($context['_seq'] as $context["_key"] => $context["paiement"]) {
                    // line 279
                    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.', 279, $this->source); })()) + 1);
                    // line 280
                    yield "                                    <tr style=\"height: 25px\">
                                        <td>";
                    // line 281
                    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, 281), "d/m/Y"), "html", null, true);
                    yield "</td>
                                        <td>";
                    // line 282
                    yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["paiement"], "montantTtc", [], "any", false, false, false, 282), "html", null, true);
                    yield "€</td>
                                        <td>";
                    // line 283
                    ((CoreExtension::getAttribute($this->env, $this->source, $context["paiement"], "datePrevisionnelle", [], "any", false, false, false, 283)) ? (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, 283), "d/m/Y"), "html", null, true)) : (yield ""));
                    yield "</td>
                                        <td>";
                    // line 284
                    ((CoreExtension::getAttribute($this->env, $this->source, $context["paiement"], "moyenPaiement", [], "any", false, false, false, 284)) ? (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, 284), "libelleCourt", [], "any", false, false, false, 284), "html", null, true)) : (yield ""));
                    yield "</td>
                                        <td></td>
                                        <td></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 289
                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.', 289, $this->source); })()));
                // line 290
                yield "                                ";
                if ((1 === CoreExtension::compare((isset($context["emptyRows"]) || array_key_exists("emptyRows", $context) ? $context["emptyRows"] : (function () { throw new RuntimeError('Variable "emptyRows" does not exist.', 290, $this->source); })()), 0))) {
                    // line 291
                    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.', 291, $this->source); })())));
                    foreach ($context['_seq'] as $context["_key"] => $context["i"]) {
                        // line 292
                        yield "                                        <tr style=\"height: 25px\"><td colspan=\"6\"></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 294
                    yield "                                ";
                }
                // line 295
                yield "                            ";
            } else {
                // line 296
                yield "                                <tr style=\"height: 25px\"><td colspan=\"6\"></td></tr>
                                <tr style=\"height: 25px\"><td colspan=\"6\"></td></tr>
                                <tr style=\"height: 25px\"><td colspan=\"6\"></td></tr>
                            ";
            }
            // line 300
            yield "                        </tbody>
                    </table>
                </div>
            </div>
        ";
        }
        // line 305
        yield "    </div>
    ";
        // line 306
        if ( !(isset($context["is_readonly"]) || array_key_exists("is_readonly", $context) ? $context["is_readonly"] : (function () { throw new RuntimeError('Variable "is_readonly" does not exist.', 306, $this->source); })())) {
            // line 307
            yield "        ";
            // line 308
            yield "        <div class=\"flex-grow-1\">
            <div class=\"d-flex\">
                <div class=\"d-flex flex-column\" style=\"margin-right:30px;\">
                    <div class=\"titre-small color-orange\">Déplacement</div>
                    <div class=\"d-flex\">
                        <div class=\"d-flex align-items-center\" style=\"margin-right: 30px;\">
                            <label style=\"width: 33px;\">Qté</label>
                            <input type=\"text\" style=\"width:50px\" disabled class=\"form-control\" value=\"";
            // line 315
            (((isset($context["ligne_deplacement"]) || array_key_exists("ligne_deplacement", $context) ? $context["ligne_deplacement"] : (function () { throw new RuntimeError('Variable "ligne_deplacement" does not exist.', 315, $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.', 315, $this->source); })()), "quantite", [], "any", false, false, false, 315), "html", null, true)) : (yield ""));
            yield "\">
                        </div>
                        <div class=\"d-flex align-items-center\">
                            <label style=\"width: 58px;\">Prix HT</label>
                            <input type=\"text\" style=\"width:80px\" disabled class=\"form-control\" value=\"";
            // line 319
            (((isset($context["ligne_deplacement"]) || array_key_exists("ligne_deplacement", $context) ? $context["ligne_deplacement"] : (function () { throw new RuntimeError('Variable "ligne_deplacement" does not exist.', 319, $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.', 319, $this->source); })()), "getPrixTotalHt", [], "any", false, false, false, 319)) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($this->extensions['Twig\Extension\CoreExtension']->formatNumber(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.', 319, $this->source); })()), "getPrixTotalHt", [], "any", false, false, false, 319), 2, ",", " ") . "€"), "html", null, true)) : (yield ""))) : (yield ""));
            yield "\">
                        </div>
                    </div>
                    <div class=\"d-flex mt-2\">
                        <div class=\"d-flex align-items-center\" style=\"margin-right: 30px;\">
                            <label style=\"width: 33px;\">TVA</label>
                            <select name=\"deplacement_tva\" style=\"width:50px\" id=\"deplacement-tva\" ";
            // line 325
            yield (((0 === CoreExtension::compare((isset($context["type"]) || array_key_exists("type", $context) ? $context["type"] : (function () { throw new RuntimeError('Variable "type" does not exist.', 325, $this->source); })()), "technique"))) ? ("disabled") : (""));
            yield " data-group=\"deplacement\" form=\"form_validation_intervention\" class=\"form-control tva-select\">
                                <option value=\"\"></option>
                                ";
            // line 327
            $context['_parent'] = $context;
            $context['_seq'] = CoreExtension::ensureTraversable((isset($context["tauxTva"]) || array_key_exists("tauxTva", $context) ? $context["tauxTva"] : (function () { throw new RuntimeError('Variable "tauxTva" does not exist.', 327, $this->source); })()));
            foreach ($context['_seq'] as $context["_key"] => $context["taux"]) {
                // line 328
                yield "                                    ";
                $context["selected"] = ((((((isset($context["ligne_deplacement"]) || array_key_exists("ligne_deplacement", $context) ? $context["ligne_deplacement"] : (function () { throw new RuntimeError('Variable "ligne_deplacement" does not exist.', 328, $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.', 328, $this->source); })()), "getTauxTva", [], "any", false, false, false, 328))) ? ((0 === CoreExtension::compare(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.', 328, $this->source); })()), "getTauxTva", [], "any", false, false, false, 328), "id", [], "any", false, false, false, 328), CoreExtension::getAttribute($this->env, $this->source, $context["taux"], "id", [], "any", false, false, false, 328)))) : (""))) ? ("selected") : (""));
                // line 329
                yield "                                    <option value=\"";
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["taux"], "id", [], "any", false, false, false, 329), "html", null, true);
                yield "\" ";
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["selected"]) || array_key_exists("selected", $context) ? $context["selected"] : (function () { throw new RuntimeError('Variable "selected" does not exist.', 329, $this->source); })()), "html", null, true);
                yield ">";
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["taux"], "taux", [], "any", false, false, false, 329), "html", null, true);
                yield "%</option>
                                ";
            }
            $_parent = $context['_parent'];
            unset($context['_seq'], $context['_iterated'], $context['_key'], $context['taux'], $context['_parent'], $context['loop']);
            $context = array_intersect_key($context, $_parent) + $_parent;
            // line 331
            yield "                            </select>
                            <input type=\"hidden\" id=\"deplacement-prix-ht\" value=\"";
            // line 332
            (((isset($context["ligne_deplacement"]) || array_key_exists("ligne_deplacement", $context) ? $context["ligne_deplacement"] : (function () { throw new RuntimeError('Variable "ligne_deplacement" does not exist.', 332, $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.', 332, $this->source); })()), "getPrixTotalHt", [], "any", false, false, false, 332), "html", null, true)) : (yield ""));
            yield "\">
                        </div>
                        <div class=\"d-flex align-items-center me-2\">
                            <label style=\"width: 58px;\">Prix TTC</label>
                            <input type=\"text\" style=\"width:80px\" disabled class=\"form-control\" id=\"deplacement-intervention-prix-ttc\" value=\"\">
                        </div>
                    </div>
                </div>
                <div class=\"d-flex flex-column ms-auto\">
                    <div class=\"titre-small color-orange\">Main d'oeuvre</div>
                    <div class=\"d-flex\">
                        <div class=\"d-flex align-items-center\" style=\"margin-right: 30px;\">
                            <label style=\"width: 33px;\">Qté</label>
                            <input type=\"text\" style=\"width:50px\" disabled class=\"form-control\" value=\"";
            // line 345
            (((isset($context["ligne_mo"]) || array_key_exists("ligne_mo", $context) ? $context["ligne_mo"] : (function () { throw new RuntimeError('Variable "ligne_mo" does not exist.', 345, $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.', 345, $this->source); })()), "quantite", [], "any", false, false, false, 345), "html", null, true)) : (yield ""));
            yield "\">
                        </div>
                        <div class=\"d-flex align-items-center\">
                            <label style=\"width: 58px;\">Prix HT</label>
                            <input type=\"text\" style=\"width:80px\" disabled class=\"form-control\" value=\"";
            // line 349
            (((isset($context["ligne_mo"]) || array_key_exists("ligne_mo", $context) ? $context["ligne_mo"] : (function () { throw new RuntimeError('Variable "ligne_mo" does not exist.', 349, $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.', 349, $this->source); })()), "getPrixTotalHt", [], "any", false, false, false, 349)) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($this->extensions['Twig\Extension\CoreExtension']->formatNumber(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.', 349, $this->source); })()), "getPrixTotalHt", [], "any", false, false, false, 349), 2, ",", " ") . "€"), "html", null, true)) : (yield ""))) : (yield ""));
            yield "\">
                        </div>
                    </div>
                    <div class=\"d-flex mt-2\">
                        <div class=\"d-flex align-items-center\" style=\"margin-right: 30px;\">
                            <label style=\"width: 33px;\">TVA</label>
                            <select name=\"mo_tva\" style=\"width:50px\" form=\"form_validation_intervention\" ";
            // line 355
            yield (((0 === CoreExtension::compare((isset($context["type"]) || array_key_exists("type", $context) ? $context["type"] : (function () { throw new RuntimeError('Variable "type" does not exist.', 355, $this->source); })()), "technique"))) ? ("disabled") : (""));
            yield " class=\"form-control tva-select\" id=\"mo-tva\" data-group=\"mo\">
                                <option value=\"\"></option>
                                ";
            // line 357
            $context['_parent'] = $context;
            $context['_seq'] = CoreExtension::ensureTraversable((isset($context["tauxTva"]) || array_key_exists("tauxTva", $context) ? $context["tauxTva"] : (function () { throw new RuntimeError('Variable "tauxTva" does not exist.', 357, $this->source); })()));
            foreach ($context['_seq'] as $context["_key"] => $context["taux"]) {
                // line 358
                yield "                                    ";
                $context["selected"] = ((((((isset($context["ligne_mo"]) || array_key_exists("ligne_mo", $context) ? $context["ligne_mo"] : (function () { throw new RuntimeError('Variable "ligne_mo" does not exist.', 358, $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.', 358, $this->source); })()), "getTauxTva", [], "any", false, false, false, 358))) ? ((0 === CoreExtension::compare(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.', 358, $this->source); })()), "getTauxTva", [], "any", false, false, false, 358), "id", [], "any", false, false, false, 358), CoreExtension::getAttribute($this->env, $this->source, $context["taux"], "id", [], "any", false, false, false, 358)))) : (""))) ? ("selected") : (""));
                // line 359
                yield "                                    <option value=\"";
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["taux"], "id", [], "any", false, false, false, 359), "html", null, true);
                yield "\" ";
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["selected"]) || array_key_exists("selected", $context) ? $context["selected"] : (function () { throw new RuntimeError('Variable "selected" does not exist.', 359, $this->source); })()), "html", null, true);
                yield ">";
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["taux"], "taux", [], "any", false, false, false, 359), "html", null, true);
                yield "%</option>
                                ";
            }
            $_parent = $context['_parent'];
            unset($context['_seq'], $context['_iterated'], $context['_key'], $context['taux'], $context['_parent'], $context['loop']);
            $context = array_intersect_key($context, $_parent) + $_parent;
            // line 361
            yield "                            </select>
                            <input type=\"hidden\" id=\"mo-prix-ht\" value=\"";
            // line 362
            (((isset($context["ligne_mo"]) || array_key_exists("ligne_mo", $context) ? $context["ligne_mo"] : (function () { throw new RuntimeError('Variable "ligne_mo" does not exist.', 362, $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.', 362, $this->source); })()), "getPrixTotalHt", [], "any", false, false, false, 362), "html", null, true)) : (yield ""));
            yield "\">
                        </div>
                        <div class=\"d-flex align-items-center\">
                            <label style=\"width: 58px;\">Prix TTC</label>
                            <input type=\"text\" style=\"width:80px\" disabled class=\"form-control\" id=\"mo-intervention-prix-ttc\" value=\"\">
                        </div>
                    </div>
                </div>
            </div>
            <div class=\"mt-2\">
                <div class=\"titre-small color-orange\">Pièces</div>
                <div class=\"d-flex justify-content-between\">
                    <div class=\"d-flex align-items-center\">
                        <label style=\"width: 68px;\">Total HT</label>
                        <input type=\"text\" style=\"width:80px\" disabled class=\"form-control\" id=\"total-ht-pieces\" value=\"\">
                    </div>
                    <div class=\"d-flex align-items-center\">
                        <label style=\"width: 76px;\">Total TVA</label>
                        <input type=\"text\" style=\"width:80px\" disabled class=\"form-control\" id=\"total-recap-tab-tva\" value=\"\">
                    </div>
                    <div class=\"d-flex align-items-center\">
                        <label style=\"width: 75px;\">Total TTC</label>
                        <input type=\"text\" style=\"width:80px\" disabled class=\"form-control\" id=\"total-ttc-pieces\" value=\"\">
                    </div>
                </div>
            </div>
            ";
            // line 389
            yield "            <div class=\"my-1\" style=\"height: 19.5px\"></div>
            <div class=\"d-flex justify-content-between\">
                <div class=\"d-flex align-items-center\">
                    <label style=\"width:68px;\">Total HT</label>
                    <input type=\"text\" style=\"width:80px\" disabled class=\"form-control\" id=\"montant-ht-recap\" value=\"\">
                </div>
                <div class=\"d-flex align-items-center\">
                    <label style=\"width: 76px;\">Total TVA</label>
                    <input type=\"text\" style=\"width:80px\" id=\"montant-tva-recap\" disabled class=\"form-control\" value=\"\">
                </div>
                <div class=\"d-flex align-items-center\">
                    <label style=\"width: 75px;\">Total TTC</label>
                    <input type=\"text\" style=\"width:80px\" id=\"montant-ttc-recap\" disabled class=\"form-control\" value=\"\">
                </div>
            </div>
            <div class=\"d-flex justify-content-between mt-2\">
                <div class=\"d-flex align-items-center\">
                    <label style=\"width:68px;\">Total perçu</label>
                    <input type=\"text\" style=\"width:80px\" ";
            // line 407
            yield (((0 === CoreExtension::compare((isset($context["type"]) || array_key_exists("type", $context) ? $context["type"] : (function () { throw new RuntimeError('Variable "type" does not exist.', 407, $this->source); })()), "technique"))) ? ("disabled") : (""));
            yield " class=\"form-control\" id=\"montant-paiement\" value=\"";
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["total_paiement"]) || array_key_exists("total_paiement", $context) ? $context["total_paiement"] : (function () { throw new RuntimeError('Variable "total_paiement" does not exist.', 407, $this->source); })()), "html", null, true);
            yield "€\">
                </div>
                <div class=\"d-flex align-items-center\">
                    <label style=\"width: 76px;\">Restant dû</label>
                    <input type=\"text\" style=\"width:80px\" ";
            // line 411
            yield (((0 === CoreExtension::compare((isset($context["type"]) || array_key_exists("type", $context) ? $context["type"] : (function () { throw new RuntimeError('Variable "type" does not exist.', 411, $this->source); })()), "technique"))) ? ("disabled") : (""));
            yield " class=\"form-control\" id=\"montant-du\" value=\"\">
                </div>
                <div class=\"d-flex align-items-center\">
                    <label style=\"width: 75px;\">Ecart</label>
                    <input type=\"text\" style=\"width:80px\" disabled id=\"montant-ecart\" class=\"form-control\" value=\"\">
                </div>
            </div>
        </div>
    ";
        }
        // line 420
        yield "    </div>
</div>
";
        
        $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);

        
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);

        return; yield '';
    }

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

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

    /**
     * @codeCoverageIgnore
     */
    public function getDebugInfo()
    {
        return array (  951 => 420,  939 => 411,  930 => 407,  910 => 389,  881 => 362,  878 => 361,  865 => 359,  862 => 358,  858 => 357,  853 => 355,  844 => 349,  837 => 345,  821 => 332,  818 => 331,  805 => 329,  802 => 328,  798 => 327,  793 => 325,  784 => 319,  777 => 315,  768 => 308,  766 => 307,  764 => 306,  761 => 305,  754 => 300,  748 => 296,  745 => 295,  742 => 294,  735 => 292,  730 => 291,  727 => 290,  724 => 289,  713 => 284,  709 => 283,  705 => 282,  701 => 281,  698 => 280,  695 => 279,  690 => 278,  687 => 277,  685 => 276,  661 => 254,  659 => 253,  657 => 252,  654 => 251,  643 => 243,  639 => 242,  635 => 241,  631 => 240,  627 => 239,  623 => 238,  616 => 233,  614 => 232,  604 => 226,  602 => 225,  594 => 221,  588 => 220,  582 => 219,  579 => 218,  576 => 217,  573 => 216,  570 => 215,  567 => 214,  562 => 213,  557 => 212,  555 => 211,  547 => 207,  541 => 206,  535 => 205,  532 => 204,  529 => 203,  526 => 202,  521 => 201,  516 => 200,  514 => 199,  501 => 190,  498 => 189,  495 => 188,  492 => 187,  489 => 186,  486 => 185,  484 => 184,  477 => 180,  468 => 174,  461 => 170,  448 => 161,  445 => 160,  442 => 159,  439 => 158,  436 => 157,  433 => 156,  431 => 155,  424 => 151,  415 => 145,  408 => 141,  400 => 135,  397 => 133,  391 => 128,  385 => 124,  382 => 123,  379 => 122,  372 => 120,  367 => 119,  364 => 118,  361 => 117,  352 => 114,  348 => 113,  344 => 112,  341 => 111,  338 => 110,  335 => 109,  330 => 108,  327 => 107,  324 => 106,  321 => 105,  318 => 104,  315 => 103,  312 => 102,  309 => 101,  306 => 100,  304 => 99,  301 => 98,  298 => 97,  295 => 96,  292 => 95,  289 => 94,  286 => 93,  284 => 92,  278 => 91,  272 => 90,  269 => 89,  266 => 88,  263 => 87,  260 => 86,  257 => 85,  254 => 84,  251 => 83,  248 => 82,  243 => 81,  238 => 80,  236 => 79,  234 => 78,  224 => 71,  219 => 69,  214 => 66,  208 => 61,  202 => 57,  199 => 56,  196 => 55,  189 => 53,  184 => 52,  181 => 51,  178 => 50,  169 => 47,  165 => 46,  161 => 45,  157 => 44,  153 => 43,  149 => 42,  145 => 41,  140 => 40,  135 => 39,  132 => 38,  126 => 37,  120 => 36,  117 => 35,  114 => 34,  111 => 33,  106 => 32,  101 => 31,  99 => 30,  83 => 16,  81 => 15,  79 => 14,  77 => 13,  70 => 12,  64 => 7,  62 => 6,  50 => 5,  46 => 3,  44 => 2,);
    }

    public function getSourceContext()
    {
        return new Source("{# Détection du contexte : readonly ou validation #}
{% set is_readonly = is_readonly|default(false) %}

<div class=\"d-flex\">
    <div class=\"d-flex flex-column position-relative {% if is_readonly %}w-100{% else %}me-3{% endif %}\" style=\"{% if not is_readonly %}width: 972px{% endif %}\">
        {% if not is_readonly and type != 'technique' %}
            {# Bouton ajouter pièce en mode validation #}
            <div class=\"d-flex\" style=\"position: absolute;top:inherit;right:13px;\">
                <i id=\"add_facture-piece\" data-disable-on-view=\"\" class=\"fa fa-lg fa-plus button-add custom-history bg-vert\" style=\"position:relative;border-color: #14a085;-webkit-text-stroke: 1px #14a085;top:inherit;right:inherit\"></i>
            </div>
        {% endif %}
        <div class=\"d-flex flex-column\" style=\"{% if not is_readonly %}width: 972px{% endif %};\">
            {% if is_readonly %}
                {# Mode readonly : Structure exacte comme demandé #}
                {# Ligne 1 : Tableau pièces + Tableau récap TVA à droite #}
                <div class=\"d-flex\">
                    <div class=\"d-flex justify-content-between w-100\">
                        <div style=\"min-height: 122px;max-height: 122px;overflow-y: auto;border: 1px solid #E0E0E0;width:802px;\">
                            <table class=\"table table-responsive table-sm table-inverse-color-datagrid mb-0\">
                                <thead align=\"center\" style=\"vertical-align: middle!important;\">
                                    <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>
                                    {% set facture_lignes_pieces = [] %}
                                    {% for facture in intervention.factures %}
                                        {% for factureLigne in facture.getFactureLignes %}
                                            {% if factureLigne.getProduit and factureLigne.getProduit.getProduitType and factureLigne.getProduit.getProduitType.id == 1 %}
                                                {% set facture_lignes_pieces = facture_lignes_pieces|merge([factureLigne]) %}
                                            {% endif %}
                                        {% endfor %}
                                    {% endfor %}
                                    {% if facture_lignes_pieces|length > 0 %}
                                        {% for factureLigne in facture_lignes_pieces %}
                                            <tr class=\"{{ factureLigne.getProduitFactureAffectation and factureLigne.getProduitFactureAffectation.libelleCourt == 'S' ? 'bg-orange-input' : '' }}\">
                                                <td class=\"text-center\">{{ factureLigne.getProduit ? factureLigne.getProduit.code : '' }}</td>
                                                <td class=\"text-center\">{{ factureLigne.getProduit ? factureLigne.getProduit.designation : factureLigne.designation }}</td>
                                                <td class=\"text-center\">{{ factureLigne.getPuHt ? factureLigne.getPuHt|number_format(2, ',', ' ') ~ '€' : '' }}</td>
                                                <td class=\"text-center\">{{ factureLigne.quantite ? factureLigne.quantite : '' }}</td>
                                                <td class=\"text-center\">{{ factureLigne.getPrixTotalHt ? factureLigne.getPrixTotalHt|number_format(2, ',', ' ') ~ '€' : '' }}</td>
                                                <td class=\"text-center\">{{ factureLigne.getTauxTva ? factureLigne.getTauxTva.taux ~ '%' : '' }}</td>
                                                <td class=\"text-center\">{{ factureLigne.getProduitFactureAffectation ? factureLigne.getProduitFactureAffectation.libelleCourt : '' }}</td>
                                            </tr>
                                        {% endfor %}
                                        {% set emptyRows = 3 - facture_lignes_pieces|length %}
                                        {% if emptyRows > 0 %}
                                            {% for i in 1..emptyRows %}
                                                <tr style=\"height: 25px\"><td colspan=\"9\"></td></tr>
                                            {% endfor %}
                                        {% endif %}
                                    {% else %}
                                        <tr style=\"height: 25px\"><td colspan=\"9\"></td></tr>
                                        <tr style=\"height: 25px\"><td colspan=\"9\"></td></tr>
                                        <tr style=\"height: 25px\"><td colspan=\"9\"></td></tr>
                                    {% endif %}
                                </tbody>
                            </table>
                        </div>
                        <div style=\"margin-left: 8px;width:273px;margin-top:-5px;\">
                            {# Bon de commande en haut à droite #}
                            <div class=\"d-flex align-items-center mb-1\">
                                <label style=\"width:115px\">Bon de commande</label>
                                <div class=\"d-flex align-items-start\">
                                    <input type=\"text\" disabled class=\"form-control bg-grey\" style=\"width:120px;\" value=\"{{ intervention.numBonCommande ? intervention.numBonCommande : '' }}\">
                                    <button type=\"button\" class=\"btn ms-2 d-flex align-items-center justify-content-center\" style=\"width:28px;height:28px;padding:0;background:white;border:1px solid #0099FF;margin-top:0;\" disabled>
                                        {{ source('@public_path'~asset('build/images/file-regular.svg')) }}
                                    </button>
                                </div>
                            </div>
                            <table class=\"table table-responsive table-sm table-inverse-color-datagrid mb-0\" id=\"tab-recap-taux\" style=\"overflow-y: auto;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\">
                                    {% set tva_totaux = {} %}
                                    {# Calcul des totaux TVA pour les pièces #}
                                    {% for facture in intervention.factures %}
                                        {% for factureLigne in facture.getFactureLignes %}
                                            {% if factureLigne.getProduit and factureLigne.getProduit.getProduitType and factureLigne.getProduit.getProduitType.id == 1 %}
                                                {% if factureLigne.getProduitFactureAffectation and factureLigne.getProduitFactureAffectation.libelleCourt == 'F' %}
                                                    {% set tva = factureLigne.getTauxTva ? factureLigne.getTauxTva.taux : 0 %}
                                                    {% set tva_key = (tva ~ '_tva') %}
                                                    {% set montant = factureLigne.getPrixTotalHt ? factureLigne.getPrixTotalHt : 0 %}
                                                    {% set tva_totaux = tva_totaux|merge({ (tva_key): (tva_totaux[tva_key]|default(0) + montant) }) %}
                                                {% endif %}
                                            {% endif %}
                                        {% endfor %}
                                    {% endfor %}
                                    {# Ajout de la MO si elle existe #}
                                    {% if ligne_mo %}
                                        {% set tva = ligne_mo.getTauxTva ? ligne_mo.getTauxTva.taux : 0 %}
                                        {% set tva_key = (tva ~ '_tva') %}
                                        {% set montant = ligne_mo.getPrixTotalHt ? ligne_mo.getPrixTotalHt : 0 %}
                                        {% set tva_totaux = tva_totaux|merge({ (tva_key): (tva_totaux[tva_key]|default(0) + montant) }) %}
                                    {% endif %}
                                    {# Ajout du déplacement s'il existe #}
                                    {% if ligne_deplacement %}
                                        {% set tva = ligne_deplacement.getTauxTva ? ligne_deplacement.getTauxTva.taux : 0 %}
                                        {% set tva_key = (tva ~ '_tva') %}
                                        {% set montant = ligne_deplacement.getPrixTotalHt ? ligne_deplacement.getPrixTotalHt : 0 %}
                                        {% set tva_totaux = tva_totaux|merge({ (tva_key): (tva_totaux[tva_key]|default(0) + montant) }) %}
                                    {% endif %}
                                    {% if tva_totaux|length > 0 %}
                                        {% set nb_line = 0 %}
                                        {% for tva_key, montant in tva_totaux %}
                                            {% set taux = tva_key|replace({'_tva':''}) %}
                                            {% set nb_line = nb_line + 1 %}
                                            <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>
                                        {% endfor %}
                                        {% set emptyRows = 3 - nb_line %}
                                        {% if emptyRows > 0 %}
                                            {% for i in 1..emptyRows %}
                                                <tr style=\"height: 25px\"><td colspan=\"3\"></td></tr>
                                            {% endfor %}
                                        {% endif %}
                                    {% 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>
                    </div>
                    {# Tableau récap TVA à droite, collé au tableau principal #}
                </div>
                {# Ligne 2 : Sections Déplacement, Main d'œuvre et Pièces alignées horizontalement #}
                <div class=\"d-flex justify-content-between align-items-center\">
                    <div class=\"d-flex flex-column\">
                        <div class=\"titre-small color-orange\">Déplacement</div>
                        <div class=\"d-flex\">
                            <div class=\"d-flex align-items-center\" style=\"margin-right: 30px;\">
                                <label style=\"width: 33px;\">Qté</label>
                                <input type=\"text\" style=\"width:50px\" disabled class=\"form-control bg-grey\" value=\"{{ ligne_deplacement ? ligne_deplacement.quantite }}\">
                            </div>
                            <div class=\"d-flex align-items-center\">
                                <label style=\"width: 58px;\">Prix HT</label>
                                <input type=\"text\" style=\"width:80px\" disabled class=\"form-control bg-grey\" value=\"{{ ligne_deplacement and ligne_deplacement.getPrixTotalHt ? ligne_deplacement.getPrixTotalHt|number_format(2, ',', ' ') ~ '€' : '' }}\">
                            </div>
                        </div>
                        <div class=\"d-flex mt-2\">
                            <div class=\"d-flex align-items-center\" style=\"margin-right: 30px;\">
                                <label style=\"width: 33px;\">TVA</label>
                                <input type=\"text\" style=\"width:50px\" disabled class=\"form-control bg-grey\" value=\"{{ ligne_deplacement and ligne_deplacement.getTauxTva ? ligne_deplacement.getTauxTva.taux ~ '%' : '' }}\">
                            </div>
                            <div class=\"d-flex align-items-center me-2\">
                                <label style=\"width: 58px;\">Prix TTC</label>
                                {% set deplacement_ttc = 0 %}
                                {% if ligne_deplacement %}
                                    {% set tva = ligne_deplacement.getTauxTva ? ligne_deplacement.getTauxTva.taux : 0 %}
                                    {% set montant = ligne_deplacement.getPrixTotalHt ? ligne_deplacement.getPrixTotalHt : 0 %}
                                    {% set deplacement_ttc = montant + (montant*tva)/100 %}
                                {% endif %}
                                <input type=\"text\" style=\"width:80px\" disabled class=\"form-control bg-grey\" value=\"{{ deplacement_ttc|number_format(2, ',', ' ') }}€\">
                            </div>
                        </div>
                    </div>
                    <div class=\"d-flex flex-column\">
                        <div class=\"titre-small color-orange\">Main d'oeuvre</div>
                        <div class=\"d-flex\">
                            <div class=\"d-flex align-items-center\" style=\"margin-right: 30px;\">
                                <label style=\"width: 33px;\">Qté</label>
                                <input type=\"text\" style=\"width:50px\" disabled class=\"form-control bg-grey\" value=\"{{ ligne_mo ? ligne_mo.quantite }}\">
                            </div>
                            <div class=\"d-flex align-items-center\">
                                <label style=\"width: 58px;\">Prix HT</label>
                                <input type=\"text\" style=\"width:80px\" disabled class=\"form-control bg-grey\" value=\"{{ ligne_mo and ligne_mo.getPrixTotalHt ? ligne_mo.getPrixTotalHt|number_format(2, ',', ' ') ~ '€' : '' }}\">
                            </div>
                        </div>
                        <div class=\"d-flex mt-2\">
                            <div class=\"d-flex align-items-center\" style=\"margin-right: 30px;\">
                                <label style=\"width: 33px;\">TVA</label>
                                <input type=\"text\" style=\"width:50px\" disabled class=\"form-control bg-grey\" value=\"{{ ligne_mo and ligne_mo.getTauxTva ? ligne_mo.getTauxTva.taux ~ '%' : '' }}\">
                            </div>
                            <div class=\"d-flex align-items-center\">
                                <label style=\"width: 58px;\">Prix TTC</label>
                                {% set mo_ttc = 0 %}
                                {% if ligne_mo %}
                                    {% set tva = ligne_mo.getTauxTva ? ligne_mo.getTauxTva.taux : 0 %}
                                    {% set montant = ligne_mo.getPrixTotalHt ? ligne_mo.getPrixTotalHt : 0 %}
                                    {% set mo_ttc = montant + (montant*tva)/100 %}
                                {% endif %}
                                <input type=\"text\" style=\"width:80px\" disabled class=\"form-control bg-grey\" value=\"{{ mo_ttc|number_format(2, ',', ' ') }}€\">
                            </div>
                        </div>
                    </div>
                    <div class=\"d-flex flex-column\">
                        <div class=\"titre-small color-orange\">Pièces</div>
                        <div class=\"d-flex\">
                            <div class=\"d-flex align-items-center\" style=\"margin-right: 20px;\">
                                <label style=\"width: 68px;\">Total HT</label>
                                {% set total_ht_pieces = 0 %}
                                {% for facture in intervention.factures %}
                                    {% for factureLigne in facture.getFactureLignes %}
                                        {% if factureLigne.getProduit and factureLigne.getProduit.getProduitType and factureLigne.getProduit.getProduitType.id == 1 %}
                                            {% set total_ht_pieces = total_ht_pieces + (factureLigne.getPrixTotalHt ? factureLigne.getPrixTotalHt : 0) %}
                                        {% endif %}
                                    {% endfor %}
                                {% endfor %}
                                <input type=\"text\" style=\"width:80px\" disabled class=\"form-control bg-grey\" value=\"{{ total_ht_pieces|number_format(2, ',', ' ') }}€\">
                            </div>
                            <div class=\"d-flex align-items-center\" style=\"margin-right: 20px;\">
                                <label style=\"width: 76px;\">Total TVA</label>
                                {% set total_tva_pieces = 0 %}
                                {% for facture in intervention.factures %}
                                    {% for factureLigne in facture.getFactureLignes %}
                                        {% if factureLigne.getProduit and factureLigne.getProduit.getProduitType and factureLigne.getProduit.getProduitType.id == 1 %}
                                            {% set tva = factureLigne.getTauxTva ? factureLigne.getTauxTva.taux : 0 %}
                                            {% set montant = factureLigne.getPrixTotalHt ? factureLigne.getPrixTotalHt : 0 %}
                                            {% set total_tva_pieces = total_tva_pieces + (montant * tva)/100 %}
                                        {% endif %}
                                    {% endfor %}
                                {% endfor %}
                                <input type=\"text\" style=\"width:80px\" disabled class=\"form-control bg-grey\" value=\"{{ total_tva_pieces|number_format(2, ',', ' ') }}€\">
                            </div>
                            <div class=\"d-flex align-items-center\">
                                <label style=\"width: 75px;\">Total TTC</label>
                                {% set total_ttc_pieces = total_ht_pieces + total_tva_pieces %}
                                <input type=\"text\" style=\"width:80px\" disabled class=\"form-control bg-grey\" value=\"{{ total_ttc_pieces|number_format(2, ',', ' ') }}€\">
                            </div>
                        </div>
                    </div>
                </div>
            {% else %}
                {# Mode validation : Grid DevExtreme #}
                <div
                    class=\"grid\"
                    data-style=\"tab\"
                    style=\"width:972px;min-height: 122px;max-height: 122px;overflow-y: auto\"
                    id=\"intervention-grid-facturation\"
                    data-columns=\"{{ facturationGrid.columns|json_encode() }}\"
                    data-getpath=\"{{ facturationGrid.get_path is defined ? facturationGrid.get_path : '' }}\"
                    data-createpath=\"{{ facturationGrid.create_path is defined ? facturationGrid.create_path : '' }}\"
                    data-editing=\"{{ type != 'technique' and facturationGrid.editing is defined ? facturationGrid.editing|json_encode() : '{}' }}\"
                    data-deletepath=\"{{ facturationGrid.delete_path is defined ? facturationGrid.delete_path : '' }}\"
                    data-patchpath=\"{{ facturationGrid.patch_path is defined ? facturationGrid.patch_path : '' }}\"
                    data-searchpanel='{\"visible\":false}'
                    data-pagination='{\"visible\":false}'
                    data-rowclass=\"function(item) { return item.affectation === 'S' ? 'bg-orange-input' : ''; }\"
                    data-tooltip-field=\"motif_service\"
                    data-toolbarinvisible=\"true\"
                ></div>
            {% endif %}
        </div>
        {% if not is_readonly %}
            {# Mode validation : Tableau récap TVA et tableau paiement côte à côte #}
            <div class=\"d-flex mt-1\">
                <div>
                    <table class=\"table table-responsive table-sm table-inverse-color-datagrid mb-0\" id=\"tab-recap-taux\" style=\"width: 230px;overflow-y: auto;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\">
                            <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>
                        </tbody>
                    </table>
                </div>
                <div class=\"ms-auto\" style=\"width:570px;overflow-y: auto\">
                    <table class=\"table table-responsive table-bordered table-sm table-inverse-color-datagrid mb-0\" style=\"width: 570px\">
                        <thead align=\"center\" style=\"vertical-align: middle!important;\">
                            <th>Date</th>
                            <th>Montant</th>
                            <th>Date prévue enc.</th>
                            <th>Mode paiement</th>
                            <th>Date enc.</th>
                            <th>Perçu</th>
                        </thead>
                        <tbody style=\"height: 75px;\">
                            {% set nb_line = 0 %}
                            {% if liste_paiement|length > 0 %}
                                {% for paiement in liste_paiement %}
                                    {% set nb_line = nb_line + 1 %}
                                    <tr style=\"height: 25px\">
                                        <td>{{ paiement.date|date('d/m/Y') }}</td>
                                        <td>{{ paiement.montantTtc }}€</td>
                                        <td>{{ paiement.datePrevisionnelle ? paiement.datePrevisionnelle|date('d/m/Y') : '' }}</td>
                                        <td>{{ paiement.moyenPaiement ? paiement.moyenPaiement.libelleCourt : '' }}</td>
                                        <td></td>
                                        <td></td>
                                    </tr>
                                {% endfor %}
                                {% set emptyRows = 3 - nb_line %}
                                {% if emptyRows > 0 %}
                                    {% for i in 1..emptyRows %}
                                        <tr style=\"height: 25px\"><td colspan=\"6\"></td></tr>
                                    {% endfor %}
                                {% endif %}
                            {% else %}
                                <tr style=\"height: 25px\"><td colspan=\"6\"></td></tr>
                                <tr style=\"height: 25px\"><td colspan=\"6\"></td></tr>
                                <tr style=\"height: 25px\"><td colspan=\"6\"></td></tr>
                            {% endif %}
                        </tbody>
                    </table>
                </div>
            </div>
        {% endif %}
    </div>
    {% if not is_readonly %}
        {# Mode validation : Sections Déplacement, Main d'œuvre et Pièces à droite #}
        <div class=\"flex-grow-1\">
            <div class=\"d-flex\">
                <div class=\"d-flex flex-column\" style=\"margin-right:30px;\">
                    <div class=\"titre-small color-orange\">Déplacement</div>
                    <div class=\"d-flex\">
                        <div class=\"d-flex align-items-center\" style=\"margin-right: 30px;\">
                            <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\">
                            <label style=\"width: 58px;\">Prix HT</label>
                            <input type=\"text\" style=\"width:80px\" disabled class=\"form-control\" value=\"{{ ligne_deplacement ? (ligne_deplacement.getPrixTotalHt ? ligne_deplacement.getPrixTotalHt|number_format(2, ',', ' ') ~ '€' : '') }}\">
                        </div>
                    </div>
                    <div class=\"d-flex mt-2\">
                        <div class=\"d-flex align-items-center\" style=\"margin-right: 30px;\">
                            <label style=\"width: 33px;\">TVA</label>
                            <select name=\"deplacement_tva\" style=\"width:50px\" id=\"deplacement-tva\" {{ type == 'technique' ? 'disabled'}} data-group=\"deplacement\" form=\"form_validation_intervention\" class=\"form-control tva-select\">
                                <option value=\"\"></option>
                                {% for taux in tauxTva %}
                                    {% set selected = (ligne_deplacement and ligne_deplacement.getTauxTva ? ligne_deplacement.getTauxTva.id == taux.id) ? 'selected' : '' %}
                                    <option value=\"{{ taux.id }}\" {{ selected }}>{{ taux.taux }}%</option>
                                {% endfor %}
                            </select>
                            <input type=\"hidden\" id=\"deplacement-prix-ht\" value=\"{{ ligne_deplacement ? ligne_deplacement.getPrixTotalHt : '' }}\">
                        </div>
                        <div class=\"d-flex align-items-center me-2\">
                            <label style=\"width: 58px;\">Prix TTC</label>
                            <input type=\"text\" style=\"width:80px\" disabled class=\"form-control\" id=\"deplacement-intervention-prix-ttc\" value=\"\">
                        </div>
                    </div>
                </div>
                <div class=\"d-flex flex-column ms-auto\">
                    <div class=\"titre-small color-orange\">Main d'oeuvre</div>
                    <div class=\"d-flex\">
                        <div class=\"d-flex align-items-center\" style=\"margin-right: 30px;\">
                            <label style=\"width: 33px;\">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 style=\"width: 58px;\">Prix HT</label>
                            <input type=\"text\" style=\"width:80px\" disabled class=\"form-control\" value=\"{{ ligne_mo ? (ligne_mo.getPrixTotalHt ? ligne_mo.getPrixTotalHt|number_format(2, ',', ' ') ~ '€' : '') }}\">
                        </div>
                    </div>
                    <div class=\"d-flex mt-2\">
                        <div class=\"d-flex align-items-center\" style=\"margin-right: 30px;\">
                            <label style=\"width: 33px;\">TVA</label>
                            <select name=\"mo_tva\" style=\"width:50px\" form=\"form_validation_intervention\" {{ type == 'technique' ? 'disabled'}} class=\"form-control tva-select\" id=\"mo-tva\" data-group=\"mo\">
                                <option value=\"\"></option>
                                {% for taux in tauxTva %}
                                    {% set selected = (ligne_mo and ligne_mo.getTauxTva ? ligne_mo.getTauxTva.id == taux.id) ? 'selected' : '' %}
                                    <option value=\"{{ taux.id }}\" {{ selected }}>{{ taux.taux }}%</option>
                                {% endfor %}
                            </select>
                            <input type=\"hidden\" id=\"mo-prix-ht\" value=\"{{ ligne_mo ? ligne_mo.getPrixTotalHt : '' }}\">
                        </div>
                        <div class=\"d-flex align-items-center\">
                            <label style=\"width: 58px;\">Prix TTC</label>
                            <input type=\"text\" style=\"width:80px\" disabled class=\"form-control\" id=\"mo-intervention-prix-ttc\" value=\"\">
                        </div>
                    </div>
                </div>
            </div>
            <div class=\"mt-2\">
                <div class=\"titre-small color-orange\">Pièces</div>
                <div class=\"d-flex justify-content-between\">
                    <div class=\"d-flex align-items-center\">
                        <label style=\"width: 68px;\">Total HT</label>
                        <input type=\"text\" style=\"width:80px\" disabled class=\"form-control\" id=\"total-ht-pieces\" value=\"\">
                    </div>
                    <div class=\"d-flex align-items-center\">
                        <label style=\"width: 76px;\">Total TVA</label>
                        <input type=\"text\" style=\"width:80px\" disabled class=\"form-control\" id=\"total-recap-tab-tva\" value=\"\">
                    </div>
                    <div class=\"d-flex align-items-center\">
                        <label style=\"width: 75px;\">Total TTC</label>
                        <input type=\"text\" style=\"width:80px\" disabled class=\"form-control\" id=\"total-ttc-pieces\" value=\"\">
                    </div>
                </div>
            </div>
            {# Mode validation : Espacement et totaux avec IDs pour JS #}
            <div class=\"my-1\" style=\"height: 19.5px\"></div>
            <div class=\"d-flex justify-content-between\">
                <div class=\"d-flex align-items-center\">
                    <label style=\"width:68px;\">Total HT</label>
                    <input type=\"text\" style=\"width:80px\" disabled class=\"form-control\" id=\"montant-ht-recap\" value=\"\">
                </div>
                <div class=\"d-flex align-items-center\">
                    <label style=\"width: 76px;\">Total TVA</label>
                    <input type=\"text\" style=\"width:80px\" id=\"montant-tva-recap\" disabled class=\"form-control\" value=\"\">
                </div>
                <div class=\"d-flex align-items-center\">
                    <label style=\"width: 75px;\">Total TTC</label>
                    <input type=\"text\" style=\"width:80px\" id=\"montant-ttc-recap\" disabled class=\"form-control\" value=\"\">
                </div>
            </div>
            <div class=\"d-flex justify-content-between mt-2\">
                <div class=\"d-flex align-items-center\">
                    <label style=\"width:68px;\">Total perçu</label>
                    <input type=\"text\" style=\"width:80px\" {{ type == 'technique' ? 'disabled'}} class=\"form-control\" id=\"montant-paiement\" value=\"{{ total_paiement }}€\">
                </div>
                <div class=\"d-flex align-items-center\">
                    <label style=\"width: 76px;\">Restant dû</label>
                    <input type=\"text\" style=\"width:80px\" {{ type == 'technique' ? 'disabled'}} class=\"form-control\" id=\"montant-du\" value=\"\">
                </div>
                <div class=\"d-flex align-items-center\">
                    <label style=\"width: 75px;\">Ecart</label>
                    <input type=\"text\" style=\"width:80px\" disabled id=\"montant-ecart\" class=\"form-control\" value=\"\">
                </div>
            </div>
        </div>
    {% endif %}
    </div>
</div>
", "intervention/bloc_facturation.html.twig", "/builds/dev/refonte_sav/templates/intervention/bloc_facturation.html.twig");
    }
}
