stock_check report template
This commit is contained in:
@@ -6,14 +6,24 @@ class MenuItemInstance < ApplicationRecord
|
||||
# before_create :generate_menu_item_instance_code
|
||||
|
||||
def self.findParentCategory(item)
|
||||
if item.menu_category_id
|
||||
return item.menu_category_id
|
||||
if item.menu_category_id
|
||||
item.menu_category_id
|
||||
else
|
||||
parentitem = MenuItem.find(item.menu_item_id)
|
||||
findParentCategory(parentitem)
|
||||
end
|
||||
end
|
||||
|
||||
def self.get_item_name(item_code)
|
||||
menu_item = MenuItemInstance.find_by_item_instance_code(item_code)
|
||||
if menu_item.nil?
|
||||
item_name = Product.find_by_item_code(item_code).name
|
||||
else
|
||||
item_name = menu_item.menu_item.name + ' - ' + menu_item.item_instance_name
|
||||
end
|
||||
item_name
|
||||
end
|
||||
|
||||
# private
|
||||
|
||||
# def generate_menu_item_instance_code
|
||||
|
||||
@@ -2,7 +2,7 @@ class StockCheck < ApplicationRecord
|
||||
|
||||
has_many :stock_check_items
|
||||
|
||||
def create(user, eason, item_list)
|
||||
def create(user, reason, item_list)
|
||||
self.reason = reason
|
||||
self.check_by = user.id
|
||||
self.check_start = Time.now
|
||||
|
||||
Reference in New Issue
Block a user