{% spaceless %}
{# шестерёнка у сотрудника #} {% if 1 == 1 %} {% endif %} {% set jobman = user_v[0]['jobman'] %} {% set jobman_fio = user_v[0]['fio'] %} {% if user_v[0]['fio'] is not empty %}{{ user_v[0]['fio'] }}{% else %}{{ user_v[0]['iiko_name'] }}{% endif %} {#{{ pa(user_v[0]) }}#}
{{ user_v[0]['dolgnost_name'] }} {% if user_v[0]['position_calc_auto'] is not empty %}ФОТ{% endif %}
{#{{ pa(user_v[0]) }}#} {% if user_v[0]['type'] == 'spec' %} {% else %} {# запуск должности только если она была ранее даты старта #} {% if user_v[0]['date']|date('U') <= date_start|date('U') %} {% set now_dolgn = user_v[0] %} {% else %} {% set now_dolgn = '' %} {% endif %} {% endif %} {#{{ pa( now_dolgn ) }}#} {#{{ pa(user_v) }}#}
{% set no_job = false %} {% for i in range(low=0, high=31, step=1) %} {% set date = date_start|date_modify("+"~i~" day")|date("Y-m-d") %} {% if date <= date_finish %} {#{% if 1 == 1 %}#}
{% set new_dolgn = '' %} {#{{ pa(user_v,2) }}#} {% for k3,i in user_v if i['date'] == date %} {#{% if user_id == 95252 %}{{ pa(i) }}{% endif %}#} {#{{ pa(now_dolgn) }}#} {% if i['type'] == 'spec' %} {#spec {{ pa(i) }}#} {% else %} {% if 1 == 2 and now_dolgn != i %} {#{% set i = now_dolgn %}#} {% include dir_mod_now_mod_ditpl~'body.2007.1sp.1worker.new_dolgnost.htm' %} {% endif %} {#{% include dir_mod_now_mod_ditpl~'body.2007.1sp.1worker.new_dolgnost.htm' %}#} {#{{ pa(i) }}#} {% set now_dolgn = i %} {% set new_dolgn = 1 %} {% endif %} {% endfor %} {#{{ pa(now_dolgn) }}#} {% set now_spec = '' %} {% if jobmans.data.spec[jobman_id] is defined %} {% for k3 , i in jobmans.data.spec[jobman_id] if i.date == date %} {#{% if jobman_id == 241 %} {{ pa(i) }} {% endif %}#} {#{% if jobman_id == 101362 %} {{ pa(i) }} {% endif %}#} {#{% include dir_mod_now_mod_ditpl~'body.2007.1sp.1worker.new_spec.htm' %}#} {#22spec {{ pa(i) }}#} {% if i.sale_point == get.sp %} {% set now_spec = i %} {% else %} {% include dir_mod_now_mod_ditpl~'body.2007.1sp.1worker.new_spec.htm' %} {% endif %} {% endfor %} {% endif %} {# если работает на другой точке и нет спец назначения на эту #} {% if now_dolgn.sale_point is defined and now_dolgn.sale_point != get.sp and now_spec == '' %} {#norm {{ pa(now_dolgn) }}#} {#spec {{ pa(now_spec) }}#} {#+++ на другой точке#}
{{ sps[now_dolgn.sale_point]['head'] }} {{ now_dolgn.dolgnost_name }}
{% else %} {#{% if jobman_id == 517 %} now_dolgn {{ pa(now_dolgn) }} now_spec {{ pa(now_spec) }} {% endif %}#} {% if now_dolgn != '' or ( now_spec.sale_point is defined and now_spec.sale_point == get.sp ) %} {% include dir_mod_now_mod_ditpl~'body.2007.1sp.1worker.day_option.htm' %} {% endif %} {% if now_dolgn != '' and new_dolgn != '' %} {% set i = now_dolgn %} {% for k3,i22 in user_v if i22['date'] == date %} {% if i['type'] == 'spec' %} {% else %} {% if i22 != i %} {% set i23 = i %} {% set i = i22 %} {% include dir_mod_now_mod_ditpl~'body.2007.1sp.1worker.new_dolgnost.htm' %} {% set i = i23 %} {% endif %} {% endif %} {% endfor %} {% include dir_mod_now_mod_ditpl~'body.2007.1sp.1worker.new_dolgnost.htm' %} {% endif %} {% if now_spec != '' %} {#{{ pa(now_spec) }}#} {% set i = now_spec %} {% include dir_mod_now_mod_ditpl~'body.2007.1sp.1worker.new_spec.htm' %} {% endif %} {#{{ pa(jobdesc_metki) }}#} {% if now_dolgn != '' or now_spec != '' %} {#
122++#} {#{{ pa(now_dolgn) }}#} {% for p, i in actions.data.actions if i.jobman == jobman_id and i.sale_point == get.sp and i.date == date and i.type == 'metki' %} {% include dir_mod_now_mod_ditpl~'body.2007.1sp.1worker.'~i.type~'.htm' %} {#{{ pa(i,2) }}#} {#{{ pa(a_menu['072.metki'],2) }}#} {% endfor %} {% set i2 = 0 %} {% set n1 = 1 %} {#{% set skip = [] %}#} {% set last_id = 0 %} {% for p, i in actions.data.actions if i.jobman == jobman_id and i.date == date and i.type == 'check' %} {% if i.spec_sp > 0 and i.spec_sp != get.sp and i.sale_point == '' %} {#+++ на другой точке#}
рабочая смена на {{ sps[i.spec_sp]['head'] }}
{% elseif i.sale_point != '' and i.sale_point != sp_now %} {#+++ на другой точке#}
рабочая смена на {{ sps[i.sale_point]['head'] }}
{% else %} {% if last_id != i.id %} {#
141++ {{ p }} / {{ last_id }} / {{ i.id }}#} {% set last_id = i.id %} {% if i.sale_point == '' or i.sale_point == get.sp %} {% set i2 = i %} {% endif %} {#{% set skip = skip|merge({ i['id'] }) %}#} {% include dir_mod_now_mod_ditpl~'body.2007.1sp.1worker.'~i.type~'.htm' %} {% endif %} {#{{ pa(i,2) }}#} {% endif %} {% endfor %} {% if i2 != 0 %} {% set auto_bonus = jobdesc__calcAutoBonus( db, get.sp, i2 ) %} {#{{ pa(auto_bonus) }}#} {% include dir_mod_now_mod_ditpl~'body.2007.1sp.1worker.plus.auto.htm' %} {% set auto_bonus = [] %} {% endif %} {% for p, i in actions.data.actions if i.jobman == jobman_id and i.date == date and ( i.type == 'minus' or i.type == 'plus' or i.type == 'comment' ) %} {#
162++#} {% include dir_mod_now_mod_ditpl~'body.2007.1sp.1worker.'~i.type~'.htm' %} {% endfor %} {% endif %} {% endif %} {% if date == now_dolgn.date_finish %}
конец назначения (крайний день в должности)
{#{{ pa(now_dolgn) }}#} {% set now_dolgn = '' %} {% endif %} {#delivery_{{ jobman_id }}_{{ date }}#}
{% endif %} {% endfor %}
{% endspaceless %}