update optimization
This commit is contained in:
@@ -8,7 +8,6 @@ class AssignedOrderItem < ApplicationRecord
|
||||
belongs_to :order_queue_station
|
||||
|
||||
def self.assigned_order_item (order, item_code, instance_code, order_queue_station )
|
||||
AssignedOrderItem.transaction do
|
||||
assigned_order_item = AssignedOrderItem.new()
|
||||
assigned_order_item.order = order
|
||||
assigned_order_item.item_code = item_code
|
||||
@@ -17,7 +16,6 @@ class AssignedOrderItem < ApplicationRecord
|
||||
assigned_order_item.print_status = false
|
||||
assigned_order_item.delivery_status = false
|
||||
assigned_order_item.save!
|
||||
end
|
||||
end
|
||||
|
||||
def self.assigned_order_item_by_job(order_id)
|
||||
|
||||
@@ -207,7 +207,7 @@ class OrderQueueStation < ApplicationRecord
|
||||
private
|
||||
#Print order_items in 1 slip
|
||||
def print_slip(oqs, order, order_items)
|
||||
printer = PrintSetting.all
|
||||
printer = PrintSetting.all.order("id ASC")
|
||||
unique_code="OrderSummaryPdf"
|
||||
|
||||
if !printer.empty?
|
||||
@@ -245,7 +245,7 @@ class OrderQueueStation < ApplicationRecord
|
||||
|
||||
#Print order_item in 1 slip per item
|
||||
def print_slip_item(oqs, order, assigned_items)
|
||||
printer = PrintSetting.all
|
||||
printer = PrintSetting.all.order("id ASC")
|
||||
unique_code="OrderItemPdf"
|
||||
|
||||
if !printer.empty?
|
||||
|
||||
@@ -70,7 +70,7 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
|
||||
print_settings.save!
|
||||
end
|
||||
|
||||
print_setting = PrintSetting.all
|
||||
print_setting = PrintSetting.all.order("id ASC")
|
||||
order=print_query('order_summary', order_id)
|
||||
# For Print Per Item
|
||||
if oqs.cut_per_item
|
||||
@@ -170,7 +170,7 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
|
||||
print_settings.save!
|
||||
end
|
||||
|
||||
print_setting = PrintSetting.all
|
||||
print_setting = PrintSetting.all.order("id ASC")
|
||||
|
||||
order=print_query('booking_summary', booking_id)
|
||||
# For Print Per Item
|
||||
|
||||
@@ -8,12 +8,10 @@ class SaleOrder < ApplicationRecord
|
||||
belongs_to :order
|
||||
|
||||
def create_sale_order(sale, order)
|
||||
SaleOrder.transaction do
|
||||
sale_order = SaleOrder.new
|
||||
sale_order.sale_id = sale
|
||||
sale_order.order_id = order
|
||||
sale_order.save!
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
Reference in New Issue
Block a user