receipt.pdf.erb 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <div class='pdf-body'>
  2. <h3 style="margin-top:20px" class="text-center">Traspaso de <strong><%= origin %></strong> a <strong><%= destiny %></strong></h3>
  3. <div class="resume" style="border-bottom:1px solid black;">
  4. <h4 style="margin-top:5px;margin-bottom:5px">Información general</h4>
  5. <strong>Fecha:</strong>&nbsp;&nbsp;
  6. <%= l(transfer.transfer_date, :format => '%d/%m/%y') %><br>
  7. <strong>Capturó:</strong>&nbsp;&nbsp;
  8. <%= transfer.user.first_name %><br>
  9. <strong>Productos:</strong>&nbsp;&nbsp;
  10. <%= transfer.products.count %><br>
  11. <strong>Status:</strong>&nbsp;&nbsp;
  12. <% case transfer.status %>
  13. <% when "cancelled" %>
  14. CANCELADO <br>
  15. <% when "pending" %>
  16. PENDIENTE <br>
  17. <% when "received" %>
  18. RECIBIDO <br>
  19. <% end %>
  20. <% if transfer.received? %>
  21. <strong>Status de recepción:</strong>&nbsp;&nbsp;
  22. <%= reception_status %><br>
  23. <strong>Fecha de recepción:</strong>&nbsp;&nbsp;
  24. <%= l(transfer.reception_date, :format => '%d/%m/%y') %><br>
  25. <strong>Recibió:</strong>&nbsp;&nbsp;
  26. <%= transfer.received_by.first_name %>
  27. <% if transfer.observations.present? %>
  28. <br> <strong>Observaciones:</strong>&nbsp;&nbsp;
  29. <%= transfer.observations %>
  30. <% end %>
  31. <% end %>
  32. </div>
  33. <div class="products">
  34. <table cellspacing="0">
  35. <thead>
  36. <tr>
  37. <th style="text-align:left;font-weight:normal">Cant. Enviado</th>
  38. <th style="text-align:center;font-weight:normal">Cant. Recibido</th>
  39. <th style="text-align:right;font-weight:normal">Status recepción</th>
  40. </tr>
  41. </thead>
  42. <tbody style="border-top:1px solid black">
  43. <% transfer.transfer_details.each do |detail| %>
  44. <tr>
  45. <td colspan="3">
  46. <strong><%= truncate(detail.product.name.upcase, :length => 30, :separator => ' ', :omission => '') %> &nbsp; <%= truncate(detail.product.display_attributes_receipt.upcase, :length => 20, :separator => ' ', :omission => '') %></strong>
  47. </td>
  48. </tr>
  49. <tr>
  50. <td style="text-align:center">
  51. <%= detail.quantity.round %>
  52. </td>
  53. <td style="text-align:center">
  54. <%= detail.adjustment if transfer.received? %>
  55. </td>
  56. <td style="text-align:right">
  57. <% if detail.has_looses? %>
  58. CON PERDIDA
  59. <% elsif detail.has_surplus? %>
  60. CON EXCEDENTE
  61. <% end %>
  62. </td>
  63. </tr>
  64. <% end %>
  65. </tbody>
  66. </table>
  67. </div>
  68. </div>