table_id
This commit is contained in:
@@ -74,7 +74,8 @@ class Api::OrdersController < Api::ApiController
|
|||||||
else
|
else
|
||||||
if checkin_checkout_time(params[:booking_id])
|
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 = table.current_checkin_booking if table
|
||||||
booking ||= Booking.find(params[:booking_id]) if params[:booking_id].present?
|
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
|
customer_id: params[:customer_id].present? ? params[:customer_id] : Customer.walkin.customer_id, # for no customer id from mobile
|
||||||
items: items_arr,
|
items: items_arr,
|
||||||
guest: params[:guest_info],
|
guest: params[:guest_info],
|
||||||
table_id: params[:table_id],
|
table_id: !table.nil? ? table.id : '',
|
||||||
new_booking: true,
|
new_booking: true,
|
||||||
waiters: @user.name,
|
waiters: @user.name,
|
||||||
employee_name: @user.name,
|
employee_name: @user.name,
|
||||||
@@ -132,7 +133,8 @@ class Api::OrdersController < Api::ApiController
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
return return_json_status_with_code(406, "Checkout time is over!")
|
@status =false
|
||||||
|
@message ="Checkout time is over!"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ class Api::PaymentsController < Api::ApiController
|
|||||||
other_amount = SaleItem.calculate_other_charges(sale_items)
|
other_amount = SaleItem.calculate_other_charges(sale_items)
|
||||||
|
|
||||||
printer = Printer::ReceiptPrinter.new(print_settings)
|
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})
|
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
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -43,7 +43,16 @@ class ReceiptBillA5Pdf < Prawn::Document
|
|||||||
|
|
||||||
header(shop_details)
|
header(shop_details)
|
||||||
if sale_data.orders[0].source =='app'
|
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
|
move_down 1
|
||||||
text "Customer Ph : #{sale_data.customer.contact_no}", :size => self.header_font_size,:align => :left
|
text "Customer Ph : #{sale_data.customer.contact_no}", :size => self.header_font_size,:align => :left
|
||||||
move_down 1
|
move_down 1
|
||||||
|
|||||||
@@ -44,7 +44,16 @@ class ReceiptBillOrderPdf < Prawn::Document
|
|||||||
|
|
||||||
header(shop_details)
|
header(shop_details)
|
||||||
if sale_data.orders[0].source =='app'
|
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
|
move_down 1
|
||||||
text "Customer Ph : #{sale_data.customer.contact_no}", :size => self.header_font_size,:align => :left
|
text "Customer Ph : #{sale_data.customer.contact_no}", :size => self.header_font_size,:align => :left
|
||||||
move_down 1
|
move_down 1
|
||||||
|
|||||||
@@ -46,13 +46,16 @@ class ReceiptBillPdf < Prawn::Document
|
|||||||
|
|
||||||
header(shop_details)
|
header(shop_details)
|
||||||
if sale_data.orders[0].source =='app'
|
if sale_data.orders[0].source =='app'
|
||||||
|
move_down 3
|
||||||
y_position = cursor
|
y_position = cursor
|
||||||
bounding_box([0,y_position], :width =>self.description_width + self.price_num_width) do
|
bounding_box([0,y_position], :width =>self.description_width + self.price_num_width) do
|
||||||
text "Mobile Order", :size => self.header_font_size,:align => :left
|
text "Mobile Order", :size => self.header_font_size,:align => :left
|
||||||
end
|
end
|
||||||
bounding_box([self.description_width - 2,y_position], :width => self.price_num_width) do
|
if !sale_data.bookings[0].dining_facility.nil?
|
||||||
text "#{ sale_data.bookings[0].dining_facility.type } - #{ sale_data.bookings[0].dining_facility.name }" , :size => self.header_font_size,:align => :right,:style=>:bold
|
bounding_box([0,y_position], :width =>self.description_width + self.price_num_width) do
|
||||||
end
|
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
|
move_down 1
|
||||||
text "Customer Ph : #{sale_data.customer.contact_no}", :size => self.header_font_size,:align => :left
|
text "Customer Ph : #{sale_data.customer.contact_no}", :size => self.header_font_size,:align => :left
|
||||||
move_down 1
|
move_down 1
|
||||||
@@ -72,7 +75,7 @@ class ReceiptBillPdf < Prawn::Document
|
|||||||
else
|
else
|
||||||
customer(customer_account,nil)
|
customer(customer_account,nil)
|
||||||
end
|
end
|
||||||
|
|
||||||
#start card sale trans data
|
#start card sale trans data
|
||||||
if card_data != nil
|
if card_data != nil
|
||||||
card_sale_data(card_data)
|
card_sale_data(card_data)
|
||||||
|
|||||||
@@ -45,7 +45,16 @@ class ReceiptBillStarPdf < Prawn::Document
|
|||||||
|
|
||||||
header(shop_details)
|
header(shop_details)
|
||||||
if sale_data.orders[0].source =='app'
|
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
|
move_down 1
|
||||||
text "Customer Ph : #{sale_data.customer.contact_no}", :size => self.header_font_size,:align => :left
|
text "Customer Ph : #{sale_data.customer.contact_no}", :size => self.header_font_size,:align => :left
|
||||||
move_down 1
|
move_down 1
|
||||||
|
|||||||
Reference in New Issue
Block a user