fixed inventory

This commit is contained in:
NyanLinHtut
2019-09-27 20:43:48 +06:30
parent ba7e929dc4
commit 62c03bf5fe
6 changed files with 59 additions and 59 deletions

View File

@@ -24,14 +24,8 @@ class InventoryDefinition < ApplicationRecord
end
def self.find_product_in_inventory(item)
product = InventoryDefinition.find_by_item_code(item.item_instance_code)
if product.nil?
return false, nil
else
stock_check_item = StockCheckItem.find_by_item_code(item.item_instance_code)
if stock_check_item.nil?
return false, nil
else
if product = InventoryDefinition.find_by_item_code(item.item_instance_code)
if stock_check_item = StockCheckItem.find_by_item_code(item.item_instance_code)
return true, product
end
end