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";
 }
 protected function doDisplay(array $context, array $blocks = array())
 {
     // line 1
     if (twig_length_filter($this->env, $this->getAttribute(isset($context["product"]) ? $context["product"] : null, "addons")) > 0) {
         // line 2
         echo "<hr/>\n<section>\n    <header>\n        <h2>";
         // line 5
         echo gettext("Addons & extras");
         echo "</h2>\n    </header>\n</section>\n<div class=\"row-fluid\">\n        <table class=\"table table-condensed\">\n            <tbody>\n            ";
         // line 11
         $context['_parent'] = (array) $context;
         $context['_seq'] = twig_ensure_traversable($this->getAttribute(isset($context["product"]) ? $context["product"] : null, "addons"));
         foreach ($context['_seq'] as $context["_key"] => $context["addon"]) {
             // line 12
             echo "            <label for=\"addon_";
             echo twig_escape_filter($this->env, $this->getAttribute(isset($context["addon"]) ? $context["addon"] : null, "id"), "html", null, true);
             echo "\">\n            <tr>\n                <td>\n                    <input type=\"hidden\" name=\"addons[";
             // line 15
             echo twig_escape_filter($this->env, $this->getAttribute(isset($context["addon"]) ? $context["addon"] : null, "id"), "html", null, true);
             echo "][selected]\" value=\"0\">\n                    <input type=\"checkbox\" name=\"addons[";
             // line 16
             echo twig_escape_filter($this->env, $this->getAttribute(isset($context["addon"]) ? $context["addon"] : null, "id"), "html", null, true);
             echo "][selected]\" value=\"1\" id=\"addon_";
             echo twig_escape_filter($this->env, $this->getAttribute(isset($context["addon"]) ? $context["addon"] : null, "id"), "html", null, true);
             echo "\">\n                </td>\n\n                <td ";
             // line 19
             if (!$this->getAttribute(isset($context["addon"]) ? $context["addon"] : null, "icon_url")) {
                 echo "style=\"display: none\"";
             }
             echo ">\n                    <label for=\"addon_";
             // line 20
             echo twig_escape_filter($this->env, $this->getAttribute(isset($context["addon"]) ? $context["addon"] : null, "id"), "html", null, true);
             echo "\"><img src=\"";
             echo twig_escape_filter($this->env, $this->getAttribute(isset($context["addon"]) ? $context["addon"] : null, "icon_url"), "html", null, true);
             echo "\" alt=\"\" width=\"36\"/></label>\n                </td>\n\n                <td>\n                    <label for=\"addon_";
             // line 24
             echo twig_escape_filter($this->env, $this->getAttribute(isset($context["addon"]) ? $context["addon"] : null, "id"), "html", null, true);
             echo "\"><h3>";
             echo twig_escape_filter($this->env, $this->getAttribute(isset($context["addon"]) ? $context["addon"] : null, "title"), "html", null, true);
             echo "</h3></label>\n                    ";
             // line 25
             echo twig_bbmd_filter($this->env, $this->getAttribute(isset($context["addon"]) ? $context["addon"] : null, "description"));
             echo "\n                </td>\n\n                <td class=\"currency\">\n                    <label for=\"addon_";
             // line 29
             echo twig_escape_filter($this->env, $this->getAttribute(isset($context["addon"]) ? $context["addon"] : null, "id"), "html", null, true);
             echo "\">\n                    ";
             // line 30
             if ($this->getAttribute($this->getAttribute(isset($context["addon"]) ? $context["addon"] : null, "pricing"), "type") === "recurrent") {
                 // line 31
                 echo "                        ";
                 $context["periods"] = $this->getAttribute(isset($context["guest"]) ? $context["guest"] : null, "system_periods");
                 // line 32
                 echo "                        <select name=\"addons[";
                 echo twig_escape_filter($this->env, $this->getAttribute(isset($context["addon"]) ? $context["addon"] : null, "id"), "html", null, true);
                 echo "][period]\" rel=\"addon-periods-";
                 echo twig_escape_filter($this->env, $this->getAttribute(isset($context["addon"]) ? $context["addon"] : null, "id"), "html", null, true);
                 echo "\">\n                        ";
                 // line 33
                 $context['_parent'] = (array) $context;
                 $context['_seq'] = twig_ensure_traversable($this->getAttribute($this->getAttribute(isset($context["addon"]) ? $context["addon"] : null, "pricing"), "recurrent"));
                 foreach ($context['_seq'] as $context["code"] => $context["prices"]) {
                     // line 34
                     echo "                        ";
                     if ($this->getAttribute(isset($context["prices"]) ? $context["prices"] : null, "enabled")) {
                         // line 35
                         echo "                        <option value=\"";
                         echo twig_escape_filter($this->env, isset($context["code"]) ? $context["code"] : null, "html", null, true);
                         echo "\">";
                         echo twig_escape_filter($this->env, $this->getAttribute(isset($context["periods"]) ? $context["periods"] : null, isset($context["code"]) ? $context["code"] : null, array(), "array"), "html", null, true);
                         echo " ";
                         echo twig_money_convert($this->env, $this->getAttribute(isset($context["prices"]) ? $context["prices"] : null, "price"));
                         echo " ";
                         if ($this->getAttribute(isset($context["prices"]) ? $context["prices"] : null, "setup") != "0.00") {
                             echo gettext("Setup:");
                             echo " ";
                             echo twig_money_convert($this->env, $this->getAttribute(isset($context["prices"]) ? $context["prices"] : null, "setup"));
                         }
                         echo "</option>\n                        ";
                     }
                     // line 37
                     echo "                        ";
                 }
                 $_parent = $context['_parent'];
                 unset($context['_seq'], $context['_iterated'], $context['code'], $context['prices'], $context['_parent'], $context['loop']);
                 $context = array_intersect_key($context, $_parent) + $_parent;
                 // line 38
                 echo "                    </select>\n                    ";
             }
             // line 40
             echo "\n                    ";
             // line 41
             if ($this->getAttribute($this->getAttribute(isset($context["addon"]) ? $context["addon"] : null, "pricing"), "type") === "once") {
                 // line 42
                 echo "                    ";
                 echo twig_money_convert($this->env, $this->getAttribute($this->getAttribute($this->getAttribute(isset($context["addon"]) ? $context["addon"] : null, "pricing"), "once"), "price") + $this->getAttribute($this->getAttribute($this->getAttribute(isset($context["addon"]) ? $context["addon"] : null, "pricing"), "once"), "setup"));
                 echo "\n                    ";
             }
             // line 44
             echo "\n                    ";
             // line 45
             if ($this->getAttribute($this->getAttribute(isset($context["addon"]) ? $context["addon"] : null, "pricing"), "type") === "free") {
                 // line 46
                 echo "                    ";
                 echo twig_money_convert($this->env, 0);
                 echo "\n                    ";
             }
             // line 48
             echo "                    </label>\n                </td>\n            </tr>\n            ";
         }
         $_parent = $context['_parent'];
         unset($context['_seq'], $context['_iterated'], $context['_key'], $context['addon'], $context['_parent'], $context['loop']);
         $context = array_intersect_key($context, $_parent) + $_parent;
         // line 52
         echo "            </tbody>\n        </table>\n</div>\n";
     }
 }
 public function block_content($context, array $blocks = array())
 {
     // line 7
     echo "<div class=\"widget simpleTabs\">\n\n    <ul class=\"tabs\">\n        <li><a href=\"#tab-index\">";
     // line 10
     echo gettext("Extensions");
     echo "</a></li>\n        <li><a href=\"#tab-core\">";
     // line 11
     echo gettext("Update BoxBilling");
     echo "</a></li>\n        <li><a href=\"#tab-about\">";
     // line 12
     echo gettext("Learn more about extensions");
     echo "</a></li>\n        <li><a href=\"#tab-hooks\">";
     // line 13
     echo gettext("Hooks");
     echo "</a></li>\n    </ul>\n\n    <div class=\"tabs_container\">\n\n        <div class=\"fix\"></div>\n        <div class=\"tab_content nopadding\" id=\"tab-index\">\n            <div class=\"help\">\n                <h5>BoxBilling extensions</h5>\n                <p>";
     // line 22
     echo gettext("Activate or deactivate extensions");
     echo "</p>\n            </div>\n            <table class=\"tableStatic wide\">\n                <thead>\n                    <tr>\n                        <td width=\"3%\">&nbsp;</td>\n                        <td width=\"20%\">";
     // line 28
     echo gettext("Extension");
     echo "</td>\n                        <td>";
     // line 29
     echo gettext("Description");
     echo "</td>\n                        <td style=\"width: 21%;\">";
     // line 30
     echo gettext("Actions");
     echo "</td>\n                    </tr>\n                </thead>\n\n                <tbody>\n                ";
     // line 35
     $context['_parent'] = (array) $context;
     $context['_seq'] = twig_ensure_traversable($this->getAttribute(isset($context["admin"]) ? $context["admin"] : null, "extension_get_list"));
     $context['_iterated'] = false;
     foreach ($context['_seq'] as $context["_key"] => $context["ext"]) {
         // line 36
         echo "                <tr>\n                    <td><img src=\"";
         // line 37
         echo twig_escape_filter($this->env, $this->getAttribute(isset($context["ext"]) ? $context["ext"] : null, "icon_url", array(), "any", true, true) ? _twig_default_filter($this->getAttribute(isset($context["ext"]) ? $context["ext"] : null, "icon_url"), "images/icons/middlenav/cog.png") : "images/icons/middlenav/cog.png", "html", null, true);
         echo "\" alt=\"";
         echo twig_escape_filter($this->env, $this->getAttribute(isset($context["ext"]) ? $context["ext"] : null, "name"), "html", null, true);
         echo "\" style=\"width: 32px; height: 32px;\"/></td>\n                    <td><strong>";
         // line 38
         echo twig_escape_filter($this->env, $this->getAttribute(isset($context["ext"]) ? $context["ext"] : null, "name"), "html", null, true);
         echo "</strong> ";
         echo twig_escape_filter($this->env, $this->getAttribute(isset($context["ext"]) ? $context["ext"] : null, "version"), "html", null, true);
         echo "<br />by <a href=\"";
         echo twig_escape_filter($this->env, $this->getAttribute(isset($context["ext"]) ? $context["ext"] : null, "author_url"), "html", null, true);
         echo "\" target=\"_blank\">";
         echo twig_escape_filter($this->env, $this->getAttribute(isset($context["ext"]) ? $context["ext"] : null, "author"), "html", null, true);
         echo "</a></td>\n                    <td>\n                        ";
         // line 40
         echo twig_bbmd_filter($this->env, $this->getAttribute(isset($context["ext"]) ? $context["ext"] : null, "description"));
         echo "\n                        <a href=\"";
         // line 41
         echo twig_escape_filter($this->env, $this->getAttribute(isset($context["ext"]) ? $context["ext"] : null, "project_url"), "html", null, true);
         echo "\" target=\"_blank\" title=\"Project details\">Learn more</a>\n                    </td>\n                    <td>\n                        ";
         // line 44
         if ($this->getAttribute(isset($context["ext"]) ? $context["ext"] : null, "type") == "mod") {
             // line 45
             echo "                            ";
             if ($this->getAttribute(isset($context["ext"]) ? $context["ext"] : null, "status") == "installed") {
                 // line 46
                 echo "                            <a class=\"api-link bb-button btn14\" href=\"";
                 echo $this->env->getExtension('bb')->twig_bb_client_link_filter("api/admin/extension/deactivate", array("type" => $this->getAttribute(isset($context["ext"]) ? $context["ext"] : null, "type"), "id" => $this->getAttribute(isset($context["ext"]) ? $context["ext"] : null, "id")));
                 echo "\" data-api-confirm=\"Are you sure?\" data-api-reload=\"Module was deactivated\" title=\"";
                 echo gettext("Deactivate");
                 echo "\"><img src=\"images/icons/dark/close.png\" alt=\"\" class=\"icon\"></a>\n                            ";
             } else {
                 // line 48
                 echo "                            <a class=\"btnIconLeft mr10 api-link\" href=\"";
                 echo $this->env->getExtension('bb')->twig_bb_client_link_filter("api/admin/extension/activate", array("type" => $this->getAttribute(isset($context["ext"]) ? $context["ext"] : null, "type"), "id" => $this->getAttribute(isset($context["ext"]) ? $context["ext"] : null, "id")));
                 echo "\" data-api-confirm=\"Are you sure?\" data-api-jsonp=\"onAfterModuleActivated\"><img src=\"images/icons/dark/cog.png\" alt=\"\" class=\"icon\"><span>Activate</span></a>\n                            ";
             }
             // line 50
             echo "                        ";
         } else {
             // line 51
             echo "                        &nbsp;\n                        ";
         }
         // line 53
         echo "\n                        ";
         // line 54
         if ($this->getAttribute(isset($context["ext"]) ? $context["ext"] : null, "has_settings")) {
             // line 55
             echo "                            <a class=\"bb-button btn14\" href=\"";
             echo $this->env->getExtension('bb')->twig_bb_admin_link_filter("extension/settings");
             echo "/";
             echo twig_escape_filter($this->env, $this->getAttribute(isset($context["ext"]) ? $context["ext"] : null, "id"), "html", null, true);
             echo "\"><img src=\"images/icons/dark/pencil.png\" alt=\"\" class=\"icon\" title=\"";
             echo gettext("Module settings");
             echo "\"></a>\n                        ";
         }
         // line 57
         echo "                    </td>\n                </tr>\n                ";
         $context['_iterated'] = true;
     }
     if (!$context['_iterated']) {
         // line 60
         echo "                    <tr>\n                        <td colspan=\"4\">\n                            ";
         // line 62
         echo gettext("The list is empty");
         // line 63
         echo "                        </td>\n                    </tr>\n                ";
     }
     $_parent = $context['_parent'];
     unset($context['_seq'], $context['_iterated'], $context['_key'], $context['ext'], $context['_parent'], $context['loop']);
     $context = array_intersect_key($context, $_parent) + $_parent;
     // line 66
     echo "                </tbody>\n                <tfoot>\n                    <tr>\n                        <td colspan=\"4\"></td>\n                    </tr>\n                </tfoot>\n            </table>\n\n            <div class=\"help\">\n                <h5>BoxBilling modules on extension site</h5>\n            </div>\n            ";
     // line 77
     $this->env->loadTemplate("partial_extensions.phtml")->display($context);
     // line 78
     echo "        </div>\n\n        <div class=\"tab_content nopadding\" id=\"tab-hooks\">\n            <table class=\"tableStatic wide\">\n                <thead>\n                    <tr>\n                        <td>";
     // line 84
     echo gettext("Extension");
     echo "</td>\n                        <td>";
     // line 85
     echo gettext("Hook");
     echo "</td>\n                    </tr>\n                </thead>\n\n                <tbody>\n                ";
     // line 90
     $context['_parent'] = (array) $context;
     $context['_seq'] = twig_ensure_traversable($this->getAttribute($this->getAttribute(isset($context["admin"]) ? $context["admin"] : null, "hook_get_list", array(0 => array("per_page" => 90)), "method"), "list"));
     foreach ($context['_seq'] as $context["_key"] => $context["hook"]) {
         // line 91
         echo "                <tr>\n                    <td>\n                        ";
         // line 93
         echo twig_escape_filter($this->env, twig_capitalize_string_filter($this->env, $this->getAttribute(isset($context["hook"]) ? $context["hook"] : null, "rel_id")), "html", null, true);
         echo "\n                    </td>\n                    <td>\n                        ";
         // line 96
         echo twig_escape_filter($this->env, $this->getAttribute(isset($context["hook"]) ? $context["hook"] : null, "event"), "html", null, true);
         echo "\n                    </td>\n                </tr>\n                ";
     }
     $_parent = $context['_parent'];
     unset($context['_seq'], $context['_iterated'], $context['_key'], $context['hook'], $context['_parent'], $context['loop']);
     $context = array_intersect_key($context, $_parent) + $_parent;
     // line 100
     echo "                </tbody>\n            </table>\n        </div>\n            \n        <div class=\"tab_content nopadding\" id=\"tab-core\">\n            <div class=\"help\">\n                <h3>";
     // line 106
     echo gettext("Automatic update");
     echo "</h3>\n                <p>";
     // line 107
     echo gettext("Automatic updater is a tool to update BoxBilling to latest version in one click. Works on these hosting environments where PHP has permissions to overwrite files uploaded via FTP.");
     echo "</p>\n            </div>\n\n            <div class=\"body\">\n                <a href=\"";
     // line 111
     echo $this->env->getExtension('bb')->twig_bb_client_link_filter("api/admin/extension/update_core");
     echo "\" title=\"\" class=\"btnIconLeft mr10 mt5 api-link\" data-api-confirm=\"Make sure that you have made database and files backups before proceeding with automatic update. Click OK when you are ready to continue.\" data-api-msg=\"Update complete\"><img src=\"images/icons/dark/cog.png\" alt=\"\" class=\"icon\"><span>Update BoxBilling</span></a>\n            </div>\n\n            <div class=\"help\">\n                <h3>";
     // line 115
     echo gettext("Manual update");
     echo "</h3>\n                <p>";
     // line 116
     echo gettext("Manual update is a solution when auto updater can not work on current installation environment");
     echo "</p>\n            </div>\n\n            <div class=\"body list arrowGreen\">\n                <ul>\n                    <li>Download latest BoxBilling from <a href=\"http://www.boxbilling.com/download\" target=\"_blank\">www.boxbilling.com</a></li>\n                    <li>Extract files at your computer</li>\n                    <li>Upload (overwrite) extracted files via FTP to <strong>";
     // line 123
     echo twig_escape_filter($this->env, twig_constant("BB_PATH_ROOT"), "html", null, true);
     echo "</strong></li>\n                    <li>When upload is complete, execute <a href=\"";
     // line 124
     echo twig_escape_filter($this->env, twig_constant("BB_URL"), "html", null, true);
     echo "bb-update.php\" target=\"_blank\">";
     echo twig_escape_filter($this->env, twig_constant("BB_URL"), "html", null, true);
     echo "bb-update.php</a> in your browser</li>\n                    <li>Your BoxBilling is now updated to latest version.</li>\n                </ul>\n            </div>\n        </div>\n        \n        <div class=\"tab_content nopadding\" id=\"tab-about\">\n            <div class=\"help\">\n                <h3>";
     // line 132
     echo gettext("Extending BoxBilling");
     echo "</h3>\n                <p>";
     // line 133
     echo gettext("BoxBilling gives developers all the capabilities to customize, integrate & extend the core system into your own website & applications.");
     echo "</p>\n            </div>\n            <div class=\"body\">\n                <h2 class=\"pt20\">More extensions</h2>\n                <p>If you can not find extensions you are looking for in this admin area, please visit extensions site at <a href=\"http://extensions.boxbilling.com\" target=\"_blank\">http://extensions.boxbilling.com</a></p>\n\n                <h2 class=\"pt20\">How to create new extension</h2>\n                <div class=\"pt20 list arrowGrey\">\n                    <ul>\n                        <li>Create free account at <a href=\"https://github.com/signup/free\" target=\"_blank\">Github</a></li>\n                        <li>Create new public repository dedicated for extension only</li>\n                        <li>Repository must have plugin json file. <a href=\"http://extensions.boxbilling.com/article/getting-started\" target=\"_blank\">More information</a></li>\n                        <li>Login to <a href=\"http://extensions.boxbilling.com/\" target=\"_blank\">BoxBilling extensions site</a> with github account.</li>\n                        <li>If your repository contains valid json file, it can be registered in extensions site.</li>\n                        <li>Registered extensions can be visible in every BoxBilling admin area.</li>\n                    </ul>\n                </div>\n\n                <h2 class=\"pt20\">Supported extension types</h2>\n                <div class=\"pt20 list arrowGrey\">\n                    <ul>\n                        <li>Payment gateways</li>\n                        <li>Server managers</li>\n                        <li>Domain registrars</li>\n                        <li>Client area themes</li>\n                        <li>Admin area themes</li>\n                        <li>Translations for client and admin areas</li>\n                        <li>Event hooks - Hooks can be injected into the process, change its behaviour, stop executing actions</li>\n                        <li>API module - External program which uses BoxBilling API</li>\n                    </ul>\n                </div>\n\n                <h2 class=\"pt20\">Extension support</h2>\n                <p>Contact extensions developers directly for support. You can find issue tracker on extension site.</p>\n            </div>\n        </div>\n    </div>\n</div>\n\n";
 }
 protected function doDisplay(array $context, array $blocks = array())
 {
     // line 1
     if (isset($context["request"])) {
         $_request_ = $context["request"];
     } else {
         $_request_ = null;
     }
     if (isset($context["guest"])) {
         $_guest_ = $context["guest"];
     } else {
         $_guest_ = null;
     }
     $context["product"] = $this->getAttribute($_request_, "order") ? $this->getAttribute($_guest_, "product_get", array(0 => array("id" => $this->getAttribute($_request_, "order"))), "method") : null;
     // line 2
     echo "<div class=\"accordion-group\" id=\"product-configuration\">\n    <div class=\"accordion-heading\">\n        <a class=\"accordion-toggle\" href=\"#order\" data-parent=\"#accordion1\" data-toggle=\"collapse\"><span class=\"awe-cog\"></span> ";
     // line 4
     echo gettext("Product Configuration");
     echo "</a>\n    </div>\n    ";
     // line 6
     if (isset($context["product"])) {
         $_product_ = $context["product"];
     } else {
         $_product_ = null;
     }
     if ($_product_) {
         // line 7
         echo "    <div id=\"order\" class=\"accordion-body collapse ";
         if (isset($context["request"])) {
             $_request_ = $context["request"];
         } else {
             $_request_ = null;
         }
         if ($this->getAttribute($_request_, "order")) {
             echo "in";
         }
         echo "\">\n        <div class=\"accordion-inner\">\n            <form method=\"post\" style=\"background:none;\" class=\"form-";
         // line 9
         if (isset($context["product"])) {
             $_product_ = $context["product"];
         } else {
             $_product_ = null;
         }
         if (isset($context["guest"])) {
             $_guest_ = $context["guest"];
         } else {
             $_guest_ = null;
         }
         echo twig_escape_filter($this->env, $this->getAttribute($_product_, "form_id") ? $this->getAttribute($this->getAttribute($this->getAttribute($_guest_, "formbuilder_get", array(0 => array("id" => $this->getAttribute($_product_, "form_id"))), "method"), "style"), "type") : 0, "html", null, true);
         echo "\" action=\"";
         echo $this->env->getExtension('bb')->twig_bb_client_link_filter("/order");
         echo "/";
         if (isset($context["product"])) {
             $_product_ = $context["product"];
         } else {
             $_product_ = null;
         }
         echo twig_escape_filter($this->env, $this->getAttribute($_product_, "slug"), "html", null, true);
         echo "\" id=\"add-to-cart\" onsubmit=\"return false;\">\n\n            ";
         // line 11
         ob_start();
         // line 12
         echo "            <div class=\"well\">\n                <strong>";
         // line 13
         if (isset($context["product"])) {
             $_product_ = $context["product"];
         } else {
             $_product_ = null;
         }
         echo twig_escape_filter($this->env, $this->getAttribute($_product_, "title"), "html", null, true);
         echo "</strong>\n                ";
         // line 14
         if (isset($context["product"])) {
             $_product_ = $context["product"];
         } else {
             $_product_ = null;
         }
         echo twig_bbmd_filter($this->env, $this->getAttribute($_product_, "description"));
         echo "\n\n                ";
         // line 16
         if (isset($context["product"])) {
             $_product_ = $context["product"];
         } else {
             $_product_ = null;
         }
         if ($this->getAttribute($this->getAttribute($_product_, "pricing"), "type") == "recurrent") {
             // line 17
             echo "                ";
             if (isset($context["guest"])) {
                 $_guest_ = $context["guest"];
             } else {
                 $_guest_ = null;
             }
             $context["periods"] = $this->getAttribute($_guest_, "system_periods");
             // line 18
             echo "                <select name=\"period\" id=\"period-selector\">\n                    ";
             // line 19
             if (isset($context["product"])) {
                 $_product_ = $context["product"];
             } else {
                 $_product_ = null;
             }
             $context['_parent'] = (array) $context;
             $context['_seq'] = twig_ensure_traversable($this->getAttribute($this->getAttribute($_product_, "pricing"), "recurrent"));
             foreach ($context['_seq'] as $context["code"] => $context["prices"]) {
                 // line 20
                 echo "                    ";
                 if (isset($context["prices"])) {
                     $_prices_ = $context["prices"];
                 } else {
                     $_prices_ = null;
                 }
                 if ($this->getAttribute($_prices_, "enabled")) {
                     // line 21
                     echo "                    <option value=\"";
                     if (isset($context["code"])) {
                         $_code_ = $context["code"];
                     } else {
                         $_code_ = null;
                     }
                     echo twig_escape_filter($this->env, $_code_, "html", null, true);
                     echo "\" data-bb-price=\"";
                     if (isset($context["prices"])) {
                         $_prices_ = $context["prices"];
                     } else {
                         $_prices_ = null;
                     }
                     echo twig_money_convert($this->env, $this->getAttribute($_prices_, "price"));
                     echo "\" name=\"period\">";
                     if (isset($context["periods"])) {
                         $_periods_ = $context["periods"];
                     } else {
                         $_periods_ = null;
                     }
                     if (isset($context["code"])) {
                         $_code_ = $context["code"];
                     } else {
                         $_code_ = null;
                     }
                     echo twig_escape_filter($this->env, $this->getAttribute($_periods_, $_code_, array(), "array"), "html", null, true);
                     echo " - ";
                     if (isset($context["prices"])) {
                         $_prices_ = $context["prices"];
                     } else {
                         $_prices_ = null;
                     }
                     echo twig_money_convert($this->env, $this->getAttribute($_prices_, "price"));
                     echo "</option>\n                    ";
                 }
                 // line 23
                 echo "                    ";
             }
             $_parent = $context['_parent'];
             unset($context['_seq'], $context['_iterated'], $context['code'], $context['prices'], $context['_parent'], $context['loop']);
             $context = array_intersect_key($context, $_parent) + $_parent;
             // line 24
             echo "                </select>\n                ";
         } elseif ($this->getAttribute($this->getAttribute($_product_, "pricing"), "type") == "free") {
             // line 26
             echo "                <span class=\"label label-info\">";
             echo gettext("FREE");
             echo "</span>\n                ";
         } else {
             // line 28
             echo "                <span class=\"label label-info\">";
             if (isset($context["product"])) {
                 $_product_ = $context["product"];
             } else {
                 $_product_ = null;
             }
             echo twig_money_convert($this->env, $this->getAttribute($this->getAttribute($this->getAttribute($_product_, "pricing"), "once"), "price"));
             echo "</span>\n                ";
         }
         // line 30
         echo "            </div>\n            ";
         $context["product_details"] = '' === ($tmp = ob_get_clean()) ? '' : new Twig_Markup($tmp, $this->env->getCharset());
         // line 32
         echo "\n            ";
         // line 33
         if (isset($context["product"])) {
             $_product_ = $context["product"];
         } else {
             $_product_ = null;
         }
         $context["tpl"] = "mod_service" . $this->getAttribute($_product_, "type") . "_order_form.phtml";
         // line 34
         echo "            ";
         if (isset($context["guest"])) {
             $_guest_ = $context["guest"];
         } else {
             $_guest_ = null;
         }
         if (isset($context["tpl"])) {
             $_tpl_ = $context["tpl"];
         } else {
             $_tpl_ = null;
         }
         if (isset($context["product"])) {
             $_product_ = $context["product"];
         } else {
             $_product_ = null;
         }
         if ($this->getAttribute($_guest_, "system_template_exists", array(0 => array("file" => $_tpl_)), "method")) {
             // line 35
             echo "                ";
             if (isset($context["tpl"])) {
                 $_tpl_ = $context["tpl"];
             } else {
                 $_tpl_ = null;
             }
             if (isset($context["product"])) {
                 $_product_ = $context["product"];
             } else {
                 $_product_ = null;
             }
             $template = $this->env->resolveTemplate($_tpl_);
             $template->display(array_merge($context, $_product_));
             // line 36
             echo "            ";
         } elseif ($this->getAttribute($_product_, "form_id") && $this->getAttribute($_guest_, "extension_is_on", array(0 => array("mod" => "formbuilder")), "method")) {
             // line 37
             echo "                ";
             if (isset($context["product_details"])) {
                 $_product_details_ = $context["product_details"];
             } else {
                 $_product_details_ = null;
             }
             echo twig_escape_filter($this->env, $_product_details_, "html", null, true);
             echo "\n                ";
             // line 38
             if (isset($context["guest"])) {
                 $_guest_ = $context["guest"];
             } else {
                 $_guest_ = null;
             }
             if (isset($context["product"])) {
                 $_product_ = $context["product"];
             } else {
                 $_product_ = null;
             }
             $context["form"] = $this->getAttribute($_guest_, "formbuilder_get", array(0 => array("id" => $this->getAttribute($_product_, "form_id"))), "method");
             // line 39
             echo "                ";
             if (isset($context["product"])) {
                 $_product_ = $context["product"];
             } else {
                 $_product_ = null;
             }
             $this->env->loadTemplate("mod_formbuilder_build.phtml")->display(array_merge($context, $_product_));
             // line 40
             echo "            ";
         } else {
             // line 41
             echo "                ";
             if (isset($context["product_details"])) {
                 $_product_details_ = $context["product_details"];
             } else {
                 $_product_details_ = null;
             }
             echo twig_escape_filter($this->env, $_product_details_, "html", null, true);
             echo "\n            ";
         }
         // line 43
         echo "\n            ";
         // line 44
         if (isset($context["product"])) {
             $_product_ = $context["product"];
         } else {
             $_product_ = null;
         }
         $this->env->loadTemplate("mod_orderbutton_addons.phtml")->display(array_merge($context, $_product_));
         // line 45
         echo "\n            <input type=\"hidden\" name=\"multiple\" value=\"1\" />\n            <input type=\"hidden\" name=\"id\" value=\"";
         // line 47
         if (isset($context["product"])) {
             $_product_ = $context["product"];
         } else {
             $_product_ = null;
         }
         echo twig_escape_filter($this->env, $this->getAttribute($_product_, "id"), "html", null, true);
         echo "\" />\n               <button type=\"submit\" class=\"btn btn-primary\">";
         // line 48
         echo gettext("Order");
         echo "</button>\n        </div>\n        </form>\n    </div>\n    ";
     }
     // line 53
     echo "</div>";
 }