Skip to content

Commit

Permalink
Right align total columns
Browse files Browse the repository at this point in the history
  • Loading branch information
tatheerf02 committed Nov 19, 2024
1 parent e72557a commit 7ae8045
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/views/storage_locations/_storage_location_row.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<td><%= storage_location.address %></td>
<td><%= storage_location.square_footage %></td>
<td><%= storage_location.warehouse_type %></td>
<td><%= storage_location.inventory_total_quantity(@inventory) %></td>
<td><%= number_to_currency(storage_location.inventory_total_value_in_dollars(@inventory)) %></td>
<td class="text-right"><%= storage_location.inventory_total_quantity(@inventory) %></td>
<td class="text-right"><%= number_to_currency(storage_location.inventory_total_value_in_dollars(@inventory)) %></td>
<td class="text-right">
<%= view_button_to storage_location %>
<%= edit_button_to edit_storage_location_path(storage_location) %>
Expand Down
9 changes: 5 additions & 4 deletions app/views/storage_locations/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,20 @@
<th>Address</th>
<th>Square Footage</th>
<th>Warehouse Type</th>
<th>Total Inventory</th>
<th>Fair Market Value</th>
<th class="text-right">Total Inventory</th>
<th class="text-right">Fair Market Value</th>
<th class="text-center">Actions</th>
</tr>
</thead>
<tbody>
<%= render partial: "storage_location_row", collection: @storage_locations, as: :storage_location %>
<tr>
<td colspan="4"><strong>Total</strong></td>
<td>
<td class="text-right">
<%= @storage_locations.sum { |sl| sl.inventory_total_quantity(@inventory) } %>
</td>
<td><%= number_to_currency(@storage_locations.sum(&:inventory_total_value_in_dollars)) %></td>
<td class="text-right"><%= number_to_currency(@storage_locations.sum(&:inventory_total_value_in_dollars)) %></td>
<td></td>
</tr>
</tbody>
</table>
Expand Down

0 comments on commit 7ae8045

Please sign in to comment.