<?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/_facturation.html.twig */
class __TwigTemplate_34aeab23e05193e4408c86f8596fa41938014707af081de883ee34bd73b5e2fe 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/_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/_facturation.html.twig"));

        // line 1
        $context["liste_paiement"] = [];
        // line 2
        $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.', 2, $this->source); })()), "factures", [], "any", false, false, false, 2));
        foreach ($context['_seq'] as $context["_key"] => $context["facture"]) {
            // line 3
            yield "    ";
            $context['_parent'] = $context;
            $context['_seq'] = CoreExtension::ensureTraversable(CoreExtension::getAttribute($this->env, $this->source, $context["facture"], "getPaiements", [], "any", false, false, false, 3));
            foreach ($context['_seq'] as $context["_key"] => $context["paiement"]) {
                // line 4
                yield "        ";
                $context["total_paiement"] = ((isset($context["total_paiement"]) || array_key_exists("total_paiement", $context) ? $context["total_paiement"] : (function () { throw new RuntimeError('Variable "total_paiement" does not exist.', 4, $this->source); })()) + CoreExtension::getAttribute($this->env, $this->source, $context["paiement"], "montantTTC", [], "any", false, false, false, 4));
                // line 5
                yield "        ";
                $context["liste_paiement"] = Twig\Extension\CoreExtension::merge((isset($context["liste_paiement"]) || array_key_exists("liste_paiement", $context) ? $context["liste_paiement"] : (function () { throw new RuntimeError('Variable "liste_paiement" does not exist.', 5, $this->source); })()), [$context["paiement"]]);
                // line 6
                yield "    ";
            }
            $_parent = $context['_parent'];
            unset($context['_seq'], $context['_iterated'], $context['_key'], $context['paiement'], $context['_parent'], $context['loop']);
            $context = array_intersect_key($context, $_parent) + $_parent;
            // line 7
            yield "    ";
            if (CoreExtension::getAttribute($this->env, $this->source, $context["facture"], "getFactureAcompte", [], "any", false, false, false, 7)) {
                // line 8
                yield "        ";
                $context['_parent'] = $context;
                $context['_seq'] = CoreExtension::ensureTraversable(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["facture"], "getFactureAcompte", [], "any", false, false, false, 8), "getPaiements", [], "any", false, false, false, 8));
                foreach ($context['_seq'] as $context["_key"] => $context["paiement"]) {
                    // line 9
                    yield "            ";
                    $context["total_accompte"] = ((isset($context["total_accompte"]) || array_key_exists("total_accompte", $context) ? $context["total_accompte"] : (function () { throw new RuntimeError('Variable "total_accompte" does not exist.', 9, $this->source); })()) + CoreExtension::getAttribute($this->env, $this->source, $context["paiement"], "montantTTC", [], "any", false, false, false, 9));
                    // line 10
                    yield "            ";
                    $context["id_paiement_acompte"] = CoreExtension::getAttribute($this->env, $this->source, $context["paiement"], "id", [], "any", false, false, false, 10);
                    // line 11
                    yield "            ";
                    $context["liste_paiement"] = Twig\Extension\CoreExtension::merge((isset($context["liste_paiement"]) || array_key_exists("liste_paiement", $context) ? $context["liste_paiement"] : (function () { throw new RuntimeError('Variable "liste_paiement" does not exist.', 11, $this->source); })()), [$context["paiement"]]);
                    // line 12
                    yield "        ";
                }
                $_parent = $context['_parent'];
                unset($context['_seq'], $context['_iterated'], $context['_key'], $context['paiement'], $context['_parent'], $context['loop']);
                $context = array_intersect_key($context, $_parent) + $_parent;
                // line 13
                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 14
        yield " ";
        
        $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);

        
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);

        return; yield '';
    }

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

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

    /**
     * @codeCoverageIgnore
     */
    public function getDebugInfo()
    {
        return array (  97 => 14,  90 => 13,  84 => 12,  81 => 11,  78 => 10,  75 => 9,  70 => 8,  67 => 7,  61 => 6,  58 => 5,  55 => 4,  50 => 3,  46 => 2,  44 => 1,);
    }

    public function getSourceContext()
    {
        return new Source("{% set liste_paiement = [] %}
{% for facture in intervention.factures %}
    {% for paiement in facture.getPaiements %}
        {% set total_paiement = total_paiement + paiement.montantTTC %}
        {% set liste_paiement = liste_paiement|merge([paiement]) %}
    {% endfor %}
    {% if facture.getFactureAcompte %}
        {% for paiement in facture.getFactureAcompte.getPaiements %}
            {% set total_accompte = total_accompte + paiement.montantTTC %}
            {% set id_paiement_acompte = paiement.id %}
            {% set liste_paiement = liste_paiement|merge([paiement]) %}
        {% endfor %}
    {% endif %}
{% endfor %} ", "intervention/_facturation.html.twig", "/builds/dev/refonte_sav/templates/intervention/_facturation.html.twig");
    }
}
