From f126d2faf601dcad552025ca0264d5169a9c2504 Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Wed, 28 Mar 2018 09:29:54 +0630 Subject: [PATCH] update print file.substring for jade --- app/views/origami/home/show.html.erb | 8 ++++---- app/views/origami/payments/show.html.erb | 6 +++--- app/views/origami/rooms/show.html.erb | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/views/origami/home/show.html.erb b/app/views/origami/home/show.html.erb index 4922c1df..7afa2769 100755 --- a/app/views/origami/home/show.html.erb +++ b/app/views/origami/home/show.html.erb @@ -726,9 +726,9 @@ // For Server Print - from jade if ($("#server_mode").val() == "cloud") { - code2lab.printFile(result.filepath, result.printer_url); + code2lab.printFile(result.filepath.substr(6), result.printer_url); } - + // console.log(result); // code2lab.printBill(result.filepath, result.printer_model, result.printer_url); location.reload(); @@ -776,7 +776,7 @@ createReceiptNoInFirstBillData(receipt_no,type); // For Server Print - from jade if ($("#server_mode").val() == "cloud") { - code2lab.printFile(result.filepath, result.printer_url); + code2lab.printFile(result.filepath.substr(6), result.printer_url); } location.reload(); } @@ -942,7 +942,7 @@ success: function (result) { // For Server Print - from jade if ($("#server_mode").val() == "cloud") { - code2lab.printFile(result.filepath, result.printer_url); + code2lab.printFile(result.filepath.substr(6), result.printer_url); } window.location.href = '/origami/'; } diff --git a/app/views/origami/payments/show.html.erb b/app/views/origami/payments/show.html.erb index 001adc53..eb3eefe3 100755 --- a/app/views/origami/payments/show.html.erb +++ b/app/views/origami/payments/show.html.erb @@ -725,7 +725,7 @@ var customer_name = "<%= @customer.name %>"; customer_display_view(null,"reload"); // For Server Print - from jade if ($("#server_mode").val() == "cloud") { - code2lab.printFile(result.filepath, result.printer_url); + code2lab.printFile(result.filepath.substr(6), result.printer_url); } if (cashier_type=="cashier") { window.location.href = '/origami'; @@ -939,7 +939,7 @@ var customer_name = "<%= @customer.name %>"; }, function () { // For Server Print - from jade if ($("#server_mode").val() == "cloud") { - code2lab.printFile(result.filepath, result.printer_url); + code2lab.printFile(result.filepath.substr(6), result.printer_url); } if (cashier_type=="cashier") { window.location.href = '/origami'; @@ -1018,7 +1018,7 @@ var customer_name = "<%= @customer.name %>"; console.log(result); // For Server Print - from jade if ($("#server_mode").val() == "cloud") { - code2lab.printFile(result.filepath, result.printer_url); + code2lab.printFile(result.filepath.substr(6), result.printer_url); } if (cashier_type=="cashier") { window.location.href = '/origami'; diff --git a/app/views/origami/rooms/show.html.erb b/app/views/origami/rooms/show.html.erb index 1b034655..424690ff 100755 --- a/app/views/origami/rooms/show.html.erb +++ b/app/views/origami/rooms/show.html.erb @@ -705,7 +705,7 @@ $("#first_bill").on('click', function(){ createReceiptNoInFirstBillData(receipt_no,""); // For Server Print - from jade if ($("#server_mode").val() == "cloud") { - code2lab.printFile(result.filepath, result.printer_url); + code2lab.printFile(result.filepath.substr(6), result.printer_url); } location.reload(); } @@ -739,7 +739,7 @@ $(".choose_payment").on('click', function () { // For Server Print - from jade if ($("#server_mode").val() == "cloud") { - code2lab.printFile(result.filepath, result.printer_url); + code2lab.printFile(result.filepath.substr(6), result.printer_url); } location.reload();