class="danger"<% end %> >
| # |
<%= purchase.purchase_code %> |
<%= purchase.user.first_name%> |
<% if current_user.usertype == "A" || current_user.usertype == "SS" %>
<%= purchase.pointsale.present? ? purchase.pointsale.name : '' %> |
<%= purchase.warehouse.present? ? purchase.warehouse.name : '' %> |
<% end %>
<%= purchase.supplier.nick_name %> |
<%= number_to_currency(purchase.total, precision: 2) %> <%= purchase.is_in_dollars ? 'USD' : 'MXN' %> |
<%= l(purchase.purchase_date, format: '%d/%B/%Y') %> |
<% case purchase.status %>
<% when "paid"%>
Pagada
<% when "cancelled"%>
Cancelada
<% when "parcial"%>
Abonada
<% when "notpaid"%>
Pendiente de pago
<% end %>
|
<%= link_to purchase, {:class=>"btn btn-icon-only default", :title=>"Ver compra"} do %> <% end %>
<% daysToCancel = @pos_config.days_cancel_purchase %>
<% if (can? :manage, Purchase) && (purchase.purchase_date + daysToCancel.days >= Date.today) && !purchase.cancelled? %>
<%= link_to purchase_path(purchase), method: :delete, :class => "btn btn-icon-only btn-danger", :title=>"Cancelar compra", data: { confirm: '¿Está seguro de cancelar la compra?' } do %> <% end %>
<% end %>
|