mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-02-07 01:54:16 +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
|
nil
|
||||||
end
|
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
|
remaining_stock = product.stock[stock_type] + quantity
|
||||||
product.product_stock_movements.create(stock_type: stock_type, reason: reason, quantity: quantity, remaining_stock: remaining_stock,
|
product.product_stock_movements.create(stock_type: stock_type, reason: reason, quantity: quantity, remaining_stock: remaining_stock,
|
||||||
date: DateTime.current,
|
date: DateTime.current,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user