oqs sample
This commit is contained in:
@@ -1,2 +1,15 @@
|
||||
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
|
||||
|
||||
@@ -8,7 +8,7 @@ class OrderQueueStation < ApplicationRecord
|
||||
|
||||
scope :active, -> {where(is_active: true)}
|
||||
|
||||
def process_order (order)
|
||||
def process_order (order)
|
||||
oqs_stations = OrderQueueStation.active
|
||||
|
||||
order_items = order.order_items
|
||||
@@ -20,10 +20,11 @@ class OrderQueueStation < ApplicationRecord
|
||||
#Loop through the processing items
|
||||
pq_items.each do |pq_item|
|
||||
#Processing through the looping items
|
||||
order_items.each do |order_item|
|
||||
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)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
2
app/models/test.rb
Normal file
2
app/models/test.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
class Test < ApplicationRecord
|
||||
end
|
||||
Reference in New Issue
Block a user