Explorar el Código

round generated commission in form

jose miguel hace 9 años
padre
commit
cf3a3c878e
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      app/views/commissions/_form.html.erb

+ 1 - 1
app/views/commissions/_form.html.erb

@@ -57,7 +57,7 @@
                             <% @sellers.each_with_index do |seller, key| %>
                               <tr>
                                 <% sales_by_period = seller.get_sales_by_period(@initial_date, @final_date, 'commission') %>
-                                <% commission_calculated = (@pos_config.commission_percent / 100.0) *sales_by_period.sum(:total) %>
+                                <% commission_calculated = ((@pos_config.commission_percent / 100.0) *sales_by_period.sum(:total)).round(2) %>
                                 <td> <%= key +1 %> </td>
                                 <td> <%= seller.name %> </td>
                                 <td> <%= sales_by_period.count %> </td>