Merge branch 'discount'

This commit is contained in:
Yan
2017-06-08 09:49:58 +06:30
2 changed files with 4 additions and 3 deletions

View File

@@ -208,8 +208,7 @@ class Order < ApplicationRecord
OrderBroadcastJob.perform_later(self.id)
end
#Origami: Cashier : to view order type Table
#Origami: Cashier : to view order Table
def self.get_order_table
order_table = Order.select("orders.order_id as order_id,sum(order_items.qty*order_items.price) as total_price,
order_items.order_items_id as order_items_id,dining_facilities.name as table_name")
@@ -220,6 +219,8 @@ class Order < ApplicationRecord
.where("dining_facilities.type=? and orders.order_type=? and dining_facilities.is_active=?",DiningFacility::TABLE_TYPE,"dine_in",true)
.group("orders.order_id, order_items.order_items_id,dining_facilities.name")
end
#Origami: Cashier : to view booking order Table
def self.get_booking_order_table
booking_orders = Booking.select("sales.receipt_no,orders.status as order_status,
bookings.booking_id,sales.sale_id as sale_id,dining_facilities.name as table_name")