1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-18 07:52:23 +01:00

set default value of order_item_id in update_stock

This commit is contained in:
Du Peng 2022-08-26 14:08:20 +02:00
parent 8d52768031
commit e3dfe4935a

View File

@ -23,7 +23,7 @@ class ProductService
nil
end
def self.update_stock(product, stock_type, reason, quantity, order_item_id)
def self.update_stock(product, stock_type, reason, quantity, order_item_id = nil)
remaining_stock = product.stock[stock_type] + quantity
product.product_stock_movements.create(stock_type: stock_type, reason: reason, quantity: quantity, remaining_stock: remaining_stock,
date: DateTime.current,