Explorar o código

changed the way we get the total of products in sale

Jose Miguel Ledon Nieblas %!s(int64=9) %!d(string=hai) anos
pai
achega
1276f416be
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      app/views/sales/index.html.erb

+ 1 - 1
app/views/sales/index.html.erb

@@ -124,7 +124,7 @@
                           Apartado
                           <% end %>
                         </td>
-                        <td><%= sale.products.count %></td>
+                        <td><%= sale.sales_details.sum(:quantity).round %></td>
                         <td>
                           <% case sale.status %>
                           <% when "paid"%>