public function block_content($context, array $blocks = array())
 {
     // line 6
     echo "\n";
     // line 7
     if (isset($context["admin"])) {
         $_admin_ = $context["admin"];
     } else {
         $_admin_ = null;
     }
     $context['_parent'] = (array) $context;
     $context['_seq'] = twig_ensure_traversable($this->getAttribute($_admin_, "system_messages", array(0 => array("type" => "info")), "method"));
     $context['loop'] = array('parent' => $context['_parent'], 'index0' => 0, 'index' => 1, 'first' => true);
     if (is_array($context['_seq']) || is_object($context['_seq']) && $context['_seq'] instanceof Countable) {
         $length = count($context['_seq']);
         $context['loop']['revindex0'] = $length - 1;
         $context['loop']['revindex'] = $length;
         $context['loop']['length'] = $length;
         $context['loop']['last'] = 1 === $length;
     }
     foreach ($context['_seq'] as $context["_key"] => $context["msg"]) {
         // line 8
         echo "<div class=\"nNote nInformation hideit ";
         if (isset($context["loop"])) {
             $_loop_ = $context["loop"];
         } else {
             $_loop_ = null;
         }
         if ($this->getAttribute($_loop_, "first")) {
             echo "first";
         }
         echo "\">\n    <p><strong>";
         // line 9
         echo gettext("INFORMATION");
         echo ": </strong>";
         if (isset($context["msg"])) {
             $_msg_ = $context["msg"];
         } else {
             $_msg_ = null;
         }
         echo twig_escape_filter($this->env, $_msg_, "html", null, true);
         echo "</p>\n</div>\n";
         ++$context['loop']['index0'];
         ++$context['loop']['index'];
         $context['loop']['first'] = false;
         if (isset($context['loop']['length'])) {
             --$context['loop']['revindex0'];
             --$context['loop']['revindex'];
             $context['loop']['last'] = 0 === $context['loop']['revindex0'];
         }
     }
     $_parent = $context['_parent'];
     unset($context['_seq'], $context['_iterated'], $context['_key'], $context['msg'], $context['_parent'], $context['loop']);
     $context = array_intersect_key($context, $_parent) + $_parent;
     // line 12
     echo "\n";
     // line 13
     if (isset($context["admin"])) {
         $_admin_ = $context["admin"];
     } else {
         $_admin_ = null;
     }
     if ($this->getAttribute($_admin_, "system_is_allowed", array(0 => array("mod" => "stats")), "method")) {
         // line 14
         echo "<div class=\"widget\">\n    <div class=\"head\"><h5><i class=\"dark-sprite-icon sprite-chart8\" style=\"margin: 0 15px 0 -15px\"></i>";
         // line 15
         if (isset($context["guest"])) {
             $_guest_ = $context["guest"];
         } else {
             $_guest_ = null;
         }
         echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($_guest_, "system_company"), "name"), "html", null, true);
         echo " ";
         echo gettext("Statistics");
         echo "</h5></div>\n    ";
         // line 16
         if (isset($context["admin"])) {
             $_admin_ = $context["admin"];
         } else {
             $_admin_ = null;
         }
         $context["stats"] = $this->getAttribute($_admin_, "stats_get_summary");
         // line 17
         echo "    ";
         if (isset($context["admin"])) {
             $_admin_ = $context["admin"];
         } else {
             $_admin_ = null;
         }
         $context["income"] = $this->getAttribute($_admin_, "stats_get_summary_income");
         // line 18
         echo "    <table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" class=\"tableStatic\">\n        <thead>\n            <tr>\n                <td width=\"10%\">";
         // line 21
         echo gettext("Metric");
         echo "</td>\n                <td>";
         // line 22
         echo gettext("Today");
         echo "</td>\n                <td>";
         // line 23
         echo gettext("Yesterday");
         echo "</td>\n                <td>";
         // line 24
         echo gettext("This month so far");
         echo "</td>\n                <td>";
         // line 25
         echo gettext("Last month");
         echo "</td>\n                <td>";
         // line 26
         echo gettext("Total");
         echo "</td>\n            </tr>\n        </thead>\n\n        <tbody>\n            <tr>\n                <td>";
         // line 32
         echo gettext("Income");
         echo "</td>\n                <td align=\"center\"><a href=\"";
         // line 33
         echo $this->env->getExtension('bb')->twig_bb_admin_link_filter("invoice", array("paid_at" => twig_date_format_filter($this->env, "now", "Y-m-d")));
         echo "\" title=\"\" class=\"webStatsLink\">";
         if (isset($context["mf"])) {
             $_mf_ = $context["mf"];
         } else {
             $_mf_ = null;
         }
         if (isset($context["income"])) {
             $_income_ = $context["income"];
         } else {
             $_income_ = null;
         }
         echo twig_escape_filter($this->env, $this->getAttribute($_mf_, "currency_format", array(0 => $this->getAttribute($_income_, "today")), "method"), "html", null, true);
         echo "</a></td>\n                <td align=\"center\"><a href=\"";
         // line 34
         echo $this->env->getExtension('bb')->twig_bb_admin_link_filter("invoice", array("paid_at" => twig_date_format_filter($this->env, "yesterday", "Y-m-d")));
         echo "\" title=\"\" class=\"webStatsLink\">";
         if (isset($context["mf"])) {
             $_mf_ = $context["mf"];
         } else {
             $_mf_ = null;
         }
         if (isset($context["income"])) {
             $_income_ = $context["income"];
         } else {
             $_income_ = null;
         }
         echo twig_escape_filter($this->env, $this->getAttribute($_mf_, "currency_format", array(0 => $this->getAttribute($_income_, "yesterday")), "method"), "html", null, true);
         echo "</a></td>\n                <td align=\"center\"><a href=\"";
         // line 35
         echo $this->env->getExtension('bb')->twig_bb_admin_link_filter("invoice");
         echo "\" title=\"\" class=\"webStatsLink\">";
         if (isset($context["mf"])) {
             $_mf_ = $context["mf"];
         } else {
             $_mf_ = null;
         }
         if (isset($context["income"])) {
             $_income_ = $context["income"];
         } else {
             $_income_ = null;
         }
         echo twig_escape_filter($this->env, $this->getAttribute($_mf_, "currency_format", array(0 => $this->getAttribute($_income_, "this_month")), "method"), "html", null, true);
         echo "</a></td>\n                <td align=\"center\"><a href=\"";
         // line 36
         echo $this->env->getExtension('bb')->twig_bb_admin_link_filter("invoice");
         echo "\" title=\"\" class=\"webStatsLink\">";
         if (isset($context["mf"])) {
             $_mf_ = $context["mf"];
         } else {
             $_mf_ = null;
         }
         if (isset($context["income"])) {
             $_income_ = $context["income"];
         } else {
             $_income_ = null;
         }
         echo twig_escape_filter($this->env, $this->getAttribute($_mf_, "currency_format", array(0 => $this->getAttribute($_income_, "last_month")), "method"), "html", null, true);
         echo "</a></td>\n                <td align=\"center\"><a href=\"";
         // line 37
         echo $this->env->getExtension('bb')->twig_bb_admin_link_filter("invoice");
         echo "\" title=\"\" class=\"webStatsLink\">";
         if (isset($context["mf"])) {
             $_mf_ = $context["mf"];
         } else {
             $_mf_ = null;
         }
         if (isset($context["income"])) {
             $_income_ = $context["income"];
         } else {
             $_income_ = null;
         }
         echo twig_escape_filter($this->env, $this->getAttribute($_mf_, "currency_format", array(0 => $this->getAttribute($_income_, "total")), "method"), "html", null, true);
         echo "</a></td>\n            </tr>\n            <tr>\n                <td>";
         // line 40
         echo gettext("Clients");
         echo "</td>\n                <td align=\"center\"><a href=\"";
         // line 41
         echo $this->env->getExtension('bb')->twig_bb_admin_link_filter("client", array("created_at" => twig_date_format_filter($this->env, "now", "Y-m-d")));
         echo "\" title=\"\" class=\"webStatsLink\">";
         if (isset($context["stats"])) {
             $_stats_ = $context["stats"];
         } else {
             $_stats_ = null;
         }
         echo twig_escape_filter($this->env, $this->getAttribute($_stats_, "clients_today"), "html", null, true);
         echo "</a></td>\n                <td align=\"center\"><a href=\"";
         // line 42
         echo $this->env->getExtension('bb')->twig_bb_admin_link_filter("client", array("created_at" => twig_date_format_filter($this->env, "yesterday", "Y-m-d")));
         echo "\" title=\"\" class=\"webStatsLink\">";
         if (isset($context["stats"])) {
             $_stats_ = $context["stats"];
         } else {
             $_stats_ = null;
         }
         echo twig_escape_filter($this->env, $this->getAttribute($_stats_, "clients_yesterday"), "html", null, true);
         echo "</a></td>\n                <td align=\"center\"><a href=\"";
         // line 43
         echo $this->env->getExtension('bb')->twig_bb_admin_link_filter("client");
         echo "\" title=\"\" class=\"webStatsLink\">";
         if (isset($context["stats"])) {
             $_stats_ = $context["stats"];
         } else {
             $_stats_ = null;
         }
         echo twig_escape_filter($this->env, $this->getAttribute($_stats_, "clients_this_month"), "html", null, true);
         echo "</a></td>\n                <td align=\"center\"><a href=\"";
         // line 44
         echo $this->env->getExtension('bb')->twig_bb_admin_link_filter("client");
         echo "\" title=\"\" class=\"webStatsLink\">";
         if (isset($context["stats"])) {
             $_stats_ = $context["stats"];
         } else {
             $_stats_ = null;
         }
         echo twig_escape_filter($this->env, $this->getAttribute($_stats_, "clients_last_month"), "html", null, true);
         echo "</a></td>\n                <td align=\"center\"><a href=\"";
         // line 45
         echo $this->env->getExtension('bb')->twig_bb_admin_link_filter("client");
         echo "\" title=\"\" class=\"webStatsLink\">";
         if (isset($context["stats"])) {
             $_stats_ = $context["stats"];
         } else {
             $_stats_ = null;
         }
         echo twig_escape_filter($this->env, $this->getAttribute($_stats_, "clients_total"), "html", null, true);
         echo "</a></td>\n            </tr>\n            <tr>\n                <td>";
         // line 48
         echo gettext("Orders");
         echo "</td>\n                <td align=\"center\"><a href=\"";
         // line 49
         echo $this->env->getExtension('bb')->twig_bb_admin_link_filter("order", array("created_at" => twig_date_format_filter($this->env, "now", "Y-m-d")));
         echo "\" title=\"\" class=\"webStatsLink\">";
         if (isset($context["stats"])) {
             $_stats_ = $context["stats"];
         } else {
             $_stats_ = null;
         }
         echo twig_escape_filter($this->env, $this->getAttribute($_stats_, "orders_today"), "html", null, true);
         echo "</a></td>\n                <td align=\"center\"><a href=\"";
         // line 50
         echo $this->env->getExtension('bb')->twig_bb_admin_link_filter("order", array("created_at" => twig_date_format_filter($this->env, "yesterday", "Y-m-d")));
         echo "\" title=\"\" class=\"webStatsLink\">";
         if (isset($context["stats"])) {
             $_stats_ = $context["stats"];
         } else {
             $_stats_ = null;
         }
         echo twig_escape_filter($this->env, $this->getAttribute($_stats_, "orders_yesterday"), "html", null, true);
         echo "</a></td>\n                <td align=\"center\"><a href=\"";
         // line 51
         echo $this->env->getExtension('bb')->twig_bb_admin_link_filter("order");
         echo "\" title=\"\" class=\"webStatsLink\">";
         if (isset($context["stats"])) {
             $_stats_ = $context["stats"];
         } else {
             $_stats_ = null;
         }
         echo twig_escape_filter($this->env, $this->getAttribute($_stats_, "orders_this_month"), "html", null, true);
         echo "</a></td>\n                <td align=\"center\"><a href=\"";
         // line 52
         echo $this->env->getExtension('bb')->twig_bb_admin_link_filter("order");
         echo "\" title=\"\" class=\"webStatsLink\">";
         if (isset($context["stats"])) {
             $_stats_ = $context["stats"];
         } else {
             $_stats_ = null;
         }
         echo twig_escape_filter($this->env, $this->getAttribute($_stats_, "orders_last_month"), "html", null, true);
         echo "</a></td>\n                <td align=\"center\"><a href=\"";
         // line 53
         echo $this->env->getExtension('bb')->twig_bb_admin_link_filter("order");
         echo "\" title=\"\" class=\"webStatsLink\">";
         if (isset($context["stats"])) {
             $_stats_ = $context["stats"];
         } else {
             $_stats_ = null;
         }
         echo twig_escape_filter($this->env, $this->getAttribute($_stats_, "orders_total"), "html", null, true);
         echo "</a></td>\n            </tr>\n            <tr>\n                <td>";
         // line 56
         echo gettext("Invoices");
         echo "</td>\n                <td align=\"center\"><a href=\"";
         // line 57
         echo $this->env->getExtension('bb')->twig_bb_admin_link_filter("invoice", array("created_at" => twig_date_format_filter($this->env, "now", "Y-m-d")));
         echo "\" title=\"\" class=\"webStatsLink\">";
         if (isset($context["stats"])) {
             $_stats_ = $context["stats"];
         } else {
             $_stats_ = null;
         }
         echo twig_escape_filter($this->env, $this->getAttribute($_stats_, "invoices_today"), "html", null, true);
         echo "</a></td>\n                <td align=\"center\"><a href=\"";
         // line 58
         echo $this->env->getExtension('bb')->twig_bb_admin_link_filter("invoice", array("created_at" => twig_date_format_filter($this->env, "yesterday", "Y-m-d")));
         echo "\" title=\"\" class=\"webStatsLink\">";
         if (isset($context["stats"])) {
             $_stats_ = $context["stats"];
         } else {
             $_stats_ = null;
         }
         echo twig_escape_filter($this->env, $this->getAttribute($_stats_, "invoices_yesterday"), "html", null, true);
         echo "</a></td>\n                <td align=\"center\"><a href=\"";
         // line 59
         echo $this->env->getExtension('bb')->twig_bb_admin_link_filter("invoice");
         echo "\" title=\"\" class=\"webStatsLink\">";
         if (isset($context["stats"])) {
             $_stats_ = $context["stats"];
         } else {
             $_stats_ = null;
         }
         echo twig_escape_filter($this->env, $this->getAttribute($_stats_, "invoices_this_month"), "html", null, true);
         echo "</a></td>\n                <td align=\"center\"><a href=\"";
         // line 60
         echo $this->env->getExtension('bb')->twig_bb_admin_link_filter("invoice");
         echo "\" title=\"\" class=\"webStatsLink\">";
         if (isset($context["stats"])) {
             $_stats_ = $context["stats"];
         } else {
             $_stats_ = null;
         }
         echo twig_escape_filter($this->env, $this->getAttribute($_stats_, "invoices_last_month"), "html", null, true);
         echo "</a></td>\n                <td align=\"center\"><a href=\"";
         // line 61
         echo $this->env->getExtension('bb')->twig_bb_admin_link_filter("invoice");
         echo "\" title=\"\" class=\"webStatsLink\">";
         if (isset($context["stats"])) {
             $_stats_ = $context["stats"];
         } else {
             $_stats_ = null;
         }
         echo twig_escape_filter($this->env, $this->getAttribute($_stats_, "invoices_total"), "html", null, true);
         echo "</a></td>\n            </tr>\n            <tr>\n                <td>";
         // line 64
         echo gettext("Tickets");
         echo "</td>\n                <td align=\"center\"><a href=\"";
         // line 65
         echo $this->env->getExtension('bb')->twig_bb_admin_link_filter("support", array("created_at" => twig_date_format_filter($this->env, "now", "Y-m-d")));
         echo "\" title=\"\" class=\"webStatsLink\">";
         if (isset($context["stats"])) {
             $_stats_ = $context["stats"];
         } else {
             $_stats_ = null;
         }
         echo twig_escape_filter($this->env, $this->getAttribute($_stats_, "tickets_today"), "html", null, true);
         echo "</a></td>\n                <td align=\"center\"><a href=\"";
         // line 66
         echo $this->env->getExtension('bb')->twig_bb_admin_link_filter("support", array("created_at" => twig_date_format_filter($this->env, "yesterday", "Y-m-d")));
         echo "\" title=\"\" class=\"webStatsLink\">";
         if (isset($context["stats"])) {
             $_stats_ = $context["stats"];
         } else {
             $_stats_ = null;
         }
         echo twig_escape_filter($this->env, $this->getAttribute($_stats_, "tickets_yesterday"), "html", null, true);
         echo "</a></td>\n                <td align=\"center\"><a href=\"";
         // line 67
         echo $this->env->getExtension('bb')->twig_bb_admin_link_filter("support");
         echo "\" title=\"\" class=\"webStatsLink\">";
         if (isset($context["stats"])) {
             $_stats_ = $context["stats"];
         } else {
             $_stats_ = null;
         }
         echo twig_escape_filter($this->env, $this->getAttribute($_stats_, "tickets_this_month"), "html", null, true);
         echo "</a></td>\n                <td align=\"center\"><a href=\"";
         // line 68
         echo $this->env->getExtension('bb')->twig_bb_admin_link_filter("support");
         echo "\" title=\"\" class=\"webStatsLink\">";
         if (isset($context["stats"])) {
             $_stats_ = $context["stats"];
         } else {
             $_stats_ = null;
         }
         echo twig_escape_filter($this->env, $this->getAttribute($_stats_, "tickets_last_month"), "html", null, true);
         echo "</a></td>\n                <td align=\"center\"><a href=\"";
         // line 69
         echo $this->env->getExtension('bb')->twig_bb_admin_link_filter("support");
         echo "\" title=\"\" class=\"webStatsLink\">";
         if (isset($context["stats"])) {
             $_stats_ = $context["stats"];
         } else {
             $_stats_ = null;
         }
         echo twig_escape_filter($this->env, $this->getAttribute($_stats_, "tickets_total"), "html", null, true);
         echo "</a></td>\n            </tr>\n        </tbody>\n    </table>\n</div>\n";
     }
     // line 75
     echo "\n";
     // line 76
     if (isset($context["admin"])) {
         $_admin_ = $context["admin"];
     } else {
         $_admin_ = null;
     }
     $context["orders"] = $this->getAttribute($_admin_, "order_get_list", array(0 => array("per_page" => "5", "status" => "active")), "method");
     // line 77
     if (isset($context["orders"])) {
         $_orders_ = $context["orders"];
     } else {
         $_orders_ = null;
     }
     if (twig_length_filter($this->env, $this->getAttribute($_orders_, "list")) > 0) {
         // line 78
         echo "<div class=\"widgets\">\n    <div class=\"left\">\n        <div class=\"widget\">\n            <div class=\"head\">\n                <h5 class=\"iMoney\">";
         // line 82
         echo gettext("Latest orders");
         echo "</h5>\n                <div class=\"num\"><a href=\"";
         // line 83
         echo $this->env->getExtension('bb')->twig_bb_admin_link_filter("order");
         echo "\" class=\"greenNum\">+";
         if (isset($context["orders"])) {
             $_orders_ = $context["orders"];
         } else {
             $_orders_ = null;
         }
         echo twig_escape_filter($this->env, $this->getAttribute($_orders_, "total"), "html", null, true);
         echo "</a></div>\n            </div>\n            <div style=\"height: 221px; overflow: auto;\">\n                <table class=\"tableStatic wide\">\n                    <thead>\n                        <tr>\n                            <td>";
         // line 89
         echo gettext("Order");
         echo "</td>\n                            <td>";
         // line 90
         echo gettext("Client");
         echo "</td>\n                        </tr>\n                    </thead>\n                    <tbody>\n                    ";
         // line 94
         if (isset($context["orders"])) {
             $_orders_ = $context["orders"];
         } else {
             $_orders_ = null;
         }
         $context['_parent'] = (array) $context;
         $context['_seq'] = twig_ensure_traversable($this->getAttribute($_orders_, "list"));
         $context['_iterated'] = false;
         foreach ($context['_seq'] as $context["_key"] => $context["order"]) {
             // line 95
             echo "                        <tr title=\"";
             if (isset($context["order"])) {
                 $_order_ = $context["order"];
             } else {
                 $_order_ = null;
             }
             echo twig_escape_filter($this->env, twig_timeago_filter($this->getAttribute($_order_, "created_at")), "html", null, true);
             echo " ago\">\n                            <td><a href=\"";
             // line 96
             echo $this->env->getExtension('bb')->twig_bb_admin_link_filter("order/manage");
             echo "/";
             if (isset($context["order"])) {
                 $_order_ = $context["order"];
             } else {
                 $_order_ = null;
             }
             echo twig_escape_filter($this->env, $this->getAttribute($_order_, "id"), "html", null, true);
             echo "\">";
             if (isset($context["order"])) {
                 $_order_ = $context["order"];
             } else {
                 $_order_ = null;
             }
             echo twig_escape_filter($this->env, twig_truncate_filter($this->env, $this->getAttribute($_order_, "title"), 35), "html", null, true);
             echo "</a></td>\n                            <td align=\"center\"><a href=\"";
             // line 97
             echo $this->env->getExtension('bb')->twig_bb_admin_link_filter("client/manage");
             echo "/";
             if (isset($context["order"])) {
                 $_order_ = $context["order"];
             } else {
                 $_order_ = null;
             }
             echo twig_escape_filter($this->env, $this->getAttribute($_order_, "client_id"), "html", null, true);
             echo "\" title=\"\">";
             if (isset($context["order"])) {
                 $_order_ = $context["order"];
             } else {
                 $_order_ = null;
             }
             echo twig_escape_filter($this->env, twig_truncate_filter($this->env, $this->getAttribute($this->getAttribute($_order_, "client"), "first_name"), 1, null, "."), "html", null, true);
             echo " ";
             if (isset($context["order"])) {
                 $_order_ = $context["order"];
             } else {
                 $_order_ = null;
             }
             echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($_order_, "client"), "last_name"), "html", null, true);
             echo "</a></td>\n                        </tr>\n                    ";
             $context['_iterated'] = true;
         }
         if (!$context['_iterated']) {
             // line 100
             echo "                    <tr>\n                        <td colspan=\"2\" align=\"center\">";
             // line 101
             echo gettext("The list is empty");
             echo "</td>\n                    </tr>\n                    ";
         }
         $_parent = $context['_parent'];
         unset($context['_seq'], $context['_iterated'], $context['_key'], $context['order'], $context['_parent'], $context['loop']);
         $context = array_intersect_key($context, $_parent) + $_parent;
         // line 104
         echo "                    </tbody>\n                </table>\n            </div>\n        </div>\n    </div>\n\n    <div class=\"right\">\n        <div class=\"widget\">\n            <div class=\"head\">\n                <h5 class=\"iGraph\">";
         // line 113
         echo gettext("Product sales");
         echo "</h5>\n            </div>\n            <div style=\"height: 221px; overflow: auto;\">\n                <table class=\"tableStatic wide\">\n                    <thead>\n                        <tr>\n                            <td>";
         // line 119
         echo gettext("Product/Service");
         echo "</td>\n                            <td>";
         // line 120
         echo gettext("Orders");
         echo "</td>\n                        </tr>\n                    </thead>\n                    <tbody>\n                    ";
         // line 124
         if (isset($context["admin"])) {
             $_admin_ = $context["admin"];
         } else {
             $_admin_ = null;
         }
         $context['_parent'] = (array) $context;
         $context['_seq'] = twig_ensure_traversable($this->getAttribute($_admin_, "stats_get_product_summary"));
         $context['_iterated'] = false;
         foreach ($context['_seq'] as $context["_key"] => $context["p"]) {
             // line 125
             echo "                        <tr>\n                            <td><a href=\"";
             // line 126
             echo $this->env->getExtension('bb')->twig_bb_admin_link_filter("product/manage");
             echo "/";
             if (isset($context["p"])) {
                 $_p_ = $context["p"];
             } else {
                 $_p_ = null;
             }
             echo twig_escape_filter($this->env, $this->getAttribute($_p_, "id"), "html", null, true);
             echo "\" title=\"";
             if (isset($context["p"])) {
                 $_p_ = $context["p"];
             } else {
                 $_p_ = null;
             }
             echo twig_escape_filter($this->env, $this->getAttribute($_p_, "title"), "html", null, true);
             echo "\">";
             if (isset($context["p"])) {
                 $_p_ = $context["p"];
             } else {
                 $_p_ = null;
             }
             echo twig_escape_filter($this->env, twig_truncate_filter($this->env, $this->getAttribute($_p_, "title"), 35), "html", null, true);
             echo "</a></td>\n                            <td align=\"center\"><a href=\"";
             // line 127
             if (isset($context["p"])) {
                 $_p_ = $context["p"];
             } else {
                 $_p_ = null;
             }
             echo $this->env->getExtension('bb')->twig_bb_admin_link_filter("order", array("product_id" => $this->getAttribute($_p_, "id")));
             echo "\" title=\"\" class=\"webStatsLink\">";
             if (isset($context["p"])) {
                 $_p_ = $context["p"];
             } else {
                 $_p_ = null;
             }
             echo twig_escape_filter($this->env, $this->getAttribute($_p_, "orders"), "html", null, true);
             echo "</a></td>\n                        </tr>\n                    ";
             $context['_iterated'] = true;
         }
         if (!$context['_iterated']) {
             // line 130
             echo "                    <tr>\n                        <td colspan=\"2\" align=\"center\">";
             // line 131
             echo gettext("No active orders available");
             echo "</td>\n                    </tr>\n                    ";
         }
         $_parent = $context['_parent'];
         unset($context['_seq'], $context['_iterated'], $context['_key'], $context['p'], $context['_parent'], $context['loop']);
         $context = array_intersect_key($context, $_parent) + $_parent;
         // line 134
         echo "                    </tbody>\n                </table>\n            </div>\n        </div>\n    </div>\n    <div class=\"fix\"></div>\n</div>\n";
     }
     // line 142
     echo "\n";
     // line 143
     if (isset($context["admin"])) {
         $_admin_ = $context["admin"];
     } else {
         $_admin_ = null;
     }
     if ($this->getAttribute($_admin_, "system_is_allowed", array(0 => array("mod" => "stats")), "method")) {
         // line 144
         echo "<div class=\"widget\">\n    <div class=\"head\">\n        <h5><i class=\"dark-sprite-icon sprite-dropper\" style=\"margin: 0 15px 0 -15px\"></i>";
         // line 146
         echo gettext("Define date interval for graphs");
         echo "</h5>\n    </div>\n    <form method=\"get\" action=\"\" class=\"mainForm\">\n        <input type=\"hidden\" name=\"_url\" value=\"";
         // line 149
         if (isset($context["request"])) {
             $_request_ = $context["request"];
         } else {
             $_request_ = null;
         }
         echo twig_escape_filter($this->env, $this->getAttribute($_request_, "_url"), "html", null, true);
         echo "\" />\n        <fieldset>\n            <div class=\"rowElem noborder\">\n                <div class=\"moreFields\">\n                    <ul>\n                        <li style=\"width: 100px\"><input type=\"text\" name=\"date_from\" value=\"";
         // line 154
         if (isset($context["request"])) {
             $_request_ = $context["request"];
         } else {
             $_request_ = null;
         }
         if ($this->getAttribute($_request_, "date_from")) {
             if (isset($context["request"])) {
                 $_request_ = $context["request"];
             } else {
                 $_request_ = null;
             }
             echo twig_escape_filter($this->env, twig_date_format_filter($this->env, $this->getAttribute($_request_, "date_from"), "Y-m-d"), "html", null, true);
         }
         echo "\" placeholder=\"";
         if (isset($context["now"])) {
             $_now_ = $context["now"];
         } else {
             $_now_ = null;
         }
         echo twig_escape_filter($this->env, twig_date_format_filter($this->env, $_now_, "Y-m-d"), "html", null, true);
         echo "\" class=\"datepicker\"/></li>\n                        <li class=\"sep\">-</li>\n                        <li style=\"width: 100px\"><input type=\"text\" name=\"date_to\" value=\"";
         // line 156
         if (isset($context["request"])) {
             $_request_ = $context["request"];
         } else {
             $_request_ = null;
         }
         if ($this->getAttribute($_request_, "date_to")) {
             if (isset($context["request"])) {
                 $_request_ = $context["request"];
             } else {
                 $_request_ = null;
             }
             echo twig_escape_filter($this->env, twig_date_format_filter($this->env, $this->getAttribute($_request_, "date_to"), "Y-m-d"), "html", null, true);
         }
         echo "\" placeholder=\"";
         if (isset($context["now"])) {
             $_now_ = $context["now"];
         } else {
             $_now_ = null;
         }
         echo twig_escape_filter($this->env, twig_date_format_filter($this->env, $_now_, "Y-m-d"), "html", null, true);
         echo "\" class=\"datepicker\"/></li>\n                        <li class=\"sep\" style=\"padding-top: 0px\"><input type=\"submit\" value=\"";
         // line 157
         echo gettext("Update graphs");
         echo "\" class=\"greyishBtn\" /></li>\n                    </ul>\n                </div>\n                <div class=\"fix\"></div>\n            </div>\n        </fieldset>\n    </form>\n</div>\n\n<div class=\"widget\">\n    <div class=\"head\">\n        <h5><i class=\"dark-sprite-icon sprite-graph\" style=\"margin: 0 15px 0 -15px\"></i>";
         // line 168
         echo gettext("Income");
         echo "</h5>\n    </div>\n    <div class=\"body\">\n        <div id=\"graph-income\" style=\"width: 100%; height: 200px;\"></div>\n    </div>\n</div>\n\n<div class=\"widget\">\n    <div class=\"head\">\n        <h5><i class=\"dark-sprite-icon sprite-graph\" style=\"margin: 0 15px 0 -15px\"></i>";
         // line 177
         echo gettext("Orders");
         echo "</h5>\n    </div>\n    <div class=\"body\">\n        <div id=\"graph-orders\" style=\"width: 100%; height: 200px;\"></div>\n    </div>\n</div>\n\n<div class=\"widget\">\n    <div class=\"head\">\n        <h5><i class=\"dark-sprite-icon sprite-graph\" style=\"margin: 0 15px 0 -15px\"></i>";
         // line 186
         echo gettext("Invoices");
         echo "</h5>\n    </div>\n    <div class=\"body\">\n        <div id=\"graph-invoice\" style=\"width: 100%; height: 200px;\"></div>\n    </div>\n</div>\n\n<div class=\"widget\">\n    <div class=\"head\">\n        <h5><i class=\"dark-sprite-icon sprite-graph\" style=\"margin: 0 15px 0 -15px\"></i>";
         // line 195
         echo gettext("Clients");
         echo "</h5>\n    </div>\n    <div class=\"body\">\n        <div id=\"graph-clients\" style=\"width: 100%; height: 200px;\"></div>\n    </div>\n</div>\n\n<div class=\"widget\">\n    <div class=\"head\">\n        <h5><i class=\"dark-sprite-icon sprite-graph\" style=\"margin: 0 15px 0 -15px\"></i>";
         // line 204
         echo gettext("Support tickets");
         echo "</h5>\n    </div>\n    <div class=\"body\">\n        <div id=\"graph-tickets\" style=\"width: 100%; height: 200px;\"></div>\n    </div>\n</div>\n";
     }
     // line 211
     echo "\n";
     // line 212
     if (isset($context["admin"])) {
         $_admin_ = $context["admin"];
     } else {
         $_admin_ = null;
     }
     if ($this->getAttribute($_admin_, "system_is_allowed", array(0 => array("mod" => "activity")), "method")) {
         // line 213
         echo "<div class=\"widget simpleTabs\">\n    <ul class=\"tabs\">\n        <li><a href=\"#tab-index\">";
         // line 215
         echo gettext("Recent clients activity");
         echo "</a></li>\n        <li><a href=\"#tab-staff\">";
         // line 216
         echo gettext("Recent staff activity");
         echo "</a></li>\n    </ul>\n\n    <div class=\"tabs_container\">\n        <div class=\"fix\"></div>\n\n        <div class=\"tab_content nopadding\" id=\"tab-index\">\n            <table class=\"tableStatic wide\">\n                <tbody>\n                ";
         // line 225
         if (isset($context["admin"])) {
             $_admin_ = $context["admin"];
         } else {
             $_admin_ = null;
         }
         $context["events"] = $this->getAttribute($_admin_, "activity_log_get_list", array(0 => array("per_page" => 10, "only_clients" => 1)), "method");
         // line 226
         echo "                ";
         if (isset($context["events"])) {
             $_events_ = $context["events"];
         } else {
             $_events_ = null;
         }
         $context['_parent'] = (array) $context;
         $context['_seq'] = twig_ensure_traversable($this->getAttribute($_events_, "list"));
         $context['_iterated'] = false;
         $context['loop'] = array('parent' => $context['_parent'], 'index0' => 0, 'index' => 1, 'first' => true);
         if (is_array($context['_seq']) || is_object($context['_seq']) && $context['_seq'] instanceof Countable) {
             $length = count($context['_seq']);
             $context['loop']['revindex0'] = $length - 1;
             $context['loop']['revindex'] = $length;
             $context['loop']['length'] = $length;
             $context['loop']['last'] = 1 === $length;
         }
         foreach ($context['_seq'] as $context["i"] => $context["event"]) {
             // line 227
             echo "                <tr ";
             if (isset($context["loop"])) {
                 $_loop_ = $context["loop"];
             } else {
                 $_loop_ = null;
             }
             if ($this->getAttribute($_loop_, "first")) {
                 echo "class=\"noborder\"";
             }
             echo ">\n                    <td style=\"width: 5%\"><a href=\"";
             // line 228
             echo $this->env->getExtension('bb')->twig_bb_admin_link_filter("client/manage");
             echo "/";
             if (isset($context["event"])) {
                 $_event_ = $context["event"];
             } else {
                 $_event_ = null;
             }
             echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($_event_, "client"), "id"), "html", null, true);
             echo "\" title=\"";
             if (isset($context["event"])) {
                 $_event_ = $context["event"];
             } else {
                 $_event_ = null;
             }
             echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($_event_, "client"), "name"), "html", null, true);
             echo "\"><img src=\"";
             if (isset($context["event"])) {
                 $_event_ = $context["event"];
             } else {
                 $_event_ = null;
             }
             echo twig_escape_filter($this->env, twig_gravatar_filter($this->getAttribute($this->getAttribute($_event_, "client"), "email")), "html", null, true);
             echo "?size=20\" alt=\"";
             if (isset($context["event"])) {
                 $_event_ = $context["event"];
             } else {
                 $_event_ = null;
             }
             echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($_event_, "client"), "name"), "html", null, true);
             echo "\" /></a></td>\n                    <td>";
             // line 229
             if (isset($context["event"])) {
                 $_event_ = $context["event"];
             } else {
                 $_event_ = null;
             }
             echo twig_escape_filter($this->env, twig_truncate_filter($this->env, $this->getAttribute($this->getAttribute($_event_, "client"), "name"), 40), "html", null, true);
             echo "</td>\n                    <td><a href=\"";
             // line 230
             echo $this->env->getExtension('bb')->twig_bb_admin_link_filter("client/manage");
             echo "/";
             if (isset($context["event"])) {
                 $_event_ = $context["event"];
             } else {
                 $_event_ = null;
             }
             echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($_event_, "client"), "id"), "html", null, true);
             echo "\">";
             if (isset($context["event"])) {
                 $_event_ = $context["event"];
             } else {
                 $_event_ = null;
             }
             echo twig_escape_filter($this->env, twig_truncate_filter($this->env, $this->getAttribute($_event_, "message"), 50), "html", null, true);
             echo "</a></td>\n                    <td>";
             // line 231
             if (isset($context["event"])) {
                 $_event_ = $context["event"];
             } else {
                 $_event_ = null;
             }
             echo twig_escape_filter($this->env, twig_timeago_filter($this->getAttribute($_event_, "created_at")), "html", null, true);
             echo " ago</td>\n                </tr>\n                </tbody>\n\n                ";
             $context['_iterated'] = true;
             ++$context['loop']['index0'];
             ++$context['loop']['index'];
             $context['loop']['first'] = false;
             if (isset($context['loop']['length'])) {
                 --$context['loop']['revindex0'];
                 --$context['loop']['revindex'];
                 $context['loop']['last'] = 0 === $context['loop']['revindex0'];
             }
         }
         if (!$context['_iterated']) {
             // line 236
             echo "                <tbody>\n                    <tr class=\"noborder\">\n                        <td colspan=\"4\">\n                            ";
             // line 239
             echo gettext("The list is empty");
             // line 240
             echo "                        </td>\n                    </tr>\n                </tbody>\n                ";
         }
         $_parent = $context['_parent'];
         unset($context['_seq'], $context['_iterated'], $context['i'], $context['event'], $context['_parent'], $context['loop']);
         $context = array_intersect_key($context, $_parent) + $_parent;
         // line 244
         echo "            </table>\n        </div>\n        \n        <div class=\"tab_content nopadding\" id=\"tab-staff\">\n            <table class=\"tableStatic wide\">\n                <tbody>\n                ";
         // line 250
         if (isset($context["admin"])) {
             $_admin_ = $context["admin"];
         } else {
             $_admin_ = null;
         }
         $context["events"] = $this->getAttribute($_admin_, "activity_log_get_list", array(0 => array("per_page" => 10, "only_staff" => 1)), "method");
         // line 251
         echo "                ";
         if (isset($context["events"])) {
             $_events_ = $context["events"];
         } else {
             $_events_ = null;
         }
         $context['_parent'] = (array) $context;
         $context['_seq'] = twig_ensure_traversable($this->getAttribute($_events_, "list"));
         $context['_iterated'] = false;
         $context['loop'] = array('parent' => $context['_parent'], 'index0' => 0, 'index' => 1, 'first' => true);
         if (is_array($context['_seq']) || is_object($context['_seq']) && $context['_seq'] instanceof Countable) {
             $length = count($context['_seq']);
             $context['loop']['revindex0'] = $length - 1;
             $context['loop']['revindex'] = $length;
             $context['loop']['length'] = $length;
             $context['loop']['last'] = 1 === $length;
         }
         foreach ($context['_seq'] as $context["i"] => $context["event"]) {
             // line 252
             echo "                <tr ";
             if (isset($context["loop"])) {
                 $_loop_ = $context["loop"];
             } else {
                 $_loop_ = null;
             }
             if ($this->getAttribute($_loop_, "first")) {
                 echo "class=\"noborder\"";
             }
             echo ">\n                    <td style=\"width: 5%\"><a href=\"";
             // line 253
             echo $this->env->getExtension('bb')->twig_bb_admin_link_filter("staff/manage");
             echo "/";
             if (isset($context["event"])) {
                 $_event_ = $context["event"];
             } else {
                 $_event_ = null;
             }
             echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($_event_, "staff"), "id"), "html", null, true);
             echo "\" title=\"";
             if (isset($context["event"])) {
                 $_event_ = $context["event"];
             } else {
                 $_event_ = null;
             }
             echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($_event_, "staff"), "name"), "html", null, true);
             echo "\"><img src=\"";
             if (isset($context["event"])) {
                 $_event_ = $context["event"];
             } else {
                 $_event_ = null;
             }
             echo twig_escape_filter($this->env, twig_gravatar_filter($this->getAttribute($this->getAttribute($_event_, "staff"), "email")), "html", null, true);
             echo "?size=20\" alt=\"";
             if (isset($context["event"])) {
                 $_event_ = $context["event"];
             } else {
                 $_event_ = null;
             }
             echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($_event_, "staff"), "name"), "html", null, true);
             echo "\" /></a></td>\n                    <td>";
             // line 254
             if (isset($context["event"])) {
                 $_event_ = $context["event"];
             } else {
                 $_event_ = null;
             }
             echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($_event_, "staff"), "name"), "html", null, true);
             echo "</td>\n                    <td><a href=\"";
             // line 255
             echo $this->env->getExtension('bb')->twig_bb_admin_link_filter("staff/manage");
             echo "/";
             if (isset($context["event"])) {
                 $_event_ = $context["event"];
             } else {
                 $_event_ = null;
             }
             echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($_event_, "staff"), "id"), "html", null, true);
             echo "\">";
             if (isset($context["event"])) {
                 $_event_ = $context["event"];
             } else {
                 $_event_ = null;
             }
             echo twig_escape_filter($this->env, twig_truncate_filter($this->env, $this->getAttribute($_event_, "message"), 50), "html", null, true);
             echo "</a></td>\n                    <td>";
             // line 256
             if (isset($context["event"])) {
                 $_event_ = $context["event"];
             } else {
                 $_event_ = null;
             }
             echo twig_escape_filter($this->env, twig_timeago_filter($this->getAttribute($_event_, "created_at")), "html", null, true);
             echo " ago</td>\n                </tr>\n                </tbody>\n\n                ";
             $context['_iterated'] = true;
             ++$context['loop']['index0'];
             ++$context['loop']['index'];
             $context['loop']['first'] = false;
             if (isset($context['loop']['length'])) {
                 --$context['loop']['revindex0'];
                 --$context['loop']['revindex'];
                 $context['loop']['last'] = 0 === $context['loop']['revindex0'];
             }
         }
         if (!$context['_iterated']) {
             // line 261
             echo "                <tbody>\n                    <tr class=\"noborder\">\n                        <td colspan=\"4\">\n                            ";
             // line 264
             echo gettext("The list is empty");
             // line 265
             echo "                        </td>\n                    </tr>\n                </tbody>\n                ";
         }
         $_parent = $context['_parent'];
         unset($context['_seq'], $context['_iterated'], $context['i'], $context['event'], $context['_parent'], $context['loop']);
         $context = array_intersect_key($context, $_parent) + $_parent;
         // line 269
         echo "            </table>\n        </div>\n\n    </div>\n    \n    <div class=\"fix\"></div>\n</div>\n";
     }
     // line 277
     echo "\n";
 }
 public function block_content($context, array $blocks = array())
 {
     // line 17
     echo "\n<div class=\"widget simpleTabs tabsRight\">\n    <div class=\"head\">\n        <h5>";
     // line 20
     echo gettext("Invoice");
     echo " #";
     echo twig_escape_filter($this->env, $this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "id"), "html", null, true);
     echo "</h5>\n    </div>\n\n    <ul class=\"tabs\">\n        <li><a href=\"#tab-info\">Details</a></li>\n        <li><a href=\"#tab-manage\">Manage</a></li>\n        <li><a href=\"#tab-texts\">Texts</a></li>\n        <li><a href=\"#tab-buyer-credentials\">Client credentials</a></li>\n        <li><a href=\"#tab-seller-credentials\">Company credentials</a></li>\n    </ul>\n\n    <div class=\"tabs_container\">\n        <div class=\"fix\"></div>\n        <div class=\"tab_content nopadding\" id=\"tab-info\">\n            <div class=\"block\">\n                <table class=\"tableStatic wide\">\n                    <tbody>\n                    <tr class=\"noborder\">\n                        <td style=\"width: 20%\"><label>";
     // line 38
     echo gettext("ID");
     echo "</label></td>\n                        <td>";
     // line 39
     echo twig_escape_filter($this->env, $this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "id"), "html", null, true);
     echo "</td>\n                    </tr>\n                    <tr>\n                        <td><label>";
     // line 42
     echo gettext("Number");
     echo "</label></td>\n                        <td>";
     // line 43
     echo twig_escape_filter($this->env, $this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "serie"), "html", null, true);
     echo twig_escape_filter($this->env, sprintf("%05s", $this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "nr")), "html", null, true);
     echo "</td>\n                    </tr>\n                    <tr>\n                        <td><label>";
     // line 46
     echo gettext("Currency");
     echo "</label></td>\n                        <td>";
     // line 47
     echo twig_escape_filter($this->env, $this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "currency"), "html", null, true);
     echo "</td>\n                    </tr>\n                    <tr>\n                        <td><label>";
     // line 50
     echo gettext("Client");
     echo "</label></td>\n                        <td><a href=\"";
     // line 51
     echo $this->env->getExtension('bb')->twig_bb_admin_link_filter("client/manage");
     echo "/";
     echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "client"), "id"), "html", null, true);
     echo "\">";
     echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "client"), "first_name"), "html", null, true);
     echo " ";
     echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "client"), "last_name"), "html", null, true);
     echo "</a></td>\n                    </tr>\n\n                    <tr>\n                        <td><label>";
     // line 55
     echo gettext("Status");
     echo "</label></td>\n                        <td>";
     // line 56
     echo $context["mf"]->getstatus_name($this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "status"));
     echo "</td>\n                    </tr>\n\n                    ";
     // line 59
     if ($this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "tax")) {
         // line 60
         echo "                    <tr>\n                        <td><label>";
         // line 61
         echo twig_escape_filter($this->env, $this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "taxname"), "html", null, true);
         echo " ";
         echo twig_escape_filter($this->env, $this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "taxrate"), "html", null, true);
         echo "%</label></td>\n                        <td>";
         // line 62
         echo $context["mf"]->getcurrency_format($this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "tax"), $this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "currency"));
         echo "</td>\n                    </tr>\n                    ";
     }
     // line 65
     echo "                    \n                    <tr>\n                        <td><label>";
     // line 67
     echo gettext("Total");
     echo "</label></td>\n                        <td>";
     // line 68
     echo $context["mf"]->getcurrency_format($this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "total"), $this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "currency"));
     echo "</td>\n                    </tr>\n                    \n                    <tr>\n                        <td><label>";
     // line 72
     echo gettext("Created at");
     echo "</label></td>\n                        <td>";
     // line 73
     echo twig_escape_filter($this->env, $this->env->getExtension('bb')->twig_bb_date($this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "created_at")), "html", null, true);
     echo "</td>\n                    </tr>\n\n                    <tr>\n                        <td><label>";
     // line 77
     echo gettext("Due at");
     echo "</label></td>\n                        <td>";
     // line 78
     echo twig_escape_filter($this->env, $this->env->getExtension('bb')->twig_bb_date($this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "due_at")), "html", null, true);
     echo "</td>\n                    </tr>\n\n                    <tr>\n                        <td><label>";
     // line 82
     echo gettext("Paid at");
     echo "</label></td>\n                        <td>";
     // line 83
     if ($this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "paid_at")) {
         echo twig_escape_filter($this->env, $this->env->getExtension('bb')->twig_bb_date($this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "paid_at")), "html", null, true);
     } else {
         echo "-";
     }
     echo "</td>\n                    </tr>\n\n                    <tr>\n                        <td><label>";
     // line 87
     echo gettext("Reminded at");
     echo "</label></td>\n                        <td>";
     // line 88
     if ($this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "reminded_at")) {
         echo twig_escape_filter($this->env, $this->env->getExtension('bb')->twig_bb_date($this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "reminded_at")), "html", null, true);
         echo " (";
         echo twig_escape_filter($this->env, twig_timeago_filter($this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "reminded_at")), "html", null, true);
         echo " ago) ";
     }
     echo "</td>\n                    </tr>\n                    \n                    ";
     // line 91
     if ($this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "notes")) {
         // line 92
         echo "                    <tr>\n                        <td><label>";
         // line 93
         echo gettext("Notes");
         echo "</label></td>\n                        <td>";
         // line 94
         echo twig_bbmd_filter($this->env, $this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "notes"));
         echo "</td>\n                    </tr>\n                    ";
     }
     // line 97
     echo "                    </tbody>\n                    \n                    <tfoot>\n                        <tr>\n                            <td colspan=\"2\">\n                                <div class=\"aligncenter\">\n                                    <a href=\"";
     // line 103
     echo $this->env->getExtension('bb')->twig_bb_client_link_filter("invoice");
     echo "/";
     echo twig_escape_filter($this->env, $this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "hash"), "html", null, true);
     echo "\" title=\"\" class=\"btn55 mr10\" target=\"_blank\"><img src=\"images/icons/middlenav/preview.png\" alt=\"\"><span>View as client</span></a>\n                                    <a href=\"";
     // line 104
     echo $this->env->getExtension('bb')->twig_bb_client_link_filter("api/admin/invoice/delete", array("id" => $this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "id")));
     echo "\" data-api-confirm=\"Are you sure?\"  title=\"\" class=\"btn55 mr10 api-link\" data-api-redirect=\"";
     echo $this->env->getExtension('bb')->twig_bb_admin_link_filter("invoice");
     echo "\"><img src=\"images/icons/middlenav/trash.png\" alt=\"\"><span>Delete</span></a>\n                                    ";
     // line 105
     if ($this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "status") == "unpaid") {
         // line 106
         echo "                                    <a href=\"";
         echo $this->env->getExtension('bb')->twig_bb_client_link_filter("api/admin/invoice/send_reminder", array("id" => $this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "id")));
         echo "\" title=\"\" class=\"btn55 mr10 api-link\" data-api-msg=\"Payment reminder was sent\"><img src=\"images/icons/middlenav/mail.png\" alt=\"\"><span>Send reminder</span></a>\n                                    <a href=\"";
         // line 107
         echo $this->env->getExtension('bb')->twig_bb_client_link_filter("api/admin/invoice/mark_as_paid", array("id" => $this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "id"), "execute" => 1));
         echo "\" title=\"\" class=\"btn55 mr10 api-link\" data-api-reload=\"Invoice marked as paid\"><img src=\"images/icons/middlenav/play2.png\" alt=\"\"><span>Mark as paid</span></a>\n                                    ";
     }
     // line 109
     echo "                                    \n                                    ";
     // line 110
     if ($this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "status") == "paid") {
         // line 111
         echo "                                    <a href=\"";
         echo $this->env->getExtension('bb')->twig_bb_client_link_filter("api/admin/invoice/refund", array("id" => $this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "id")));
         echo "\" data-api-confirm=\"Are you sure?\"  title=\"\" class=\"btn55 mr10 api-link\" data-api-redirect=\"";
         echo $this->env->getExtension('bb')->twig_bb_admin_link_filter("invoice");
         echo "\"><img src=\"images/icons/middlenav/refresh4.png\" alt=\"\"><span>Refund</span></a>\n                                    ";
     }
     // line 113
     echo "                                    <a href=\"";
     echo $this->env->getExtension('bb')->twig_bb_client_link_filter("invoice/pdf");
     echo "/";
     echo twig_escape_filter($this->env, $this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "hash"), "html", null, true);
     echo "\" target=\"_blank\" class=\"btn55 mr10\"><img src=\"images/icons/middlenav/incoming.png\" alt=\"\"><span>PDF</span></a>\n                                </div>\n                            </td>\n                        </tr>\n                    </tfoot>\n                </table>\n            </div>\n\n        </div>\n\n        <div class=\"tab_content nopadding\" id=\"tab-manage\">\n            <form action=\"";
     // line 124
     echo $this->env->getExtension('bb')->twig_bb_client_link_filter("api/admin/invoice/update");
     echo "\" method=\"post\" class=\"mainForm api-form\" data-api-reload=\"Invoice updated\">\n                <fieldset>\n                    <div class=\"rowElem noborder\">\n                        <label>";
     // line 127
     echo gettext("Status");
     echo ":</label>\n                        <div class=\"formRight\">\n                            <input type=\"radio\" name=\"status\" value=\"paid\"";
     // line 129
     if ($this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "status") == "paid") {
         echo " checked=\"checked\"";
     }
     echo "/><label>Paid</label>\n                            <input type=\"radio\" name=\"status\" value=\"unpaid\"";
     // line 130
     if ($this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "status") == "unpaid") {
         echo " checked=\"checked\"";
     }
     echo " /><label>Unpaid</label>\n                            <input type=\"radio\" name=\"status\" value=\"refunded\"";
     // line 131
     if ($this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "status") == "refunded") {
         echo " checked=\"checked\"";
     }
     echo " /><label>Refunded</label>\n                            <input type=\"radio\" name=\"status\" value=\"canceled\"";
     // line 132
     if ($this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "status") == "canceled") {
         echo " checked=\"checked\"";
     }
     echo " /><label>Canceled</label>\n                        </div>\n                        <div class=\"fix\"></div>\n                    </div>\n\n                    <div class=\"rowElem\">\n                        <label>";
     // line 138
     echo gettext("Approved");
     echo ":</label>\n                        <div class=\"formRight\">\n                            <input type=\"radio\" name=\"approved\" value=\"1\"";
     // line 140
     if ($this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "approved")) {
         echo " checked=\"checked\"";
     }
     echo "/><label>Yes</label>\n                            <input type=\"radio\" name=\"approved\" value=\"0\"";
     // line 141
     if (!$this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "approved")) {
         echo " checked=\"checked\"";
     }
     echo " /><label>No</label>\n                        </div>\n                        <div class=\"fix\"></div>\n                    </div>\n\n                    <div class=\"rowElem\">\n                        <label>";
     // line 147
     echo gettext("Serie and number");
     echo ":</label>\n                        <div class=\"formRight moreFields\">\n                            <ul>\n                                <li style=\"width: 150px\">\n                                    <input type=\"text\" name=\"serie\" value=\"";
     // line 151
     echo twig_escape_filter($this->env, $this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "serie"), "html", null, true);
     echo "\"/>\n                                </li>\n                                <li class=\"sep\">&nbsp;</li>\n                                <li style=\"width: 150px\">\n                                    <input type=\"text\" name=\"nr\" value=\"";
     // line 155
     echo twig_escape_filter($this->env, $this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "nr"), "html", null, true);
     echo "\"/>\n                                </li>\n                            </ul>\n                        </div>\n                        <div class=\"fix\"></div>\n                    </div>\n\n                    <div class=\"rowElem\">\n                        <label>";
     // line 163
     echo gettext("Tax");
     echo ":</label>\n                        <div class=\"formRight moreFields\">\n                            <ul>\n                                <li style=\"width: 150px\">\n                                    <input type=\"text\" name=\"taxname\" value=\"";
     // line 167
     echo twig_escape_filter($this->env, $this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "taxname"), "html", null, true);
     echo "\"/>\n                                </li>\n                                <li class=\"sep\">&nbsp;</li>\n                                <li style=\"width: 40px\">\n                                    <input type=\"text\" name=\"taxrate\" value=\"";
     // line 171
     echo twig_escape_filter($this->env, $this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "taxrate"), "html", null, true);
     echo "\"/>\n                                </li>\n                                <li class=\"sep\">%</li>\n                            </ul>\n                        </div>\n                        <div class=\"fix\"></div>\n                    </div>\n                    <div class=\"rowElem\">\n                        <label>";
     // line 179
     echo gettext("Payment method");
     echo ":</label>\n                        <div class=\"formRight\">\n                            ";
     // line 181
     echo $context["mf"]->getselectbox("gateway_id", $this->getAttribute(isset($context["guest"]) ? $context["guest"] : null, "invoice_gateways", array(0 => array("format" => "pairs")), "method"), $this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "gateway_id"), 0, "Select payment method");
     echo "\n                        </div>\n                        <div class=\"fix\"></div>\n                    </div>\n\n                    <div class=\"rowElem\">\n                        <label>";
     // line 187
     echo gettext("Created at");
     echo ":</label>\n                        <div class=\"formRight\">\n                            <input type=\"text\" name=\"created_at\" value=\"";
     // line 189
     echo twig_escape_filter($this->env, twig_date_format_filter($this->env, $this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "created_at"), "Y-m-d"), "html", null, true);
     echo "\" class=\"datepicker\"/>\n                        </div>\n                        <div class=\"fix\"></div>\n                    </div>\n\n                    <div class=\"rowElem\">\n                        <label>";
     // line 195
     echo gettext("Due at");
     echo ":</label>\n                        <div class=\"formRight\">\n                            <input type=\"text\" name=\"due_at\" value=\"";
     // line 197
     if ($this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "due_at")) {
         echo twig_escape_filter($this->env, twig_date_format_filter($this->env, $this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "due_at"), "Y-m-d"), "html", null, true);
     }
     echo "\" class=\"datepicker\"/>\n                        </div>\n                        <div class=\"fix\"></div>\n                    </div>\n\n                    <div class=\"rowElem\">\n                        <label>";
     // line 203
     echo gettext("Paid at");
     echo ":</label>\n                        <div class=\"formRight\">\n                            <input type=\"text\" name=\"paid_at\" value=\"";
     // line 205
     if ($this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "paid_at")) {
         echo twig_escape_filter($this->env, twig_date_format_filter($this->env, $this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "paid_at"), "Y-m-d"), "html", null, true);
     }
     echo "\" class=\"datepicker\"/>\n                        </div>\n                        <div class=\"fix\"></div>\n                    </div>\n\n                    <div class=\"rowElem\">\n                        <label>";
     // line 211
     echo gettext("Notes");
     echo ":</label>\n                        <div class=\"formRight\">\n                            <textarea name=\"notes\" cols=\"5\" rows=\"6\">";
     // line 213
     echo twig_escape_filter($this->env, $this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "notes"), "html", null, true);
     echo "</textarea>\n                        </div>\n                        <div class=\"fix\"></div>\n                    </div>\n\n                    <input type=\"submit\" value=\"";
     // line 218
     echo gettext("Update");
     echo "\" class=\"greyishBtn submitForm\" />\n                    <input type=\"hidden\" name=\"id\" value=\"";
     // line 219
     echo twig_escape_filter($this->env, $this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "id"), "html", null, true);
     echo "\" />\n                </fieldset>\n            </form>\n        </div>\n\n        <div class=\"tab_content nopadding\" id=\"tab-texts\">\n            <form action=\"";
     // line 225
     echo $this->env->getExtension('bb')->twig_bb_client_link_filter("api/admin/invoice/update");
     echo "\" method=\"post\" class=\"mainForm api-form\" data-api-msg=\"Invoice updated\">\n                <fieldset>\n                    <label class=\"topLabel\">";
     // line 227
     echo gettext("Text before invoice items table");
     echo "</label>\n                    <textarea name=\"text_1\"  cols=\"5\" rows=\"6\" class=\"bb-textarea\"/>";
     // line 228
     echo twig_escape_filter($this->env, $this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "text_1"), "html", null, true);
     echo "</textarea>\n                </fieldset>\n                \n                <fieldset>    \n                    <label class=\"topLabel\">";
     // line 232
     echo gettext("Text after invoice items table");
     echo "</label>\n                    <textarea name=\"text_2\" cols=\"5\" rows=\"6\" class=\"bb-textarea\"/>";
     // line 233
     echo twig_escape_filter($this->env, $this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "text_2"), "html", null, true);
     echo "</textarea>\n                    <input type=\"submit\" value=\"";
     // line 234
     echo gettext("Update");
     echo "\" class=\"greyishBtn submitForm\" />\n                    <input type=\"hidden\" name=\"id\" value=\"";
     // line 235
     echo twig_escape_filter($this->env, $this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "id"), "html", null, true);
     echo "\" />\n                </fieldset>\n            </form>\n\n            <div class=\"fix\"></div>\n        </div>\n\n        <div class=\"tab_content nopadding\" id=\"tab-seller-credentials\">\n            ";
     // line 243
     $context["seller"] = $this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "seller");
     // line 244
     echo "            <form action=\"";
     echo $this->env->getExtension('bb')->twig_bb_client_link_filter("api/admin/invoice/update");
     echo "\" method=\"post\" class=\"mainForm api-form\" data-api-msg=\"Invoice updated\">\n                <fieldset>\n                    <legend>Company details at the moment of purchase</legend>\n\n                    <div class=\"rowElem noborder\">\n                        <label>";
     // line 249
     echo gettext("Company");
     echo ":</label>\n                        <div class=\"formRight\">\n                            <input type=\"text\" name=\"seller_company\" value=\"";
     // line 251
     echo twig_escape_filter($this->env, $this->getAttribute(isset($context["seller"]) ? $context["seller"] : null, "company"), "html", null, true);
     echo "\"/>\n                        </div>\n                        <div class=\"fix\"></div>\n                    </div>\n                    \n                    <div class=\"rowElem\">\n                        <label>";
     // line 257
     echo gettext("Company VAT");
     echo ":</label>\n                        <div class=\"formRight\">\n                            <input type=\"text\" name=\"seller_company_vat\" value=\"";
     // line 259
     echo twig_escape_filter($this->env, $this->getAttribute(isset($context["seller"]) ? $context["seller"] : null, "company_vat"), "html", null, true);
     echo "\"/>\n                        </div>\n                        <div class=\"fix\"></div>\n                    </div>\n                    \n                    <div class=\"rowElem\">\n                        <label>";
     // line 265
     echo gettext("Company Number");
     echo ":</label>\n                        <div class=\"formRight\">\n                            <input type=\"text\" name=\"seller_company_number\" value=\"";
     // line 267
     echo twig_escape_filter($this->env, $this->getAttribute(isset($context["seller"]) ? $context["seller"] : null, "company_number"), "html", null, true);
     echo "\"/>\n                        </div>\n                        <div class=\"fix\"></div>\n                    </div>\n\n                    <div class=\"rowElem\">\n                        <label>";
     // line 273
     echo gettext("Address");
     echo ":</label>\n                        <div class=\"formRight\">\n                            <input type=\"text\" name=\"seller_address\" value=\"";
     // line 275
     echo twig_escape_filter($this->env, $this->getAttribute(isset($context["seller"]) ? $context["seller"] : null, "address"), "html", null, true);
     echo "\"/>\n                        </div>\n                        <div class=\"fix\"></div>\n                    </div>\n\n                    <div class=\"rowElem\">\n                        <label>";
     // line 281
     echo gettext("Phone");
     echo ":</label>\n                        <div class=\"formRight\">\n                            <input type=\"text\" name=\"seller_phone\" value=\"";
     // line 283
     echo twig_escape_filter($this->env, $this->getAttribute(isset($context["seller"]) ? $context["seller"] : null, "phone"), "html", null, true);
     echo "\"/>\n                        </div>\n                        <div class=\"fix\"></div>\n                    </div>\n\n                    <div class=\"rowElem\">\n                        <label>";
     // line 289
     echo gettext("Email");
     echo ":</label>\n                        <div class=\"formRight\">\n                            <input type=\"text\" name=\"seller_email\" value=\"";
     // line 291
     echo twig_escape_filter($this->env, $this->getAttribute(isset($context["seller"]) ? $context["seller"] : null, "email"), "html", null, true);
     echo "\"/>\n                        </div>\n                        <div class=\"fix\"></div>\n                    </div>\n\n                    <input type=\"submit\" value=\"";
     // line 296
     echo gettext("Update");
     echo "\" class=\"greyishBtn submitForm\" />\n                    <input type=\"hidden\" name=\"id\" value=\"";
     // line 297
     echo twig_escape_filter($this->env, $this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "id"), "html", null, true);
     echo "\" />\n                </fieldset>\n            </form>\n\n            <div class=\"fix\"></div>\n        </div>\n\n\n        <div class=\"tab_content nopadding\" id=\"tab-buyer-credentials\">\n            ";
     // line 306
     $context["buyer"] = $this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "buyer");
     // line 307
     echo "            <form action=\"";
     echo $this->env->getExtension('bb')->twig_bb_client_link_filter("api/admin/invoice/update");
     echo "\" method=\"post\" class=\"mainForm api-form\" data-api-msg=\"Invoice updated\">\n                <fieldset>\n                    <legend>Client details at the moment of purchase</legend>\n\n                    <div class=\"rowElem noborder\">\n                        <label>";
     // line 312
     echo gettext("First name");
     echo ":</label>\n                        <div class=\"formRight\">\n                            <input type=\"text\" name=\"buyer_first_name\" value=\"";
     // line 314
     echo twig_escape_filter($this->env, $this->getAttribute(isset($context["buyer"]) ? $context["buyer"] : null, "first_name"), "html", null, true);
     echo "\"/>\n                        </div>\n                        <div class=\"fix\"></div>\n                    </div>\n\n                    <div class=\"rowElem\">\n                        <label>";
     // line 320
     echo gettext("Last name");
     echo ":</label>\n                        <div class=\"formRight\">\n                            <input type=\"text\" name=\"buyer_last_name\" value=\"";
     // line 322
     echo twig_escape_filter($this->env, $this->getAttribute(isset($context["buyer"]) ? $context["buyer"] : null, "last_name"), "html", null, true);
     echo "\"/>\n                        </div>\n                        <div class=\"fix\"></div>\n                    </div>\n\n                    <div class=\"rowElem\">\n                        <label>";
     // line 328
     echo gettext("Company");
     echo ":</label>\n                        <div class=\"formRight\">\n                            <input type=\"text\" name=\"buyer_company\" value=\"";
     // line 330
     echo twig_escape_filter($this->env, $this->getAttribute(isset($context["buyer"]) ? $context["buyer"] : null, "company"), "html", null, true);
     echo "\"/>\n                        </div>\n                        <div class=\"fix\"></div>\n                    </div>\n                    \n                    <div class=\"rowElem\">\n                        <label>";
     // line 336
     echo gettext("Company VAT");
     echo ":</label>\n                        <div class=\"formRight\">\n                            <input type=\"text\" name=\"buyer_company_vat\" value=\"";
     // line 338
     echo twig_escape_filter($this->env, $this->getAttribute(isset($context["buyer"]) ? $context["buyer"] : null, "company_vat"), "html", null, true);
     echo "\"/>\n                        </div>\n                        <div class=\"fix\"></div>\n                    </div>\n                    \n                    <div class=\"rowElem\">\n                        <label>";
     // line 344
     echo gettext("Company Number");
     echo ":</label>\n                        <div class=\"formRight\">\n                            <input type=\"text\" name=\"buyer_company_number\" value=\"";
     // line 346
     echo twig_escape_filter($this->env, $this->getAttribute(isset($context["buyer"]) ? $context["buyer"] : null, "company_number"), "html", null, true);
     echo "\"/>\n                        </div>\n                        <div class=\"fix\"></div>\n                    </div>\n\n                    <div class=\"rowElem\">\n                        <label>";
     // line 352
     echo gettext("Address");
     echo ":</label>\n                        <div class=\"formRight\">\n                            <input type=\"text\" name=\"buyer_address\" value=\"";
     // line 354
     echo twig_escape_filter($this->env, $this->getAttribute(isset($context["buyer"]) ? $context["buyer"] : null, "address"), "html", null, true);
     echo "\"/>\n                        </div>\n                        <div class=\"fix\"></div>\n                    </div>\n\n                    <div class=\"rowElem\">\n                        <label>";
     // line 360
     echo gettext("City");
     echo ":</label>\n                        <div class=\"formRight\">\n                            <input type=\"text\" name=\"buyer_city\" value=\"";
     // line 362
     echo twig_escape_filter($this->env, $this->getAttribute(isset($context["buyer"]) ? $context["buyer"] : null, "city"), "html", null, true);
     echo "\"/>\n                        </div>\n                        <div class=\"fix\"></div>\n                    </div>\n\n                    <div class=\"rowElem\">\n                        <label>";
     // line 368
     echo gettext("State");
     echo ":</label>\n                        <div class=\"formRight\">\n                            ";
     // line 371
     echo "                            <input type=\"text\" name=\"buyer_state\" value=\"";
     echo twig_escape_filter($this->env, $this->getAttribute(isset($context["buyer"]) ? $context["buyer"] : null, "state"), "html", null, true);
     echo "\" />\n                        </div>\n                        <div class=\"fix\"></div>\n                    </div>\n\n                    <div class=\"rowElem\">\n                        <label>";
     // line 377
     echo gettext("Country");
     echo ":</label>\n                        <div class=\"formRight\">\n                            ";
     // line 379
     echo $context["mf"]->getselectbox("buyer_country", $this->getAttribute(isset($context["guest"]) ? $context["guest"] : null, "system_countries"), $this->getAttribute(isset($context["buyer"]) ? $context["buyer"] : null, "country"), 0, "Select country");
     echo "\n                        </div>\n                        <div class=\"fix\"></div>\n                    </div>\n\n                    <div class=\"rowElem\">\n                        <label>";
     // line 385
     echo gettext("Phone");
     echo ":</label>\n                        <div class=\"formRight\">\n                            <input type=\"text\" name=\"buyer_phone\" value=\"";
     // line 387
     echo twig_escape_filter($this->env, $this->getAttribute(isset($context["buyer"]) ? $context["buyer"] : null, "phone"), "html", null, true);
     echo "\"/>\n                        </div>\n                        <div class=\"fix\"></div>\n                    </div>\n\n                    <div class=\"rowElem\">\n                        <label>";
     // line 393
     echo gettext("Zip");
     echo ":</label>\n                        <div class=\"formRight\">\n                            <input type=\"text\" name=\"buyer_zip\" value=\"";
     // line 395
     echo twig_escape_filter($this->env, $this->getAttribute(isset($context["buyer"]) ? $context["buyer"] : null, "zip"), "html", null, true);
     echo "\"/>\n                        </div>\n                        <div class=\"fix\"></div>\n                    </div>\n\n                    <div class=\"rowElem\">\n                        <label>";
     // line 401
     echo gettext("Email");
     echo ":</label>\n                        <div class=\"formRight\">\n                            <input type=\"text\" name=\"buyer_email\" value=\"";
     // line 403
     echo twig_escape_filter($this->env, $this->getAttribute(isset($context["buyer"]) ? $context["buyer"] : null, "email"), "html", null, true);
     echo "\"/>\n                        </div>\n                        <div class=\"fix\"></div>\n                    </div>\n\n                    <input type=\"submit\" value=\"";
     // line 408
     echo gettext("Update");
     echo "\" class=\"greyishBtn submitForm\" />\n                    <input type=\"hidden\" name=\"id\" value=\"";
     // line 409
     echo twig_escape_filter($this->env, $this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "id"), "html", null, true);
     echo "\" />\n                </fieldset>\n            </form>\n\n            <div class=\"fix\"></div>\n        </div>\n\n    </div>\n</div>\n\n\n<div class=\"widget\">\n    <div class=\"head\">\n        <h5>";
     // line 422
     echo gettext("Invoice items");
     echo "</h5>\n    </div>\n\n";
     // line 425
     if (!$this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "approved")) {
         // line 426
         echo "\n    <form action=\"";
         // line 427
         echo $this->env->getExtension('bb')->twig_bb_client_link_filter("api/admin/invoice/update");
         echo "\" method=\"post\" class=\"mainForm api-form\" data-api-reload=\"1\">\n        <fieldset>\n        <table class=\"tableStatic wide\">\n            <thead>\n                <tr>\n                    <th>";
         // line 432
         echo gettext("Title");
         echo "</th>\n                    <th class=\"currency\">";
         // line 433
         echo gettext("Price");
         echo "</th>\n                    <th>";
         // line 434
         echo gettext("Tax");
         echo "</th>\n                    <th class=\"actions\">&nbsp;</th>\n                </tr>\n            </thead>\n\n            <tbody>\n                ";
         // line 440
         $context['_parent'] = (array) $context;
         $context['_seq'] = twig_ensure_traversable($this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "lines"));
         foreach ($context['_seq'] as $context["i"] => $context["item"]) {
             // line 441
             echo "                <tr>\n                    <td style=\"width: 60%;\"><input type=\"text\" name=\"items[";
             // line 442
             echo twig_escape_filter($this->env, $this->getAttribute(isset($context["item"]) ? $context["item"] : null, "id"), "html", null, true);
             echo "][title]\" value=\"";
             echo twig_escape_filter($this->env, $this->getAttribute(isset($context["item"]) ? $context["item"] : null, "title"), "html", null, true);
             echo "\" style=\"width:98%\"></td>\n                    <td style=\"width: 20%;\"><input type=\"text\" name=\"items[";
             // line 443
             echo twig_escape_filter($this->env, $this->getAttribute(isset($context["item"]) ? $context["item"] : null, "id"), "html", null, true);
             echo "][price]\" value=\"";
             echo twig_escape_filter($this->env, $this->getAttribute(isset($context["item"]) ? $context["item"] : null, "price"), "html", null, true);
             echo "\" style=\"width:80px\"> ";
             echo twig_escape_filter($this->env, $this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "currency"), "html", null, true);
             echo "</td>\n                    <td style=\"width: 5%;\">\n                        <input type=\"checkbox\" name=\"items[";
             // line 445
             echo twig_escape_filter($this->env, $this->getAttribute(isset($context["item"]) ? $context["item"] : null, "id"), "html", null, true);
             echo "][taxed]\" value=\"1\" ";
             if ($this->getAttribute(isset($context["item"]) ? $context["item"] : null, "taxed")) {
                 echo "checked=\"checked\"";
             }
             echo "/>\n                    </td>\n                    <td style=\"width: 5%;\">\n                        <a class=\"bb-button btn14 api-link\" data-api-confirm=\"Are you sure?\" href=\"";
             // line 448
             echo $this->env->getExtension('bb')->twig_bb_client_link_filter("api/admin/invoice/item_delete", array("id" => $this->getAttribute(isset($context["item"]) ? $context["item"] : null, "id")));
             echo "\" data-api-reload=\"1\"><img src=\"images/icons/dark/trash.png\" alt=\"\"></a>\n                    </td>\n                </tr>\n                ";
         }
         $_parent = $context['_parent'];
         unset($context['_seq'], $context['_iterated'], $context['i'], $context['item'], $context['_parent'], $context['loop']);
         $context = array_intersect_key($context, $_parent) + $_parent;
         // line 452
         echo "\n                <tr>\n                    <td style=\"width: 70%;\"><input type=\"text\" name=\"new_item[title]\" value=\"\" style=\"width:98%\" placeholder=\"New line description\"></td>\n                    <td style=\"width: 20%;\"><input type=\"text\" name=\"new_item[price]\" value=\"\" style=\"width:80px\" placeholder=\"Price\"> ";
         // line 455
         echo twig_escape_filter($this->env, $this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "currency"), "html", null, true);
         echo "</td>\n                    <td><input type=\"checkbox\" name=\"new_item[taxed]\" value=\"1\"/></td>\n                    <td>&nbsp;</td>\n                </tr>\n            </tbody>\n\n            <tfoot>\n                <tr>\n                    <td colspan=\"4\" class=\"currency\">\n                        Subtotal: ";
         // line 464
         echo $context["mf"]->getcurrency_format($this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "subtotal"), $this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "currency"));
         echo "\n                    </td>\n                </tr>\n                <tr>\n                    <td colspan=\"4\" class=\"currency\">\n                        ";
         // line 469
         echo twig_escape_filter($this->env, $this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "taxname"), "html", null, true);
         echo " ";
         echo twig_escape_filter($this->env, $this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "taxrate"), "html", null, true);
         echo "%: ";
         echo $context["mf"]->getcurrency_format($this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "tax"), $this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "currency"));
         echo "\n                    </td>\n                </tr>\n                <tr>\n                    <td colspan=\"4\" class=\"currency\">\n                        Total: ";
         // line 474
         echo $context["mf"]->getcurrency_format($this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "total"), $this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "currency"));
         echo "\n                    </td>\n                </tr>\n                <tr>\n                    <td colspan=\"4\">\n                        ";
         // line 479
         if (!$this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "approved")) {
             // line 480
             echo "                        <a href=\"";
             echo $this->env->getExtension('bb')->twig_bb_client_link_filter("api/admin/invoice/approve", array("id" => $this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "id")));
             echo "\"  title=\"\" class=\"btnIconLeft mr10 api-link\" data-api-reload=\"";
             echo $this->env->getExtension('bb')->twig_bb_admin_link_filter("invoices");
             echo "\"><img src=\"images/icons/dark/check.png\" alt=\"\" class=\"icon\"><span>Approve</span></a>\n                        ";
         }
         // line 482
         echo "                        <input type=\"submit\" value=\"";
         echo gettext("Update");
         echo "\" class=\"greyishBtn submitForm\" style=\"width:100px\"/>\n                    </td>\n                </tr>\n            </tfoot>\n        </table>\n        </fieldset>\n\n        <input type=\"hidden\" name=\"id\" value=\"";
         // line 489
         echo twig_escape_filter($this->env, $this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "id"), "html", null, true);
         echo "\" />\n    </form>\n\n";
     } else {
         // line 493
         echo "    <table class=\"tableStatic wide\">\n        <thead>\n            <tr>\n                <th  style=\"width: 11%;\" colspan=\"2\"></th>\n                <th style=\"width: 70%;\">";
         // line 497
         echo gettext("Title");
         echo "</th>\n                <th style=\"width: 7%;\">";
         // line 498
         echo gettext("Tax");
         echo "</th>\n                <th class=\"currency\" style=\"width: 15%;\">";
         // line 499
         echo gettext("Total");
         echo "</th>\n            </tr>\n        </thead>\n\n        <tbody>\n            ";
         // line 504
         $context['_parent'] = (array) $context;
         $context['_seq'] = twig_ensure_traversable($this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "lines"));
         foreach ($context['_seq'] as $context["i"] => $context["item"]) {
             // line 505
             echo "\n            <tr>\n                <td>";
             // line 507
             echo twig_escape_filter($this->env, (isset($context["i"]) ? $context["i"] : null) + 1, "html", null, true);
             echo ".</td>\n                <td>\n                    <div class=\"bull task ";
             // line 509
             echo twig_escape_filter($this->env, $this->getAttribute(isset($context["item"]) ? $context["item"] : null, "status"), "html", null, true);
             echo "\" title=\"Task status: ";
             echo $context["mf"]->getstatus_name($this->getAttribute(isset($context["item"]) ? $context["item"] : null, "status"));
             echo "\"></div>\n                    <div class=\"bull charge ";
             // line 510
             echo $this->getAttribute(isset($context["item"]) ? $context["item"] : null, "charged") ? "yes" : "no";
             echo "\" title=\"";
             echo $this->getAttribute(isset($context["item"]) ? $context["item"] : null, "charged") ? "Charged from client balance" : "Not charged from client balance";
             echo "\"></div>\n                </td>\n                <td>\n                ";
             // line 513
             if ($this->getAttribute(isset($context["item"]) ? $context["item"] : null, "order_id")) {
                 // line 514
                 echo "                <a href=\"";
                 echo $this->env->getExtension('bb')->twig_bb_admin_link_filter("order/manage");
                 echo "/";
                 echo twig_escape_filter($this->env, $this->getAttribute(isset($context["item"]) ? $context["item"] : null, "order_id"), "html", null, true);
                 echo "\">";
                 echo twig_escape_filter($this->env, $this->getAttribute(isset($context["item"]) ? $context["item"] : null, "title"), "html", null, true);
                 echo " ";
                 if ($this->getAttribute(isset($context["item"]) ? $context["item"] : null, "quantity") > 1) {
                     echo " x ";
                     echo twig_escape_filter($this->env, $this->getAttribute(isset($context["item"]) ? $context["item"] : null, "quantity"), "html", null, true);
                     echo " ";
                 }
                 echo "</a>\n                ";
             } else {
                 // line 516
                 echo "                ";
                 echo twig_escape_filter($this->env, $this->getAttribute(isset($context["item"]) ? $context["item"] : null, "title"), "html", null, true);
                 echo " ";
                 if ($this->getAttribute(isset($context["item"]) ? $context["item"] : null, "quantity") > 1) {
                     echo " x ";
                     echo twig_escape_filter($this->env, $this->getAttribute(isset($context["item"]) ? $context["item"] : null, "quantity"), "html", null, true);
                     echo " ";
                 }
                 // line 517
                 echo "                ";
             }
             // line 518
             echo "                </td>\n                <td>";
             // line 519
             echo $context["mf"]->getcurrency_format($this->getAttribute(isset($context["item"]) ? $context["item"] : null, "tax"), $this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "currency"));
             echo "</td>\n                <td class=\"currency\">";
             // line 520
             echo $context["mf"]->getcurrency_format($this->getAttribute(isset($context["item"]) ? $context["item"] : null, "total"), $this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "currency"));
             echo "</td>\n            </tr>\n\n            ";
         }
         $_parent = $context['_parent'];
         unset($context['_seq'], $context['_iterated'], $context['i'], $context['item'], $context['_parent'], $context['loop']);
         $context = array_intersect_key($context, $_parent) + $_parent;
         // line 524
         echo "        </tbody>\n        \n        <tfoot>\n            <tr>\n                <td colspan=\"5\" class=\"currency\">\n                    Subtotal: ";
         // line 529
         echo $context["mf"]->getcurrency_format($this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "subtotal"), $this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "currency"));
         echo "\n                </td>\n            </tr>\n            <tr>\n                <td colspan=\"5\" class=\"currency\">\n                    ";
         // line 534
         echo twig_escape_filter($this->env, $this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "taxname"), "html", null, true);
         echo " ";
         echo twig_escape_filter($this->env, $this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "taxrate"), "html", null, true);
         echo "%: ";
         echo $context["mf"]->getcurrency_format($this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "tax"), $this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "currency"));
         echo "\n                </td>\n            </tr>\n            <tr>\n                <td colspan=\"5\" class=\"currency\">\n                    Total: ";
         // line 539
         echo $context["mf"]->getcurrency_format($this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "total"), $this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "currency"));
         echo "\n                </td>\n            </tr>\n        </tfoot>\n    </table>\n";
     }
     // line 545
     echo "\n</div>\n\n";
     // line 548
     $context["transactions"] = $this->getAttribute($this->getAttribute(isset($context["admin"]) ? $context["admin"] : null, "invoice_transaction_get_list", array(0 => array("invoice_id" => $this->getAttribute(isset($context["invoice"]) ? $context["invoice"] : null, "id"), "per_page" => 100)), "method"), "list");
     // line 549
     echo "\n";
     // line 550
     if (twig_length_filter($this->env, isset($context["transactions"]) ? $context["transactions"] : null) > 0) {
         // line 551
         echo "\n<div class=\"widget\">\n    <div class=\"head\">\n        <h5>";
         // line 554
         echo gettext("Transactions");
         echo "</h5>\n    </div>\n    <table class=\"tableStatic wide\">\n        <thead>\n            <tr>\n                <th>";
         // line 559
         echo gettext("ID");
         echo "</th>\n                <th>";
         // line 560
         echo gettext("Type");
         echo "</th>\n                <th>";
         // line 561
         echo gettext("Gateway");
         echo "</th>\n                <th>";
         // line 562
         echo gettext("Amount");
         echo "</th>\n                <th>";
         // line 563
         echo gettext("Status");
         echo "</th>\n                 <th>";
         // line 564
         echo gettext("Date");
         echo "</th>\n                <th>&nbsp;</th>\n            </tr>\n        </thead>\n\n        <tbody>\n            ";
         // line 570
         $context['_parent'] = (array) $context;
         $context['_seq'] = twig_ensure_traversable(isset($context["transactions"]) ? $context["transactions"] : null);
         foreach ($context['_seq'] as $context["i"] => $context["tx"]) {
             // line 571
             echo "            <tr>\n                <td>";
             // line 572
             echo twig_escape_filter($this->env, $this->getAttribute(isset($context["tx"]) ? $context["tx"] : null, "txn_id"), "html", null, true);
             echo "</td>\n                <td>";
             // line 573
             echo twig_escape_filter($this->env, $this->getAttribute(isset($context["tx"]) ? $context["tx"] : null, "type"), "html", null, true);
             echo "</td>\n                <td>";
             // line 574
             echo twig_escape_filter($this->env, $this->getAttribute(isset($context["tx"]) ? $context["tx"] : null, "gateway"), "html", null, true);
             echo "</td>\n                <td>";
             // line 575
             echo $context["mf"]->getcurrency_format($this->getAttribute(isset($context["tx"]) ? $context["tx"] : null, "amount"), $this->getAttribute(isset($context["tx"]) ? $context["tx"] : null, "currency"));
             echo "</td>\n                <td>";
             // line 576
             echo $context["mf"]->getstatus_name($this->getAttribute(isset($context["tx"]) ? $context["tx"] : null, "status"));
             echo "</td>\n                <td>";
             // line 577
             echo twig_escape_filter($this->env, $this->env->getExtension('bb')->twig_bb_datetime($this->getAttribute(isset($context["tx"]) ? $context["tx"] : null, "created_at")), "html", null, true);
             echo "</td>\n                <td style=\"width: 5%\">\n                    <a class=\"bb-button btn14\" href=\"";
             // line 579
             echo $this->env->getExtension('bb')->twig_bb_admin_link_filter("/invoice/transaction");
             echo "/";
             echo twig_escape_filter($this->env, $this->getAttribute(isset($context["tx"]) ? $context["tx"] : null, "id"), "html", null, true);
             echo "\"><img src=\"images/icons/dark/pencil.png\" alt=\"\"></a>\n                </td>\n            </tr>\n            ";
         }
         $_parent = $context['_parent'];
         unset($context['_seq'], $context['_iterated'], $context['i'], $context['tx'], $context['_parent'], $context['loop']);
         $context = array_intersect_key($context, $_parent) + $_parent;
         // line 583
         echo "        </tbody>\n    </table>\n</div>\n\n";
     }
     // line 588
     echo "\n";
 }
 public function block_content($context, array $blocks = array())
 {
     // line 18
     echo "\n";
     // line 19
     if (isset($context["settings"])) {
         $_settings_ = $context["settings"];
     } else {
         $_settings_ = null;
     }
     if ($this->getAttribute($_settings_, "showcase_enabled")) {
         // line 20
         echo "<div class=\"hero-unit\">\n    <h1>";
         // line 21
         if (isset($context["settings"])) {
             $_settings_ = $context["settings"];
         } else {
             $_settings_ = null;
         }
         echo twig_escape_filter($this->env, $this->getAttribute($_settings_, "showcase_heading"), "html", null, true);
         echo "</h1>\n    <p>";
         // line 22
         if (isset($context["settings"])) {
             $_settings_ = $context["settings"];
         } else {
             $_settings_ = null;
         }
         echo twig_escape_filter($this->env, $this->getAttribute($_settings_, "showcase_text"), "html", null, true);
         echo "</p>\n    <p><a class=\"btn btn-alt btn-primary btn-large\" href=\"";
         // line 23
         if (isset($context["settings"])) {
             $_settings_ = $context["settings"];
         } else {
             $_settings_ = null;
         }
         echo twig_escape_filter($this->env, $this->getAttribute($_settings_, "showcase_button_url"), "html", null, true);
         echo "\">";
         if (isset($context["settings"])) {
             $_settings_ = $context["settings"];
         } else {
             $_settings_ = null;
         }
         echo twig_escape_filter($this->env, $this->getAttribute($_settings_, "showcase_button_title"), "html", null, true);
         echo "</a></p>\n</div>\n";
     }
     // line 26
     echo "\n";
     // line 27
     if (isset($context["client"])) {
         $_client_ = $context["client"];
     } else {
         $_client_ = null;
     }
     if ($_client_) {
         // line 28
         echo "\n";
         // line 29
         if (isset($context["client"])) {
             $_client_ = $context["client"];
         } else {
             $_client_ = null;
         }
         $context["tickets"] = $this->getAttribute($_client_, "support_ticket_get_list", array(0 => array("status" => "on_hold")), "method");
         // line 30
         if (isset($context["tickets"])) {
             $_tickets_ = $context["tickets"];
         } else {
             $_tickets_ = null;
         }
         if ($this->getAttribute($_tickets_, "total") > 0) {
             // line 31
             echo "<div class=\"row\">\n<article class=\"span12 data-block\">\n<div class=\"data-container\">\n<header>\n    <h2>";
             // line 35
             echo gettext("Tickets waiting your reply");
             echo "</h2>\n</header>\n<section id=\"slimScroll1\">\n    <table class=\"table table-striped table-bordered table-condensed table-hover\">\n        <thead>\n        <tr>\n            <th>";
             // line 41
             echo gettext("Id");
             echo "</th>\n            <th>";
             // line 42
             echo gettext("Subject");
             echo "</th>\n            <th>";
             // line 43
             echo gettext("Help desk");
             echo "</th>\n            <th>";
             // line 44
             echo gettext("Status");
             echo "</th>\n            <th>";
             // line 45
             echo gettext("Submitted");
             echo "</th>\n            <th>";
             // line 46
             echo gettext("Actions");
             echo "</th>\n        </tr>\n        </thead>\n        <tbody>\n        ";
             // line 50
             if (isset($context["tickets"])) {
                 $_tickets_ = $context["tickets"];
             } else {
                 $_tickets_ = null;
             }
             $context['_parent'] = (array) $context;
             $context['_seq'] = twig_ensure_traversable($this->getAttribute($_tickets_, "list"));
             $context['_iterated'] = false;
             foreach ($context['_seq'] as $context["i"] => $context["ticket"]) {
                 // line 51
                 echo "\n        <tr class=\"";
                 // line 52
                 if (isset($context["i"])) {
                     $_i_ = $context["i"];
                 } else {
                     $_i_ = null;
                 }
                 echo twig_escape_filter($this->env, twig_cycle(array(0 => "odd", 1 => "even"), $_i_), "html", null, true);
                 echo "\">\n            <td>";
                 // line 53
                 if (isset($context["ticket"])) {
                     $_ticket_ = $context["ticket"];
                 } else {
                     $_ticket_ = null;
                 }
                 echo twig_escape_filter($this->env, $this->getAttribute($_ticket_, "id"), "html", null, true);
                 echo "</td>\n            <td><a href=\"";
                 // line 54
                 echo $this->env->getExtension('bb')->twig_bb_client_link_filter("support/ticket");
                 echo "/";
                 if (isset($context["ticket"])) {
                     $_ticket_ = $context["ticket"];
                 } else {
                     $_ticket_ = null;
                 }
                 echo twig_escape_filter($this->env, $this->getAttribute($_ticket_, "id"), "html", null, true);
                 echo "\">";
                 if (isset($context["ticket"])) {
                     $_ticket_ = $context["ticket"];
                 } else {
                     $_ticket_ = null;
                 }
                 echo twig_escape_filter($this->env, $this->getAttribute($_ticket_, "subject"), "html", null, true);
                 echo "</a></td>\n            <td>";
                 // line 55
                 if (isset($context["ticket"])) {
                     $_ticket_ = $context["ticket"];
                 } else {
                     $_ticket_ = null;
                 }
                 echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($_ticket_, "helpdesk"), "name"), "html", null, true);
                 echo "</td>\n            <td><span class=\"label\">";
                 // line 56
                 if (isset($context["mf"])) {
                     $_mf_ = $context["mf"];
                 } else {
                     $_mf_ = null;
                 }
                 if (isset($context["ticket"])) {
                     $_ticket_ = $context["ticket"];
                 } else {
                     $_ticket_ = null;
                 }
                 echo $_mf_->getstatus_name($this->getAttribute($_ticket_, "status"));
                 echo "</span></td>\n            <td>";
                 // line 57
                 if (isset($context["ticket"])) {
                     $_ticket_ = $context["ticket"];
                 } else {
                     $_ticket_ = null;
                 }
                 echo twig_escape_filter($this->env, $this->env->getExtension('bb')->twig_bb_date($this->getAttribute($_ticket_, "created_at")), "html", null, true);
                 echo "</td>\n            <td><a href=\"";
                 // line 58
                 echo $this->env->getExtension('bb')->twig_bb_client_link_filter("support/ticket");
                 echo "/";
                 if (isset($context["ticket"])) {
                     $_ticket_ = $context["ticket"];
                 } else {
                     $_ticket_ = null;
                 }
                 echo twig_escape_filter($this->env, $this->getAttribute($_ticket_, "id"), "html", null, true);
                 echo "\" class=\"btn btn-small btn-inverse\">";
                 echo gettext("Reply");
                 echo "</a></td>\n        </tr>\n\n        ";
                 $context['_iterated'] = true;
             }
             if (!$context['_iterated']) {
                 // line 62
                 echo "\n        <tr>\n            <td colspan=\"5\">";
                 // line 64
                 echo gettext("The list is empty");
                 echo "</td>\n        </tr>\n\n        ";
             }
             $_parent = $context['_parent'];
             unset($context['_seq'], $context['_iterated'], $context['i'], $context['ticket'], $context['_parent'], $context['loop']);
             $context = array_intersect_key($context, $_parent) + $_parent;
             // line 68
             echo "\n        </tbody>\n    </table>\n</section>\n</div>\n</article>\n</div>\n";
         }
         // line 76
         echo "\n<div class=\"row\">\n";
         // line 78
         if (isset($context["client"])) {
             $_client_ = $context["client"];
         } else {
             $_client_ = null;
         }
         $context["profile"] = $this->getAttribute($_client_, "client_get");
         // line 79
         echo "<article class=\"span6 data-block decent\">\n    <div class=\"data-container\">\n        <header>\n            <h2>";
         // line 82
         echo gettext("Profile");
         echo "</h2>\n            <ul class=\"data-header-actions\">\n                <li>\n                    <a class=\"btn btn-alt btn-inverse\" href=\"";
         // line 85
         echo $this->env->getExtension('bb')->twig_bb_client_link_filter("client/me");
         echo "\">";
         echo gettext("Update");
         echo "</a>\n                </li>\n            </ul>\n        </header>\n        <section>\n            <dl class=\"dl-horizontal\">\n                <dt>";
         // line 91
         echo gettext("ID");
         echo "</dt>\n                <dd>#";
         // line 92
         if (isset($context["profile"])) {
             $_profile_ = $context["profile"];
         } else {
             $_profile_ = null;
         }
         echo twig_escape_filter($this->env, $this->getAttribute($_profile_, "id"), "html", null, true);
         echo "</dd>\n                <dt>";
         // line 93
         echo gettext("Email");
         echo "</dt>\n                <dd>";
         // line 94
         if (isset($context["profile"])) {
             $_profile_ = $context["profile"];
         } else {
             $_profile_ = null;
         }
         echo twig_escape_filter($this->env, $this->getAttribute($_profile_, "email"), "html", null, true);
         echo "</dd>\n                <dt>";
         // line 95
         echo gettext("Balance");
         echo "</dt>\n                <dd>";
         // line 96
         if (isset($context["profile"])) {
             $_profile_ = $context["profile"];
         } else {
             $_profile_ = null;
         }
         echo twig_money($this->env, $this->getAttribute($_profile_, "balance"), $this->getAttribute($_profile_, "currency"));
         echo "</dd>\n            </dl>\n        </section>\n    </div>\n</article>\n\n<article class=\"span6 data-block decent\">\n    <div class=\"data-container\">\n        <header>\n            <h2>";
         // line 105
         echo gettext("Invoices");
         echo "</h2>\n            <ul class=\"data-header-actions\">\n                <li>\n                    <a class=\"btn btn-alt btn-inverse\" href=\"";
         // line 108
         echo $this->env->getExtension('bb')->twig_bb_client_link_filter("invoice");
         echo "\">";
         echo gettext("All Invoices");
         echo "</a>\n                </li>\n            </ul>\n        </header>\n        <section>\n            <dl class=\"dl-horizontal\">\n                <dt>";
         // line 114
         echo gettext("Total");
         echo "</dt>\n                    <dd>";
         // line 115
         if (isset($context["client"])) {
             $_client_ = $context["client"];
         } else {
             $_client_ = null;
         }
         echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($_client_, "invoice_get_list", array(), "method"), "total"), "html", null, true);
         echo "</dd>\n                <dt>";
         // line 116
         echo gettext("Paid");
         echo "</dt>\n                    <dd>";
         // line 117
         if (isset($context["client"])) {
             $_client_ = $context["client"];
         } else {
             $_client_ = null;
         }
         echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($_client_, "invoice_get_list", array(0 => array("status" => "paid")), "method"), "total"), "html", null, true);
         echo "</dd>\n                <dt>";
         // line 118
         echo gettext("Unpaid");
         echo "</dt>\n                    <dd>";
         // line 119
         if (isset($context["client"])) {
             $_client_ = $context["client"];
         } else {
             $_client_ = null;
         }
         echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($_client_, "invoice_get_list", array(0 => array("status" => "unpaid")), "method"), "total"), "html", null, true);
         echo "</dd>\n            </dl>\n        </section>\n    </div>\n</article>\n</div>\n\n<div class=\"row\">\n\n<article class=\"span6 data-block decent\">\n    <div class=\"data-container\">\n        <header>\n            <h2>";
         // line 131
         echo gettext("Orders");
         echo "</h2>\n            <ul class=\"data-header-actions\">\n                <li>\n                    <a class=\"btn btn-alt btn-info order-button\" href=\"";
         // line 134
         echo $this->env->getExtension('bb')->twig_bb_client_link_filter("order");
         echo "\">";
         echo gettext("New order");
         echo "</a>\n                    <a class=\"btn btn-alt btn-inverse\" href=\"";
         // line 135
         echo $this->env->getExtension('bb')->twig_bb_client_link_filter("order/service");
         echo "\">";
         echo gettext("All orders");
         echo "</a>\n                </li>\n            </ul>\n        </header>\n        <section>\n            <dl class=\"dl-horizontal\">\n                <dt>";
         // line 141
         echo gettext("Total");
         echo "</dt>\n                <dd>";
         // line 142
         if (isset($context["client"])) {
             $_client_ = $context["client"];
         } else {
             $_client_ = null;
         }
         echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($_client_, "order_get_list", array(0 => array("hide_addons" => 1)), "method"), "total"), "html", null, true);
         echo "</dd>\n                <dt>";
         // line 143
         echo gettext("Active");
         echo "</dt>\n                <dd>";
         // line 144
         if (isset($context["client"])) {
             $_client_ = $context["client"];
         } else {
             $_client_ = null;
         }
         echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($_client_, "order_get_list", array(0 => array("hide_addons" => 1, "status" => "active")), "method"), "total"), "html", null, true);
         echo "</dd>\n                <dt>";
         // line 145
         echo gettext("Expiring");
         echo "</dt>\n                <dd>";
         // line 146
         if (isset($context["client"])) {
             $_client_ = $context["client"];
         } else {
             $_client_ = null;
         }
         echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($_client_, "order_get_list", array(0 => array("expiring" => 1)), "method"), "total"), "html", null, true);
         echo "</dd>\n            </dl>\n        </section>\n    </div>\n</article>\n\n<article class=\"span6 data-block decent\">\n    <div class=\"data-container\">\n        <header>\n            <h2>";
         // line 155
         echo gettext("Tickets");
         echo "</h2>\n            <ul class=\"data-header-actions\">\n                <li>\n                    <a class=\"btn btn-alt btn-info\" href=\"";
         // line 158
         echo $this->env->getExtension('bb')->twig_bb_client_link_filter("support", array("ticket" => 1));
         echo "\">";
         echo gettext("New ticket");
         echo "</a>\n                    <a class=\"btn btn-alt btn-inverse\" href=\"";
         // line 159
         echo $this->env->getExtension('bb')->twig_bb_client_link_filter("support");
         echo "\">";
         echo gettext("All tickets");
         echo "</a>\n                </li>\n            </ul>\n        </header>\n        <section>\n            <dl class=\"dl-horizontal\">\n                <dt>";
         // line 165
         echo gettext("Total");
         echo "</dt>\n                <dd>";
         // line 166
         if (isset($context["client"])) {
             $_client_ = $context["client"];
         } else {
             $_client_ = null;
         }
         echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($_client_, "support_ticket_get_list", array(), "method"), "total"), "html", null, true);
         echo "</dd>\n                <dt>";
         // line 167
         echo gettext("Open");
         echo "</dt>\n                <dd>";
         // line 168
         if (isset($context["client"])) {
             $_client_ = $context["client"];
         } else {
             $_client_ = null;
         }
         echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($_client_, "support_ticket_get_list", array(0 => array("status" => "open")), "method"), "total"), "html", null, true);
         echo "</dd>\n                <dt>";
         // line 169
         echo gettext("On Hold");
         echo "</dt>\n                <dd>";
         // line 170
         if (isset($context["client"])) {
             $_client_ = $context["client"];
         } else {
             $_client_ = null;
         }
         echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($_client_, "support_ticket_get_list", array(0 => array("status" => "on_hold")), "method"), "total"), "html", null, true);
         echo "</dd>\n            </dl>\n        </section>\n    </div>\n</article>\n</div>\n\n<div class=\"row\">\n\n<article class=\"span6 data-block decent\">\n    <div class=\"data-container\">\n        <header>\n            <h2>";
         // line 182
         echo gettext("Recent orders");
         echo "</h2>\n        </header>\n        <section>\n            <table class=\"table table-striped table-bordered table-condensed table-hover\">\n                <tbody>\n                ";
         // line 187
         if (isset($context["client"])) {
             $_client_ = $context["client"];
         } else {
             $_client_ = null;
         }
         if (isset($context["request"])) {
             $_request_ = $context["request"];
         } else {
             $_request_ = null;
         }
         $context['_parent'] = (array) $context;
         $context['_seq'] = twig_ensure_traversable($this->getAttribute($this->getAttribute($_client_, "order_get_list", array(0 => array("per_page" => 5, "page" => $this->getAttribute($_request_, "page"), "hide_addons" => 1)), "method"), "list"));
         $context['_iterated'] = false;
         foreach ($context['_seq'] as $context["i"] => $context["order"]) {
             // line 188
             echo "                <tr class=\"";
             if (isset($context["i"])) {
                 $_i_ = $context["i"];
             } else {
                 $_i_ = null;
             }
             echo twig_escape_filter($this->env, twig_cycle(array(0 => "odd", 1 => "even"), $_i_), "html", null, true);
             echo "\">\n                    <td><a href=\"";
             // line 189
             echo $this->env->getExtension('bb')->twig_bb_client_link_filter("order/service/manage");
             echo "/";
             if (isset($context["order"])) {
                 $_order_ = $context["order"];
             } else {
                 $_order_ = null;
             }
             echo twig_escape_filter($this->env, $this->getAttribute($_order_, "id"), "html", null, true);
             echo "\">";
             if (isset($context["order"])) {
                 $_order_ = $context["order"];
             } else {
                 $_order_ = null;
             }
             echo twig_escape_filter($this->env, twig_truncate_filter($this->env, $this->getAttribute($_order_, "title"), 30), "html", null, true);
             echo "</a></td>\n                    <td><span class=\"label ";
             // line 190
             if (isset($context["order"])) {
                 $_order_ = $context["order"];
             } else {
                 $_order_ = null;
             }
             if ($this->getAttribute($_order_, "status") == "active") {
                 echo "label-success";
             } elseif ($this->getAttribute($_order_, "status") == "pending_setup") {
                 echo "label-warning";
             }
             echo "\">";
             if (isset($context["mf"])) {
                 $_mf_ = $context["mf"];
             } else {
                 $_mf_ = null;
             }
             if (isset($context["order"])) {
                 $_order_ = $context["order"];
             } else {
                 $_order_ = null;
             }
             echo $_mf_->getstatus_name($this->getAttribute($_order_, "status"));
             echo "</span></td>\n                </tr>\n                ";
             $context['_iterated'] = true;
         }
         if (!$context['_iterated']) {
             // line 193
             echo "                <tr>\n                    <td colspan=\"3\">";
             // line 194
             echo gettext("The list is empty");
             echo "</td>\n                </tr>\n                ";
         }
         $_parent = $context['_parent'];
         unset($context['_seq'], $context['_iterated'], $context['i'], $context['order'], $context['_parent'], $context['loop']);
         $context = array_intersect_key($context, $_parent) + $_parent;
         // line 197
         echo "                </tbody>\n            </table>\n        </section>\n    </div>\n</article>\n\n<article class=\"span6 data-block decent\">\n    <div class=\"data-container\">\n        <header>\n            <h2>";
         // line 206
         echo gettext("Recent emails");
         echo "</h2>\n        </header>\n        <section>\n            <table class=\"table table-striped table-bordered table-condensed table-hover\">\n                <tbody>\n                ";
         // line 211
         if (isset($context["client"])) {
             $_client_ = $context["client"];
         } else {
             $_client_ = null;
         }
         $context['_parent'] = (array) $context;
         $context['_seq'] = twig_ensure_traversable($this->getAttribute($this->getAttribute($_client_, "email_get_list", array(0 => array("per_page" => 5)), "method"), "list"));
         $context['_iterated'] = false;
         foreach ($context['_seq'] as $context["i"] => $context["email"]) {
             // line 212
             echo "                <tr class=\"";
             if (isset($context["i"])) {
                 $_i_ = $context["i"];
             } else {
                 $_i_ = null;
             }
             echo twig_escape_filter($this->env, twig_cycle(array(0 => "odd", 1 => "even"), $_i_), "html", null, true);
             echo "\">\n                    <td><a href=\"";
             // line 213
             echo $this->env->getExtension('bb')->twig_bb_client_link_filter("email");
             echo "/";
             if (isset($context["email"])) {
                 $_email_ = $context["email"];
             } else {
                 $_email_ = null;
             }
             echo twig_escape_filter($this->env, $this->getAttribute($_email_, "id"), "html", null, true);
             echo "\">";
             if (isset($context["email"])) {
                 $_email_ = $context["email"];
             } else {
                 $_email_ = null;
             }
             echo twig_escape_filter($this->env, twig_truncate_filter($this->env, $this->getAttribute($_email_, "subject"), 30), "html", null, true);
             echo "</a></td>\n                    <td title=\"";
             // line 214
             if (isset($context["email"])) {
                 $_email_ = $context["email"];
             } else {
                 $_email_ = null;
             }
             echo twig_escape_filter($this->env, $this->env->getExtension('bb')->twig_bb_date($this->getAttribute($_email_, "created_at")), "html", null, true);
             echo "\">";
             if (isset($context["email"])) {
                 $_email_ = $context["email"];
             } else {
                 $_email_ = null;
             }
             echo twig_escape_filter($this->env, twig_timeago_filter($this->getAttribute($_email_, "created_at")), "html", null, true);
             echo " ";
             echo gettext("ago");
             echo "</td>\n                </tr>\n                ";
             $context['_iterated'] = true;
         }
         if (!$context['_iterated']) {
             // line 217
             echo "                <tr>\n                    <td colspan=\"2\">";
             // line 218
             echo gettext("The list is empty");
             echo "</td>\n                </tr>\n                ";
         }
         $_parent = $context['_parent'];
         unset($context['_seq'], $context['_iterated'], $context['i'], $context['email'], $context['_parent'], $context['loop']);
         $context = array_intersect_key($context, $_parent) + $_parent;
         // line 221
         echo "                </tbody>\n            </table>\n        </section>\n    </div>\n</article>\n\n</div>\n\n";
     }
 }