deleted order queue item

This commit is contained in:
Yan
2017-06-01 12:07:27 +06:30
parent 2d511cc63e
commit 2a323c8d0d
6 changed files with 29 additions and 36 deletions

View File

@@ -9,16 +9,14 @@ 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 'mysql2', '>= 0.3.18', '< 0.5'
#Use PosgreSQL
gem 'pg'
#gem 'pg'
# redis server for cable
gem 'redis', '~> 3.0'
gem 'mysql2', '>= 0.3.18', '< 0.5'
# Use Puma as the app server
gem 'puma', '~> 3.0'
# Use SCSS for stylesheets
@@ -45,6 +43,9 @@ gem 'to_xls-rails'
#Reporting gem
#gem 'compendium'
# Pagination
gem 'kaminari', :git => "git://github.com/amatsuda/kaminari.git", :branch => 'master'
# Use jquery as the JavaScript library
gem 'jquery-rails'

View File

@@ -1,3 +1,21 @@
GIT
remote: git://github.com/amatsuda/kaminari.git
revision: c3c853a944cd2bff072ae05e48c563b2c9a29597
branch: master
specs:
kaminari (1.0.1)
activesupport (>= 4.1.0)
kaminari-actionview (= 1.0.1)
kaminari-activerecord (= 1.0.1)
kaminari-core (= 1.0.1)
kaminari-actionview (1.0.1)
actionview
kaminari-core (= 1.0.1)
kaminari-activerecord (1.0.1)
activerecord
kaminari-core (= 1.0.1)
kaminari-core (1.0.1)
GEM
remote: https://rubygems.org/
specs:
@@ -96,11 +114,12 @@ GEM
mini_portile2 (2.1.0)
minitest (5.10.2)
multi_json (1.12.1)
nio4r (2.1.0)
mysql2 (0.4.6)
nio4r (2.1.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)
@@ -231,8 +250,10 @@ DEPENDENCIES
font-awesome-rails
jbuilder (~> 2.5)
jquery-rails
kaminari!
listen (~> 3.0.5)
mysql2 (>= 0.3.18, < 0.5)
pg
prawn
prawn-table
puma (~> 3.0)

View File

@@ -209,6 +209,7 @@ class Order < ApplicationRecord
def send_order_broadcast
#Send to background job for processing
OrderBroadcastJob.perform_later(self.id)
end
#Origami: Cashier : to view order type Table
def self.get_order_table
@@ -242,6 +243,5 @@ class Order < ApplicationRecord
left join order_items on order_items.order_id = orders.id")
.where("dining_facilities.is_active=?",true)
.group("orders.id")
>>>>>>> 47469cf466f1464fa4289e78c68b60e279174c60
end
end

View File

@@ -1,15 +0,0 @@
class OrderQueueItem < ApplicationRecord
belongs_to :order
belongs_to :order_queue_station
def self.add_order_item (order, item_code, order_queue_station )
order_queue_item = OrderQueueItem.new()
order_queue_item.order = order
order_queue_item.item_code = item_code
order_queue_item.order_queue_station = order_queue_station
order_queue_item.print_status = false
order_queue_item.delivery_status = false
order_queue_item.queue_status = true
order_queue_item.save
end
end

View File

@@ -23,8 +23,7 @@ class OrderQueueStation < ApplicationRecord
order_items.each do |order_item|
if (pq_item == order_item.item_code)
#Same Order_items can appear in two location.
AssignedOrderItem.assigned_order_item(order, order_item.item_code, oqs)
OrderQueueItem.add_order_item(order, order_item.item_code, oqs)
AssignedOrderItem.assigned_order_item(order, order_item.item_code, oqs)
end
end

View File

@@ -1,13 +0,0 @@
class CreateOrderQueueItems < ActiveRecord::Migration[5.1]
def change
create_table :order_queue_items do |t|
t.string :item_code, :null => false, :index => true
t.references :order_queue_station, foreign_key: true
t.references :order, foreign_key: true
t.boolean :print_status
t.boolean :delivery_status
t.boolean :queue_status
t.timestamps
end
end
end