Merge branch 'adminbsb_material_ui'
This commit is contained in:
2
Gemfile
2
Gemfile
@@ -48,7 +48,6 @@ gem 'prawn'
|
|||||||
gem 'prawn-table'
|
gem 'prawn-table'
|
||||||
gem 'spreadsheet'
|
gem 'spreadsheet'
|
||||||
gem 'to_xls-rails'
|
gem 'to_xls-rails'
|
||||||
|
|
||||||
#Reporting gem
|
#Reporting gem
|
||||||
#gem 'compendium'
|
#gem 'compendium'
|
||||||
#gem "cancan"
|
#gem "cancan"
|
||||||
@@ -81,7 +80,6 @@ gem 'kaminari', '~> 1.0.1'
|
|||||||
gem 'filterrific'
|
gem 'filterrific'
|
||||||
|
|
||||||
gem 'cancancan', '~> 1.10'
|
gem 'cancancan', '~> 1.10'
|
||||||
|
|
||||||
#pageless no need for current
|
#pageless no need for current
|
||||||
# gem 'will_paginate'
|
# gem 'will_paginate'
|
||||||
# gem 'pageless-rails', github: 'rorlab/pageless-rails'
|
# gem 'pageless-rails', github: 'rorlab/pageless-rails'
|
||||||
|
|||||||
@@ -180,7 +180,6 @@ $(function() {
|
|||||||
image_path = "image/logo.png";
|
image_path = "image/logo.png";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(menu_items[field].options)
|
|
||||||
|
|
||||||
row = '<div class="card custom-card testimonial-card animated fadeInRight" style="height:100%;background-image:url(../../'+image_path+');background-repeat: no-repeat;">'
|
row = '<div class="card custom-card testimonial-card animated fadeInRight" style="height:100%;background-image:url(../../'+image_path+');background-repeat: no-repeat;">'
|
||||||
+'<div class="custom-card-head card-head row" style="line-height:14px;margin:0px;" style="">'
|
+'<div class="custom-card-head card-head row" style="line-height:14px;margin:0px;" style="">'
|
||||||
@@ -190,6 +189,7 @@ $(function() {
|
|||||||
+JSON.stringify(menu_items[field].instances)+"' data-id = '"
|
+JSON.stringify(menu_items[field].instances)+"' data-id = '"
|
||||||
+JSON.stringify(menu_items[field].attributes)+"' data-item = '"
|
+JSON.stringify(menu_items[field].attributes)+"' data-item = '"
|
||||||
+JSON.stringify(item_attributes)+"' data-option = '"
|
+JSON.stringify(item_attributes)+"' data-option = '"
|
||||||
|
+JSON.stringify(menu_items[field].options)+"'data-opt = '"
|
||||||
+JSON.stringify(menu_items[field].options)+"' data-item-sets = '"
|
+JSON.stringify(menu_items[field].options)+"' data-item-sets = '"
|
||||||
+JSON.stringify(menu_items[field].item_sets)+"' data-toggle='modal' data-target='."+data_target+"' >"
|
+JSON.stringify(menu_items[field].item_sets)+"' data-toggle='modal' data-target='."+data_target+"' >"
|
||||||
+"<i class='fa "+fa_plus+" '>"
|
+"<i class='fa "+fa_plus+" '>"
|
||||||
@@ -202,6 +202,7 @@ $(function() {
|
|||||||
+ price +"' data-instance-code = '"+ code +"' data-instance = '"
|
+ price +"' data-instance-code = '"+ code +"' data-instance = '"
|
||||||
+ name +"' data-promotion-price = '"+ promotion_price +"' data-attributes = '"
|
+ name +"' data-promotion-price = '"+ promotion_price +"' data-attributes = '"
|
||||||
+ JSON.stringify(item_attributes) +"' data-options = '"
|
+ JSON.stringify(item_attributes) +"' data-options = '"
|
||||||
|
+ JSON.stringify(menu_items[field].options) +"' data-opt = '"
|
||||||
+ JSON.stringify(menu_items[field].options) +"' data-image='"+image_path+"' data-toggle='"
|
+ JSON.stringify(menu_items[field].options) +"' data-image='"+image_path+"' data-toggle='"
|
||||||
+data_modal+"' data-target='."+data_target+"' data-item-sets = '"
|
+data_modal+"' data-target='."+data_target+"' data-item-sets = '"
|
||||||
+JSON.stringify(menu_items[field].item_sets)+"'data-instances = '"
|
+JSON.stringify(menu_items[field].item_sets)+"'data-instances = '"
|
||||||
@@ -296,7 +297,7 @@ $(function() {
|
|||||||
$('.set-item').attr('data-code',instances[0]['code']);
|
$('.set-item').attr('data-code',instances[0]['code']);
|
||||||
$('.set-item').attr('data-name',instances[0]['name']);
|
$('.set-item').attr('data-name',instances[0]['name']);
|
||||||
$('.set-item').attr('data-price',instances[0]['price']);
|
$('.set-item').attr('data-price',instances[0]['price']);
|
||||||
// $('.set-item').attr('data-options','[]');
|
$('.set-item').attr('data-options','');
|
||||||
$('.set-item').attr('data-parent',true);
|
$('.set-item').attr('data-parent',true);
|
||||||
|
|
||||||
$('#set_change_qty').val(1);
|
$('#set_change_qty').val(1);
|
||||||
@@ -351,6 +352,7 @@ $(function() {
|
|||||||
sub_total = $('#set_total_price').text();
|
sub_total = $('#set_total_price').text();
|
||||||
name = $(this).data('name');
|
name = $(this).data('name');
|
||||||
price = $(this).data('price');
|
price = $(this).data('price');
|
||||||
|
options = $(this).attr('data-options','');
|
||||||
// qty = $('#set_change_qty').val();
|
// qty = $('#set_change_qty').val();
|
||||||
qty = document.getElementById("set_count").value;
|
qty = document.getElementById("set_count").value;
|
||||||
total = qty*price;
|
total = qty*price;
|
||||||
@@ -379,14 +381,14 @@ $(function() {
|
|||||||
|
|
||||||
item = get_set_item(items);
|
item = get_set_item(items);
|
||||||
customer_display_view(item,"set_add");
|
customer_display_view(item,"set_add");
|
||||||
|
var option = ''
|
||||||
attribute_arr = []
|
attribute_arr = []
|
||||||
|
|
||||||
var rowCount = $('.summary-items tbody tr').length+1;
|
var rowCount = $('.summary-items tbody tr').length+1;
|
||||||
code = $('.set-item').attr('data-code');
|
code = $('.set-item').attr('data-code');
|
||||||
name = $('.set-item').attr('data-name');
|
name = $('.set-item').attr('data-name');
|
||||||
price = $('.set-item').attr('data-price');
|
price = $('.set-item').attr('data-price');
|
||||||
option = $('.set-item').attr('data-options');
|
option = ($('.set-item').attr('data-options') === 'undefined') ? '' :$('.set-item').attr('data-options');
|
||||||
parent = $('.set-item').attr('data-parent');
|
parent = $('.set-item').attr('data-parent');
|
||||||
total = qty * price ;
|
total = qty * price ;
|
||||||
row ="<tr class='item_box' data-price ='"
|
row ="<tr class='item_box' data-price ='"
|
||||||
@@ -396,7 +398,7 @@ $(function() {
|
|||||||
+attribute_arr+"' data-options ='"
|
+attribute_arr+"' data-options ='"
|
||||||
+option+"' data-row ='"+rowCount+ "' data-parent ='"+parent+ "'>"
|
+option+"' data-row ='"+rowCount+ "' data-parent ='"+parent+ "'>"
|
||||||
+'<td class="item-cell-no">'+rowCount+'</td>'
|
+'<td class="item-cell-no">'+rowCount+'</td>'
|
||||||
+'<td class="item-cell-name" id="item_name" >' + item_name+ ' ' + name +'-' + option +'</td>'
|
+'<td class="item-cell-name" id="item_name" >' + item_name+ ' ' + name +' ' + option +'</td>'
|
||||||
+'<td class="item-cell-qty" id="item_qty">' + qty + '</td>'
|
+'<td class="item-cell-qty" id="item_qty">' + qty + '</td>'
|
||||||
+'<td class="item-cell-price" id="item_price">'
|
+'<td class="item-cell-price" id="item_price">'
|
||||||
+ parseFloat(total).toFixed(2)
|
+ parseFloat(total).toFixed(2)
|
||||||
@@ -404,22 +406,23 @@ $(function() {
|
|||||||
+'</tr>';
|
+'</tr>';
|
||||||
$(".summary-items tbody").append(row);
|
$(".summary-items tbody").append(row);
|
||||||
var rowCount = $('.summary-items tbody tr').length+1;
|
var rowCount = $('.summary-items tbody tr').length+1;
|
||||||
|
var set_option = ''
|
||||||
$(items).each(function(i){
|
$(items).each(function(i){
|
||||||
code = $(items[i]).attr('data-code');
|
code = $(items[i]).attr('data-code');
|
||||||
name = $(items[i]).attr('data-name');
|
name = $(items[i]).attr('data-name');
|
||||||
price = $(items[i]).attr('data-price');
|
price = $(items[i]).attr('data-price');
|
||||||
option = $(items[i]).attr('data-options');
|
set_option = ($(items[i]).attr('data-options') === 'undefined') ? ' ' :$(items[i]).attr('data-options');
|
||||||
|
|
||||||
sub_item = $(items[i]).attr('data-sub-item');
|
sub_item = $(items[i]).attr('data-sub-item');
|
||||||
option = $(items[i]).attr('data-options');
|
|
||||||
total = qty * price ;
|
total = qty * price ;
|
||||||
row ="<tr class='item_box' data-price ='"
|
row ="<tr class='item_box' data-price ='"
|
||||||
+price+ "' data-toggle='modal' data-target='#sx_itemModal' 'data-instance ='"
|
+price+ "' data-toggle='modal' data-target='#sx_itemModal' 'data-instance ='"
|
||||||
+name+ "' data-code='"+item_code+"' data-instance-code='"
|
+name+ "' data-code='"+item_code+"' data-instance-code='"
|
||||||
+code+"' data-attributes='"
|
+code+"' data-attributes='"
|
||||||
+attribute_arr+"' data-options ='"
|
+attribute_arr+"' data-options ='"
|
||||||
+option+"' data-row ='"+rowCount+ "' data-sub-item ='"+sub_item+ "'>"
|
+set_option+"' data-row ='"+rowCount+ "' data-sub-item ='"+sub_item+ "'>"
|
||||||
+'<td class="item-cell-no">'+rowCount+'</td>'
|
+'<td class="item-cell-no">'+rowCount+'</td>'
|
||||||
+'<td class="item-cell-name" id="item_name" >' + item_name+ ' ' + name +'-' + option +'</td>'
|
+'<td class="item-cell-name" id="item_name" >' + item_name+ ' ' + name +' ' + set_option +'</td>'
|
||||||
+'<td class="item-cell-qty" id="item_qty">' + qty + '</td>'
|
+'<td class="item-cell-qty" id="item_qty">' + qty + '</td>'
|
||||||
+'<td class="item-cell-price" id="item_price">'
|
+'<td class="item-cell-price" id="item_price">'
|
||||||
+ parseFloat(total).toFixed(2)
|
+ parseFloat(total).toFixed(2)
|
||||||
@@ -659,7 +662,6 @@ $(function() {
|
|||||||
|
|
||||||
attribute_arr = get_selected_attributes('selected-attribute');
|
attribute_arr = get_selected_attributes('selected-attribute');
|
||||||
option_arr = get_selected_attributes('selected-option');
|
option_arr = get_selected_attributes('selected-option');
|
||||||
|
|
||||||
if (item_row.length>0) {
|
if (item_row.length>0) {
|
||||||
var instances = jQuery.parseJSON(item_row.attr('data-instances'));
|
var instances = jQuery.parseJSON(item_row.attr('data-instances'));
|
||||||
|
|
||||||
@@ -700,7 +702,7 @@ $(function() {
|
|||||||
var item_data = $(this);
|
var item_data = $(this);
|
||||||
item = get_item(item_data);
|
item = get_item(item_data);
|
||||||
customer_display_view(item,"add");
|
customer_display_view(item,"add");
|
||||||
show_item_detail(item_data);
|
show_item_detail(item_data,"add_to_order");
|
||||||
calculate_sub_total();
|
calculate_sub_total();
|
||||||
|
|
||||||
}); //End add order Click
|
}); //End add order Click
|
||||||
@@ -710,11 +712,11 @@ $(function() {
|
|||||||
var item_data = $(this);
|
var item_data = $(this);
|
||||||
item = get_item(item_data);
|
item = get_item(item_data);
|
||||||
customer_display_view(item,"add");
|
customer_display_view(item,"add");
|
||||||
show_item_detail(item_data);
|
show_item_detail(item_data,"add_icon");
|
||||||
calculate_sub_total();
|
calculate_sub_total();
|
||||||
}); //End Add Icon Click
|
}); //End Add Icon Click
|
||||||
|
|
||||||
function show_item_detail(data){
|
function show_item_detail(data,click_type){
|
||||||
|
|
||||||
qty = parseInt(data.attr('data-qty'));
|
qty = parseInt(data.attr('data-qty'));
|
||||||
append = 0;
|
append = 0;
|
||||||
@@ -726,23 +728,26 @@ $(function() {
|
|||||||
}else{
|
}else{
|
||||||
instance = "("+data.attr('data-instance')+")";
|
instance = "("+data.attr('data-instance')+")";
|
||||||
}
|
}
|
||||||
|
d_option = data.attr('data-opt');
|
||||||
d_option = data.attr('data-options');
|
if (click_type != "add_icon"){
|
||||||
if (d_option){
|
|
||||||
option_name = "-"+data.attr('data-options');
|
option_name = "-"+data.attr('data-options');
|
||||||
|
data_option = data.attr('data-options') ;
|
||||||
}else{
|
}else{
|
||||||
option_name = '';
|
option_name = ' ';
|
||||||
|
data_option = '[]';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var rowCount = $('.summary-items tbody tr').length+1;
|
var rowCount = $('.summary-items tbody tr').length+1;
|
||||||
var item_row = $('.summary-items tbody tr');
|
var item_row = $('.summary-items tbody tr');
|
||||||
|
|
||||||
$(item_row).each(function(i){
|
$(item_row).each(function(i){
|
||||||
item_code = $(item_row[i]).attr('data-code');
|
item_code = $(item_row[i]).attr('data-code');
|
||||||
instance_code = $(item_row[i]).attr('data-instance-code');
|
instance_code = $(item_row[i]).attr('data-instance-code');
|
||||||
r_option = $(item_row[i]).attr('data-options');
|
r_option = $(item_row[i]).attr('data-opt');
|
||||||
|
console.log(r_option)
|
||||||
if (item_code == data.attr('data-item-code') && instance_code == data.attr('data-instance-code')&&r_option==d_option) {
|
console.log(d_option)
|
||||||
|
if (item_code == data.attr('data-item-code') && instance_code == data.attr('data-instance-code')&&r_option == d_option) {
|
||||||
if (qty > 1) {
|
if (qty > 1) {
|
||||||
qty = parseInt($(item_row[i]).children('#item_qty').text()) + qty;
|
qty = parseInt($(item_row[i]).children('#item_qty').text()) + qty;
|
||||||
}else{
|
}else{
|
||||||
@@ -766,9 +771,10 @@ $(function() {
|
|||||||
+instance+ "' data-code='"+data.attr('data-item-code')+"' data-instance-code='"
|
+instance+ "' data-code='"+data.attr('data-item-code')+"' data-instance-code='"
|
||||||
+data.attr('data-instance-code')+"' data-attributes='"
|
+data.attr('data-instance-code')+"' data-attributes='"
|
||||||
+data.attr('data-attributes')+"' data-options ='"
|
+data.attr('data-attributes')+"' data-options ='"
|
||||||
|
+data_option+"' data-opt ='"
|
||||||
+data.attr('data-options')+"' data-row ='"+rowCount+ "'>"
|
+data.attr('data-options')+"' data-row ='"+rowCount+ "'>"
|
||||||
+'<td class="item-cell-no">'+rowCount+'</td>'
|
+'<td class="item-cell-no">'+rowCount+'</td>'
|
||||||
+'<td class="item-cell-name" id="item_name" >' + data.attr('data-name')+ ' ' + instance +' ' + option_name +'</td>'
|
+'<td class="item-cell-name" id="item_name" >' + data.attr('data-name')+ ' ' + instance +''+option_name+'</td>'
|
||||||
+'<td class="item-cell-qty" id="item_qty">' + qty + '</td>'
|
+'<td class="item-cell-qty" id="item_qty">' + qty + '</td>'
|
||||||
+'<td class="item-cell-price" id="item_price">'
|
+'<td class="item-cell-price" id="item_price">'
|
||||||
+ parseFloat(price).toFixed(2)
|
+ parseFloat(price).toFixed(2)
|
||||||
@@ -822,8 +828,6 @@ $(function() {
|
|||||||
data: params,
|
data: params,
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
success:function(result){
|
success:function(result){
|
||||||
console.log(type)
|
|
||||||
console.log(table_type)
|
|
||||||
if (type == "quick_service") {
|
if (type == "quick_service") {
|
||||||
window.location.href = "/origami/quick_service"
|
window.location.href = "/origami/quick_service"
|
||||||
}else{
|
}else{
|
||||||
@@ -889,7 +893,7 @@ $(function() {
|
|||||||
dataType: "json",
|
dataType: "json",
|
||||||
success:function(result){
|
success:function(result){
|
||||||
if (result.status) {
|
if (result.status) {
|
||||||
console.log(result)
|
|
||||||
if (result.data == null){
|
if (result.data == null){
|
||||||
swal({
|
swal({
|
||||||
title: "Please Open Shift !",
|
title: "Please Open Shift !",
|
||||||
|
|||||||
@@ -67,7 +67,8 @@ class Api::OrdersController < Api::ApiController
|
|||||||
end
|
end
|
||||||
}
|
}
|
||||||
#end extra time
|
#end extra time
|
||||||
|
puts params[:order_items]
|
||||||
|
puts "ITEM aaaaaaaaaaaaaaaaaaa"
|
||||||
# begin
|
# begin
|
||||||
@order = Order.new
|
@order = Order.new
|
||||||
@order.source = params[:order_source]
|
@order.source = params[:order_source]
|
||||||
|
|||||||
@@ -94,10 +94,10 @@ class Origami::AddordersController < BaseOrigamiController
|
|||||||
extra_time = Time.at(time)
|
extra_time = Time.at(time)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if i["parent_order_item_id"]
|
if i["parent_order_item_id"];
|
||||||
items = {"order_item_id": i["order_item_id"],"item_instance_code": i["item_instance_code"],"quantity": i["quantity"],"parent_order_item_id": i["parent_order_item_id"],"options": i["options"]}
|
items = {"order_item_id": i["order_item_id"],"item_instance_code": i["item_instance_code"],"quantity": i["quantity"],"parent_order_item_id": i["parent_order_item_id"],"options": JSON.parse(i["options"])}
|
||||||
else
|
else
|
||||||
items = {"order_item_id": i["order_item_id"],"item_instance_code": i["item_instance_code"],"quantity": i["quantity"],"options": i["options"]}
|
items = {"order_item_id": i["order_item_id"],"item_instance_code": i["item_instance_code"],"quantity": i["quantity"],"options": JSON.parse(i["options"])}
|
||||||
end
|
end
|
||||||
items_arr.push(items)
|
items_arr.push(items)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,10 @@ class Settings::MenusController < ApplicationController
|
|||||||
@settings_menus = Menu.all.page(params[:page]).per(10)
|
@settings_menus = Menu.all.page(params[:page]).per(10)
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html
|
format.html
|
||||||
format.csv { send_data Menu.to_csv }
|
# format.csv { send_data MenuCsvExport.generate }
|
||||||
|
|
||||||
|
format.csv { send_data Menu.to_csv }
|
||||||
|
# format.csv { send_data MenuCategory.to_csv }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -71,6 +74,11 @@ class Settings::MenusController < ApplicationController
|
|||||||
# end
|
# end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def import
|
||||||
|
Menu.import(params[:file])
|
||||||
|
redirect_to settings_menu_path, notice: "imported"
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
# Use callbacks to share common setup or constraints between actions.
|
# Use callbacks to share common setup or constraints between actions.
|
||||||
def set_settings_menu
|
def set_settings_menu
|
||||||
|
|||||||
@@ -23,8 +23,9 @@ class Transactions::OrdersController < ApplicationController
|
|||||||
@to = to
|
@to = to
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html # index.html.erb
|
format.html
|
||||||
format.json { render json: @orders }
|
format.json { render json: @orders }
|
||||||
|
# format.csv { send_data OrdersCsvExport.generate }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -33,27 +33,20 @@ class Menu < ApplicationRecord
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.to_csv
|
def self.to_csv
|
||||||
m_attributes = %w{id name is_active valid_days valid_time_from valid_time_to created_by created_at updated_at}
|
m_attributes = %w{name is_active valid_days valid_time_from valid_time_to created_by created_at updated_at}
|
||||||
CSV.generate(headers: true) do |csv|
|
CSV.generate(headers: true) do |csv|
|
||||||
csv << m_attributes
|
csv << m_attributes
|
||||||
menu = Menu.all
|
menu = Menu.all
|
||||||
menu.each do |user|
|
menu.each do |user|
|
||||||
puts user
|
|
||||||
csv << m_attributes.map{ |attr| user.send(attr)}
|
csv << m_attributes.map{ |attr| user.send(attr)}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# mc_attributes = %w{id menu_id code name alt_name order_by created_by menu_category_id is_available created_at updated_at}
|
def self.import(file)
|
||||||
# CSV.generate(headers: true) do |csv|
|
CSV.foreach(file.path, headers:true) do |row|
|
||||||
# csv << m_attributes
|
Menu.create! row.to_hash
|
||||||
|
end
|
||||||
# csv << mc_attributes
|
|
||||||
# MenuCategory.all.each do |user|
|
|
||||||
# puts user
|
|
||||||
# csv << mc_attributes.map{ |attr| user.send(attr)}
|
|
||||||
# end
|
|
||||||
# end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
class MenuCategory < ApplicationRecord
|
class MenuCategory < ApplicationRecord
|
||||||
# before_create :generate_menu_category_code
|
# before_create :generate_menu_category_code
|
||||||
|
|
||||||
belongs_to :menu
|
belongs_to :menu , counter_cache: true
|
||||||
has_many :children, :class_name => "MenuCategory", foreign_key: "menu_category_id"
|
has_many :children, :class_name => "MenuCategory", foreign_key: "menu_category_id"
|
||||||
belongs_to :parent, :class_name => "MenuCategory", foreign_key: "menu_category_id", optional: true
|
belongs_to :parent, :class_name => "MenuCategory", foreign_key: "menu_category_id", optional: true
|
||||||
has_many :menu_items
|
has_many :menu_items
|
||||||
@@ -83,4 +83,19 @@ class MenuCategory < ApplicationRecord
|
|||||||
# def generate_menu_category_code
|
# def generate_menu_category_code
|
||||||
# self.code = SeedGenerator.generate_code(self.class.name, "C")
|
# self.code = SeedGenerator.generate_code(self.class.name, "C")
|
||||||
# end
|
# end
|
||||||
|
|
||||||
|
def self.to_csv
|
||||||
|
|
||||||
|
mc_attributes = %w{id menu_id code name alt_name order_by created_by menu_category_id is_available created_at updated_at}
|
||||||
|
CSV.generate(headers: true) do |csv|
|
||||||
|
csv << mc_attributes
|
||||||
|
|
||||||
|
csv << mc_attributes
|
||||||
|
MenuCategory.all.each do |user|
|
||||||
|
puts user
|
||||||
|
csv << mc_attributes.map{ |attr| user.send(attr)}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ class OrderItem < ApplicationRecord
|
|||||||
|
|
||||||
#Associations
|
#Associations
|
||||||
belongs_to :order, autosave: true
|
belongs_to :order, autosave: true
|
||||||
|
# belongs_to :order, counter_cache: true
|
||||||
|
|
||||||
#Validation
|
#Validation
|
||||||
validates_presence_of :item_code, :item_name, :qty
|
validates_presence_of :item_code, :item_name, :qty
|
||||||
|
|||||||
@@ -375,7 +375,7 @@
|
|||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<div class="row set-item">
|
<div class="row set-item">
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<p style="text-align: center;"> <%= image_tag "logo.png" ,width: '', height: '', :id => 'logo' %></p>
|
<p class="set_default_option" style="text-align: center;"> <%= image_tag "logo.png" ,width: '', height: '', :id => 'logo' %></p>
|
||||||
<!-- <div class="form-group">
|
<!-- <div class="form-group">
|
||||||
<label class="col-md-6" style="margin-top:5px">Quantity</label>
|
<label class="col-md-6" style="margin-top:5px">Quantity</label>
|
||||||
<input type="number" name="qty" class="form-control col-md-5 input-number change_qty" id="set_change_qty" value="" min="1" max="100">
|
<input type="number" name="qty" class="form-control col-md-5 input-number change_qty" id="set_change_qty" value="" min="1" max="100">
|
||||||
|
|||||||
@@ -7,6 +7,11 @@
|
|||||||
</span>
|
</span>
|
||||||
</ol>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- <h4>Import</h4>
|
||||||
|
<%= form_tag import_settings_menus_path, multipart:true do%>
|
||||||
|
<%=file_field_tag :file%>
|
||||||
|
<%=submit_tag "Import CSV"%>
|
||||||
|
<%end%> -->
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12 col-sm-12 col-md-2 col-lg-2">
|
<div class="col-xs-12 col-sm-12 col-md-2 col-lg-2">
|
||||||
<br><br>
|
<br><br>
|
||||||
|
|||||||
@@ -20,5 +20,7 @@ module SXRestaurants
|
|||||||
config.active_record.time_zone_aware_types = [:datetime, :time]
|
config.active_record.time_zone_aware_types = [:datetime, :time]
|
||||||
config.active_job.queue_adapter = :sidekiq
|
config.active_job.queue_adapter = :sidekiq
|
||||||
config.time_zone = 'Asia/Rangoon'
|
config.time_zone = 'Asia/Rangoon'
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -298,6 +298,7 @@ scope "(:locale)", locale: /en|mm/ do
|
|||||||
#menu
|
#menu
|
||||||
resources :menus do
|
resources :menus do
|
||||||
#menu_categories
|
#menu_categories
|
||||||
|
collection { post :import }
|
||||||
resources :menu_categories, only: [:new, :create, :edit, :delete]
|
resources :menu_categories, only: [:new, :create, :edit, :delete]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -1,128 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"name": "Administrator",
|
|
||||||
"role": "administrator",
|
|
||||||
"emp_id": "999",
|
|
||||||
"password_digest": "$2a$10$mfWmxBvOHt3NbWrLGOF/POTpnxF7QEtnW99qW818dkrQqVLtjQdrS",
|
|
||||||
"token_session": null,
|
|
||||||
"session_expiry": null,
|
|
||||||
"session_last_login": "2018-03-14 09:41:25 +0630",
|
|
||||||
"created_by": "SYSTEM DEFAULT",
|
|
||||||
"created_at": "2017-11-08 09:44:30 +0630",
|
|
||||||
"updated_at": "2018-03-14 16:02:09 +0630",
|
|
||||||
"image_path": {"url":null}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 2,
|
|
||||||
"name": "Waiter",
|
|
||||||
"role": "waiter",
|
|
||||||
"emp_id": "111",
|
|
||||||
"password_digest": "$2a$10$PjBemEA2yKOcoGAyXjz81OqglrASIF8RTYHVe0vqp3FQ0T4/PzJJG",
|
|
||||||
"token_session": "662e797ad508ab6c43b1",
|
|
||||||
"session_expiry": "2018-02-21 01:45:11 +0630",
|
|
||||||
"session_last_login": "2018-02-20 13:45:11 +0630",
|
|
||||||
"created_by": "SYSTEM DEFAULT",
|
|
||||||
"created_at": "2017-11-08 09:44:30 +0630",
|
|
||||||
"updated_at": "2018-02-20 13:59:17 +0630",
|
|
||||||
"image_path": {"url":null}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 3,
|
|
||||||
"name": "Waiter 2",
|
|
||||||
"role": "waiter",
|
|
||||||
"emp_id": "222",
|
|
||||||
"password_digest": "$2a$10$gXh/Tpbr8EyJSaxsbJYVh.K7Fr4bT0A1i2mWuuZm/FHQ4D/wV1E8e",
|
|
||||||
"token_session": "61868be9530b753ada84",
|
|
||||||
"session_expiry": "2018-03-14 05:41:12 +0630",
|
|
||||||
"session_last_login": "2018-03-13 17:11:12 +0630",
|
|
||||||
"created_by": "SYSTEM DEFAULT",
|
|
||||||
"created_at": "2017-11-08 09:44:30 +0630",
|
|
||||||
"updated_at": "2018-03-13 17:32:47 +0630",
|
|
||||||
"image_path": {"url":null}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 4,
|
|
||||||
"name": "Cashier",
|
|
||||||
"role": "cashier",
|
|
||||||
"emp_id": "333",
|
|
||||||
"password_digest": "$2a$10$fHo.9wOn.yr.2Ke6iuCfou6DjpyHXwQSmZQ.43O7W4SnlmzuoIEF2",
|
|
||||||
"token_session": "693f6e98bb90b6af9978",
|
|
||||||
"session_expiry": "2018-03-15 12:36:28 +0630",
|
|
||||||
"session_last_login": "2018-03-14 16:36:28 +0630",
|
|
||||||
"created_by": "SYSTEM DEFAULT",
|
|
||||||
"created_at": "2017-11-08 09:44:30 +0630",
|
|
||||||
"updated_at": "2018-03-14 17:05:14 +0630",
|
|
||||||
"image_path": {"url":null}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 5,
|
|
||||||
"name": "manager",
|
|
||||||
"role": "manager",
|
|
||||||
"emp_id": "888",
|
|
||||||
"password_digest": "$2a$10$EaU/Sxfsb8Q3kBIAyxSEJ.ZpRC9vxSdVAFvF0WXUvWiAqHyqGggoe",
|
|
||||||
"token_session": null,
|
|
||||||
"session_expiry": null,
|
|
||||||
"session_last_login": "2018-01-16 13:37:05 +0630",
|
|
||||||
"created_by": null,
|
|
||||||
"created_at": "2017-11-30 10:03:11 +0630",
|
|
||||||
"updated_at": "2018-01-16 13:48:02 +0630",
|
|
||||||
"image_path": {"url":null}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 6,
|
|
||||||
"name": "Account",
|
|
||||||
"role": "account",
|
|
||||||
"emp_id": "777",
|
|
||||||
"password_digest": "$2a$10$bJmgIxHefkvxpxJQLQPcpurTJrp8.BwP/kirJRYb1v1thrU3TDzkC",
|
|
||||||
"token_session": null,
|
|
||||||
"session_expiry": null,
|
|
||||||
"session_last_login": "2018-01-16 10:37:22 +0630",
|
|
||||||
"created_by": null,
|
|
||||||
"created_at": "2018-01-16 10:23:09 +0630",
|
|
||||||
"updated_at": "2018-01-16 10:49:24 +0630",
|
|
||||||
"image_path": {"url":null}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 7,
|
|
||||||
"name": "Supervisor",
|
|
||||||
"role": "supervisor",
|
|
||||||
"emp_id": "666",
|
|
||||||
"password_digest": "$2a$10$/WQirOw5nu6kKDiITTVa7.IGeVyxH5JmLp3/Astu/5DlOAoMLn4Ne",
|
|
||||||
"token_session": null,
|
|
||||||
"session_expiry": null,
|
|
||||||
"session_last_login": "2018-01-16 14:28:40 +0630",
|
|
||||||
"created_by": null,
|
|
||||||
"created_at": "2018-01-16 10:23:32 +0630",
|
|
||||||
"updated_at": "2018-01-16 15:32:33 +0630",
|
|
||||||
"image_path": {"url":null}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 8,
|
|
||||||
"name": "123",
|
|
||||||
"role": "waiter",
|
|
||||||
"emp_id": "123",
|
|
||||||
"password_digest": "$2a$10$v8JBsc31XkLRNZ/QhfYBg.wbVT7CyVvk83U..0PsGiz61w0Atl/WW",
|
|
||||||
"token_session": "4fc9a18a5df511e507fc",
|
|
||||||
"session_expiry": "2018-02-01 20:08:35 +0630",
|
|
||||||
"session_last_login": "2018-02-01 14:08:35 +0630",
|
|
||||||
"created_by": null,
|
|
||||||
"created_at": "2018-02-01 14:07:16 +0630",
|
|
||||||
"updated_at": "2018-02-01 17:45:10 +0630",
|
|
||||||
"image_path": {"url":null}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 9,
|
|
||||||
"name": "Cashier 2",
|
|
||||||
"role": "cashier",
|
|
||||||
"emp_id": "444",
|
|
||||||
"password_digest": "$2a$10$5n34O09xmrIHbgvX.uhr9uAaUR8etjaqiicaXr017VWm/qDkjKVue",
|
|
||||||
"token_session": "0477edce9cf259f280c1",
|
|
||||||
"session_expiry": "2018-02-20 19:07:50 +0630",
|
|
||||||
"session_last_login": "2018-02-20 11:37:50 +0630",
|
|
||||||
"created_by": null,
|
|
||||||
"created_at": "2018-02-14 17:10:12 +0630",
|
|
||||||
"updated_at": "2018-02-20 13:37:46 +0630",
|
|
||||||
"image_path": {"url":null}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
Reference in New Issue
Block a user