req bill bugs fixing
This commit is contained in:
@@ -230,7 +230,7 @@ class Order < ApplicationRecord
|
||||
.joins("left join sale_orders on sale_orders.order_id = orders.order_id")
|
||||
.joins("left join sales on sales.sale_id = sale_orders.sale_id")
|
||||
.where("booking_orders.order_id IS NOT NULL and dining_facilities.type=? and dining_facilities.is_active=?",DiningFacility::TABLE_TYPE,true)
|
||||
.group("bookings.booking_id")
|
||||
.group("bookings.booking_id,sales.receipt_no,orders.status,sales.sale_id,dining_facilities.name,orders.status")
|
||||
|
||||
end
|
||||
|
||||
@@ -243,7 +243,7 @@ class Order < ApplicationRecord
|
||||
.joins("left join sale_orders on sale_orders.order_id = orders.order_id")
|
||||
.joins("left join sales on sales.sale_id = sale_orders.sale_id")
|
||||
.where("booking_orders.order_id IS NOT NULL and dining_facilities.type=? and dining_facilities.is_active=?",DiningFacility::ROOM_TYPE,true)
|
||||
.group("bookings.booking_id")
|
||||
.group("bookings.booking_id,sales.receipt_no,orders.status,sales.sale_id,dining_facilities.name")
|
||||
end
|
||||
|
||||
#Origami: Cashier : to view order type Room
|
||||
@@ -255,7 +255,7 @@ class Order < ApplicationRecord
|
||||
left join dining_facilities on dining_facilities.id = bookings.dining_facility_id
|
||||
left join order_items on order_items.order_id = orders.order_id")
|
||||
.where("dining_facilities.type=? and orders.order_type=? and dining_facilities.is_active=?",DiningFacility::ROOM_TYPE,"dine_in",true)
|
||||
.group("orders.order_id,order_items.order_items_id,dining_facilities.name")
|
||||
.group("orders.order_id,order_items.order_items_id,dining_facilities.name,sales.receipt_no")
|
||||
|
||||
end
|
||||
|
||||
@@ -271,7 +271,7 @@ class Order < ApplicationRecord
|
||||
left join sale_orders on sale_orders.order_id = orders.order_id
|
||||
left join sales on sales.sale_id = sale_orders.sale_id")
|
||||
.where("dining_facilities.is_active=? and orders.date between ? and ?",true,from,to)
|
||||
.group("orders.order_id,order_items.order_items_id,dining_facilities.name")
|
||||
.group("orders.order_id,order_items.order_items_id,dining_facilities.name,sales.receipt_no,bookings.booking_id,sales.sale_id")
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
@@ -64,11 +64,11 @@ class Printer::ReceiptPrinter < Printer::PrinterWorker
|
||||
self.print(filename)
|
||||
end
|
||||
#Bill Receipt Print
|
||||
def print_receipt_bill(printer_settings,sale_items,sale,sale_data)
|
||||
def print_receipt_bill(printer_settings,sale_items,sale_data, customer_name)
|
||||
#Use CUPS service
|
||||
#Generate PDF
|
||||
#Print
|
||||
pdf = ReceiptBillPdf.new(printer_settings,sale_items,sale,sale_data)
|
||||
pdf = ReceiptBillPdf.new(printer_settings, sale_items, sale_data, customer_name)
|
||||
pdf.render_file "tmp/receipt_bill.pdf"
|
||||
self.print("tmp/receipt_bill.pdf")
|
||||
end
|
||||
|
||||
@@ -33,7 +33,7 @@ class Sale < ApplicationRecord
|
||||
end
|
||||
order = booking.booking_orders.take.order
|
||||
link_order_sale(order.id)
|
||||
return status
|
||||
return status, sale_id
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user