menu export import

This commit is contained in:
phyusin
2018-06-21 11:33:22 +06:30
parent 84084303f4
commit 9c6edffd59
2 changed files with 7 additions and 3 deletions

View File

@@ -184,7 +184,11 @@ class Menu < ApplicationRecord
account = Account.create({title: row["Account"], account_type: "0"})
end
menu_itm = MenuItem.create(item_code: row["Item Code"], name: row["Item Name"], account_id: account.id, alt_name: row["Item AltName"], image_path: "", description: '', information: '', unit: '', type: "SimpleMenuItem", menu_category_id: menu_cat.id, item_attributes: item_attrs, item_options: item_opts, is_sub_item: 0, is_available: 1, created_by: created_by)
image_path = row["Image Path"] ? row["Image Path"] : ""
puts image_path
menu_itm = MenuItem.create(item_code: row["Item Code"], name: row["Item Name"], account_id: account.id, alt_name: row["Item AltName"], image_path: image_path.to_s, description: '', information: '', unit: '', type: "SimpleMenuItem", menu_category_id: menu_cat.id, item_attributes: item_attrs, item_options: item_opts, is_sub_item: 0, is_available: 1, created_by: created_by)
puts "menu_itm"
puts menu_itm.to_json
# else
# status = status + "Item Code already exists for " + row["Item Name"] + "."
end