This commit is contained in:
Myat Zin Wai Maw
2020-02-25 15:10:54 +06:30
parent 1d0100b382
commit 300779402d
6 changed files with 43 additions and 11 deletions

View File

@@ -74,7 +74,8 @@ class Api::OrdersController < Api::ApiController
else
if checkin_checkout_time(params[:booking_id])
table = DiningFacility.find(params[:table_id]) if params[:table_id].present?
table = DiningFacility.find_by_name(params[:table_name]) if params[:table_name].present?
# table = DiningFacility.find(params[:table_id]) if params[:table_id].present?
booking = table.current_checkin_booking if table
booking ||= Booking.find(params[:booking_id]) if params[:booking_id].present?
@@ -107,7 +108,7 @@ class Api::OrdersController < Api::ApiController
customer_id: params[:customer_id].present? ? params[:customer_id] : Customer.walkin.customer_id, # for no customer id from mobile
items: items_arr,
guest: params[:guest_info],
table_id: params[:table_id],
table_id: !table.nil? ? table.id : '',
new_booking: true,
waiters: @user.name,
employee_name: @user.name,
@@ -132,7 +133,8 @@ class Api::OrdersController < Api::ApiController
end
end
else
return return_json_status_with_code(406, "Checkout time is over!")
@status =false
@message ="Checkout time is over!"
end
end
end

View File

@@ -130,7 +130,7 @@ class Api::PaymentsController < Api::ApiController
other_amount = SaleItem.calculate_other_charges(sale_items)
printer = Printer::ReceiptPrinter.new(print_settings)
filename, sale_receipt_no, printer_name = printer.print_receipt_bill(print_settings, false, nil, cashier_terminal,sale_items,sale,params[:card_no], item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,@shop, 'Foodcourt',current_balance,card_data,other_amount,latest_order_no,card_balance_amount,nil,transaction_ref)
filename, sale_receipt_no, printer_name = printer.print_receipt_bill(print_settings, false, nil, cashier_terminal,sale_items,sale,params[:card_no], item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,@shop, 'Paid',current_balance,card_data,other_amount,latest_order_no,card_balance_amount,nil,transaction_ref)
render json: JSON.generate({:status => true, :balance_amount => card_balance_amount,:receipt_no => sale.receipt_no,:order_no => latest_order_no, :message => "complete", :paid_amount => sale.grand_total})
end
end

View File

@@ -43,7 +43,16 @@ class ReceiptBillA5Pdf < Prawn::Document
header(shop_details)
if sale_data.orders[0].source =='app'
text "Mobile Order", :size => self.header_font_size,:align => :left
move_down 3
y_position = cursor
bounding_box([0,y_position], :width =>self.description_width + self.price_num_width) do
text "Mobile Order", :size => self.header_font_size,:align => :left
end
if !sale_data.bookings[0].dining_facility.nil?
bounding_box([0,y_position], :width =>self.description_width + self.price_num_width) do
text "#{ sale_data.bookings[0].dining_facility.type } - #{ sale_data.bookings[0].dining_facility.name }" , :size => self.header_font_size,:align => :right,:style=>:bold
end
end
move_down 1
text "Customer Ph : #{sale_data.customer.contact_no}", :size => self.header_font_size,:align => :left
move_down 1

View File

@@ -44,7 +44,16 @@ class ReceiptBillOrderPdf < Prawn::Document
header(shop_details)
if sale_data.orders[0].source =='app'
text "Mobile Order", :size => self.header_font_size,:align => :left
move_down 3
y_position = cursor
bounding_box([0,y_position], :width =>self.description_width + self.price_num_width) do
text "Mobile Order", :size => self.header_font_size,:align => :left
end
if !sale_data.bookings[0].dining_facility.nil?
bounding_box([0,y_position], :width =>self.description_width + self.price_num_width) do
text "#{ sale_data.bookings[0].dining_facility.type } - #{ sale_data.bookings[0].dining_facility.name }" , :size => self.header_font_size,:align => :right,:style=>:bold
end
end
move_down 1
text "Customer Ph : #{sale_data.customer.contact_no}", :size => self.header_font_size,:align => :left
move_down 1

View File

@@ -46,13 +46,16 @@ class ReceiptBillPdf < Prawn::Document
header(shop_details)
if sale_data.orders[0].source =='app'
move_down 3
y_position = cursor
bounding_box([0,y_position], :width =>self.description_width + self.price_num_width) do
text "Mobile Order", :size => self.header_font_size,:align => :left
end
bounding_box([self.description_width - 2,y_position], :width => self.price_num_width) do
text "#{ sale_data.bookings[0].dining_facility.type } - #{ sale_data.bookings[0].dining_facility.name }" , :size => self.header_font_size,:align => :right,:style=>:bold
end
if !sale_data.bookings[0].dining_facility.nil?
bounding_box([0,y_position], :width =>self.description_width + self.price_num_width) do
text "#{ sale_data.bookings[0].dining_facility.type } - #{ sale_data.bookings[0].dining_facility.name }" , :size => self.header_font_size,:align => :right,:style=>:bold
end
end
move_down 1
text "Customer Ph : #{sale_data.customer.contact_no}", :size => self.header_font_size,:align => :left
move_down 1
@@ -72,7 +75,7 @@ class ReceiptBillPdf < Prawn::Document
else
customer(customer_account,nil)
end
#start card sale trans data
if card_data != nil
card_sale_data(card_data)

View File

@@ -45,7 +45,16 @@ class ReceiptBillStarPdf < Prawn::Document
header(shop_details)
if sale_data.orders[0].source =='app'
text "Mobile Order", :size => self.header_font_size,:align => :left
move_down 3
y_position = cursor
bounding_box([0,y_position], :width =>self.description_width + self.price_num_width) do
text "Mobile Order", :size => self.header_font_size,:align => :left
end
if !sale_data.bookings[0].dining_facility.nil?
bounding_box([0,y_position], :width =>self.description_width + self.price_num_width) do
text "#{ sale_data.bookings[0].dining_facility.type } - #{ sale_data.bookings[0].dining_facility.name }" , :size => self.header_font_size,:align => :right,:style=>:bold
end
end
move_down 1
text "Customer Ph : #{sale_data.customer.contact_no}", :size => self.header_font_size,:align => :left
move_down 1