diff --git a/app/models/order_item.rb b/app/models/order_item.rb index f4f3efba..109665d0 100644 --- a/app/models/order_item.rb +++ b/app/models/order_item.rb @@ -43,10 +43,10 @@ class OrderItem < ApplicationRecord def self.get_order_items_details(booking_id) # booking_orders = BookingOrder.where("booking_id=?",booking.booking_id) # if booking_orders - # booking_orders.each do |book_order| + # booking_orders.each do |book_order| # order_details = OrderItem.select("order_items.item_name,order_items.qty,order_items.price,(order_items.qty*order_items.price) as total_price") # .joins("left join orders on orders.order_id = order_items.order_id") - # .where("order_items.order_id=?",book_order.order) + # .where("order_items.order_id=?",book_order.order) # return order_details # end # else @@ -57,9 +57,9 @@ class OrderItem < ApplicationRecord .joins("left join orders on orders.order_id = order_items.order_id") .joins("left join booking_orders on booking_orders.order_id = order_items.order_id") .joins("left join bookings on bookings.booking_id = booking_orders.booking_id") - .where("bookings.booking_id=?",booking_id) + .where("bookings.booking_id=?",booking_id) - return order_details + return order_details end private diff --git a/app/models/shift_sale.rb b/app/models/shift_sale.rb index aa471972..f59c2797 100644 --- a/app/models/shift_sale.rb +++ b/app/models/shift_sale.rb @@ -21,7 +21,7 @@ class ShiftSale < ApplicationRecord #find open shift where is open today and is not closed and login by current cashier today_date = DateTime.now.strftime("%Y-%m-%d") - shift = ShiftSale.where("DATE(shift_started_at)= #{ today_date } and shift_started_at is not null and shift_closed_at is null and employee_id = #{current_user}").take + shift = ShiftSale.where("DATE(shift_started_at)=? and shift_started_at is not null and shift_closed_at is null and employee_id = #{current_user}",today_date).take return shift #end diff --git a/app/views/origami/shifts/new.html.erb b/app/views/origami/shifts/new.html.erb index f5f032bc..83f4df55 100644 --- a/app/views/origami/shifts/new.html.erb +++ b/app/views/origami/shifts/new.html.erb @@ -17,7 +17,7 @@ <% @float.each do |float| %> <%= float.name %> - + <% end %> @@ -25,12 +25,7 @@
-
-
-
- -
-
+
@@ -56,9 +51,9 @@
00
-
Del
-
Clr
-
Ent
+
Clr
+
Calculate
+
Open Cashier
@@ -67,17 +62,54 @@