update for order process
Add activereocrd-import gem for bulk insert
This commit is contained in:
@@ -41,12 +41,12 @@ class AssignedOrderItem < ApplicationRecord
|
||||
|
||||
def self.assigned_order_item_by_job(order_id)
|
||||
order_item = AssignedOrderItem.select("assigned_order_items.assigned_order_item_id,
|
||||
assigned_order_items.order_queue_station_id,
|
||||
oqs.id as station_id, oqs.station_name,
|
||||
oqs.is_active, oqpz.zone_id,
|
||||
df.name as zone, df.type as table_type,
|
||||
odt.order_id, odt.item_code, odt.item_instance_code, odt.item_name,
|
||||
odt.price, odt.qty, odt.item_order_by, odt.options,
|
||||
assigned_order_items.order_queue_station_id,
|
||||
oqs.id as station_id, oqs.station_name,
|
||||
oqs.is_active, oqpz.zone_id,
|
||||
df.name as zone, df.type as table_type,
|
||||
odt.order_id, odt.item_code, odt.item_instance_code, odt.item_name,
|
||||
odt.price, odt.qty, odt.item_order_by, odt.options,
|
||||
cus.name as customer_name, odt.created_at")
|
||||
.joins(" left join order_queue_stations as oqs on oqs.id = assigned_order_items.order_queue_station_id
|
||||
left join order_queue_process_by_zones as oqpz on oqpz.order_queue_station_id = oqs.id
|
||||
@@ -62,6 +62,11 @@ class AssignedOrderItem < ApplicationRecord
|
||||
return order_item
|
||||
end
|
||||
|
||||
protected
|
||||
def self.generate_ids(count = 1)
|
||||
SeedGenerator.generate_ids(self.name, "AOI", count)
|
||||
end
|
||||
|
||||
private
|
||||
def generate_custom_id
|
||||
if self.assigned_order_item_id.nil?
|
||||
|
||||
Reference in New Issue
Block a user