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