<?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/timesheet.html.twig */
class __TwigTemplate_19b979a77e2f994b4bd81e8c9f4220571dd5ea57d36be6c15f2dbf2593703358 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/timesheet.html.twig", 1)->unwrap();
        // line 2
        $this->parent = $this->loadTemplate("invoice/layout.html.twig", "invoice/renderer/timesheet.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
        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>
        </h2>
    </div>
</div>

<div class=\"row\">
    <div class=\"col-xs-12\">
        <table class=\"table no-border table-condensed\">
            <tr>
                <th>";
        // line 18
        echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("invoice.from"), "html", null, true);
        echo "</th>
                <td contenteditable=\"true\">
                    ";
        // line 20
        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, 20), "user", [], "any", false, false, false, 20))) {
            // line 21
            echo "                        ";
            echo twig_call_macro($macros["widgets"], "macro_username", [twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["model"] ?? null), "query", [], "any", false, false, false, 21), "user", [], "any", false, false, false, 21)], 21, $context, $this->getSourceContext());
            echo "
                    ";
        } else {
            // line 23
            echo "                        ";
            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, 23), "company", [], "any", false, false, false, 23), "html", null, true);
            echo "
                    ";
        }
        // line 25
        echo "                </td>
            </tr>
            <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 30
        if ((0 !== twig_compare(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, 30), "begin", [], "any", false, false, false, 30), "m"), 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, 30), "end", [], "any", false, false, false, 30), "m")) || 0 !== twig_compare(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, 30), "begin", [], "any", false, false, false, 30), "Y"), 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, 30), "end", [], "any", false, false, false, 30), "Y")))) {
            // line 31
            echo "                        ";
            echo twig_escape_filter($this->env, $this->extensions['App\Twig\DateExtensions']->dateShort(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["model"] ?? null), "query", [], "any", false, false, false, 31), "begin", [], "any", false, false, false, 31)), "html", null, true);
            echo " - ";
            echo twig_escape_filter($this->env, $this->extensions['App\Twig\DateExtensions']->dateShort(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["model"] ?? null), "query", [], "any", false, false, false, 31), "end", [], "any", false, false, false, 31)), "html", null, true);
            echo "
                    ";
        } else {
            // line 33
            echo "                        ";
            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 "
                    ";
        }
        // line 35
        echo "                </td>
            </tr>
            <tr>
                <th>";
        // line 38
        echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("label.customer"), "html", null, true);
        echo "</th>
                <td contenteditable=\"true\">
                    ";
        // line 40
        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, 40), "number", [], "any", false, false, false, 40))) {
            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, 40), "number", [], "any", false, false, false, 40), "html", null, true);
            echo "]";
        }
        // line 41
        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, 41), "name", [], "any", false, false, false, 41), "html", null, true);
        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, 41), "contact", [], "any", false, false, false, 41))) {
            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, 41), "contact", [], "any", false, false, false, 41), "html", null, true);
        }
        // line 42
        echo "                </td>
            </tr>
            ";
        // line 44
        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, 44), "project", [], "any", false, false, false, 44)) &&  !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, 44), "project", [], "any", false, false, false, 44), "orderNumber", [], "any", false, false, false, 44)))) {
            // line 45
            echo "                <tr>
                    <th>";
            // line 46
            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 48
            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, 48), "project", [], "any", false, false, false, 48), "orderNumber", [], "any", false, false, false, 48), "html", null, true);
            echo "
                    </td>
                </tr>
            ";
        }
        // line 52
        echo "        </table>
    </div>
</div>

<div class=\"row invoice-items\">
    <div class=\"col-xs-12 table-responsive\">
        <table class=\"table table-striped\">
            <thead>
            <tr>
                <th>";
        // line 61
        echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("label.date"), "html", null, true);
        echo "</th>
                ";
        // line 62
        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, 62), "user", [], "any", false, false, false, 62))) {
            // line 63
            echo "                <th>";
            echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("label.user"), "html", null, true);
            echo "</th>
                ";
        }
        // line 65
        echo "                <th>";
        echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("label.activity"), "html", null, true);
        echo "</th>
                <th>";
        // line 66
        echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("label.hours"), "html", null, true);
        echo "</th>
            </tr>
            </thead>
            <tbody>
            ";
        // line 70
        $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, 70), "entries", [], "any", false, false, false, 70));
        foreach ($context['_seq'] as $context["_key"] => $context["entry"]) {
            // line 71
            echo "            <tr>
                <td>";
            // line 72
            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, 72)), "html", null, true);
            echo "</td>
                ";
            // line 73
            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, 73), "user", [], "any", false, false, false, 73))) {
                // line 74
                echo "                    <td>";
                echo twig_call_macro($macros["widgets"], "macro_username", [twig_get_attribute($this->env, $this->source, $context["entry"], "user", [], "any", false, false, false, 74)], 74, $context, $this->getSourceContext());
                echo "</td>
                ";
            }
            // line 76
            echo "                <td contenteditable=\"true\">
                    ";
            // line 77
            if ( !twig_test_empty(twig_get_attribute($this->env, $this->source, $context["entry"], "description", [], "any", false, false, false, 77))) {
                // line 78
                echo "                        ";
                echo nl2br(twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["entry"], "description", [], "any", false, false, false, 78), "html", null, true));
                echo "
                    ";
            } else {
                // line 80
                echo "                        ";
                if ( !(null === twig_get_attribute($this->env, $this->source, $context["entry"], "activity", [], "any", false, false, false, 80))) {
                    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, 80), "name", [], "any", false, false, false, 80), "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, 80), "name", [], "any", false, false, false, 80), "html", null, true);
                echo "
                    ";
            }
            // line 82
            echo "                </td>
                <td class=\"text-nowrap\">";
            // line 83
            echo twig_escape_filter($this->env, $this->extensions['App\Twig\LocaleExtensions']->duration(twig_get_attribute($this->env, $this->source, $context["entry"], "duration", [], "any", false, false, false, 83), ($context["isDecimal"] ?? 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 86
        echo "            </tbody>
            <tfoot>
            <tr>
                <th></th>
                ";
        // line 90
        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, 90), "user", [], "any", false, false, false, 90))) {
            // line 91
            echo "                <th></th>
                ";
        }
        // line 93
        echo "                <th>";
        echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("invoice.total_working_time"), "html", null, true);
        echo "</th>
                <th class=\"text-nowrap\">";
        // line 94
        echo twig_escape_filter($this->env, $this->extensions['App\Twig\LocaleExtensions']->duration(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["model"] ?? null), "calculator", [], "any", false, false, false, 94), "timeWorked", [], "any", false, false, false, 94), ($context["isDecimal"] ?? null)), "html", null, true);
        echo "</th>
            </tr>
            </tfoot>
        </table>
    </div>
</div>

<div class=\"row\">
    <div class=\"col-xs-12\">
        ";
        // line 103
        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, 103), "paymentTerms", [], "any", false, false, false, 103))) {
            // line 104
            echo "            <p class=\"lead\">";
            echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("label.payment_terms"), "html", null, true);
            echo "</p>

            <p class=\"text-muted well well-sm no-shadow\" contenteditable=\"true\" style=\"margin-bottom: 100px\">
                ";
            // line 107
            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, 107), "paymentTerms", [], "any", false, false, false, 107)), "html", null, true));
            echo "
            </p>
        ";
        }
        // line 110
        echo "
        <div class=\"table-responsive\">
            <table class=\"table\">
                <tbody>
                <tr>
                    <th style=\"padding-bottom: 60px\">";
        // line 115
        echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("invoice.signature_user"), "html", null, true);
        echo "</th>
                </tr>
                <tr>
                    <th>";
        // line 118
        echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("invoice.signature_customer"), "html", null, true);
        echo "</th>
                </tr>
                </tbody>
            </table>
        </div>
    </div>
</div>
";
    }

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

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  307 => 118,  301 => 115,  294 => 110,  288 => 107,  281 => 104,  279 => 103,  267 => 94,  262 => 93,  258 => 91,  256 => 90,  250 => 86,  241 => 83,  238 => 82,  228 => 80,  222 => 78,  220 => 77,  217 => 76,  211 => 74,  209 => 73,  205 => 72,  202 => 71,  198 => 70,  191 => 66,  186 => 65,  180 => 63,  178 => 62,  174 => 61,  163 => 52,  156 => 48,  151 => 46,  148 => 45,  146 => 44,  142 => 42,  135 => 41,  129 => 40,  124 => 38,  119 => 35,  111 => 33,  103 => 31,  101 => 30,  96 => 28,  91 => 25,  85 => 23,  79 => 21,  77 => 20,  72 => 18,  60 => 9,  55 => 6,  53 => 5,  49 => 4,  44 => 2,  42 => 1,  35 => 2,);
    }

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