<?php

use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
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;

/* invoice/renderer/default.html.twig */
class __TwigTemplate_8100d40de3aef51ebf9e6dca904e1031bb3bb50793812b70727410be514dc266 extends Template
{
    private $source;
    private $macros = [];

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

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

        $this->blocks = [
            'invoice' => [$this, 'block_invoice'],
        ];
    }

    protected function doGetParent(array $context)
    {
        // line 1
        return "invoice/layout.html.twig";
    }

    protected function doDisplay(array $context, array $blocks = [])
    {
        $macros = $this->macros;
        $this->parent = $this->loadTemplate("invoice/layout.html.twig", "invoice/renderer/default.html.twig", 1);
        $this->parent->display($context, array_merge($this->blocks, $blocks));
    }

    // line 3
    public function block_invoice($context, array $blocks = [])
    {
        $macros = $this->macros;
        // line 4
        $context["isDecimal"] = ((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["model"] ?? null), "template", [], "any", false, true, false, 4), "decimalDuration", [], "any", true, true, false, 4)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["model"] ?? null), "template", [], "any", false, true, false, 4), "decimalDuration", [], "any", false, false, false, 4), false)) : (false));
        // line 5
        $context["currency"] = twig_get_attribute($this->env, $this->source, ($context["model"] ?? null), "currency", [], "any", false, false, false, 5);
        // line 6
        echo "<div class=\"row\">
    <div class=\"col-xs-12\">
        <h2 class=\"page-header\">
            <span contenteditable=\"true\">";
        // line 9
        echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["model"] ?? null), "template", [], "any", false, false, false, 9), "title", [], "any", false, false, false, 9), "html", null, true);
        echo "</span>
            <small class=\"pull-right\">";
        // line 10
        echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("label.date"), "html", null, true);
        echo ": ";
        echo twig_escape_filter($this->env, $this->extensions['App\Twig\DateExtensions']->dateShort(twig_get_attribute($this->env, $this->source, ($context["model"] ?? null), "invoiceDate", [], "any", false, false, false, 10)), "html", null, true);
        echo "</small>
        </h2>
    </div>
</div>

<div class=\"row\">
    <div class=\"col-sm-5\">
        ";
        // line 17
        echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("invoice.to"), "html", null, true);
        echo "
        <address contenteditable=\"true\">
            <strong>";
        // line 19
        echo twig_escape_filter($this->env, ((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["model"] ?? null), "customer", [], "any", false, true, false, 19), "company", [], "any", true, true, false, 19)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["model"] ?? null), "customer", [], "any", false, true, false, 19), "company", [], "any", false, false, false, 19), twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["model"] ?? null), "customer", [], "any", false, false, false, 19), "name", [], "any", false, false, false, 19))) : (twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["model"] ?? null), "customer", [], "any", false, false, false, 19), "name", [], "any", false, false, false, 19))), "html", null, true);
        echo "</strong><br>
            ";
        // line 20
        echo nl2br(twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["model"] ?? null), "customer", [], "any", false, false, false, 20), "address", [], "any", false, false, false, 20), "html", null, true));
        echo "
            ";
        // line 21
        if ( !twig_test_empty(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["model"] ?? null), "customer", [], "any", false, false, false, 21), "vatId", [], "any", false, false, false, 21))) {
            // line 22
            echo "                <br>
                ";
            // line 23
            echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("label.vat_id"), "html", null, true);
            echo ": ";
            echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["model"] ?? null), "customer", [], "any", false, false, false, 23), "vatId", [], "any", false, false, false, 23), "html", null, true);
            echo "
            ";
        }
        // line 25
        echo "            ";
        if ( !twig_test_empty(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["model"] ?? null), "customer", [], "any", false, false, false, 25), "number", [], "any", false, false, false, 25))) {
            // line 26
            echo "                <br>
                ";
            // line 27
            echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("label.number"), "html", null, true);
            echo ": ";
            echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["model"] ?? null), "customer", [], "any", false, false, false, 27), "number", [], "any", false, false, false, 27), "html", null, true);
            echo "
            ";
        }
        // line 29
        echo "            ";
        if (( !twig_test_empty(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["model"] ?? null), "query", [], "any", false, false, false, 29), "project", [], "any", false, false, false, 29)) &&  !twig_test_empty(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["model"] ?? null), "query", [], "any", false, false, false, 29), "project", [], "any", false, false, false, 29), "orderNumber", [], "any", false, false, false, 29)))) {
            // line 30
            echo "                <br>
                ";
            // line 31
            echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("label.orderNumber"), "html", null, true);
            echo ": ";
            echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["model"] ?? null), "query", [], "any", false, false, false, 31), "project", [], "any", false, false, false, 31), "orderNumber", [], "any", false, false, false, 31), "html", null, true);
            echo "
            ";
        }
        // line 33
        echo "        </address>
    </div>
    <div class=\"col-sm-2\"></div>
    <div class=\"col-sm-5\">
        ";
        // line 37
        echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("invoice.from"), "html", null, true);
        echo "
        <address contenteditable=\"true\">
            <strong>";
        // line 39
        echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["model"] ?? null), "template", [], "any", false, false, false, 39), "company", [], "any", false, false, false, 39), "html", null, true);
        echo "</strong><br>
            ";
        // line 40
        echo nl2br(twig_escape_filter($this->env, twig_trim_filter(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["model"] ?? null), "template", [], "any", false, false, false, 40), "address", [], "any", false, false, false, 40)), "html", null, true));
        echo "
            ";
        // line 41
        if ( !twig_test_empty(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["model"] ?? null), "template", [], "any", false, false, false, 41), "vatId", [], "any", false, false, false, 41))) {
            // line 42
            echo "            <br>
            ";
            // line 43
            echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("label.vat_id"), "html", null, true);
            echo ":
            ";
            // line 44
            echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["model"] ?? null), "template", [], "any", false, false, false, 44), "vatId", [], "any", false, false, false, 44), "html", null, true);
            echo "
            ";
        }
        // line 46
        echo "        </address>
    </div>
</div>

<div class=\"row\">
    <div class=\"col-sm-5\">
        <p contenteditable=\"true\">
            <strong>";
        // line 53
        echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("invoice.number"), "html", null, true);
        echo ":</strong>
            ";
        // line 54
        echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, ($context["model"] ?? null), "invoiceNumber", [], "any", false, false, false, 54), "html", null, true);
        echo "
            
            <br>
            <strong>";
        // line 57
        echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("invoice.due_days"), "html", null, true);
        echo ":</strong>
            ";
        // line 58
        echo twig_escape_filter($this->env, $this->extensions['App\Twig\DateExtensions']->dateShort(twig_get_attribute($this->env, $this->source, ($context["model"] ?? null), "dueDate", [], "any", false, false, false, 58)), "html", null, true);
        echo "
        </p>
    </div>
    <div class=\"col-sm-7\"></div>
</div>

<div class=\"row invoice-items\">
    <div class=\"col-xs-12 table-responsive\">
        <table class=\"table\">
            <thead>
                <tr>
                    <th>";
        // line 69
        echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("label.date"), "html", null, true);
        echo "</th>
                    <th>";
        // line 70
        echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("label.description"), "html", null, true);
        echo "</th>
                    <th class=\"text-right\">";
        // line 71
        echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("label.unit_price"), "html", null, true);
        echo "</th>
                    <th class=\"text-right\">";
        // line 72
        echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("label.amount"), "html", null, true);
        echo "</th>
                    <th class=\"text-right\">";
        // line 73
        echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("label.total_rate"), "html", null, true);
        echo "</th>
                </tr>
            </thead>
            <tbody>
            ";
        // line 77
        $context['_parent'] = $context;
        $context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["model"] ?? null), "calculator", [], "any", false, false, false, 77), "entries", [], "any", false, false, false, 77));
        foreach ($context['_seq'] as $context["_key"] => $context["entry"]) {
            // line 78
            echo "                ";
            $context["duration"] = $this->extensions['App\Twig\LocaleExtensions']->duration(twig_get_attribute($this->env, $this->source, $context["entry"], "duration", [], "any", false, false, false, 78), ($context["isDecimal"] ?? null));
            // line 79
            echo "                ";
            if (twig_get_attribute($this->env, $this->source, $context["entry"], "fixedRate", [], "any", false, false, false, 79)) {
                // line 80
                echo "                    ";
                $context["rate"] = twig_get_attribute($this->env, $this->source, $context["entry"], "fixedRate", [], "any", false, false, false, 80);
                // line 81
                echo "                    ";
                $context["duration"] = $this->extensions['App\Twig\LocaleExtensions']->amount(twig_get_attribute($this->env, $this->source, $context["entry"], "amount", [], "any", false, false, false, 81));
                // line 82
                echo "                ";
            } else {
                // line 83
                echo "                    ";
                $context["rate"] = twig_get_attribute($this->env, $this->source, $context["entry"], "hourlyRate", [], "any", false, false, false, 83);
                // line 84
                echo "                ";
            }
            // line 85
            echo "                <tr>
                    <td nowrap class=\"text-nowrap\">";
            // line 86
            echo twig_escape_filter($this->env, $this->extensions['App\Twig\DateExtensions']->dateShort(twig_get_attribute($this->env, $this->source, $context["entry"], "begin", [], "any", false, false, false, 86)), "html", null, true);
            echo "</td>
                    <td contenteditable=\"true\">
                        ";
            // line 88
            if ( !twig_test_empty(twig_get_attribute($this->env, $this->source, $context["entry"], "description", [], "any", false, false, false, 88))) {
                // line 89
                echo "                            ";
                echo nl2br(twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["entry"], "description", [], "any", false, false, false, 89), "html", null, true));
                echo "
                        ";
            } else {
                // line 91
                echo "                            ";
                if ( !(null === twig_get_attribute($this->env, $this->source, $context["entry"], "activity", [], "any", false, false, false, 91))) {
                    echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["entry"], "activity", [], "any", false, false, false, 91), "name", [], "any", false, false, false, 91), "html", null, true);
                    echo " / ";
                }
                echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["entry"], "project", [], "any", false, false, false, 91), "name", [], "any", false, false, false, 91), "html", null, true);
                echo "
                        ";
            }
            // line 93
            echo "                    </td>
                    <td nowrap class=\"text-nowrap text-right\">";
            // line 94
            echo twig_escape_filter($this->env, $this->extensions['App\Twig\LocaleExtensions']->money(($context["rate"] ?? null), ($context["currency"] ?? null)), "html", null, true);
            echo "</td>
                    <td nowrap class=\"text-nowrap text-right\">";
            // line 95
            echo twig_escape_filter($this->env, ($context["duration"] ?? null), "html", null, true);
            echo "</td>
                    <td nowrap class=\"text-nowrap text-right\">";
            // line 96
            echo twig_escape_filter($this->env, $this->extensions['App\Twig\LocaleExtensions']->money(twig_get_attribute($this->env, $this->source, $context["entry"], "rate", [], "any", false, false, false, 96), ($context["currency"] ?? null)), "html", null, true);
            echo "</td>
                </tr>
            ";
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['entry'], $context['_parent'], $context['loop']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 99
        echo "            </tbody>
            <tfoot>
                <tr>
                    <td colspan=\"4\" class=\"text-right\">
                        ";
        // line 103
        echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("invoice.subtotal"), "html", null, true);
        echo "
                    </td>
                    <td class=\"text-right\">";
        // line 105
        echo twig_escape_filter($this->env, $this->extensions['App\Twig\LocaleExtensions']->money(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["model"] ?? null), "calculator", [], "any", false, false, false, 105), "subtotal", [], "any", false, false, false, 105), ($context["currency"] ?? null)), "html", null, true);
        echo "</td>
                </tr>
                <tr>
                    <td colspan=\"4\" class=\"text-right\">
                        ";
        // line 109
        echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("invoice.tax"), "html", null, true);
        echo " (";
        echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["model"] ?? null), "calculator", [], "any", false, false, false, 109), "vat", [], "any", false, false, false, 109), "html", null, true);
        echo "%)
                    </td>
                    <td class=\"text-right\">";
        // line 111
        echo twig_escape_filter($this->env, $this->extensions['App\Twig\LocaleExtensions']->money(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["model"] ?? null), "calculator", [], "any", false, false, false, 111), "tax", [], "any", false, false, false, 111), ($context["currency"] ?? null)), "html", null, true);
        echo "</td>
                </tr>
                <tr>
                    <td colspan=\"4\" class=\"text-right text-nowrap\">
                        <strong>";
        // line 115
        echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("invoice.total"), "html", null, true);
        echo "</strong>
                    </td>
                    <td class=\"text-right\">
                        <strong>";
        // line 118
        echo twig_escape_filter($this->env, $this->extensions['App\Twig\LocaleExtensions']->money(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["model"] ?? null), "calculator", [], "any", false, false, false, 118), "total", [], "any", false, false, false, 118), ($context["currency"] ?? null)), "html", null, true);
        echo "</strong>
                    </td>
                </tr>
            </tfoot>
        </table>
    </div>
</div>

<div class=\"row\">
    <div class=\"col-xs-12\">
        ";
        // line 128
        if ( !twig_test_empty(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["model"] ?? null), "template", [], "any", false, false, false, 128), "paymentTerms", [], "any", false, false, false, 128))) {
            // line 129
            echo "        <div contenteditable=\"true\" class=\"paymentTerms\">
            ";
            // line 130
            echo $this->extensions['App\Twig\MarkdownExtension']->markdownToHtml(nl2br(twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["model"] ?? null), "template", [], "any", false, false, false, 130), "paymentTerms", [], "any", false, false, false, 130), "html", null, true)));
            echo "
        </div>
        ";
        }
        // line 133
        echo "    </div>
</div>

<footer class=\"footer\">
    <p>
        <strong>";
        // line 138
        echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("label.address"), "html", null, true);
        echo "</strong>: ";
        echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["model"] ?? null), "template", [], "any", false, false, false, 138), "company", [], "any", false, false, false, 138), "html", null, true);
        echo " &ndash; ";
        echo twig_replace_filter(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["model"] ?? null), "template", [], "any", false, false, false, 138), "address", [], "any", false, false, false, 138), ["
" => " &ndash; ", "
" => " &ndash; ", "
" => " &ndash; "]);
        echo "
        <br>
        <strong>";
        // line 140
        echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("label.invoice_bank_account"), "html", null, true);
        echo "</strong>: ";
        echo twig_replace_filter(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["model"] ?? null), "template", [], "any", false, false, false, 140), "paymentDetails", [], "any", false, false, false, 140), ["
" => " &ndash; ", "
" => " &ndash; ", "
" => " &ndash; "]);
        echo "
        <br>
        <strong>";
        // line 142
        echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("label.contact"), "html", null, true);
        echo "</strong>: ";
        echo twig_replace_filter(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["model"] ?? null), "template", [], "any", false, false, false, 142), "contact", [], "any", false, false, false, 142), ["
" => " &ndash; ", "
" => " &ndash; ", "
" => " &ndash; "]);
        echo "
    </p>
</footer>
";
    }

    public function getTemplateName()
    {
        return "invoice/renderer/default.html.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  379 => 142,  370 => 140,  359 => 138,  352 => 133,  346 => 130,  343 => 129,  341 => 128,  328 => 118,  322 => 115,  315 => 111,  308 => 109,  301 => 105,  296 => 103,  290 => 99,  281 => 96,  277 => 95,  273 => 94,  270 => 93,  260 => 91,  254 => 89,  252 => 88,  247 => 86,  244 => 85,  241 => 84,  238 => 83,  235 => 82,  232 => 81,  229 => 80,  226 => 79,  223 => 78,  219 => 77,  212 => 73,  208 => 72,  204 => 71,  200 => 70,  196 => 69,  182 => 58,  178 => 57,  172 => 54,  168 => 53,  159 => 46,  154 => 44,  150 => 43,  147 => 42,  145 => 41,  141 => 40,  137 => 39,  132 => 37,  126 => 33,  119 => 31,  116 => 30,  113 => 29,  106 => 27,  103 => 26,  100 => 25,  93 => 23,  90 => 22,  88 => 21,  84 => 20,  80 => 19,  75 => 17,  63 => 10,  59 => 9,  54 => 6,  52 => 5,  50 => 4,  46 => 3,  35 => 1,);
    }

    public function getSourceContext()
    {
        return new Source("", "invoice/renderer/default.html.twig", "/var/www/html/kimai2/templates/invoice/renderer/default.html.twig");
    }
}
