confirm_payments.js.erb 511 B

12345678910111213141516
  1. <% if @sale.present? %>
  2. window.location = "<%= new_sale_path %>";
  3. $("#notice").html("<%= flash[:notice] %>");
  4. $.ajax({
  5. type: "get",
  6. url: '<%= print_receipt_path(@sale.id) %>',
  7. dataType: 'script'
  8. });
  9. <% elsif @products_return.present? %>
  10. window.location = "<%= products_returns_path %>";
  11. $("#notice").html("<%= flash[:notice] %>");
  12. var ticket_window = window.open("<%= print_return_receipt_path(@products_return.id, format: 'pdf') %>", 'New tab', '' );
  13. ticket_window.print();
  14. <% end %>