<% pointsale = sale.get_pointsale %> <% if pointsale.img_pointsale? %> <%= wicked_pdf_image_tag_for_public(pointsale.img_pointsale_url, :style => "margin-top:10px") %> <% elsif @pos_config.ticket_img? %> <%= wicked_pdf_image_tag_for_public(@pos_config.ticket_img_url, :style => "margin-top:10px") %> <% end %>

<% if sale.get_pointsale.notes.blank? %> <%= simple_format(@pos_config.ticket_description, class: 'text-center') %> <% else %> <%= simple_format(sale.get_pointsale.notes, class: 'text-center') %> <% end %>

<%= l(sale.created_at, :format => '%d/%m/%y %I:%M %p') %>   |   <%= sale.sale_code %>   |   <%= sale.seller.name %>
VENTA AL CONTADO
<% sale.sales_details.each_with_index do |detail, key| %> <% end %>
Cantidad Precio Desc. Importe
<%= truncate(detail.product.name, :length => 30, :separator => ' ', :omission => '') %>   <%= truncate(detail.product.display_attributes_receipt, :length => 20, :separator => ' ', :omission => '') %>
<%= detail.quantity.round %> <%= number_to_currency(detail.unit_price, precision: 2) %> <%= number_to_currency(detail.discount, precision: 2) %> <%= number_to_currency(((detail.unit_price * detail.quantity) - detail.discount), precision: 2) %>
<% margin = 60 %> <% if sale.tax > 0 %> <% margin = margin += 20 %> <% end %>
Subtotal $ <%= number_to_currency(sale.amount - sale.discount, precision: 2, :unit => "") %>
IVA $ <%= number_to_currency(sale.tax, precision: 2, :unit => "") %>
Total $ <%= number_to_currency(sale.total, precision: 2, :unit => "") %>
<% marginFooter = 20 %> <% sale.cash_registers_moves.each do |move| %> <% if move.payment_method.isCash? %> <% marginFooter += 80 %> <% else %> <% marginFooter += 60 %> <% end %> <% end %>
<%= move.payment_method.method %>
Recibido: <%= number_to_currency(move.received, precision: 2) %>
Pagó: <%= number_to_currency(move.quantity, precision: 2) %>
Cambio: <%= number_to_currency(move.change, precision: 2) %>
Pagó: <%= number_to_currency(move.quantity, precision: 2) %>
tarjeta nº: <%= move.cardnumber %>
<% if sale.get_pointsale.ticket_footer.blank? %> <%= simple_format(@pos_config.ticket_footer) %> <% else %> <%= simple_format(sale.get_pointsale.ticket_footer) %> <% end %>