%= render partial: 'tech_bonuses/styles' %> <% report = @report %> <% previous_week = @week - 1 %> <% next_week = @week + 1 %>
<%= l(:text_tech_bonus_week_in_progress, date: format_date(@week.end_date)) %>
<% end %><%= l(:text_tech_bonus_no_technicians) %> <% if User.current.admin? %><%= link_to l(:label_bonus_technician_new), new_bonus_technician_path %><% end %>
<% else %> <%= form_tag tech_bonus_week_path(@week.to_param), method: :post, id: 'tech-bonus-run' do %>| <%= l(:label_user) %> | <%= l(:field_role) %> | <%= l(:label_tech_bonus_hours) %> | <%= l(:label_tech_bonus_attended) %> | <%= l(:label_tech_bonus_base) %> | <%= l(:label_tech_bonus_tier_bonus) %> | <%= l(:label_tech_bonus_amount) %> | <%= l(:label_tech_bonus_credit_memo) %> | <%= l(:field_status) %> | |||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
<%= link_to_user tech.user %>
<% if @can_run %> <%= tech.customer&.name || l(:text_tech_bonus_no_customer) %><% end %> |
<%= tech.role_name %> | <%= bonus_hours(line.hours) %> | <% if credited %> <%= sprite_icon('checked', l(:general_text_Yes)) %> <% elsif @can_run && line.eligible? %> <%= check_box_tag 'attended[]', tech.user_id, credit.nil? || credit.message != l(:text_tech_bonus_missed_shift), id: "attended_#{tech.user_id}", disabled: !report.goal_met? %> <% end %> | <% if credited %><%= bonus_money(credit.base_amount) %> | <%= bonus_money(credit.tier_amount) %> | <%= bonus_money(credit.amount) %> | <% else %><%= bonus_money(line.base_amount) %> | <%= bonus_money(line.tier_amount) %> | <%= bonus_money(line.amount) %> | <% end %><%= @can_run ? credit_memo_link(credit) : (credit&.doc_number.presence && "##{credit.doc_number}") %> | <% if credited && @can_run %> <%= link_to sprite_icon('email', l(:button_tech_bonus_resend)), resend_tech_bonus_credit_path(credit), method: :post, class: 'icon icon-email', data: { confirm: l(:text_tech_bonus_resend_confirm) } %> <% end %> |
<%= l(:text_tech_bonus_attendance) %>
<% end %> <% if @can_run && @week.completed? %><% label = report.goal_met? ? l(:button_tech_bonus_run) : l(:button_tech_bonus_record) %> <%= submit_tag label, data: { confirm: report.goal_met? ? l(:text_tech_bonus_run_confirm) : nil } %> <% if @bonus_week %> <%= l(:text_tech_bonus_already_run, user: @bonus_week.run_by&.name, time: format_time(@bonus_week.updated_at)) %> <% end %>
<% end %> <% end %> <% end %><%= l(:label_no_data) %>
<% else %> <% tech_ids = report.technicians.map(&:user_id) %>| <%= l(:label_user) %> | <%= l(:label_tech_bonus_hours) %> |
|---|---|
| <%= report.users[user_id] ? link_to_user(report.users[user_id]) : "##{user_id}" %> <% unless tech_ids.include?(user_id) %>(<%= l(:text_tech_bonus_helping) %>)<% end %> | <%= bonus_hours(hours) %> |
| <%= l(:label_total_time) %> | <%= bonus_hours(report.total_hours) %> |