diff --git a/Gemfile b/Gemfile index d64ba992..d42da647 100644 --- a/Gemfile +++ b/Gemfile @@ -9,8 +9,8 @@ end # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 5.1.0' # Use mysql as the database for Active Record -#gem 'mysql2', '>= 0.3.18', '< 0.5' -gem 'pg' +gem 'mysql2', '>= 0.3.18', '< 0.5' +#gem 'pg' # Use Puma as the app server gem 'puma', '~> 3.0' # Use SCSS for stylesheets diff --git a/Gemfile.lock b/Gemfile.lock index 3627d882..6916f408 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -96,11 +96,11 @@ GEM mini_portile2 (2.1.0) minitest (5.10.2) multi_json (1.12.1) + mysql2 (0.4.6) nio4r (2.0.0) nokogiri (1.7.2) mini_portile2 (~> 2.1.0) pdf-core (0.7.0) - pg (0.20.0) prawn (2.2.2) pdf-core (~> 0.7.0) ttfunk (~> 1.5) @@ -232,7 +232,7 @@ DEPENDENCIES jbuilder (~> 2.5) jquery-rails listen (~> 3.0.5) - pg + mysql2 (>= 0.3.18, < 0.5) prawn prawn-table puma (~> 3.0) diff --git a/app/controllers/crm/home_controller.rb b/app/controllers/crm/home_controller.rb index 6c0671c3..2a7153f8 100644 --- a/app/controllers/crm/home_controller.rb +++ b/app/controllers/crm/home_controller.rb @@ -1,16 +1,22 @@ class Crm::HomeController < BaseCrmController def index - @booking = Booking.select("bookings.id as booking_id, - bookings.checkin_at, - od.customer_id as customer, - odt.id") + # @booking = Booking.all + + @booking = Booking.select("bookings.id as booking_id, + bookings.checkin_at, + bookings.checkin_by, + bookings.dining_facility_id, + od.customer_id as customer, + od.item_count as count, + odt.id as order_item_id, + odt.item_name as item_name") .joins("join booking_orders as bko ON bko.booking_id = bookings.id") .joins("right join orders as od ON od.id = bko.order_id") .joins("right join order_items as odt ON odt.order_id=od.id") - .order("bookings.id DESC") + .order("bookings.id DESC") - + @customer = Customer.all end def show diff --git a/app/models/order_queue_item.rb b/app/models/order_queue_item.rb deleted file mode 100644 index 7f94fbec..00000000 --- a/app/models/order_queue_item.rb +++ /dev/null @@ -1,2 +0,0 @@ -class OrderQueueItem < ApplicationRecord -end diff --git a/app/views/crm/home/_booking.html.erb b/app/views/crm/home/_booking.html.erb new file mode 100644 index 00000000..cf983116 --- /dev/null +++ b/app/views/crm/home/_booking.html.erb @@ -0,0 +1,26 @@ + +
Medium, Fries, Salad +
++ + Order at <%= booking.checkin_at.strftime("%H,%m") %>, <%= booking.checkin_by %> + +
+Name : <%= customer.name %>
+Contact No : <%= customer.contact_no %>
+Email : <%= customer.email %>
+This card has supporting text below as a natural lead-in to additional content.
+Last updated 3 mins ago
+Well Done, Fries, Salad
++ Order at 12:23, Kyaw Lwin | + Printed at 12:23 | + Completed at 12:43 +
+ + +Well Done, Fries, Salad
+Order at 12:23, Kyaw Lwin
+Well Done, Fries, Salad
+Order at 12:23, Kyaw Lwin
+Well Done, Fries, Salad
-- Order at 12:23, Kyaw Lwin | - Printed at 12:23 | - Completed at 12:43 -
- - -Well Done, Fries, Salad
-Order at 12:23, Kyaw Lwin
-Well Done, Fries, Salad
-Order at 12:23, Kyaw Lwin
-fries, Salad - asdf -
-- - adf - -
-Well Done, Fries, Salad
-Order at 12:23, Kyaw Lwin
-This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.
---Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.
- -
This card has supporting text below as a natural lead-in to additional content.
-Last updated 3 mins ago
---Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat.
- -
This card has supporting text below as a natural lead-in to additional content.
-Last updated 3 mins ago
-This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.
-Last updated 3 mins ago
- -This card has supporting text below as a natural lead-in to additional content.
-Last updated 3 mins ago
-This card has supporting text below as a natural lead-in to additional content.
-Last updated 3 mins ago
-