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:
parent
8d52768031
commit
e3dfe4935a
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user