<%# Settings for redmine_qbo_bonus (Administration » Plugins » Configure) %> <% s = RedmineQboBonus::Settings %> <% field = ->(key) { "settings[#{key}]" } %>

<%= link_to sprite_icon('user', l(:label_bonus_technician_plural)), bonus_technicians_path, class: 'icon icon-user' %> <%= link_to sprite_icon('time', l(:label_tech_bonus_plural)), tech_bonuses_path, class: 'icon icon-time' %>

<%= l(:label_tech_bonus_hours_counted) %>

<%= hidden_field_tag "#{field.call('project_ids')}[]", '', id: nil %> <%= select_tag "#{field.call('project_ids')}[]", project_tree_options_for_select(Project.active.sorted.to_a, selected: Project.where(id: s.project_ids).to_a), multiple: true, size: 8, id: 'qbo_bonus_projects' %> <%= l(:text_tech_bonus_projects) %>

<%= hidden_field_tag field.call('include_subprojects'), '0', id: nil %> <%= check_box_tag field.call('include_subprojects'), '1', s.include_subprojects?, id: 'qbo_bonus_subprojects' %>

<%= select_tag field.call('tracker_mode'), options_for_select([[l(:label_tech_bonus_trackers_exclude), 'exclude'], [l(:label_tech_bonus_trackers_include), 'include']], s.tracker_mode), id: 'qbo_bonus_tracker_mode' %>
<%= hidden_field_tag "#{field.call('tracker_ids')}[]", '', id: nil %> <%= select_tag "#{field.call('tracker_ids')}[]", options_from_collection_for_select(Tracker.sorted, :id, :name, s.tracker_ids), multiple: true, size: 8, id: 'qbo_bonus_trackers' %> <%= l(:text_tech_bonus_trackers) %>

<%= hidden_field_tag "#{field.call('user_ids')}[]", '', id: nil %> <%= select_tag "#{field.call('user_ids')}[]", options_from_collection_for_select(User.active.sorted, :id, :name, s.user_ids), multiple: true, size: 8, id: 'qbo_bonus_users' %> <%= l(:text_tech_bonus_users) %>

<%= l(:label_tech_bonus_target) %>

<%= number_field_tag field.call('goal_hours'), RedmineQboBonus.format_hours(s.goal_hours), id: 'qbo_bonus_goal', min: 0, step: 0.25, style: 'width: 6em' %> <%= l(:text_tech_bonus_goal) %>

<%= number_field_tag field.call('tier_hours'), RedmineQboBonus.format_hours(s.tier_hours), id: 'qbo_bonus_tier', min: 0.25, step: 0.25, style: 'width: 6em' %> <%= l(:text_tech_bonus_tier) %>

<% BonusTechnician::ROLES.each do |role| %>

<%= number_field_tag field.call("#{role}_amount"), RedmineQboBonus.format_hours(s.amount(role)), id: "qbo_bonus_#{role}_amount", min: 0, step: 0.01, style: 'width: 6em' %> <%= l(:label_tech_bonus_per_tier) %> <%= number_field_tag field.call("#{role}_tier_amount"), RedmineQboBonus.format_hours(s.tier_amount(role)), id: "qbo_bonus_#{role}_tier_amount", min: 0, step: 0.01, style: 'width: 6em' %>

<% end %>
<%= l(:label_tech_bonus_credit_memo) %>

<%= select_tag field.call('item_id'), options_from_collection_for_select(Item.sellable.order(:name), :id, :name, s.item_id), include_blank: true, id: 'qbo_bonus_item' %> <%= l(:text_tech_bonus_item) %>

<%= text_area_tag field.call('customer_memo'), s.customer_memo, id: 'qbo_bonus_memo', rows: 2, cols: 60 %>

<%= hidden_field_tag field.call('email_credits'), '0', id: nil %> <%= check_box_tag field.call('email_credits'), '1', s.email_credits?, id: 'qbo_bonus_email' %> <%= l(:text_tech_bonus_email_credits) %>