add_quick_payment.js.erb 671 B

123456789101112131415161718
  1. $('#dialog h3.modal-title').html("<%= @type == 1 ? 'Seleccione cliente para abonar' : 'Abono a apartado' %>");
  2. $('#dialog').modal({ closeOnEscape: false });
  3. <% if @type == 1 %>
  4. $('.modal-body').html('<%= j render("cash_registers_moves/quick_credit_payment") %>');
  5. <% else %>
  6. $('#dialog').addClass('bs-modal-lg');
  7. $('#dialog .modal-dialog').addClass('modal-lg');
  8. $('.modal-body').html('<%= j render("cash_registers_moves/quick_reserve_payment") %>');
  9. <% end %>
  10. // Show the dynamic dialog
  11. $('#dialog').modal("show");
  12. // Set focus to the first element
  13. $('#dialog').on('shown.bs.modal', function () {
  14. $("#customer_id").select2({
  15. dropdownParent: $("#dialog")
  16. });
  17. })