Venta

<% if @sale.reserved? %> <%= link_to sales_reserved_path(:filter => @filter, :current_page => @current_page), {:class=>"fr-space btn blue-hoki "} do %> Regresar <% end %> <% else %> <%= link_to sales_path(:filter => @filter, :current_page => @current_page), {:class=>"fr-space btn blue-hoki "} do %> Regresar <% end %> <% end %>
Información de la venta
<%= @sale.sale_code %>
<%= @sale.customer.nick_name %>
<%= @sale.user.first_name %>
<%= l(@sale.date_sale, :format => '%A, %d de %B de %Y') %>
<%= @sale.products.count %> producto(s)
<% if @sale.saletype == "credit" && @sale.credit_note.blank? %> Venta a crédito <% elsif @sale.saletype == "credit" && @sale.credit_note.present? %> Crédito/vale <% elsif @sale.saletype == "cash" %> Venta a contado <% elsif @sale.saletype == "reserved" %> Apartado <% end %>
<%= number_to_currency(@sale.total, precision: 2) %>
<%= sale_status(@sale) %>
<% if @sale.credit_note.present? %>
Folio vale: <%= @sale.credit_note %>
<% end %>
Detalle de los productos
<% @sale.sales_details.each_with_index do |detail, key| %> <% end %>
# SKU Imagen Producto Cantidad Precio IVA Descuento Importe
<%= key + 1 %> <%= detail.product.sku %> <%= detail.product.name %>
<%= detail.product.display_attributes %> <% if @returned_prods_ids.include?(detail.product_id) %> <% end %>
<%= detail.quantity.round %> <%= number_to_currency(detail.unit_price, precision: 2) %> <%= number_to_currency(detail.tax, precision: 2) %> <%= number_to_currency(detail.discount, precision: 2) %> <%= number_to_currency(detail.total, precision: 2) %>
<% if @products_return.present? %>
Detalle de devolución
  • Monto devuelto <%= number_to_currency(@products_return.returned_amount, precision: 2) %>
  • Nuevo monto <%= number_to_currency(@products_return.new_amount, precision: 2) %>
  • Diferencia <%= number_to_currency(@products_return.difference_amount, precision: 2) %>

Productos devueltos

<% @products_return.products_return_ins.each do |detail| %> <% end %>
Cantidad Imagen Producto Monto Razón Destino
<%= detail.quantity.round %> <%= detail.product.name %>
<%= detail.product.display_attributes %>
<%= number_to_currency(detail.amount, precision: 2) %> <%= detail.reason %> <%= detail.is_wasted? ? 'Merma' : 'Inventario' %>

Productos por cambio

<% @products_return.products_return_outs.each do |detail| %> <% end %>
Cantidad Imagen Producto Monto
<%= detail.quantity.round %> <%= detail.product.name %>
<%= detail.product.display_attributes %>
<%= number_to_currency(detail.amount, precision: 2) %>
<% end %>
Detalle de pago(s)
<% @payments.each_with_index do |payment, key| %> <% end %>
# Fecha Metodo de pago Monto Info. Adicional
<%= key + 1 %> <%= l(payment.created_at, :format => '%d/%m/%y %I:%M %p') %> <%= payment.payment_method.method %> <%= number_to_currency(payment.quantity, precision: 2) %> <%= payment.cardnumber %>