<?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/freelancer.html.twig */
class __TwigTemplate_0b76ccfd5353a4f4b7bfe3d929f7bcd2a7aa662750479a48422872cf085a2d79 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 2
        return "invoice/layout.html.twig";
    }

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

    // line 4
    public function block_invoice($context, array $blocks = [])
    {
        $macros = $this->macros;
        // line 5
        $context["isDecimal"] = ((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["model"] ?? null), "template", [], "any", false, true, false, 5), "decimalDuration", [], "any", true, true, false, 5)) ? (_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, 5), "decimalDuration", [], "any", false, false, false, 5), false)) : (false));
        // line 6
        $context["currency"] = twig_get_attribute($this->env, $this->source, ($context["model"] ?? null), "currency", [], "any", false, false, false, 6);
        // line 7
        echo "<div class=\"row\" id=\"freelancer-invoice\">
    <div class=\"col-xs-12\">
        <header>
            <address>
                <p contenteditable=\"true\">";
        // line 11
        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, 11), "company", [], "any", false, false, false, 11), "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, 11), "address", [], "any", false, false, false, 11), ["
" => " &ndash; ", "
" => " &ndash; ", "
" => " &ndash; "]);
        echo "</p>
            </address>
        </header>
        <article class=\"address\">
            <h1>";
        // line 15
        echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("invoice.to"), "html", null, true);
        echo "</h1>
            <address>
                <p>
                    <strong>";
        // line 18
        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, 18), "company", [], "any", true, true, false, 18)) ? (_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, 18), "company", [], "any", false, false, false, 18), twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["model"] ?? null), "customer", [], "any", false, false, false, 18), "name", [], "any", false, false, false, 18))) : (twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["model"] ?? null), "customer", [], "any", false, false, false, 18), "name", [], "any", false, false, false, 18))), "html", null, true);
        echo "</strong><br>
                    ";
        // line 19
        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, 19), "address", [], "any", false, false, false, 19), "html", null, true));
        echo "
                    ";
        // line 20
        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, 20), "vatId", [], "any", false, false, false, 20))) {
            // line 21
            echo "                    <br>
                    ";
            // line 22
            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, 22), "vatId", [], "any", false, false, false, 22), "html", null, true);
            echo "
                    ";
        }
        // line 24
        echo "                </p>
            </address>
            <table class=\"meta\">
                <tr>
                    <th>";
        // line 28
        echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("label.date"), "html", null, true);
        echo ":</th>
                    <td contenteditable=\"true\">";
        // line 29
        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, 29)), "html", null, true);
        echo "</td>
                </tr>
                <tr>
                    <th>";
        // line 32
        echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("invoice.service_date"), "html", null, true);
        echo ":</th>
                    <td><span contenteditable=\"true\">";
        // line 33
        echo twig_escape_filter($this->env, $this->extensions['App\Twig\DateExtensions']->monthName(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["model"] ?? null), "query", [], "any", false, false, false, 33), "end", [], "any", false, false, false, 33)), "html", null, true);
        echo " ";
        echo twig_escape_filter($this->env, twig_date_format_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["model"] ?? null), "query", [], "any", false, false, false, 33), "end", [], "any", false, false, false, 33), "Y"), "html", null, true);
        echo "</span></td>
                </tr>
                <tr>
                    <th>";
        // line 36
        echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("invoice.number"), "html", null, true);
        echo ":</th>
                    <td>";
        // line 37
        echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, ($context["model"] ?? null), "invoiceNumber", [], "any", false, false, false, 37), "html", null, true);
        echo "</td>
                </tr>
                ";
        // line 39
        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, 39), "project", [], "any", false, false, false, 39)) &&  !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, 39), "project", [], "any", false, false, false, 39), "orderNumber", [], "any", false, false, false, 39)))) {
            // line 40
            echo "                    <tr>
                        <th>";
            // line 41
            echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("label.orderNumber"), "html", null, true);
            echo "</th>
                        <td contenteditable=\"true\">
                            ";
            // line 43
            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, 43), "project", [], "any", false, false, false, 43), "orderNumber", [], "any", false, false, false, 43), "html", null, true);
            echo "
                        </td>
                    </tr>
                ";
        }
        // line 47
        echo "                ";
        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, 47), "vatId", [], "any", false, false, false, 47))) {
            // line 48
            echo "                    <tr>
                        <th>";
            // line 49
            echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("label.vat_id"), "html", null, true);
            echo ":</th>
                        <td>
                            ";
            // line 51
            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, 51), "vatId", [], "any", false, false, false, 51), "html", null, true);
            echo "
                        </td>
                    </tr>
                ";
        }
        // line 55
        echo "            </table>
        </article>
        <article class=\"invoice-items\">
            <h2>";
        // line 58
        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, 58), "title", [], "any", false, false, false, 58), "html", null, true);
        echo "</h2>
            <table class=\"inventory\">
                <thead>
                    <tr>
                        <th>";
        // line 62
        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 63
        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 64
        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 65
        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 69
        $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, 69), "entries", [], "any", false, false, false, 69));
        foreach ($context['_seq'] as $context["_key"] => $context["entry"]) {
            // line 70
            echo "                    ";
            $context["duration"] = $this->extensions['App\Twig\LocaleExtensions']->duration(twig_get_attribute($this->env, $this->source, $context["entry"], "duration", [], "any", false, false, false, 70), ($context["isDecimal"] ?? null));
            // line 71
            echo "                    ";
            if ( !(null === twig_get_attribute($this->env, $this->source, $context["entry"], "fixedRate", [], "any", false, false, false, 71))) {
                // line 72
                echo "                        ";
                $context["rate"] = twig_get_attribute($this->env, $this->source, $context["entry"], "fixedRate", [], "any", false, false, false, 72);
                // line 73
                echo "                        ";
                $context["duration"] = $this->extensions['App\Twig\LocaleExtensions']->amount(twig_get_attribute($this->env, $this->source, $context["entry"], "amount", [], "any", false, false, false, 73));
                // line 74
                echo "                    ";
            } else {
                // line 75
                echo "                        ";
                $context["rate"] = twig_get_attribute($this->env, $this->source, $context["entry"], "hourlyRate", [], "any", false, false, false, 75);
                // line 76
                echo "                    ";
            }
            // line 77
            echo "
                    <tr>
                        <td contenteditable=\"true\">
                            ";
            // line 80
            if ( !twig_test_empty(twig_get_attribute($this->env, $this->source, $context["entry"], "description", [], "any", false, false, false, 80))) {
                // line 81
                echo "                                ";
                echo nl2br(twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["entry"], "description", [], "any", false, false, false, 81), "html", null, true));
                echo "
                            ";
            } else {
                // line 83
                echo "                                ";
                if ( !(null === twig_get_attribute($this->env, $this->source, $context["entry"], "activity", [], "any", false, false, false, 83))) {
                    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, 83), "name", [], "any", false, false, false, 83), "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, 83), "name", [], "any", false, false, false, 83), "html", null, true);
                echo "
                            ";
            }
            // line 85
            echo "                        </td>
                        <td class=\"text-right text-nowrap\">";
            // line 86
            echo twig_escape_filter($this->env, $this->extensions['App\Twig\LocaleExtensions']->money(($context["rate"] ?? null), ($context["currency"] ?? null)), "html", null, true);
            echo "</td>
                        <td class=\"text-right text-nowrap\">";
            // line 87
            echo twig_escape_filter($this->env, ($context["duration"] ?? null), "html", null, true);
            echo "</td>
                        <td class=\"text-right text-nowrap\">";
            // line 88
            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, 88), ($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 91
        echo "                </tbody>
            </table>
            <table class=\"balance\">
                <tr>
                    <th>";
        // line 95
        echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("invoice.subtotal"), "html", null, true);
        echo "</th>
                    <td>";
        // line 96
        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, 96), "subtotal", [], "any", false, false, false, 96), ($context["currency"] ?? null)), "html", null, true);
        echo "</td>
                </tr>
                <tr>
                    <th>";
        // line 99
        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, 99), "vat", [], "any", false, false, false, 99), "html", null, true);
        echo "%)</th>
                    <td>";
        // line 100
        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, 100), "tax", [], "any", false, false, false, 100), ($context["currency"] ?? null)), "html", null, true);
        echo "</td>
                </tr>
                <tr>
                    <th class=\"total\">";
        // line 103
        echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("invoice.total"), "html", null, true);
        echo "</th>
                    <td class=\"total\">";
        // line 104
        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, 104), "total", [], "any", false, false, false, 104), ($context["currency"] ?? null)), "html", null, true);
        echo "</td>
                </tr>
            </table>
        </article>
        ";
        // line 108
        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, 108), "paymentTerms", [], "any", false, false, false, 108))) {
            // line 109
            echo "            <article class=\"paymentTerms\">
                <div contenteditable=\"true\">
                    ";
            // line 111
            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, 111), "paymentTerms", [], "any", false, false, false, 111), "html", null, true)));
            echo "
                </div>
            </article>
        ";
        }
        // line 115
        echo "        <footer class=\"footer\">
            <div class=\"row\">
                <div class=\"col-sm-4\" contenteditable=\"true\">
                    <p>
                        <strong>";
        // line 119
        echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("label.address"), "html", null, true);
        echo "</strong>
                    </p>
                    <p>
                        ";
        // line 122
        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, 122), "company", [], "any", false, false, false, 122), "html", null, true);
        echo "<br>
                        ";
        // line 123
        echo 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, 123), "address", [], "any", false, false, false, 123), "html", null, true));
        echo "
                    </p>
                </div>
                <div class=\"col-sm-4 text-center\" contenteditable=\"true\">
                    <p>
                        <strong>";
        // line 128
        echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("label.invoice_bank_account"), "html", null, true);
        echo "</strong>
                    </p>
                    <p>
                        ";
        // line 131
        echo 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, 131), "paymentDetails", [], "any", false, false, false, 131), "html", null, true));
        echo "
                    </p>
                </div>
                <div class=\"col-sm-4 text-right\" contenteditable=\"true\">
                    <p>
                        <strong>";
        // line 136
        echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("label.contact"), "html", null, true);
        echo "</strong>
                    </p>
                    <p>
                        ";
        // line 139
        echo 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, 139), "contact", [], "any", false, false, false, 139), "html", null, true));
        echo "
                    </p>
                </div>
            </div>
        </footer>
    </div>
</div>
";
    }

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

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  367 => 139,  361 => 136,  353 => 131,  347 => 128,  339 => 123,  335 => 122,  329 => 119,  323 => 115,  316 => 111,  312 => 109,  310 => 108,  303 => 104,  299 => 103,  293 => 100,  287 => 99,  281 => 96,  277 => 95,  271 => 91,  262 => 88,  258 => 87,  254 => 86,  251 => 85,  241 => 83,  235 => 81,  233 => 80,  228 => 77,  225 => 76,  222 => 75,  219 => 74,  216 => 73,  213 => 72,  210 => 71,  207 => 70,  203 => 69,  196 => 65,  192 => 64,  188 => 63,  184 => 62,  177 => 58,  172 => 55,  165 => 51,  160 => 49,  157 => 48,  154 => 47,  147 => 43,  142 => 41,  139 => 40,  137 => 39,  132 => 37,  128 => 36,  120 => 33,  116 => 32,  110 => 29,  106 => 28,  100 => 24,  93 => 22,  90 => 21,  88 => 20,  84 => 19,  80 => 18,  74 => 15,  63 => 11,  57 => 7,  55 => 6,  53 => 5,  49 => 4,  44 => 2,  42 => 1,  35 => 2,);
    }

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