Edit MoveTablePdf for cloud

This commit is contained in:
San Wai Lwin
2018-04-12 15:28:10 +06:30
parent 926ce2f259
commit 859080d4a1
2 changed files with 23 additions and 19 deletions

View File

@@ -82,24 +82,26 @@ class Origami::MovetableController < BaseOrigamiController
@get_type = Booking.update_dining_facility(booking_array,change_to,change_from)
# get printer info
@from = (DiningFacility.find(change_from)).name
@to = (DiningFacility.find(change_to)).name
@type = (DiningFacility.find(change_to)).type
@moved_by = @current_user.name
@date = DateTime.now
@shop = Shop.first
unique_code = "MoveTablePdf"
pdf_no = PrintSetting.where(:unique_code => unique_code).count
#print_settings = PrintSetting.find_by_unique_code(unique_code)
printer_array = []
printer_array = PrintSetting.where(:unique_code => unique_code)
if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
# get printer info
@from = (DiningFacility.find(change_from)).name
@to = (DiningFacility.find(change_to)).name
@type = (DiningFacility.find(change_to)).type
@moved_by = @current_user.name
@date = DateTime.now
@shop = Shop.first
unique_code = "MoveTablePdf"
pdf_no = PrintSetting.where(:unique_code => unique_code).count
#print_settings = PrintSetting.find_by_unique_code(unique_code)
printer_array = []
printer_array = PrintSetting.where(:unique_code => unique_code)
for i in 0..pdf_no
if i != pdf_no
print_settings = printer_array[i]
printer = Printer::ReceiptPrinter.new(print_settings)
printer.print_move_table(print_settings,@to,@from ,@shop,@date,@type,@moved_by,order_items)
for i in 0..pdf_no
if i != pdf_no
print_settings = printer_array[i]
printer = Printer::ReceiptPrinter.new(print_settings)
printer.print_move_table(print_settings,@to,@from ,@shop,@date,@type,@moved_by,order_items)
end
end
end
end

View File

@@ -437,10 +437,12 @@
<div class="row m-b-10 m-r-30">
<div class="col-md-5 m-r-20">
<button type="button" class="btn btn-link bg-red waves-effect print_receipt">Print</button>
<% if ENV["SERVER_MODE"] != "cloud" %>
<button type="button" class="btn btn-link bg-red waves-effect print_receipt">Print</button>
<% end %>
</div>
<div class="col-md-5">
<div class="col-md-5 m-r-20">
<button type="button" class="btn btn-link bg-blue waves-effect btn_pdf_close" data-dismiss="modal">CLOSE</button>
</div>
</div>