<?php
use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\CoreExtension;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;
use Twig\TemplateWrapper;
/* workhour/pay.html.twig */
class __TwigTemplate_1b5253d370e1a08777f4bb295bf38257 extends Template
{
private Source $source;
/**
* @var array<string, Template>
*/
private array $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->blocks = [
'page_content' => [$this, 'block_page_content'],
];
}
protected function doGetParent(array $context): bool|string|Template|TemplateWrapper
{
// line 1
return "@!EasyAdmin/page/content.html.twig";
}
protected function doDisplay(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "workhour/pay.html.twig"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "workhour/pay.html.twig"));
$this->parent = $this->load("@!EasyAdmin/page/content.html.twig", 1);
yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks));
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
}
// line 3
/**
* @return iterable<null|scalar|\Stringable>
*/
public function block_page_content(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "page_content"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "page_content"));
// line 4
yield "<div>
\t<h2>";
// line 5
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);
yield "</h2>
\t<form method=\"post\">
\t\t<table class=\"table\">
\t\t";
// line 8
$context["sum"] = 0;
// line 9
yield "\t\t";
$context["sumOther"] = 0;
// line 10
yield "\t\t\t<tr>
\t\t\t\t<th>Kifizet</th>
\t\t\t\t<th>Projekt</th>
\t\t\t\t<th>Idő</th>
\t\t\t\t<th>Egyéb költség</th>
\t\t\t\t<th>Összesen</th>
\t\t\t\t<th>Nap</th>
\t\t\t\t<th>Létrehozva</th>
\t\t\t</tr>
\t\t\t";
// line 19
$context['_parent'] = $context;
$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); })()));
foreach ($context['_seq'] as $context["_key"] => $context["hour"]) {
// line 20
yield "\t\t\t<tr id=\"row-";
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);
yield "\">
\t\t\t\t";
// line 21
if ((($tmp = CoreExtension::getAttribute($this->env, $this->source, $context["hour"], "isValidated", [], "any", false, false, false, 21)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
// line 22
yield "\t\t\t\t\t<td><input type=\"checkbox\" value=\"";
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);
yield "\" checked=\"\" name=\"workhours[]\" class=\"hour-checkbox\" onClick=\"check()\"></td>\t
\t\t\t\t";
} else {
// line 24
yield "\t\t\t\t\t<td><input type=\"checkbox\" value=\"";
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);
yield "\" name=\"workhours[]\" class=\"hour-checkbox\" onClick=\"check()\"></td>\t
\t\t\t\t";
}
// line 26
yield "\t\t\t\t";
if ((($tmp = CoreExtension::getAttribute($this->env, $this->source, $context["hour"], "project", [], "any", false, false, false, 26)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
// line 27
yield " \t";
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)) {
// line 28
yield "\t\t\t\t\t <td>(";
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);
yield ") ";
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);
yield " - ";
yield CoreExtension::getAttribute($this->env, $this->source, $context["hour"], "note", [], "any", false, false, false, 28);
yield "</td>\t
";
} else {
// line 30
yield " <td>";
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);
yield " - ";
yield CoreExtension::getAttribute($this->env, $this->source, $context["hour"], "note", [], "any", false, false, false, 30);
yield "</td>\t
";
}
// line 32
yield " ";
} else {
// line 33
yield "\t\t\t\t\t<td>";
yield CoreExtension::getAttribute($this->env, $this->source, $context["hour"], "note", [], "any", false, false, false, 33);
yield "</td>\t
\t\t\t\t";
}
// line 35
yield "\t\t\t\t<td id=\"hour-";
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);
yield "\">";
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);
yield "</td>\t
\t\t\t\t<td id=\"other-";
// line 36
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);
yield "\">";
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);
yield "</td>\t
\t\t\t\t<td id=\"sum-";
// line 37
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);
yield "\">";
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);
yield "</td>\t
\t\t\t\t<td>";
// line 38
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)) : ("-"));
yield "</td>\t
\t\t\t\t<td>";
// line 39
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);
yield "</td>\t
\t\t\t\t";
// line 40
if ((($tmp = CoreExtension::getAttribute($this->env, $this->source, $context["hour"], "isValidated", [], "any", false, false, false, 40)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
// line 41
yield "\t\t\t\t\t";
$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));
// line 42
yield "\t\t\t\t\t";
$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)));
yield "\t\t
\t\t\t\t";
}
// line 44
yield "\t\t\t
\t\t\t</tr>
\t\t\t";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_key'], $context['hour'], $context['_parent']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 47
yield "\t\t\t<tfoot style=\"background-color: #fafafafa\">
\t\t\t\t<tr>
\t\t\t\t\t<td colspan=\"2\"><strong>Összesen</strong></td>
\t\t\t\t\t<td id=\"sumHours\" >";
// line 50
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);
yield "</td>
\t\t\t\t\t<td id=\"sumHours\" >";
// line 51
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);
yield "</td>
\t\t\t\t\t<td></td>
\t\t\t\t</tr>
\t\t\t\t<tr>
\t\t\t\t\t<td colspan=\"2\"><strong>Órabér</strong></td>
\t\t\t\t\t<td>";
// line 56
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);
yield "</td>
\t\t\t\t\t<td><input type=\"number\" name=\"priceHour\" id=\"priceHour\" value=\"";
// line 57
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);
yield "\"></td>
\t\t\t\t\t<td><input type=\"number\" name=\"priceHour\" id=\"priceHour\" value=\"";
// line 58
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);
yield "\"></td>
\t\t\t\t</tr>
\t\t\t\t<tr>
\t\t\t\t\t<td colspan=\"2\"><strong>Fizetendő óra</strong></td>
\t\t\t\t\t<td id=\"sumHoursPrice\">";
// line 62
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);
yield "</td>
\t\t\t\t\t<td colspan=\"2\"><strong>Fizetendő óra</strong></td>
\t\t\t\t\t<td id=\"sumHoursPrice\">";
// line 64
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);
yield "</td>
\t\t\t\t\t<td></td>
\t\t\t\t</tr>
\t\t\t\t<tr>
\t\t\t\t\t<td colspan=\"2\"><strong>Egyéb költség</strong></td>
\t\t\t\t\t<td id=\"sumOther\">";
// line 69
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);
yield "</td>
\t\t\t\t\t<td id=\"sumOther\">";
// line 70
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);
yield "</td>
\t\t\t\t\t<td></td>
\t\t\t\t</tr>
\t\t\t\t<tr>
\t\t\t\t\t<td colspan=\"2\"><strong>Teljes fizetendő összeg</strong></td>
\t\t\t\t\t<td><strong id=\"sumTotalStrong\">";
// line 75
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);
yield "</strong></td>
\t\t\t\t\t<td><input type=\"hidden\" name=\"sumTotal\" id=\"sumTotal\" value=\"";
// line 76
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);
yield "\"></td>
\t\t\t\t</tr>
\t\t\t</tfoot>
\t\t</table>
\t\t<input type=\"submit\" name=\"submit\" value=\"Fizetés\" class=\"btn btn-info\">
\t</form>
<script type=\"text/javascript\">
\tfunction check(){
\t\t\$('#sumTotal').val(0);
\t\tvar total = 0;
\t\tvar sumHours = 0;
\t\tvar sumHoursPrice = 0;
\t\tvar sumOther = 0;
\t\tvar priceHour = parseInt(\$('#priceHour').val())
\t\t\$('.hour-checkbox:checked').each(function(key,chk){
\t\t\tvar price = parseInt(\$('#sum-'+chk.value).html())
\t\t\tvar other = parseInt(\$('#other-'+chk.value).html())
\t\t\tvar hour = parseFloat(\$('#hour-'+chk.value).html())
\t\t\ttotal = total + price;
\t\t\tif(other > 0){
\t\t\t\tsumOther = sumOther + other;
\t\t\t}
\t\t\tsumHours = sumHours + hour;
\t\t\tsumHoursPrice = sumHoursPrice + (hour*priceHour);
\t\t\t\$('#sumTotalStrong').html(total);
\t\t\t\$('#sumOther').html(sumOther);
\t\t\t\$('#sumHours').html(sumHours);
\t\t\t\$('#sumHoursPrice').html(sumHoursPrice);
\t\t})
\t}
</script>
<script type=\"text/javascript\">
\tfunction check(){
\t\tvar sumTotal = document.getElementById('sumTotal')
\t\tsumTotal.value = 0;
\t\tvar total = 0;
\t\tvar sumHours = 0;
\t\tvar sumHoursPrice = 0;
\t\tvar sumOther = 0;
\t\tvar priceHour = document.getElementById('priceHour')
\t\tvar priceHour = parseInt(priceHour.value)
\t\tvar checked = document.querySelectorAll('.hour-checkbox:checked')
\t\tchecked.forEach(function(chk, key){
\t\t\tconsole.log(key, chk, chk.value)
\t\t\tvar price = parseInt(document.getElementById('sum-'+chk.value).innerHTML)
\t\t\tvar other = parseInt(document.getElementById('other-'+chk.value).innerHTML)
\t\t\tvar hour = parseFloat(document.getElementById('hour-'+chk.value).innerHTML)
\t\t\ttotal = total + price;
\t\t\tif(other > 0){
\t\t\t\tsumOther = sumOther + other;
\t\t\t}
\t\t\tsumHours = sumHours + hour;
\t\t\tsumHoursPrice = sumHoursPrice + (hour*priceHour);
\t\t\tdocument.getElementById('sumTotalStrong').innerHTML = total;
\t\t\tdocument.getElementById('sumOther').innerHTML = sumOther;
\t\t\tdocument.getElementById('sumHours').innerHTML = sumHours;
\t\t\tdocument.getElementById('sumHoursPrice').innerHTML = sumHoursPrice;
\t\t})
\t}\t
</script>
</div>
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
yield from [];
}
/**
* @codeCoverageIgnore
*/
public function getTemplateName(): string
{
return "workhour/pay.html.twig";
}
/**
* @codeCoverageIgnore
*/
public function isTraitable(): bool
{
return false;
}
/**
* @codeCoverageIgnore
*/
public function getDebugInfo(): array
{
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,);
}
public function getSourceContext(): Source
{
return new Source("{% extends '@!EasyAdmin/page/content.html.twig' %}
{% block page_content %}
<div>
\t<h2>{{worker}}</h2>
\t<form method=\"post\">
\t\t<table class=\"table\">
\t\t{% set sum=0 %}
\t\t{% set sumOther=0 %}
\t\t\t<tr>
\t\t\t\t<th>Kifizet</th>
\t\t\t\t<th>Projekt</th>
\t\t\t\t<th>Idő</th>
\t\t\t\t<th>Egyéb költség</th>
\t\t\t\t<th>Összesen</th>
\t\t\t\t<th>Nap</th>
\t\t\t\t<th>Létrehozva</th>
\t\t\t</tr>
\t\t\t{% for hour in hours %}
\t\t\t<tr id=\"row-{{hour.id}}\">
\t\t\t\t{% if hour.isValidated %}
\t\t\t\t\t<td><input type=\"checkbox\" value=\"{{hour.id}}\" checked=\"\" name=\"workhours[]\" class=\"hour-checkbox\" onClick=\"check()\"></td>\t
\t\t\t\t{% else %}
\t\t\t\t\t<td><input type=\"checkbox\" value=\"{{hour.id}}\" name=\"workhours[]\" class=\"hour-checkbox\" onClick=\"check()\"></td>\t
\t\t\t\t{% endif %}
\t\t\t\t{% if hour.project %}
\t{% if hour.project.customer %}
\t\t\t\t\t <td>({{hour.project.customer.name}}) {{hour.project.name}} - {{hour.note|raw}}</td>\t
{% else %}
<td>{{hour.project.name}} - {{hour.note|raw}}</td>\t
{% endif %}
{% else %}
\t\t\t\t\t<td>{{hour.note|raw}}</td>\t
\t\t\t\t{% endif %}
\t\t\t\t<td id=\"hour-{{hour.id}}\">{{hour.hours}}</td>\t
\t\t\t\t<td id=\"other-{{hour.id}}\">{{hour.otherPrice}}</td>\t
\t\t\t\t<td id=\"sum-{{hour.id}}\">{{(hour.hours*worker.priceHour)+hour.otherPrice}}</td>\t
\t\t\t\t<td>{{hour.day?hour.day.format('Y-m-d'):'-'}}</td>\t
\t\t\t\t<td>{{hour.created.format('Y-m-d')}}</td>\t
\t\t\t\t{% if hour.isValidated %}
\t\t\t\t\t{% set sum = sum + hour.hours %}
\t\t\t\t\t{% set sumOther = sumOther + (hour.otherPrice?hour.otherPrice:0) %}\t\t
\t\t\t\t{% endif %}
\t\t\t
\t\t\t</tr>
\t\t\t{% endfor %}
\t\t\t<tfoot style=\"background-color: #fafafafa\">
\t\t\t\t<tr>
\t\t\t\t\t<td colspan=\"2\"><strong>Összesen</strong></td>
\t\t\t\t\t<td id=\"sumHours\" >{{sum}}</td>
\t\t\t\t\t<td id=\"sumHours\" >{{sum}}</td>
\t\t\t\t\t<td></td>
\t\t\t\t</tr>
\t\t\t\t<tr>
\t\t\t\t\t<td colspan=\"2\"><strong>Órabér</strong></td>
\t\t\t\t\t<td>{{worker.priceHour|format_currency('HUF',{fraction_digit: 0}, locale='hu')}}</td>
\t\t\t\t\t<td><input type=\"number\" name=\"priceHour\" id=\"priceHour\" value=\"{{worker.priceHour}}\"></td>
\t\t\t\t\t<td><input type=\"number\" name=\"priceHour\" id=\"priceHour\" value=\"{{worker.priceHour}}\"></td>
\t\t\t\t</tr>
\t\t\t\t<tr>
\t\t\t\t\t<td colspan=\"2\"><strong>Fizetendő óra</strong></td>
\t\t\t\t\t<td id=\"sumHoursPrice\">{{(sum*worker.priceHour)|format_currency('HUF',{fraction_digit: 0}, locale='hu')}}</td>
\t\t\t\t\t<td colspan=\"2\"><strong>Fizetendő óra</strong></td>
\t\t\t\t\t<td id=\"sumHoursPrice\">{{(sum*worker.priceHour)|format_currency('HUF',{fraction_digit: 0}, locale='hu')}}</td>
\t\t\t\t\t<td></td>
\t\t\t\t</tr>
\t\t\t\t<tr>
\t\t\t\t\t<td colspan=\"2\"><strong>Egyéb költség</strong></td>
\t\t\t\t\t<td id=\"sumOther\">{{sumOther|format_currency('HUF',{fraction_digit: 0}, locale='hu')}}</td>
\t\t\t\t\t<td id=\"sumOther\">{{sumOther|format_currency('HUF',{fraction_digit: 0}, locale='hu')}}</td>
\t\t\t\t\t<td></td>
\t\t\t\t</tr>
\t\t\t\t<tr>
\t\t\t\t\t<td colspan=\"2\"><strong>Teljes fizetendő összeg</strong></td>
\t\t\t\t\t<td><strong id=\"sumTotalStrong\">{{((sum*worker.priceHour)+sumOther)|format_currency('HUF',{fraction_digit: 0}, locale='hu')}}</strong></td>
\t\t\t\t\t<td><input type=\"hidden\" name=\"sumTotal\" id=\"sumTotal\" value=\"{{(sum*worker.priceHour)+sumOther}}\"></td>
\t\t\t\t</tr>
\t\t\t</tfoot>
\t\t</table>
\t\t<input type=\"submit\" name=\"submit\" value=\"Fizetés\" class=\"btn btn-info\">
\t</form>
<script type=\"text/javascript\">
\tfunction check(){
\t\t\$('#sumTotal').val(0);
\t\tvar total = 0;
\t\tvar sumHours = 0;
\t\tvar sumHoursPrice = 0;
\t\tvar sumOther = 0;
\t\tvar priceHour = parseInt(\$('#priceHour').val())
\t\t\$('.hour-checkbox:checked').each(function(key,chk){
\t\t\tvar price = parseInt(\$('#sum-'+chk.value).html())
\t\t\tvar other = parseInt(\$('#other-'+chk.value).html())
\t\t\tvar hour = parseFloat(\$('#hour-'+chk.value).html())
\t\t\ttotal = total + price;
\t\t\tif(other > 0){
\t\t\t\tsumOther = sumOther + other;
\t\t\t}
\t\t\tsumHours = sumHours + hour;
\t\t\tsumHoursPrice = sumHoursPrice + (hour*priceHour);
\t\t\t\$('#sumTotalStrong').html(total);
\t\t\t\$('#sumOther').html(sumOther);
\t\t\t\$('#sumHours').html(sumHours);
\t\t\t\$('#sumHoursPrice').html(sumHoursPrice);
\t\t})
\t}
</script>
<script type=\"text/javascript\">
\tfunction check(){
\t\tvar sumTotal = document.getElementById('sumTotal')
\t\tsumTotal.value = 0;
\t\tvar total = 0;
\t\tvar sumHours = 0;
\t\tvar sumHoursPrice = 0;
\t\tvar sumOther = 0;
\t\tvar priceHour = document.getElementById('priceHour')
\t\tvar priceHour = parseInt(priceHour.value)
\t\tvar checked = document.querySelectorAll('.hour-checkbox:checked')
\t\tchecked.forEach(function(chk, key){
\t\t\tconsole.log(key, chk, chk.value)
\t\t\tvar price = parseInt(document.getElementById('sum-'+chk.value).innerHTML)
\t\t\tvar other = parseInt(document.getElementById('other-'+chk.value).innerHTML)
\t\t\tvar hour = parseFloat(document.getElementById('hour-'+chk.value).innerHTML)
\t\t\ttotal = total + price;
\t\t\tif(other > 0){
\t\t\t\tsumOther = sumOther + other;
\t\t\t}
\t\t\tsumHours = sumHours + hour;
\t\t\tsumHoursPrice = sumHoursPrice + (hour*priceHour);
\t\t\tdocument.getElementById('sumTotalStrong').innerHTML = total;
\t\t\tdocument.getElementById('sumOther').innerHTML = sumOther;
\t\t\tdocument.getElementById('sumHours').innerHTML = sumHours;
\t\t\tdocument.getElementById('sumHoursPrice').innerHTML = sumHoursPrice;
\t\t})
\t}\t
</script>
</div>
{% endblock page_content %}", "workhour/pay.html.twig", "/home/gortech.hu/domains/munka.gortech.hu/public_html/erp/templates/workhour/pay.html.twig");
}
}