_pre_sale.html.erb 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <tr id="pre_sale_<%= pre_sale.id %>">
  2. <td> # <%= hidden_field_tag "amount_" + pre_sale.id.to_s, pre_sale.amount %></td>
  3. <td><%= pre_sale.product.sku %></td>
  4. <td class="text-center"><img src="<%= pre_sale.product.small_img %>" width="100" height="100"/></td>
  5. <td>
  6. <%= pre_sale.product.name %><br>
  7. <%= pre_sale.product.display_attributes %>
  8. </td>
  9. <td>
  10. <input type="number" min="1" id="quantity_<%= pre_sale.id %>" class="form-control input-xsmall" id="quantity_<%= pre_sale.id %>" oninput="calculatePrice($(this))" value="<%= pre_sale.quantity %>" pattern="^[0-9]*[1-9][0-9]*$" title="La cantidad debe de ser mayor o igual a 1" required>
  11. </td>
  12. <td>
  13. <label><%= number_to_currency(pre_sale.unit_price, precision: 2) %></label>
  14. <%= hidden_field_tag('unit_price', pre_sale.unit_price, { id: "unit_price_" + pre_sale.id.to_s }) %>
  15. </td>
  16. <td class="hidden">
  17. <label><%= number_to_currency(pre_sale.tax, precision: 2) %></label>
  18. <%= hidden_field_tag('tax', pre_sale.tax, { id: "tax_" + pre_sale.id.to_s }) %>
  19. </td>
  20. <td>
  21. <label><%= number_to_currency(pre_sale.discount, precision: 2) %></label>
  22. <%= hidden_field_tag('discount', pre_sale.discount, { id: "discount_" + pre_sale.id.to_s }) %>
  23. </td>
  24. <td>
  25. <label><%= number_to_currency(pre_sale.total, precision: 2) %></label>
  26. <%= hidden_field_tag('total', pre_sale.total, { id: "total_" + pre_sale.id.to_s }) %>
  27. </td>
  28. <td style="width:5%">
  29. <% if @pos_config.enable_haggle? && pre_sale.haggle.zero? && pre_sale.haggle_percent.zero? %>
  30. <%= link_to add_sale_haggle_path(pre_sale), :remote => true, :class => "btn btn-icon-only btn-primary hagglebutton", :title=>"Agregar regate" do %>
  31. <i class="fa fa-tag"></i>
  32. <% end %>
  33. <% else %>
  34. <%= pre_sale_haggle_type(pre_sale) %>
  35. <% end %>
  36. <button type="button" class="btn btn-icon-only btn-danger" onclick="deleteRow($(this))"><i class="fa fa-trash-o"></i></button>
  37. </td>
  38. </tr>