anchor.diff:          <Cell><Data ss:Type="String">Replacement Cost</Data></Cell>
         </Row>
   
  -      <% @data.assets.order(:organization_id, :asset_subtype_id).to_a.each do |asset| %>
  +      <% assets.order('organizations.short_name','fta_asset_categories.name','fta_asset_classes.name','fta_vehicle_types.name', 'asset_subtypes.name').to_a.each do |asset| %>
           <% a = Rails.application.config.asset_base_class_name.constantize.get_typed_asset(asset) %>
           <% if (!a.nil?) %>
             <Row>
               <Cell><Data ss:Type="String"><%= format_as_fiscal_year(@data.fy) %></Data></Cell>
   
               <Cell><Data ss:Type="String"><%= a.organization.short_name %></Data></Cell>
  -
  -            <Cell><Data ss:Type="String"><%= a.asset_type %></Data></Cell>
  +            <Cell><Data ss:Type="String"><%= a.fta_asset_category %></Data></Cell>
  +            <Cell><Data ss:Type="String"><%= a.fta_asset_class %></Data></Cell>
  +            <Cell><Data ss:Type="String"><%= a.fta_type %></Data></Cell>
               <Cell><Data ss:Type="String"><%= a.asset_subtype %></Data></Cell>
               <Cell><Data ss:Type="String"><%= a.asset_tag %></Data></Cell>
               <Cell><Data ss:Type="String"><%= a.description %></Data></Cell>
  
positive.code:         <Row>
            <Cell><Data ss:Type="String">Fiscal Year</Data></Cell>
            <Cell><Data ss:Type="String">Transit Agency</Data></Cell>
            <Cell><Data ss:Type="String">Type</Data></Cell>
            <Cell><Data ss:Type="String">Sub Type</Data></Cell>
            <Cell><Data ss:Type="String">Count</Data></Cell>
  
negative.code:           <Cell><Data ss:Type="String">Replacement Cost</Data></Cell>
          </Row>
          <% total_book_val = total_repl_cost = total_count = 0 %>
          <% assets = @data.assets.joins(:fta_asset_category, :fta_asset_class).joins('INNER JOIN fta_vehicle_types ON fta_vehicle_types.id = fta_type_id AND fta_type_type = "FtaVehicleType"').joins('INNER JOIN asset_subtypes ON asset_subtypes.id = transam_assets.asset_subtype_id').joins('INNER JOIN organizations ON organizations.id = transam_assets.organization_id') %>
          <% assets.group('organizations.short_name','fta_asset_categories.name','fta_asset_classes.name','fta_vehicle_types.name', 'asset_subtypes.name').count.each do |k,v| %>
            <Row>
              <Cell><Data ss:Type="String"><%= format_as_fiscal_year(@data.fy) %></Data></Cell>
              <Cell><Data ss:Type="String"><%= k[0] %></Data></Cell>
              <Cell><Data ss:Type="String"><%=  k[1] %></Data></Cell>
              <Cell><Data ss:Type="String"><%=  k[2] %></Data></Cell>
              <Cell><Data ss:Type="String"><%=  k[3] %></Data></Cell>
              <Cell><Data ss:Type="String"><%=  k[4] %></Data></Cell>
              <% total_count += v %>
              <Cell><Data ss:Type="Number"><%=  v %></Data></Cell>
              <% book_val_for_ast = assets.where(fta_vehicle_types: {name: k[3]}, asset_subtypes: {name: k[4]}).sum{ |a| a.book_value.to_i } %>
              <% total_book_val += book_val_for_ast %>
              <Cell><Data ss:Type="Number"><%= book_val_for_ast %></Data></Cell>
              <% repl_cost_for_ast = assets.where(fta_vehicle_types: {name: k[3]}, asset_subtypes: {name: k[4]}).sum{ |a| a.scheduled_replacement_cost.to_i } %>
              <% total_repl_cost += repl_cost_for_ast %>
              <Cell><Data ss:Type="Number"><%= repl_cost_for_ast %></Data></Cell>
            </Row>
          <% end %>
          <Row>
            <Cell><Data ss:Type="String"></Data></Cell>
  