%table.table.table-hover
  %thead
    %tr
      %th.left Fiscal Year
      %th.left Type
      %th.left Sub Type
      %th.right Count
      %th.right Book Value
      %th.right Replacement Cost
  %tbody
    - sum_cost = 0
    - sum_book_val = 0
    - assets.group_by(&:asset_subtype).each do |subtype, assets_by_subtype|
      %tr{:data => {:target => "#{org.id}_#{subtype.id}"}}
        %td.left= format_as_fiscal_year(@data.fy)
        %td.left= subtype.asset_type
        %td.left= subtype
        %td.right= format_as_integer(assets_by_subtype.count)
        - cost = assets_by_subtype.sum{ |a| a.estimated_replacement_cost.to_i }
        - book_val = assets_by_subtype.sum{ |a| a.book_value.to_i }
        - sum_cost += cost
        - sum_book_val += book_val
        %td.right= format_as_currency(book_val)
        %td.right= format_as_currency(sum_book_val)
  %tfoot
    %tr
      %td{:colspan => 3}
      %td.right= format_as_integer(assets.count)
      %td.right= format_as_currency(sum_book_val)
      %td.right= format_as_currency(sum_cost)

%table.table.table-hover
  %thead
    %tr
      %th.left Fiscal Year
      %th.left Type
      %th.left Sub Type
      %th.right Count
      %th.right Book Value
      %th.right Replacement Cost
  %tbody
    - sum_cost = 0
    - sum_book_val = 0
    - assets.group_by(&:asset_subtype).each do |subtype, assets_by_subtype|
      %tr{:data => {:target => "#{org.id}_#{subtype.id}"}}
        %td.left= format_as_fiscal_year(@data.fy)
        %td.left= subtype.asset_type
        %td.left= subtype
        %td.right= format_as_integer(assets_by_subtype.count)
        - cost = assets_by_subtype.sum{ |a| a.estimated_replacement_cost.to_i }
        - book_val = assets_by_subtype.sum{ |a| a.book_value.to_i }
        - sum_cost += cost
        - sum_book_val += book_val
        %td.right= format_as_currency(book_val)
        %td.right= format_as_currency(cost)
  %tfoot
    %tr
      %td{:colspan => 3}
      %td.right= format_as_integer(assets.count)
      %td.right= format_as_currency(sum_book_val)
      %td.right= format_as_currency(sum_cost)

Remove bug in asset report summary
Remove bug in asset report summary
