Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant
This commit is contained in:
2
Gemfile
2
Gemfile
@@ -91,3 +91,5 @@ end
|
|||||||
|
|
||||||
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
|
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
|
||||||
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
|
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
|
||||||
|
|
||||||
|
gem 'httparty', '~> 0.15.5'
|
||||||
@@ -92,6 +92,8 @@ GEM
|
|||||||
railties (>= 3.2, < 5.2)
|
railties (>= 3.2, < 5.2)
|
||||||
globalid (0.4.0)
|
globalid (0.4.0)
|
||||||
activesupport (>= 4.2.0)
|
activesupport (>= 4.2.0)
|
||||||
|
httparty (0.15.5)
|
||||||
|
multi_xml (>= 0.5.2)
|
||||||
i18n (0.8.4)
|
i18n (0.8.4)
|
||||||
jbuilder (2.6.4)
|
jbuilder (2.6.4)
|
||||||
activesupport (>= 3.0.0)
|
activesupport (>= 3.0.0)
|
||||||
@@ -114,6 +116,7 @@ GEM
|
|||||||
mini_portile2 (2.1.0)
|
mini_portile2 (2.1.0)
|
||||||
minitest (5.10.2)
|
minitest (5.10.2)
|
||||||
multi_json (1.12.1)
|
multi_json (1.12.1)
|
||||||
|
multi_xml (0.6.0)
|
||||||
mysql2 (0.4.6)
|
mysql2 (0.4.6)
|
||||||
nio4r (2.1.0)
|
nio4r (2.1.0)
|
||||||
nokogiri (1.7.2)
|
nokogiri (1.7.2)
|
||||||
@@ -248,6 +251,7 @@ DEPENDENCIES
|
|||||||
factory_girl_rails (~> 4.0)
|
factory_girl_rails (~> 4.0)
|
||||||
faker
|
faker
|
||||||
font-awesome-rails
|
font-awesome-rails
|
||||||
|
httparty (~> 0.15.5)
|
||||||
jbuilder (~> 2.5)
|
jbuilder (~> 2.5)
|
||||||
jquery-rails
|
jquery-rails
|
||||||
kaminari!
|
kaminari!
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ class Crm::CustomersController < ApplicationController
|
|||||||
# GET /crm/customers/new
|
# GET /crm/customers/new
|
||||||
def new
|
def new
|
||||||
@crm_customer = Customer.new
|
@crm_customer = Customer.new
|
||||||
|
@membership = Customer.get_member_group
|
||||||
end
|
end
|
||||||
|
|
||||||
# GET /crm/customers/1/edit
|
# GET /crm/customers/1/edit
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ class Oqs::PrintController < ApplicationController
|
|||||||
def print
|
def print
|
||||||
unique_code="OrderItemPdf"
|
unique_code="OrderItemPdf"
|
||||||
assigned_item_id=params[:id]
|
assigned_item_id=params[:id]
|
||||||
assigned_order_item=AssignedOrderItem.select("order_id, item_code").where('assigned_order_item_id='+assigned_item_id)
|
assigned_order_item=AssignedOrderItem.select("order_id, item_code").where("assigned_order_item_id='" + assigned_item_id + "'")
|
||||||
|
|
||||||
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||||
order_queue_printer= Printer::OrderQueuePrinter.new(print_settings)
|
order_queue_printer= Printer::OrderQueuePrinter.new(print_settings)
|
||||||
|
|||||||
@@ -218,9 +218,8 @@ class Order < ApplicationRecord
|
|||||||
left join dining_facilities on dining_facilities.id = bookings.dining_facility_id
|
left join dining_facilities on dining_facilities.id = bookings.dining_facility_id
|
||||||
left join order_items on order_items.order_id = orders.id")
|
left join order_items on order_items.order_id = orders.id")
|
||||||
.where("dining_facilities.type=? and orders.order_type=? and dining_facilities.is_active=?",DiningFacility::TABLE_TYPE,"dine_in",true)
|
.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")
|
||||||
.group("orders.id, order_items.id,dining_facilities.name")
|
end
|
||||||
|
|
||||||
|
|
||||||
def self.get_booking_order_table
|
def self.get_booking_order_table
|
||||||
booking_orders = Booking.select("sales.receipt_no,orders.status as order_status,
|
booking_orders = Booking.select("sales.receipt_no,orders.status as order_status,
|
||||||
@@ -234,6 +233,7 @@ class Order < ApplicationRecord
|
|||||||
.group("bookings.booking_id")
|
.group("bookings.booking_id")
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
#Origami: Cashier : to view order type Room
|
#Origami: Cashier : to view order type Room
|
||||||
def self.get_booking_order_rooms
|
def self.get_booking_order_rooms
|
||||||
booking_rooms = Booking.select("sales.receipt_no,orders.status as order_status,bookings.booking_id,sales.sale_id as sale_id,dining_facilities.name as room_name")
|
booking_rooms = Booking.select("sales.receipt_no,orders.status as order_status,bookings.booking_id,sales.sale_id as sale_id,dining_facilities.name as room_name")
|
||||||
@@ -245,6 +245,7 @@ class Order < ApplicationRecord
|
|||||||
.where("booking_orders.order_id IS NOT NULL and dining_facilities.type=? and dining_facilities.is_active=?",DiningFacility::ROOM_TYPE,true)
|
.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")
|
||||||
end
|
end
|
||||||
|
|
||||||
#Origami: Cashier : to view order type Room
|
#Origami: Cashier : to view order type Room
|
||||||
def self.get_order_rooms
|
def self.get_order_rooms
|
||||||
order_rooms = Order.select("orders.order_id as order_id,sum(order_items.qty*order_items.price) as total_price,
|
order_rooms = Order.select("orders.order_id as order_id,sum(order_items.qty*order_items.price) as total_price,
|
||||||
@@ -254,9 +255,10 @@ class Order < ApplicationRecord
|
|||||||
left join dining_facilities on dining_facilities.id = bookings.dining_facility_id
|
left join dining_facilities on dining_facilities.id = bookings.dining_facility_id
|
||||||
left join order_items on order_items.order_id = orders.order_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)
|
.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.id,dining_facilities.name")
|
.group("orders.order_id,order_items.order_items_id,dining_facilities.name")
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
#Origami: Cashier : to view orders
|
#Origami: Cashier : to view orders
|
||||||
def self.get_orders
|
def self.get_orders
|
||||||
from = Time.now.beginning_of_day.utc
|
from = Time.now.beginning_of_day.utc
|
||||||
@@ -265,19 +267,15 @@ class Order < ApplicationRecord
|
|||||||
.joins("left join booking_orders on booking_orders.order_id = orders.order_id
|
.joins("left join booking_orders on booking_orders.order_id = orders.order_id
|
||||||
left join bookings on bookings.booking_id = booking_orders.order_id
|
left join bookings on bookings.booking_id = booking_orders.order_id
|
||||||
left join dining_facilities on dining_facilities.id = bookings.dining_facility_id
|
left join dining_facilities on dining_facilities.id = bookings.dining_facility_id
|
||||||
|
|
||||||
left join order_items on order_items.order_id = orders.order_id
|
left join order_items on order_items.order_id = orders.order_id
|
||||||
left join sale_orders on sale_orders.order_id = orders.order_id
|
left join sale_orders on sale_orders.order_id = orders.order_id
|
||||||
left join sales on sales.sale_id = sale_orders.sale_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)
|
.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.id,order_items.id,dining_facilities.name")
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def generate_custom_id
|
def generate_custom_id
|
||||||
self.order_id = SeedGenerator.generate_id(self.class.name, "ODR")
|
self.order_id = SeedGenerator.generate_id(self.class.name, "ODR")
|
||||||
end
|
end
|
||||||
@@ -285,4 +283,5 @@ class Order < ApplicationRecord
|
|||||||
def set_order_date
|
def set_order_date
|
||||||
self.date = Time.now.utc
|
self.date = Time.now.utc
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -29,18 +29,18 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
|
|||||||
.joins("left join orders ON orders.order_id = order_items.order_id
|
.joins("left join orders ON orders.order_id = order_items.order_id
|
||||||
left join booking_orders AS bo ON bo.order_id=order_items.order_id
|
left join booking_orders AS bo ON bo.order_id=order_items.order_id
|
||||||
left join bookings AS b ON b.booking_id = bo.booking_id
|
left join bookings AS b ON b.booking_id = bo.booking_id
|
||||||
left join dining_facilities AS df ON df.dining_facility_id = b.dining_facility_id
|
left join dining_facilities AS df ON df.id = b.dining_facility_id
|
||||||
left join customers as cus ON cus.customer_id = orders.customer_id")
|
left join customers as cus ON cus.customer_id = orders.customer_id")
|
||||||
.where("order_items.item_code=" + code)
|
.where("order_items.item_code='" + code + "'")
|
||||||
.group("order_items.item_code")
|
.group("order_items.item_code")
|
||||||
else
|
else
|
||||||
OrderItem.select("order_items.item_code, order_items.item_name, order_items.qty, order_items.price, order_items.item_order_by as order_by, order_items.created_at as order_at, cus.name as customer, df.name as dining")
|
OrderItem.select("order_items.item_code, order_items.item_name, order_items.qty, order_items.price, order_items.item_order_by as order_by, order_items.created_at as order_at, cus.name as customer, df.name as dining")
|
||||||
.joins("left join orders ON orders.order_id = order_items.order_id
|
.joins("left join orders ON orders.order_id = order_items.order_id
|
||||||
left join booking_orders AS bo ON bo.order_id=order_items.order_id
|
left join booking_orders AS bo ON bo.order_id=order_items.order_id
|
||||||
left join bookings AS b ON b.booking_id = bo.booking_id
|
left join bookings AS b ON b.booking_id = bo.booking_id
|
||||||
left join dining_facilities AS df ON df.dining_facility_id = b.dining_facility_id
|
left join dining_facilities AS df ON df.id = b.dining_facility_id
|
||||||
left join customers as cus ON cus.customer_id = orders.customer_id")
|
left join customers as cus ON cus.customer_id = orders.customer_id")
|
||||||
.where("orders.order_id=" + code.to_s)
|
.where("orders.order_id='" + code.to_s + "'")
|
||||||
.group("order_items.item_code")
|
.group("order_items.item_code")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user