stock_check report template

This commit is contained in:
Zin Lin Phyo
2017-09-06 18:27:58 +06:30
parent 784e740da3
commit 5e1e0cd5b9
16 changed files with 940 additions and 814 deletions

View File

@@ -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

View File

@@ -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