diff --git a/app/helpers/reporting_helper.rb b/app/helpers/reporting_helper.rb index 510b1fdd2b..3d6b98016c 100644 --- a/app/helpers/reporting_helper.rb +++ b/app/helpers/reporting_helper.rb @@ -66,6 +66,11 @@ module ReportingHelper @show_row[key][value] ||= field_representation_map(key, value) end + def raw_field(key, value) + @raw_row ||= Hash.new { |h,k| h[k] = {}} + @raw_row[key][value] ||= field_sort_map(key, value) + end + def cost_object_link(cost_object_id) co = CostObject.find(cost_object_id) if User.current.allowed_to_with_inheritance?(:view_cost_objects, co.project) @@ -98,6 +103,15 @@ module ReportingHelper end end + def field_sort_map(key, value) + return "" if value.blank? + case key.to_sym + when :issue_id, :tweek, :tmonth, :week then value.to_i + when :spent_on then value.to_date.mjd + else field_representation_map(key, value) + end + end + def show_result(row, unit_id = @unit_id) case unit_id when -1 then l_hours(row.units) diff --git a/app/views/cost_reports/_cost_entry_table.rhtml b/app/views/cost_reports/_cost_entry_table.rhtml index d8f164918b..390c8a56e7 100644 --- a/app/views/cost_reports/_cost_entry_table.rhtml +++ b/app/views/cost_reports/_cost_entry_table.rhtml @@ -23,9 +23,13 @@
<% @query.each_direct_result do |result| %>