Merge pull request #73 from HDinger/fix/20697-labor-gets-default

[20697] Make "labor" default not "costs" in cost reports
pull/6827/head
ulferts 9 years ago
commit 39a335fecb
  1. 2
      app/controllers/cost_reports_controller.rb
  2. 6
      lib/widget/cost_types.rb

@ -145,7 +145,7 @@ class CostReportsController < ApplicationController
cost_type_filter.values.first.to_i if cost_type_filter
end
@unit_id = 0 unless @cost_types.include? @unit_id
@unit_id = -1 unless @cost_types.include? @unit_id
end
# Determine the active cost type, if it is not labor or money, and add a hidden filter to the query

@ -31,11 +31,11 @@ class Widget::CostTypes < Widget::Base
def contents
content_tag :div do
available_cost_type_tabs(@subject).map do |id, label|
type_selection = radio_button_tag("unit", id, id == @selected_type_id)
available_cost_type_tabs(@subject).sort_by { |id, _| id }.map do |id, label|
type_selection = radio_button_tag('unit', id, id == @selected_type_id)
type_selection += label_tag "unit_#{id}", h(label)
type_selection
end.join("<br />").html_safe
end.join('<br />').html_safe
end
end
end

Loading…
Cancel
Save