diff --git a/app/controllers/origami/payments_controller.rb b/app/controllers/origami/payments_controller.rb index 3082d0e3..602a89d3 100755 --- a/app/controllers/origami/payments_controller.rb +++ b/app/controllers/origami/payments_controller.rb @@ -418,7 +418,7 @@ class Origami::PaymentsController < BaseOrigamiController cashier_terminal = CashierTerminal.find(shift.cashier_terminal_id) end - if ENV["SERVER_MODE"] != "cloud" #no print in cloud server + # if ENV["SERVER_MODE"] != "cloud" #no print in cloud server unique_code = "ReceiptBillPdf" customer= Customer.find(saleObj.customer_id) @@ -462,7 +462,7 @@ class Origami::PaymentsController < BaseOrigamiController # Mobile Print render :json => result.to_json - end + # end end def foc diff --git a/app/views/origami/home/show.html.erb b/app/views/origami/home/show.html.erb index 05a4a536..942d3c7f 100755 --- a/app/views/origami/home/show.html.erb +++ b/app/views/origami/home/show.html.erb @@ -495,7 +495,7 @@ Void <% else %> - + <% end %> <% end %> <% if current_login_employee.role != "waiter" %> @@ -790,7 +790,6 @@ // For Server Print - from jade if ($("#server_mode").val() == "cloud") { - alert("Hello"); code2lab.printFile(result.filepath.substr(6), result.printer_url); } location.reload(); diff --git a/app/views/origami/pending_order/completed_sale.html.erb b/app/views/origami/pending_order/completed_sale.html.erb index 21caa906..a2940f4e 100644 --- a/app/views/origami/pending_order/completed_sale.html.erb +++ b/app/views/origami/pending_order/completed_sale.html.erb @@ -256,8 +256,18 @@ $(document).ready(function(){ }) $('#reprint').on('click', function () { var sale_id = $('#sale_id').val(); - window.location.href = '/origami/'+ sale_id + "/reprint" - + var ajax_url = '/origami/'+ sale_id + "/reprint" + + $.ajax({ + type: "GET", + url: ajax_url, + success: function (result) { + if ($("#server_mode").val() == "cloud") { + code2lab.printFile(result.filepath.substr(6), result.printer_url); + } + location.reload(); + } + }); }); $('#back').on('click', function () { window.location.href = '/origami/quick_service/pending_order'; diff --git a/app/views/origami/rooms/show.html.erb b/app/views/origami/rooms/show.html.erb index a4f06b85..767bed80 100755 --- a/app/views/origami/rooms/show.html.erb +++ b/app/views/origami/rooms/show.html.erb @@ -460,7 +460,7 @@ Void <% else %> - + <% end %> <% end %> diff --git a/app/views/origami/sales/show.html.erb b/app/views/origami/sales/show.html.erb index 55ed2203..116901c9 100755 --- a/app/views/origami/sales/show.html.erb +++ b/app/views/origami/sales/show.html.erb @@ -424,7 +424,7 @@ $(document).on('click', '.access_modal', function(event){ $('#re-print').click(function() { var sale_id = $('#sale_id').val(); - var ajax_url = '/origami/'+ sale_id + "/reprint" + var ajax_url = "/origami/"+ sale_id + "/reprint" // return false; $.ajax({ type: "GET", diff --git a/app/views/transactions/sales/show.html.erb b/app/views/transactions/sales/show.html.erb index fd98e214..eeb17c6c 100755 --- a/app/views/transactions/sales/show.html.erb +++ b/app/views/transactions/sales/show.html.erb @@ -43,7 +43,7 @@