fix crash on exporting costs to xls

git-svn-id: https://dev.finn.de/svn/cockpit/trunk@1066 7926756e-e54e-46e6-9721-ed318f58905e
pull/6827/head
t.felgentreff 15 years ago
parent ac63175a4a
commit cad11aa688
  1. 2
      lib/xls_report/issues_controller_patch.rb

@ -44,7 +44,7 @@ module XlsReport
h = h.to_s.downcase h = h.to_s.downcase
if (h =~ /.*hours.*/ or h == "spent_time") if (h =~ /.*hours.*/ or h == "spent_time")
sb.add_format_option_to_column idx, :number_format => "0.0 h" sb.add_format_option_to_column idx, :number_format => "0.0 h"
elsif ((h =~ /.*cost.*/) and ['Fixnum', 'Float', 'Integer'].include?(columns[idx].value(issues.first).class.name)) elsif (h =~ /.*cost.*/)
sb.add_format_option_to_column idx, :number_format => number_to_currency(0.00) sb.add_format_option_to_column idx, :number_format => number_to_currency(0.00)
end end
end end

Loading…
Cancel
Save