var/cache/dev/twig/d0/d0b9519f98865309e5488f4caa4100d1.php line 53

Open in your IDE?
  1. <?php
  2. use Twig\Environment;
  3. use Twig\Error\LoaderError;
  4. use Twig\Error\RuntimeError;
  5. use Twig\Extension\CoreExtension;
  6. use Twig\Extension\SandboxExtension;
  7. use Twig\Markup;
  8. use Twig\Sandbox\SecurityError;
  9. use Twig\Sandbox\SecurityNotAllowedTagError;
  10. use Twig\Sandbox\SecurityNotAllowedFilterError;
  11. use Twig\Sandbox\SecurityNotAllowedFunctionError;
  12. use Twig\Source;
  13. use Twig\Template;
  14. use Twig\TemplateWrapper;
  15. /* workhour/pay.html.twig */
  16. class __TwigTemplate_1b5253d370e1a08777f4bb295bf38257 extends Template
  17. {
  18. private Source $source;
  19. /**
  20. * @var array<string, Template>
  21. */
  22. private array $macros = [];
  23. public function __construct(Environment $env)
  24. {
  25. parent::__construct($env);
  26. $this->source = $this->getSourceContext();
  27. $this->blocks = [
  28. 'page_content' => [$this, 'block_page_content'],
  29. ];
  30. }
  31. protected function doGetParent(array $context): bool|string|Template|TemplateWrapper
  32. {
  33. // line 1
  34. return "@!EasyAdmin/page/content.html.twig";
  35. }
  36. protected function doDisplay(array $context, array $blocks = []): iterable
  37. {
  38. $macros = $this->macros;
  39. $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  40. $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "workhour/pay.html.twig"));
  41. $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  42. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "workhour/pay.html.twig"));
  43. $this->parent = $this->load("@!EasyAdmin/page/content.html.twig", 1);
  44. yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks));
  45. $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  46. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  47. }
  48. // line 3
  49. /**
  50. * @return iterable<null|scalar|\Stringable>
  51. */
  52. public function block_page_content(array $context, array $blocks = []): iterable
  53. {
  54. $macros = $this->macros;
  55. $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  56. $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "page_content"));
  57. $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  58. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "page_content"));
  59. // line 4
  60. yield "<div>
  61. \t<h2>";
  62. // line 5
  63. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["worker"]) || array_key_exists("worker", $context) ? $context["worker"] : (function () { throw new RuntimeError('Variable "worker" does not exist.', 5, $this->source); })()), "html", null, true);
  64. yield "</h2>
  65. \t<form method=\"post\">
  66. \t\t<table class=\"table\">
  67. \t\t";
  68. // line 8
  69. $context["sum"] = 0;
  70. // line 9
  71. yield "\t\t";
  72. $context["sumOther"] = 0;
  73. // line 10
  74. yield "\t\t\t<tr>
  75. \t\t\t\t<th>Kifizet</th>
  76. \t\t\t\t<th>Projekt</th>
  77. \t\t\t\t<th>Idő</th>
  78. \t\t\t\t<th>Egyéb költség</th>
  79. \t\t\t\t<th>Összesen</th>
  80. \t\t\t\t<th>Nap</th>
  81. \t\t\t\t<th>Létrehozva</th>
  82. \t\t\t</tr>
  83. \t\t\t";
  84. // line 19
  85. $context['_parent'] = $context;
  86. $context['_seq'] = CoreExtension::ensureTraversable((isset($context["hours"]) || array_key_exists("hours", $context) ? $context["hours"] : (function () { throw new RuntimeError('Variable "hours" does not exist.', 19, $this->source); })()));
  87. foreach ($context['_seq'] as $context["_key"] => $context["hour"]) {
  88. // line 20
  89. yield "\t\t\t<tr id=\"row-";
  90. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["hour"], "id", [], "any", false, false, false, 20), "html", null, true);
  91. yield "\">
  92. \t\t\t\t";
  93. // line 21
  94. if ((($tmp = CoreExtension::getAttribute($this->env, $this->source, $context["hour"], "isValidated", [], "any", false, false, false, 21)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
  95. // line 22
  96. yield "\t\t\t\t\t<td><input type=\"checkbox\" value=\"";
  97. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["hour"], "id", [], "any", false, false, false, 22), "html", null, true);
  98. yield "\" checked=\"\" name=\"workhours[]\" class=\"hour-checkbox\" onClick=\"check()\"></td>\t
  99. \t\t\t\t";
  100. } else {
  101. // line 24
  102. yield "\t\t\t\t\t<td><input type=\"checkbox\" value=\"";
  103. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["hour"], "id", [], "any", false, false, false, 24), "html", null, true);
  104. yield "\" name=\"workhours[]\" class=\"hour-checkbox\" onClick=\"check()\"></td>\t
  105. \t\t\t\t";
  106. }
  107. // line 26
  108. yield "\t\t\t\t";
  109. if ((($tmp = CoreExtension::getAttribute($this->env, $this->source, $context["hour"], "project", [], "any", false, false, false, 26)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
  110. // line 27
  111. yield " \t";
  112. if ((($tmp = CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["hour"], "project", [], "any", false, false, false, 27), "customer", [], "any", false, false, false, 27)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
  113. // line 28
  114. yield "\t\t\t\t\t <td>(";
  115. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["hour"], "project", [], "any", false, false, false, 28), "customer", [], "any", false, false, false, 28), "name", [], "any", false, false, false, 28), "html", null, true);
  116. yield ") ";
  117. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["hour"], "project", [], "any", false, false, false, 28), "name", [], "any", false, false, false, 28), "html", null, true);
  118. yield " - ";
  119. yield CoreExtension::getAttribute($this->env, $this->source, $context["hour"], "note", [], "any", false, false, false, 28);
  120. yield "</td>\t
  121. ";
  122. } else {
  123. // line 30
  124. yield " <td>";
  125. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["hour"], "project", [], "any", false, false, false, 30), "name", [], "any", false, false, false, 30), "html", null, true);
  126. yield " - ";
  127. yield CoreExtension::getAttribute($this->env, $this->source, $context["hour"], "note", [], "any", false, false, false, 30);
  128. yield "</td>\t
  129. ";
  130. }
  131. // line 32
  132. yield " ";
  133. } else {
  134. // line 33
  135. yield "\t\t\t\t\t<td>";
  136. yield CoreExtension::getAttribute($this->env, $this->source, $context["hour"], "note", [], "any", false, false, false, 33);
  137. yield "</td>\t
  138. \t\t\t\t";
  139. }
  140. // line 35
  141. yield "\t\t\t\t<td id=\"hour-";
  142. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["hour"], "id", [], "any", false, false, false, 35), "html", null, true);
  143. yield "\">";
  144. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["hour"], "hours", [], "any", false, false, false, 35), "html", null, true);
  145. yield "</td>\t
  146. \t\t\t\t<td id=\"other-";
  147. // line 36
  148. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["hour"], "id", [], "any", false, false, false, 36), "html", null, true);
  149. yield "\">";
  150. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["hour"], "otherPrice", [], "any", false, false, false, 36), "html", null, true);
  151. yield "</td>\t
  152. \t\t\t\t<td id=\"sum-";
  153. // line 37
  154. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["hour"], "id", [], "any", false, false, false, 37), "html", null, true);
  155. yield "\">";
  156. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(((CoreExtension::getAttribute($this->env, $this->source, $context["hour"], "hours", [], "any", false, false, false, 37) * CoreExtension::getAttribute($this->env, $this->source, (isset($context["worker"]) || array_key_exists("worker", $context) ? $context["worker"] : (function () { throw new RuntimeError('Variable "worker" does not exist.', 37, $this->source); })()), "priceHour", [], "any", false, false, false, 37)) + CoreExtension::getAttribute($this->env, $this->source, $context["hour"], "otherPrice", [], "any", false, false, false, 37)), "html", null, true);
  157. yield "</td>\t
  158. \t\t\t\t<td>";
  159. // line 38
  160. yield (((($tmp = CoreExtension::getAttribute($this->env, $this->source, $context["hour"], "day", [], "any", false, false, false, 38)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) ? ($this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["hour"], "day", [], "any", false, false, false, 38), "format", ["Y-m-d"], "method", false, false, false, 38), "html", null, true)) : ("-"));
  161. yield "</td>\t
  162. \t\t\t\t<td>";
  163. // line 39
  164. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["hour"], "created", [], "any", false, false, false, 39), "format", ["Y-m-d"], "method", false, false, false, 39), "html", null, true);
  165. yield "</td>\t
  166. \t\t\t\t";
  167. // line 40
  168. if ((($tmp = CoreExtension::getAttribute($this->env, $this->source, $context["hour"], "isValidated", [], "any", false, false, false, 40)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
  169. // line 41
  170. yield "\t\t\t\t\t";
  171. $context["sum"] = ((isset($context["sum"]) || array_key_exists("sum", $context) ? $context["sum"] : (function () { throw new RuntimeError('Variable "sum" does not exist.', 41, $this->source); })()) + CoreExtension::getAttribute($this->env, $this->source, $context["hour"], "hours", [], "any", false, false, false, 41));
  172. // line 42
  173. yield "\t\t\t\t\t";
  174. $context["sumOther"] = ((isset($context["sumOther"]) || array_key_exists("sumOther", $context) ? $context["sumOther"] : (function () { throw new RuntimeError('Variable "sumOther" does not exist.', 42, $this->source); })()) + (((($tmp = CoreExtension::getAttribute($this->env, $this->source, $context["hour"], "otherPrice", [], "any", false, false, false, 42)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) ? (CoreExtension::getAttribute($this->env, $this->source, $context["hour"], "otherPrice", [], "any", false, false, false, 42)) : (0)));
  175. yield "\t\t
  176. \t\t\t\t";
  177. }
  178. // line 44
  179. yield "\t\t\t
  180. \t\t\t</tr>
  181. \t\t\t";
  182. }
  183. $_parent = $context['_parent'];
  184. unset($context['_seq'], $context['_key'], $context['hour'], $context['_parent']);
  185. $context = array_intersect_key($context, $_parent) + $_parent;
  186. // line 47
  187. yield "\t\t\t<tfoot style=\"background-color: #fafafafa\">
  188. \t\t\t\t<tr>
  189. \t\t\t\t\t<td colspan=\"2\"><strong>Összesen</strong></td>
  190. \t\t\t\t\t<td id=\"sumHours\" >";
  191. // line 50
  192. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["sum"]) || array_key_exists("sum", $context) ? $context["sum"] : (function () { throw new RuntimeError('Variable "sum" does not exist.', 50, $this->source); })()), "html", null, true);
  193. yield "</td>
  194. \t\t\t\t\t<td id=\"sumHours\" >";
  195. // line 51
  196. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["sum"]) || array_key_exists("sum", $context) ? $context["sum"] : (function () { throw new RuntimeError('Variable "sum" does not exist.', 51, $this->source); })()), "html", null, true);
  197. yield "</td>
  198. \t\t\t\t\t<td></td>
  199. \t\t\t\t</tr>
  200. \t\t\t\t<tr>
  201. \t\t\t\t\t<td colspan=\"2\"><strong>Órabér</strong></td>
  202. \t\t\t\t\t<td>";
  203. // line 56
  204. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extra\Intl\IntlExtension']->formatCurrency(CoreExtension::getAttribute($this->env, $this->source, (isset($context["worker"]) || array_key_exists("worker", $context) ? $context["worker"] : (function () { throw new RuntimeError('Variable "worker" does not exist.', 56, $this->source); })()), "priceHour", [], "any", false, false, false, 56), "HUF", ["fraction_digit" => 0], "hu"), "html", null, true);
  205. yield "</td>
  206. \t\t\t\t\t<td><input type=\"number\" name=\"priceHour\" id=\"priceHour\" value=\"";
  207. // line 57
  208. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["worker"]) || array_key_exists("worker", $context) ? $context["worker"] : (function () { throw new RuntimeError('Variable "worker" does not exist.', 57, $this->source); })()), "priceHour", [], "any", false, false, false, 57), "html", null, true);
  209. yield "\"></td>
  210. \t\t\t\t\t<td><input type=\"number\" name=\"priceHour\" id=\"priceHour\" value=\"";
  211. // line 58
  212. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["worker"]) || array_key_exists("worker", $context) ? $context["worker"] : (function () { throw new RuntimeError('Variable "worker" does not exist.', 58, $this->source); })()), "priceHour", [], "any", false, false, false, 58), "html", null, true);
  213. yield "\"></td>
  214. \t\t\t\t</tr>
  215. \t\t\t\t<tr>
  216. \t\t\t\t\t<td colspan=\"2\"><strong>Fizetendő óra</strong></td>
  217. \t\t\t\t\t<td id=\"sumHoursPrice\">";
  218. // line 62
  219. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extra\Intl\IntlExtension']->formatCurrency(((isset($context["sum"]) || array_key_exists("sum", $context) ? $context["sum"] : (function () { throw new RuntimeError('Variable "sum" does not exist.', 62, $this->source); })()) * CoreExtension::getAttribute($this->env, $this->source, (isset($context["worker"]) || array_key_exists("worker", $context) ? $context["worker"] : (function () { throw new RuntimeError('Variable "worker" does not exist.', 62, $this->source); })()), "priceHour", [], "any", false, false, false, 62)), "HUF", ["fraction_digit" => 0], "hu"), "html", null, true);
  220. yield "</td>
  221. \t\t\t\t\t<td colspan=\"2\"><strong>Fizetendő óra</strong></td>
  222. \t\t\t\t\t<td id=\"sumHoursPrice\">";
  223. // line 64
  224. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extra\Intl\IntlExtension']->formatCurrency(((isset($context["sum"]) || array_key_exists("sum", $context) ? $context["sum"] : (function () { throw new RuntimeError('Variable "sum" does not exist.', 64, $this->source); })()) * CoreExtension::getAttribute($this->env, $this->source, (isset($context["worker"]) || array_key_exists("worker", $context) ? $context["worker"] : (function () { throw new RuntimeError('Variable "worker" does not exist.', 64, $this->source); })()), "priceHour", [], "any", false, false, false, 64)), "HUF", ["fraction_digit" => 0], "hu"), "html", null, true);
  225. yield "</td>
  226. \t\t\t\t\t<td></td>
  227. \t\t\t\t</tr>
  228. \t\t\t\t<tr>
  229. \t\t\t\t\t<td colspan=\"2\"><strong>Egyéb költség</strong></td>
  230. \t\t\t\t\t<td id=\"sumOther\">";
  231. // line 69
  232. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extra\Intl\IntlExtension']->formatCurrency((isset($context["sumOther"]) || array_key_exists("sumOther", $context) ? $context["sumOther"] : (function () { throw new RuntimeError('Variable "sumOther" does not exist.', 69, $this->source); })()), "HUF", ["fraction_digit" => 0], "hu"), "html", null, true);
  233. yield "</td>
  234. \t\t\t\t\t<td id=\"sumOther\">";
  235. // line 70
  236. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extra\Intl\IntlExtension']->formatCurrency((isset($context["sumOther"]) || array_key_exists("sumOther", $context) ? $context["sumOther"] : (function () { throw new RuntimeError('Variable "sumOther" does not exist.', 70, $this->source); })()), "HUF", ["fraction_digit" => 0], "hu"), "html", null, true);
  237. yield "</td>
  238. \t\t\t\t\t<td></td>
  239. \t\t\t\t</tr>
  240. \t\t\t\t<tr>
  241. \t\t\t\t\t<td colspan=\"2\"><strong>Teljes fizetendő összeg</strong></td>
  242. \t\t\t\t\t<td><strong id=\"sumTotalStrong\">";
  243. // line 75
  244. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extra\Intl\IntlExtension']->formatCurrency((((isset($context["sum"]) || array_key_exists("sum", $context) ? $context["sum"] : (function () { throw new RuntimeError('Variable "sum" does not exist.', 75, $this->source); })()) * CoreExtension::getAttribute($this->env, $this->source, (isset($context["worker"]) || array_key_exists("worker", $context) ? $context["worker"] : (function () { throw new RuntimeError('Variable "worker" does not exist.', 75, $this->source); })()), "priceHour", [], "any", false, false, false, 75)) + (isset($context["sumOther"]) || array_key_exists("sumOther", $context) ? $context["sumOther"] : (function () { throw new RuntimeError('Variable "sumOther" does not exist.', 75, $this->source); })())), "HUF", ["fraction_digit" => 0], "hu"), "html", null, true);
  245. yield "</strong></td>
  246. \t\t\t\t\t<td><input type=\"hidden\" name=\"sumTotal\" id=\"sumTotal\" value=\"";
  247. // line 76
  248. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((((isset($context["sum"]) || array_key_exists("sum", $context) ? $context["sum"] : (function () { throw new RuntimeError('Variable "sum" does not exist.', 76, $this->source); })()) * CoreExtension::getAttribute($this->env, $this->source, (isset($context["worker"]) || array_key_exists("worker", $context) ? $context["worker"] : (function () { throw new RuntimeError('Variable "worker" does not exist.', 76, $this->source); })()), "priceHour", [], "any", false, false, false, 76)) + (isset($context["sumOther"]) || array_key_exists("sumOther", $context) ? $context["sumOther"] : (function () { throw new RuntimeError('Variable "sumOther" does not exist.', 76, $this->source); })())), "html", null, true);
  249. yield "\"></td>
  250. \t\t\t\t</tr>
  251. \t\t\t</tfoot>
  252. \t\t</table>
  253. \t\t<input type=\"submit\" name=\"submit\" value=\"Fizetés\" class=\"btn btn-info\">
  254. \t</form>
  255. <script type=\"text/javascript\">
  256. \tfunction check(){
  257. \t\t\$('#sumTotal').val(0);
  258. \t\tvar total = 0;
  259. \t\tvar sumHours = 0;
  260. \t\tvar sumHoursPrice = 0;
  261. \t\tvar sumOther = 0;
  262. \t\tvar priceHour = parseInt(\$('#priceHour').val())
  263. \t\t\$('.hour-checkbox:checked').each(function(key,chk){
  264. \t\t\tvar price = parseInt(\$('#sum-'+chk.value).html())
  265. \t\t\tvar other = parseInt(\$('#other-'+chk.value).html())
  266. \t\t\tvar hour = parseFloat(\$('#hour-'+chk.value).html())
  267. \t\t\ttotal = total + price;
  268. \t\t\tif(other > 0){
  269. \t\t\t\tsumOther = sumOther + other;
  270. \t\t\t}
  271. \t\t\tsumHours = sumHours + hour;
  272. \t\t\tsumHoursPrice = sumHoursPrice + (hour*priceHour);
  273. \t\t\t\$('#sumTotalStrong').html(total);
  274. \t\t\t\$('#sumOther').html(sumOther);
  275. \t\t\t\$('#sumHours').html(sumHours);
  276. \t\t\t\$('#sumHoursPrice').html(sumHoursPrice);
  277. \t\t})
  278. \t}
  279. </script>
  280. <script type=\"text/javascript\">
  281. \tfunction check(){
  282. \t\tvar sumTotal = document.getElementById('sumTotal')
  283. \t\tsumTotal.value = 0;
  284. \t\tvar total = 0;
  285. \t\tvar sumHours = 0;
  286. \t\tvar sumHoursPrice = 0;
  287. \t\tvar sumOther = 0;
  288. \t\tvar priceHour = document.getElementById('priceHour')
  289. \t\tvar priceHour = parseInt(priceHour.value)
  290. \t\tvar checked = document.querySelectorAll('.hour-checkbox:checked')
  291. \t\tchecked.forEach(function(chk, key){
  292. \t\t\tconsole.log(key, chk, chk.value)
  293. \t\t\tvar price = parseInt(document.getElementById('sum-'+chk.value).innerHTML)
  294. \t\t\tvar other = parseInt(document.getElementById('other-'+chk.value).innerHTML)
  295. \t\t\tvar hour = parseFloat(document.getElementById('hour-'+chk.value).innerHTML)
  296. \t\t\ttotal = total + price;
  297. \t\t\tif(other > 0){
  298. \t\t\t\tsumOther = sumOther + other;
  299. \t\t\t}
  300. \t\t\tsumHours = sumHours + hour;
  301. \t\t\tsumHoursPrice = sumHoursPrice + (hour*priceHour);
  302. \t\t\tdocument.getElementById('sumTotalStrong').innerHTML = total;
  303. \t\t\tdocument.getElementById('sumOther').innerHTML = sumOther;
  304. \t\t\tdocument.getElementById('sumHours').innerHTML = sumHours;
  305. \t\t\tdocument.getElementById('sumHoursPrice').innerHTML = sumHoursPrice;
  306. \t\t})
  307. \t}\t
  308. </script>
  309. </div>
  310. ";
  311. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  312. $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  313. yield from [];
  314. }
  315. /**
  316. * @codeCoverageIgnore
  317. */
  318. public function getTemplateName(): string
  319. {
  320. return "workhour/pay.html.twig";
  321. }
  322. /**
  323. * @codeCoverageIgnore
  324. */
  325. public function isTraitable(): bool
  326. {
  327. return false;
  328. }
  329. /**
  330. * @codeCoverageIgnore
  331. */
  332. public function getDebugInfo(): array
  333. {
  334. return array ( 264 => 76, 260 => 75, 252 => 70, 248 => 69, 240 => 64, 235 => 62, 228 => 58, 224 => 57, 220 => 56, 212 => 51, 208 => 50, 203 => 47, 195 => 44, 189 => 42, 186 => 41, 184 => 40, 180 => 39, 176 => 38, 170 => 37, 164 => 36, 157 => 35, 151 => 33, 148 => 32, 140 => 30, 130 => 28, 127 => 27, 124 => 26, 118 => 24, 112 => 22, 110 => 21, 105 => 20, 101 => 19, 90 => 10, 87 => 9, 85 => 8, 79 => 5, 76 => 4, 63 => 3, 40 => 1,);
  335. }
  336. public function getSourceContext(): Source
  337. {
  338. return new Source("{% extends '@!EasyAdmin/page/content.html.twig' %}
  339. {% block page_content %}
  340. <div>
  341. \t<h2>{{worker}}</h2>
  342. \t<form method=\"post\">
  343. \t\t<table class=\"table\">
  344. \t\t{% set sum=0 %}
  345. \t\t{% set sumOther=0 %}
  346. \t\t\t<tr>
  347. \t\t\t\t<th>Kifizet</th>
  348. \t\t\t\t<th>Projekt</th>
  349. \t\t\t\t<th>Idő</th>
  350. \t\t\t\t<th>Egyéb költség</th>
  351. \t\t\t\t<th>Összesen</th>
  352. \t\t\t\t<th>Nap</th>
  353. \t\t\t\t<th>Létrehozva</th>
  354. \t\t\t</tr>
  355. \t\t\t{% for hour in hours %}
  356. \t\t\t<tr id=\"row-{{hour.id}}\">
  357. \t\t\t\t{% if hour.isValidated %}
  358. \t\t\t\t\t<td><input type=\"checkbox\" value=\"{{hour.id}}\" checked=\"\" name=\"workhours[]\" class=\"hour-checkbox\" onClick=\"check()\"></td>\t
  359. \t\t\t\t{% else %}
  360. \t\t\t\t\t<td><input type=\"checkbox\" value=\"{{hour.id}}\" name=\"workhours[]\" class=\"hour-checkbox\" onClick=\"check()\"></td>\t
  361. \t\t\t\t{% endif %}
  362. \t\t\t\t{% if hour.project %}
  363. \t{% if hour.project.customer %}
  364. \t\t\t\t\t <td>({{hour.project.customer.name}}) {{hour.project.name}} - {{hour.note|raw}}</td>\t
  365. {% else %}
  366. <td>{{hour.project.name}} - {{hour.note|raw}}</td>\t
  367. {% endif %}
  368. {% else %}
  369. \t\t\t\t\t<td>{{hour.note|raw}}</td>\t
  370. \t\t\t\t{% endif %}
  371. \t\t\t\t<td id=\"hour-{{hour.id}}\">{{hour.hours}}</td>\t
  372. \t\t\t\t<td id=\"other-{{hour.id}}\">{{hour.otherPrice}}</td>\t
  373. \t\t\t\t<td id=\"sum-{{hour.id}}\">{{(hour.hours*worker.priceHour)+hour.otherPrice}}</td>\t
  374. \t\t\t\t<td>{{hour.day?hour.day.format('Y-m-d'):'-'}}</td>\t
  375. \t\t\t\t<td>{{hour.created.format('Y-m-d')}}</td>\t
  376. \t\t\t\t{% if hour.isValidated %}
  377. \t\t\t\t\t{% set sum = sum + hour.hours %}
  378. \t\t\t\t\t{% set sumOther = sumOther + (hour.otherPrice?hour.otherPrice:0) %}\t\t
  379. \t\t\t\t{% endif %}
  380. \t\t\t
  381. \t\t\t</tr>
  382. \t\t\t{% endfor %}
  383. \t\t\t<tfoot style=\"background-color: #fafafafa\">
  384. \t\t\t\t<tr>
  385. \t\t\t\t\t<td colspan=\"2\"><strong>Összesen</strong></td>
  386. \t\t\t\t\t<td id=\"sumHours\" >{{sum}}</td>
  387. \t\t\t\t\t<td id=\"sumHours\" >{{sum}}</td>
  388. \t\t\t\t\t<td></td>
  389. \t\t\t\t</tr>
  390. \t\t\t\t<tr>
  391. \t\t\t\t\t<td colspan=\"2\"><strong>Órabér</strong></td>
  392. \t\t\t\t\t<td>{{worker.priceHour|format_currency('HUF',{fraction_digit: 0}, locale='hu')}}</td>
  393. \t\t\t\t\t<td><input type=\"number\" name=\"priceHour\" id=\"priceHour\" value=\"{{worker.priceHour}}\"></td>
  394. \t\t\t\t\t<td><input type=\"number\" name=\"priceHour\" id=\"priceHour\" value=\"{{worker.priceHour}}\"></td>
  395. \t\t\t\t</tr>
  396. \t\t\t\t<tr>
  397. \t\t\t\t\t<td colspan=\"2\"><strong>Fizetendő óra</strong></td>
  398. \t\t\t\t\t<td id=\"sumHoursPrice\">{{(sum*worker.priceHour)|format_currency('HUF',{fraction_digit: 0}, locale='hu')}}</td>
  399. \t\t\t\t\t<td colspan=\"2\"><strong>Fizetendő óra</strong></td>
  400. \t\t\t\t\t<td id=\"sumHoursPrice\">{{(sum*worker.priceHour)|format_currency('HUF',{fraction_digit: 0}, locale='hu')}}</td>
  401. \t\t\t\t\t<td></td>
  402. \t\t\t\t</tr>
  403. \t\t\t\t<tr>
  404. \t\t\t\t\t<td colspan=\"2\"><strong>Egyéb költség</strong></td>
  405. \t\t\t\t\t<td id=\"sumOther\">{{sumOther|format_currency('HUF',{fraction_digit: 0}, locale='hu')}}</td>
  406. \t\t\t\t\t<td id=\"sumOther\">{{sumOther|format_currency('HUF',{fraction_digit: 0}, locale='hu')}}</td>
  407. \t\t\t\t\t<td></td>
  408. \t\t\t\t</tr>
  409. \t\t\t\t<tr>
  410. \t\t\t\t\t<td colspan=\"2\"><strong>Teljes fizetendő összeg</strong></td>
  411. \t\t\t\t\t<td><strong id=\"sumTotalStrong\">{{((sum*worker.priceHour)+sumOther)|format_currency('HUF',{fraction_digit: 0}, locale='hu')}}</strong></td>
  412. \t\t\t\t\t<td><input type=\"hidden\" name=\"sumTotal\" id=\"sumTotal\" value=\"{{(sum*worker.priceHour)+sumOther}}\"></td>
  413. \t\t\t\t</tr>
  414. \t\t\t</tfoot>
  415. \t\t</table>
  416. \t\t<input type=\"submit\" name=\"submit\" value=\"Fizetés\" class=\"btn btn-info\">
  417. \t</form>
  418. <script type=\"text/javascript\">
  419. \tfunction check(){
  420. \t\t\$('#sumTotal').val(0);
  421. \t\tvar total = 0;
  422. \t\tvar sumHours = 0;
  423. \t\tvar sumHoursPrice = 0;
  424. \t\tvar sumOther = 0;
  425. \t\tvar priceHour = parseInt(\$('#priceHour').val())
  426. \t\t\$('.hour-checkbox:checked').each(function(key,chk){
  427. \t\t\tvar price = parseInt(\$('#sum-'+chk.value).html())
  428. \t\t\tvar other = parseInt(\$('#other-'+chk.value).html())
  429. \t\t\tvar hour = parseFloat(\$('#hour-'+chk.value).html())
  430. \t\t\ttotal = total + price;
  431. \t\t\tif(other > 0){
  432. \t\t\t\tsumOther = sumOther + other;
  433. \t\t\t}
  434. \t\t\tsumHours = sumHours + hour;
  435. \t\t\tsumHoursPrice = sumHoursPrice + (hour*priceHour);
  436. \t\t\t\$('#sumTotalStrong').html(total);
  437. \t\t\t\$('#sumOther').html(sumOther);
  438. \t\t\t\$('#sumHours').html(sumHours);
  439. \t\t\t\$('#sumHoursPrice').html(sumHoursPrice);
  440. \t\t})
  441. \t}
  442. </script>
  443. <script type=\"text/javascript\">
  444. \tfunction check(){
  445. \t\tvar sumTotal = document.getElementById('sumTotal')
  446. \t\tsumTotal.value = 0;
  447. \t\tvar total = 0;
  448. \t\tvar sumHours = 0;
  449. \t\tvar sumHoursPrice = 0;
  450. \t\tvar sumOther = 0;
  451. \t\tvar priceHour = document.getElementById('priceHour')
  452. \t\tvar priceHour = parseInt(priceHour.value)
  453. \t\tvar checked = document.querySelectorAll('.hour-checkbox:checked')
  454. \t\tchecked.forEach(function(chk, key){
  455. \t\t\tconsole.log(key, chk, chk.value)
  456. \t\t\tvar price = parseInt(document.getElementById('sum-'+chk.value).innerHTML)
  457. \t\t\tvar other = parseInt(document.getElementById('other-'+chk.value).innerHTML)
  458. \t\t\tvar hour = parseFloat(document.getElementById('hour-'+chk.value).innerHTML)
  459. \t\t\ttotal = total + price;
  460. \t\t\tif(other > 0){
  461. \t\t\t\tsumOther = sumOther + other;
  462. \t\t\t}
  463. \t\t\tsumHours = sumHours + hour;
  464. \t\t\tsumHoursPrice = sumHoursPrice + (hour*priceHour);
  465. \t\t\tdocument.getElementById('sumTotalStrong').innerHTML = total;
  466. \t\t\tdocument.getElementById('sumOther').innerHTML = sumOther;
  467. \t\t\tdocument.getElementById('sumHours').innerHTML = sumHours;
  468. \t\t\tdocument.getElementById('sumHoursPrice').innerHTML = sumHoursPrice;
  469. \t\t})
  470. \t}\t
  471. </script>
  472. </div>
  473. {% endblock page_content %}", "workhour/pay.html.twig", "/home/gortech.hu/domains/munka.gortech.hu/public_html/erp/templates/workhour/pay.html.twig");
  474. }
  475. }