_quick_reserve_payment.html.erb 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <div class="form-horizontal">
  2. <div class="portlet-body form">
  3. <div class="form-body">
  4. <div class="row">
  5. <div class="col-md-12">
  6. <div class="form-group">
  7. <%= label_tag :customer_id, {:class=>"col-md-4 control-label"} do %>Cliente <span class="required">*</span> <% end %>
  8. <div class="col-md-6">
  9. <%= select_tag :customer_id, options_from_collection_for_select(@customers, :id, :nick_name), :include_blank => "Seleccione cliente", class: "form-control select2" %>
  10. </div>
  11. </div>
  12. </div>
  13. <div class="col-md-12">
  14. <table class="table table-striped table-bordered table-hover" id="reserved_table">
  15. <thead>
  16. <tr>
  17. <th>Folio</th>
  18. <th>Fecha</th>
  19. <th>Vence</th>
  20. <th>Productos</th>
  21. <th>Status</th>
  22. <th>Total</th>
  23. <th>Adeudo</th>
  24. <th>Acciones</th>
  25. </tr>
  26. </thead>
  27. <tbody>
  28. </tbody>
  29. </table>
  30. </div>
  31. </div>
  32. </div>
  33. </div>
  34. </div>
  35. <script>
  36. $('#customer_id').on('change', function() {
  37. getReservedSales();
  38. });
  39. function cerrarDialog() {
  40. $('#dialog').modal('toggle');
  41. }
  42. function getReservedSales() {
  43. var customerId = $('#customer_id').val();
  44. if(customerId) {
  45. $.ajax({
  46. type: "GET",
  47. url: "/customers/"+ customerId + "/reserved_sales/",
  48. dataType: "script",
  49. success: function(xhr, status, error) {
  50. }
  51. });
  52. }
  53. }
  54. </script>