fixed inventory
This commit is contained in:
@@ -180,7 +180,7 @@ class Origami::PaymentsController < BaseOrigamiController
|
||||
else
|
||||
sp.kbz_edit_sale_payment(sp.received_amount.to_f, current_user)
|
||||
end
|
||||
|
||||
|
||||
# end
|
||||
|
||||
if !path.include? ("credit_payment")
|
||||
@@ -304,6 +304,12 @@ class Origami::PaymentsController < BaseOrigamiController
|
||||
|
||||
#end
|
||||
end
|
||||
logger.debug 'saleObj++++++++++++++++++++++++++'
|
||||
logger.debug saleObj.to_json
|
||||
if !saleObj.nil?
|
||||
# InventoryJob.perform_now(self.id)
|
||||
InventoryDefinition.calculate_product_count(saleObj)
|
||||
end
|
||||
end
|
||||
|
||||
# status, filename, sale_receipt_no, printer_name = Payment.pay(getCloudDomain, cash, sale_id, member_info, type, tax_type, path, latest_order_no, shop_detail, current_user, nil, nil)
|
||||
@@ -741,6 +747,10 @@ class Origami::PaymentsController < BaseOrigamiController
|
||||
end
|
||||
end
|
||||
# end
|
||||
if !saleObj.nil?
|
||||
#InventoryJob.perform_now(self.id)
|
||||
InventoryDefinition.calculate_product_count(saleObj)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@ class Origami::SalesController < BaseOrigamiController
|
||||
def show
|
||||
@webview = false
|
||||
if check_mobile
|
||||
@webview = true
|
||||
@webview = true
|
||||
end
|
||||
|
||||
|
||||
@tables = Table.unscoped.all.active.order('status desc')
|
||||
@rooms = Room.unscoped.all.active.order('status desc')
|
||||
@complete = Sale.completed_sale("cashier")
|
||||
@@ -36,7 +36,7 @@ class Origami::SalesController < BaseOrigamiController
|
||||
if booking.sale_id.nil?
|
||||
order_array = []
|
||||
booking.booking_orders.each do |booking_order|
|
||||
|
||||
|
||||
booking.booking_status = 'moved'
|
||||
order = Order.find(booking_order.order_id)
|
||||
order.status = 'billed'
|
||||
@@ -60,16 +60,16 @@ class Origami::SalesController < BaseOrigamiController
|
||||
booking.save
|
||||
|
||||
order_array.push(order.order_id)
|
||||
|
||||
|
||||
end
|
||||
|
||||
receipt_no = Sale.find(sale_id).receipt_no
|
||||
action_by = current_user.name
|
||||
type = "ADD_TO_EXISTING"
|
||||
|
||||
|
||||
remark = "#{action_by} add to existing order #{order_array} to Receipt No=>#{receipt_no} in #{table.name}"
|
||||
sale_audit = SaleAudit.record_audit_sale(sale_id,remark,action_by,type )
|
||||
|
||||
|
||||
booking_order = BookingOrder.where('booking_id=?',booking)
|
||||
booking_order.each do |bo|
|
||||
bo.booking_id = existing_booking.booking_id
|
||||
@@ -77,9 +77,9 @@ class Origami::SalesController < BaseOrigamiController
|
||||
end
|
||||
end
|
||||
end
|
||||
if !sale_data.empty?
|
||||
# if !sale_data.empty?
|
||||
# InventoryJob.perform_now(self.id)
|
||||
InventoryDefinition.calculate_product_count(nil,sale_data)
|
||||
# InventoryDefinition.calculate_product_count(nil,sale_data)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user