diff --git a/app/assets/javascripts/addorder.js b/app/assets/javascripts/addorder.js index 50b1a150..47c6cd4f 100755 --- a/app/assets/javascripts/addorder.js +++ b/app/assets/javascripts/addorder.js @@ -36,7 +36,7 @@ $(function() { image_path = "/image/logo.png"; } - row = '
' + row = '
' +'
' +'
'+ product[field].name +'
' +"
' + row = '
' +'
' +'
'+ menu_items[field].name +'
' +"
' + row = '' ; $(sub_category).append(row); diff --git a/app/controllers/origami/payments_controller.rb b/app/controllers/origami/payments_controller.rb index e5c0e741..348a518a 100755 --- a/app/controllers/origami/payments_controller.rb +++ b/app/controllers/origami/payments_controller.rb @@ -464,7 +464,7 @@ class Origami::PaymentsController < BaseOrigamiController # Re-call Sale Data saleObj = Sale.find(sale_id) - 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) @@ -478,7 +478,17 @@ class Origami::PaymentsController < BaseOrigamiController discount_price_by_accounts = SaleItem.get_discount_price_by_accounts(saleObj.sale_items) printer = Printer::ReceiptPrinter.new(print_settings) - printer.print_receipt_bill(print_settings,cashier_terminal,saleObj.sale_items,saleObj,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details, "FOC",nil,nil) + + filename, sale_receipt_no, printer_name = printer.print_receipt_bill(print_settings,cashier_terminal,saleObj.sale_items,saleObj,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details, "FOC",nil,nil) + result = { + :status => true, + :filepath => filename, + :printer_model => print_settings.brand_name, + :printer_url => print_settings.api_settings + } + + # Mobile Print + render :json => result.to_json if params[:type] == "quick_service" booking = Booking.find_by_sale_id(sale_id) @@ -492,7 +502,7 @@ class Origami::PaymentsController < BaseOrigamiController Order.pay_process_order_queue(order.order_id,table_id) end end - end + # end end end @@ -538,6 +548,15 @@ class Origami::PaymentsController < BaseOrigamiController printer = Printer::ReceiptPrinter.new(print_settings) printer.print_receipt_pdf(filename,receipt_no,print_settings.print_copies,printer_name) - render :json => {status: true} + result = { + :status => true, + :filepath => filename, + :printer_model => print_settings.brand_name, + :printer_url => print_settings.api_settings + } + + # Mobile Print + render :json => result.to_json + # render :json => {status: true} end end \ No newline at end of file diff --git a/app/controllers/origami/void_controller.rb b/app/controllers/origami/void_controller.rb index 00f9d76b..74e495ca 100755 --- a/app/controllers/origami/void_controller.rb +++ b/app/controllers/origami/void_controller.rb @@ -87,8 +87,6 @@ class Origami::VoidController < BaseOrigamiController if bookings[0].dining_facility_id.to_i>0 table = DiningFacility.find(bookings[0].dining_facility_id) end - - end if bookings[0].dining_facility_id.to_i > 0 @@ -100,7 +98,7 @@ class Origami::VoidController < BaseOrigamiController 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(sale.customer_id) @@ -120,9 +118,17 @@ class Origami::VoidController < BaseOrigamiController item_price_by_accounts = SaleItem.calculate_price_by_accounts(sale.sale_items) discount_price_by_accounts = SaleItem.get_discount_price_by_accounts(sale.sale_items) - printer = Printer::ReceiptPrinter.new(print_settings) - printer.print_receipt_bill(print_settings,cashier_terminal,sale.sale_items,sale,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details, "VOID",current_balance,nil) - end + printer = Printer::ReceiptPrinter.new(print_settings) + filename, sale_receipt_no, printer_name = printer.print_receipt_bill(print_settings,cashier_terminal,sale.sale_items,sale,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details, "VOID",current_balance,nil) + result = { + :filepath => filename, + :printer_model => print_settings.brand_name, + :printer_url => print_settings.api_settings + } + + # Mobile Print + render :json => result.to_json + # end #end print diff --git a/app/views/origami/addorders/detail.html.erb b/app/views/origami/addorders/detail.html.erb index 183a819f..05d50339 100755 --- a/app/views/origami/addorders/detail.html.erb +++ b/app/views/origami/addorders/detail.html.erb @@ -86,8 +86,8 @@
-
-
+
+