diff --git a/app/assets/javascripts/OQS.js b/app/assets/javascripts/OQS.js index ce844239..831f2f5f 100755 --- a/app/assets/javascripts/OQS.js +++ b/app/assets/javascripts/OQS.js @@ -66,28 +66,28 @@ $(document).on('turbolinks:load', function() { } var date = new Date(data[field]["created_at"]); - var show_date = date.getDate() + "-" + date.getMonth() + "-" + date.getFullYear() + ' ' + date.getHours()+ ':' + date.getMinutes(); + var show_date = date.getDate() + "-" + date.getMonth() + "-" + date.getFullYear() + ' ' + date.getHours()+ ':' + date.getMinutes(); row ='
' + +''+ data[field]["item_name"] +'- ' + +' [x'+ data[field]["qty"] +'] ' + +'
' +'' +'' - +'Order at' - +''+ show_date +' - ' + +'Order at - ' + +''+ show_date +'' + +''+ items[field]["item_name"] +'- ' + +' [x'+ items[field]["qty"] +'] ' + +'
' +'' +'' - +'Order at' - +''+ show_date +' - ' + +'Order at - ' + +''+ show_date +''+ items[field]["customer_name"] +'
' +''+ items[field]["assigned_order_item_id"] +'
' @@ -73,8 +74,12 @@ App.order_queue_station = App.cable.subscriptions.create('OrderQueueStationChann var $divs = $("div.queue_station"); var SortListDivs = $divs.sort(function (a, b) { + first = $(a).attr('data-date'); next = $(b).attr('data-date'); + console.log(first); + console.log("hi") + console.log(next); return parseInt(next.substring(4, 16)) - parseInt(first.substring(4, 16)); }); $("#oqs_container").html(SortListDivs); diff --git a/app/assets/stylesheets/OQS.scss b/app/assets/stylesheets/OQS.scss index bd62ff95..8258a2df 100755 --- a/app/assets/stylesheets/OQS.scss +++ b/app/assets/stylesheets/OQS.scss @@ -21,6 +21,51 @@ color: #fff !important; background-color: blue; } +.cashier_number{ + width: 33%; + height:58px; + line-height:58px; + text-align:center; + background:#54A5AF; + // float:left; + // margin:2px; + font-size:20px; + color:white; + // cursor:pointer; +} +.del_cashier_number{ + opacity:0.6, +} +.pay{ + width: 86%; + height:174px; + line-height:174px; + text-align:center; + font-size:20px; + color:white; +} +.long{ + width:43%; +} +.orange{ + background-color:#FF7F50; +} +.red { + background-color:#F44336; +} +.green{ + background-color: #009900; +} +.left{ + margin-left:1px; +} + +.bottom{ + margin-bottom:1px; +} +.border-left{ + border-left:1px solid #fff; +} diff --git a/app/controllers/origami/addorders_controller.rb b/app/controllers/origami/addorders_controller.rb index ff917887..7bde1e98 100755 --- a/app/controllers/origami/addorders_controller.rb +++ b/app/controllers/origami/addorders_controller.rb @@ -67,7 +67,7 @@ class Origami::AddordersController < ApplicationController#BaseOrigamiController @order.guest = params[:guest_info] @order.table_id = params[:table_id] # this is dining facilities's id @order.new_booking = true - @order.employee_name = current_login_employee.name + @order.waiters = current_login_employee.name #Create Table Booking or Room Booking if !params["booking_id"].nil? # check booking id is already completed. diff --git a/app/controllers/origami/home_controller.rb b/app/controllers/origami/home_controller.rb index 27b9cc52..febf7e45 100755 --- a/app/controllers/origami/home_controller.rb +++ b/app/controllers/origami/home_controller.rb @@ -24,6 +24,7 @@ class Origami::HomeController < BaseOrigamiController @dining.bookings.active.each do |booking| if booking.sale_id.nil? && booking.booking_status != 'moved' + @order_items = Array.new booking.booking_orders.each do |booking_order| order = Order.find(booking_order.order_id) @@ -31,26 +32,42 @@ class Origami::HomeController < BaseOrigamiController @obj_order = order @customer = order.customer @date = order.created_at + @booking= booking order.order_items.each do |item| @order_items.push(item) end + accounts = @customer.tax_profiles + @account_arr =[] + accounts.each do |acc| + account = TaxProfile.find(acc) + @account_arr.push(account) + end end end @status_order = 'order' else sale = Sale.find(booking.sale_id) if sale.sale_status != "completed" && sale.sale_status != 'void' + @sale_array.push(sale) if @status_order == 'order' @status_order = 'sale' end + @booking= booking @date = sale.created_at @status_sale = 'sale' @obj_sale = sale @customer = sale.customer + accounts = @customer.tax_profiles + @account_arr =[] + accounts.each do |acc| + account = TaxProfile.find(acc) + @account_arr.push(account) + end end end end + end private diff --git a/app/controllers/origami/payments_controller.rb b/app/controllers/origami/payments_controller.rb index d6671700..0ef1c1a5 100755 --- a/app/controllers/origami/payments_controller.rb +++ b/app/controllers/origami/payments_controller.rb @@ -116,6 +116,13 @@ class Origami::PaymentsController < BaseOrigamiController #get customer amount @customer = Customer.find(@sale_data.customer_id) + accounts = @customer.tax_profiles + @account_arr =[] + accounts.each do |acc| + account = TaxProfile.find(acc) + @account_arr.push(account) + end + rebate = MembershipSetting.find_by_rebate(1) # get member information if @customer.membership_id != nil && rebate @@ -136,6 +143,7 @@ class Origami::PaymentsController < BaseOrigamiController @sale_data.bookings.each do |sbk| df = DiningFacility.find(sbk.dining_facility_id) @table_no = df.type + ' ' + df.name + @checkin_time = sbk.checkin_at break end diff --git a/app/controllers/origami/rooms_controller.rb b/app/controllers/origami/rooms_controller.rb index f235aee3..6c0b98c8 100755 --- a/app/controllers/origami/rooms_controller.rb +++ b/app/controllers/origami/rooms_controller.rb @@ -24,10 +24,12 @@ class Origami::RoomsController < BaseOrigamiController @order_items = Array.new booking.booking_orders.each do |booking_order| order = Order.find(booking_order.order_id) + @customer = order.customer if (order.status == "new") @obj_order = order - @customer = order.customer + @date = order.created_at + @booking = booking order.order_items.each do |item| @order_items.push(item) end @@ -42,6 +44,7 @@ class Origami::RoomsController < BaseOrigamiController if @status_order == 'order' @status_order = 'sale' end + @booking = booking @date = sale.created_at @status_sale = 'sale' @obj_sale = sale diff --git a/app/controllers/transactions/credit_notes_controller.rb b/app/controllers/transactions/credit_notes_controller.rb index 339998f5..e28b5331 100755 --- a/app/controllers/transactions/credit_notes_controller.rb +++ b/app/controllers/transactions/credit_notes_controller.rb @@ -15,12 +15,11 @@ class Transactions::CreditNotesController < ApplicationController if filter.nil? && from.nil? && to.nil? && customer.nil? @sales = Sale.where('payment_status = ?', Sale::SALE_STATUS_OUTSTANDING) - puts "cccccccccccc" else sale = Sale.search_credit_sales(customer,filter,from,to) if sale.count > 0 @sales = sale - @sales = Kaminari.paginate_array(@sales).page(params[:page]).per(50) + @sales = Kaminari.paginate_array(@sales).page(params[:page]).per(20) else @sales = 0 end diff --git a/app/controllers/transactions/orders_controller.rb b/app/controllers/transactions/orders_controller.rb index bd079d83..496d43cd 100755 --- a/app/controllers/transactions/orders_controller.rb +++ b/app/controllers/transactions/orders_controller.rb @@ -9,19 +9,18 @@ class Transactions::OrdersController < ApplicationController if filter.nil? && from.nil? && to.nil? && count.nil? orders = Order.order("order_id desc") - puts "ssssss" + else orders = Order.search(filter,from,to,count) - puts "aaaaa" end if !orders.nil? - @orders = Kaminari.paginate_array(orders).page(params[:page]).per(50) + @orders = Kaminari.paginate_array(orders).page(params[:page]).per(20) else @orders = [] end - puts @orders.to_json + respond_to do |format| format.html # index.html.erb format.json { render json: @orders } diff --git a/app/controllers/transactions/sales_controller.rb b/app/controllers/transactions/sales_controller.rb index 9aca7d87..8486d9ca 100755 --- a/app/controllers/transactions/sales_controller.rb +++ b/app/controllers/transactions/sales_controller.rb @@ -11,13 +11,13 @@ class Transactions::SalesController < ApplicationController to = params[:to] if receipt_no.nil? && from.nil? && to.nil? - @sales = Sale.where("NOT sale_status = 'void' " ).order("sale_id desc").limit(500) - @sales = Kaminari.paginate_array(@sales).page(params[:page]).per(50) + @sales = Sale.where("NOT sale_status = 'void' " ).order("sale_id desc") + @sales = Kaminari.paginate_array(@sales).page(params[:page]).per(20) else sale = Sale.search(receipt_no,from,to) if sale.count > 0 @sales = sale - @sales = Kaminari.paginate_array(@sales).page(params[:page]).per(50) + @sales = Kaminari.paginate_array(@sales).page(params[:page]).per(20) else @sales = 0 end diff --git a/app/views/layouts/_left_sidebar.html.erb b/app/views/layouts/_left_sidebar.html.erb index cf9f77c0..fb326c24 100755 --- a/app/views/layouts/_left_sidebar.html.erb +++ b/app/views/layouts/_left_sidebar.html.erb @@ -89,7 +89,7 @@ <% end %> <% if can? :menage, Sale %><%= qid.item_name %> [x <%= qid.qty %> ] - +
-
- Order at
-
+
+ Order at -
+
<%= qid.created_at.utc.getlocal.strftime("%d-%m-%Y %I:%M %p") %>
- -
-
- <%= qid.item_order_by %>
+
+ Order By -
+ <%= qid.item_order_by %>
-
completed
<%= qid.customer_name %>
<%= qid.assigned_order_item_id %>
@@ -133,27 +134,27 @@| Order By | -Order At - | Customer - | |||
|---|---|---|---|---|---|
| - | - | + | Order By | +Order At | + +|
| + | + | ||||
| Table/Room | -+ | Customer | +|||