Zone and OQS

This commit is contained in:
Phyo
2017-06-17 18:00:59 +06:30
parent cd804a3d18
commit b093a993ba
26 changed files with 608 additions and 60 deletions

View File

@@ -5,10 +5,12 @@
class OrderQueueStation < ApplicationRecord
has_many :assigned_order_items
has_many :order_items
has_many :order_queue_process_by_zones
has_many :zones, through: :order_queue_process_by_zones
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 +22,10 @@ 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)
AssignedOrderItem.assigned_order_item(order, order_item.item_code, oqs)
end
end