index.html.erb 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <div class="page-container">
  2. <!-- BEGIN CONTENT -->
  3. <div class="page-content-wrapper">
  4. <!-- BEGIN CONTENT BODY -->
  5. <!-- BEGIN PAGE HEAD-->
  6. <div class="page-head">
  7. <div class="container-fluid">
  8. <!-- BEGIN PAGE TITLE -->
  9. <div class="page-title">
  10. <h1>Merma de productos </h1>
  11. </div>
  12. <!-- END PAGE TITLE -->
  13. </div>
  14. </div>
  15. <!-- END PAGE HEAD-->
  16. <!-- BEGIN PAGE CONTENT BODY -->
  17. <div class="page-content">
  18. <div class="container-fluid">
  19. <!-- BEGIN PAGE BREADCRUMBS -->
  20. <ul class="page-breadcrumb breadcrumb">
  21. <%= render_breadcrumbs :tag => :li, :separator => ' <i class="fa fa-circle"></i> ' %>
  22. </ul>
  23. <!-- END PAGE BREADCRUMBS -->
  24. <!-- BEGIN PAGE CONTENT INNER -->
  25. <div class="page-content-inner">
  26. <div id="notice">
  27. <% if success %>
  28. <div class="alert alert-success">
  29. <p><%= success %></p>
  30. </div>
  31. <% elsif warning %>
  32. <div class="alert alert-warning">
  33. <p><%= warning %></p>
  34. </div>
  35. <% end %>
  36. </div>
  37. <div class="row">
  38. <div class="col-md-12">
  39. <div class="portlet light ">
  40. <div class="portlet-title">
  41. <div class="caption">
  42. <i class="fa fa-list "></i>
  43. <span class="caption-subject bold uppercase">Lista de mermas</span>
  44. </div>
  45. <div class="actions">
  46. <% if can? :create, ProductWaste %>
  47. <%= link_to new_product_waste_path, {:class=>"btn bold green pull-right"} do %> Nueva Merma de producto <i class="fa fa-plus"></i><% end %>
  48. <% end %>
  49. </div>
  50. </div>
  51. <div class="portlet-body">
  52. <table class="table table-striped table-bordered table-hover tableadvanced">
  53. <thead>
  54. <tr>
  55. <th>#</th>
  56. <th>SKU</th>
  57. <th>Producto</th>
  58. <th>Merma</th>
  59. <th>Motivo</th>
  60. <th>Registró</th>
  61. <th>Fecha</th>
  62. <% if current_user.usertype == "A" || current_user.usertype == "SS" %>
  63. <th>Localización</th>
  64. <% end %>
  65. <th>Status</th>
  66. <th>Acciones</th>
  67. </tr>
  68. </thead>
  69. <tbody>
  70. <% @product_wastes.each_with_index do |product_waste, key| %>
  71. <tr>
  72. <td><%= key + 1 %></td>
  73. <td><%= product_waste.product.sku %> </td>
  74. <td>
  75. <%= product_waste.product.name %><br>
  76. <%= product_waste.product.display_attributes %>
  77. </td>
  78. <td><%= product_waste.quantity %> </td>
  79. <td><%= product_waste.reason %> </td>
  80. <td><%= product_waste.user.first_name %> </td>
  81. <td><%= l(product_waste.created_at, :format => '%d/%B/%Y') %></td>
  82. <% if current_user.usertype == "A" || current_user.usertype == "SS" %>
  83. <td> <%= product_waste.pointsale.present? ? product_waste.pointsale.name : product_waste.warehouse.name %> </td>
  84. <% end %>
  85. <td class="text-center">
  86. <% case product_waste.status %>
  87. <% when "active"%>
  88. <i class="fa fa-check font-green"></i>
  89. <% when "inactive"%>
  90. <i class="fa fa-close font-red"></i>
  91. <% end %>
  92. </td>
  93. <td class="text-center">
  94. <%= link_to product_waste, method: :delete, :class => "btn btn-icon-only btn-danger", :title => "Eliminar merma", data: { confirm: '¿Está seguro de eliminar la merma del producto?' } do %>
  95. <i class="fa fa-trash-o"></i>
  96. <% end %>
  97. </td>
  98. </tr>
  99. <% end %>
  100. </tbody>
  101. </table>
  102. </div>
  103. </div>
  104. </div>
  105. </div>
  106. </div>
  107. <!-- END PAGE CONTENT INNER -->
  108. </div>
  109. </div>
  110. <!-- END PAGE CONTENT BODY -->
  111. <!-- END CONTENT BODY -->
  112. </div>
  113. <!-- END CONTENT -->
  114. </div>