pdf viewer add and menu export testing
This commit is contained in:
BIN
Main Menu.xlsx
BIN
Main Menu.xlsx
Binary file not shown.
@@ -167,8 +167,9 @@ class Settings::MenusController < ApplicationController
|
|||||||
# end
|
# end
|
||||||
end
|
end
|
||||||
|
|
||||||
p.serialize("tmp/menus/" + menu.name + ".xlsx")
|
file_path = "public/menus/" + menu.name + ".xlsx"
|
||||||
render :json => {status: true}
|
p.serialize(file_path)
|
||||||
|
render :json => { status: true, path: file_path }
|
||||||
end
|
end
|
||||||
|
|
||||||
def import
|
def import
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ class Menu < ApplicationRecord
|
|||||||
account = Account.create({title: row["Account"], account_type: "0"})
|
account = Account.create({title: row["Account"], account_type: "0"})
|
||||||
end
|
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_options: "[]", account_id: account_id, is_sub_item: 0, is_available: 1, created_by: created_by)
|
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_options: "[]", is_sub_item: 0, is_available: 1, created_by: created_by)
|
||||||
# else
|
# else
|
||||||
# status = status + "Item Code already exists for " + row["Item Name"] + "."
|
# status = status + "Item Code already exists for " + row["Item Name"] + "."
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -115,7 +115,8 @@
|
|||||||
url: "/settings/menus/" + menu_id + "/export",
|
url: "/settings/menus/" + menu_id + "/export",
|
||||||
success: function(result){
|
success: function(result){
|
||||||
if(result.status){
|
if(result.status){
|
||||||
swal("Success", "Export Success...", "success");
|
location.href = result.path.substring(6);
|
||||||
|
// swal("Success", "Export Success...", "success");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
BIN
public/menus/Main Menu.xlsx
Normal file
BIN
public/menus/Main Menu.xlsx
Normal file
Binary file not shown.
BIN
public/menus/Shwe Myittar.xlsx
Normal file
BIN
public/menus/Shwe Myittar.xlsx
Normal file
Binary file not shown.
Reference in New Issue
Block a user