update addorder view
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
//middle edit
|
||||
$(function() {
|
||||
var role = $('#role').val();
|
||||
var second_display_lookup = $("#display_type").val();
|
||||
@@ -54,28 +55,16 @@ $(function() {
|
||||
if (type ==-1 && modify_order == -1){
|
||||
image_path = product[field].image_path.url;
|
||||
}
|
||||
}else{
|
||||
image_path = "/image/logo.png";
|
||||
}
|
||||
|
||||
|
||||
row = '<div class="col-md-3">'
|
||||
row = '<div class="col-md-6 col-sm-6 col-lg-3 mt-3">'
|
||||
+'<div class="card custom-card testimonial-card 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="col-md-10">'+ product[field].name +'</div>'
|
||||
+"<div class='col-md-2 menu_item_box' data-item-code='"
|
||||
+ product[field].item_code +"' data-instance = '"
|
||||
+JSON.stringify(item_attributes)+"' data-id = '"
|
||||
+JSON.stringify(item_attributes)+"' data-item = '"
|
||||
+JSON.stringify(item_attributes)+"' data-option = '"
|
||||
+JSON.stringify(options)+"'data-opt = '"
|
||||
+JSON.stringify(options)+"' data-item-sets = '"
|
||||
+JSON.stringify(item_attributes)+"' data-image='"+image_path+"' data-toggle='modal' data-target='.sx_item_detailModal'>"
|
||||
+"<i class='fa fa-bars material-icons m-l--10'>"
|
||||
+'view_list</i>'
|
||||
+'</div>'
|
||||
|
||||
+'</div>'
|
||||
|
||||
+"<div class='add_icon p-t-65' data-item-code='"
|
||||
+"<div class='add_icon p-t-65 p-b-65' data-item-code='"
|
||||
+ product[field].item_code +"' data-name='"
|
||||
+ product[field].name +"' data-qty = '"+ qty +"' data-price = '"
|
||||
+ product[field].unit_price +"' data-instance-code = '"+ product[field].item_code +"' data-instance = '"
|
||||
@@ -83,16 +72,71 @@ $(function() {
|
||||
+ JSON.stringify(item_attributes) +"' data-options = '"
|
||||
+ JSON.stringify(options) +"' data-opt = '"
|
||||
+ JSON.stringify(options) +"' data-image='"+image_path+"'>"
|
||||
|
||||
// +"<div class='card-block custom-card-block'>"
|
||||
// +"<img id='logo' height='125px' src='"+image_path+"'>"
|
||||
// +"</div>"
|
||||
|
||||
+'<div class="card-footer custom-card-footer">'
|
||||
+'<span>'+ product[field].unit_price +'</span>'
|
||||
+'</div>'
|
||||
+'</div>'
|
||||
+'<div class="card-footer custom-card-footer custom-flex-footer">'
|
||||
+'<span style="font-weight:900;flex-grow:1;">'+ product[field].unit_price +'</span>'
|
||||
+"<div class='col-md-2 menu_item_box' data-item-code='"
|
||||
+ product[field].item_code +"' data-instance = '"
|
||||
+JSON.stringify(item_attributes)+"' data-id = '"
|
||||
+JSON.stringify(item_attributes)+"' data-item = '"
|
||||
+JSON.stringify(item_attributes)+"' data-option = '"
|
||||
+JSON.stringify(options)+"'data-opt = '"
|
||||
+JSON.stringify(options)+"' data-item-sets = '"
|
||||
+JSON.stringify(item_attributes)+"' data-image='"+image_path+"' data-toggle='modal' data-target='.sx_item_detailModal'>"
|
||||
+"<i class='fa fa-bars material-icons m-l--10'>"
|
||||
+'view_list</i>'
|
||||
+'</div>'
|
||||
+'</div>'
|
||||
|
||||
+'</div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
row = '<div class="col-md-6 col-sm-6 col-lg-3 mt-1">'
|
||||
+'<div class="card custom-card testimonial-card fadeInRight" style="height:100%;">'
|
||||
+'<div class="custom-card-head custom-card-no-img-head card-head row" style="margin:0px;display:flex;!important">'
|
||||
+"<div class='col-12 add_icon p-t-65 p-b-65' data-item-code='"
|
||||
+ product[field].item_code +"' data-name='"
|
||||
+ product[field].name +"' data-qty = '"+ qty +"' data-price = '"
|
||||
+ product[field].unit_price +"' data-instance-code = '"+ product[field].item_code +"' data-instance = '"
|
||||
+ product[field].name +"' data-promotion-price = '"+ 1 +"' data-attributes = '"
|
||||
+ JSON.stringify(item_attributes) +"' data-options = '"
|
||||
+ JSON.stringify(options) +"' data-opt = '"
|
||||
+ JSON.stringify(options) +"' data-image=''>"
|
||||
+'<div class="product_box">'+ product[field].name +'</div>'
|
||||
+'</div>'
|
||||
|
||||
|
||||
+'</div>'
|
||||
|
||||
+"<div class='add_icon' data-item-code='"
|
||||
+ product[field].item_code +"' data-name='"
|
||||
+ product[field].name +"' data-qty = '"+ qty +"' data-price = '"
|
||||
+ product[field].unit_price +"' data-instance-code = '"+ product[field].item_code +"' data-instance = '"
|
||||
+ product[field].name +"' data-promotion-price = '"+ 1 +"' data-attributes = '"
|
||||
+ JSON.stringify(item_attributes) +"' data-options = '"
|
||||
+ JSON.stringify(options) +"' data-opt = '"
|
||||
+ JSON.stringify(options) +"' data-image=''>"
|
||||
|
||||
+'</div>'
|
||||
|
||||
+'<div class="card-footer custom-card-no-img-footer custom-flex-footer">'
|
||||
+'<span style="font-weight:900;flex-grow:1;">'+ product[field].unit_price +'</span>'
|
||||
+"<div class='col-2 menu_item_box menu_item_no_img_box' data-item-code='"
|
||||
+ product[field].item_code +"' data-instance = '"
|
||||
+JSON.stringify(item_attributes)+"' data-id = '"
|
||||
+JSON.stringify(item_attributes)+"' data-item = '"
|
||||
+JSON.stringify(item_attributes)+"' data-option = '"
|
||||
+JSON.stringify(options)+"'data-opt = '"
|
||||
+JSON.stringify(options)+"' data-item-sets = '"
|
||||
+JSON.stringify(item_attributes)+"' data-image='' data-toggle='modal' data-target='.sx_item_detailModal'>"
|
||||
+"<i class='fa fa-bars material-icons m-l--10'>"
|
||||
+'view_list</i>'
|
||||
+'</div>'
|
||||
+'</div>'
|
||||
|
||||
+'</div>';
|
||||
}
|
||||
$('.menu_items_list').append(row);
|
||||
}
|
||||
}
|
||||
@@ -499,7 +543,6 @@ $(function() {
|
||||
|
||||
//click item row for add order
|
||||
$(document).on('click', '.menu_item_box', function(event){
|
||||
|
||||
$('.attributes-list').empty();
|
||||
$('.options-list').empty();
|
||||
$('#modal_box_img').empty();
|
||||
@@ -1379,6 +1422,7 @@ $(function() {
|
||||
var menu_list = $('.menu_items_list');
|
||||
menu_list.empty();
|
||||
for(var field in menu_items) {
|
||||
console.log(menu_items[field].instances);
|
||||
if (menu_items[field].is_sub_item == false) {
|
||||
instances = menu_items[field].instances ;
|
||||
|
||||
@@ -1439,52 +1483,109 @@ $(function() {
|
||||
}else{
|
||||
image_path = menu_items[field].image;
|
||||
}
|
||||
|
||||
}else{
|
||||
if (modify_order) {
|
||||
image_path = "../../image/logo.png";
|
||||
}else{
|
||||
image_path = "image/logo.png";
|
||||
}
|
||||
}
|
||||
row = '<div class="col-md-6 col-sm-6 col-lg-3">'
|
||||
+'<div class="card custom-card testimonial-card 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;" >'
|
||||
+'<div class="col-md-10 " style="padding:0px !important;">'+ menu_items[field].name +'</div>'
|
||||
|
||||
+'</div>'
|
||||
+"<div class='"+add_icon+" p-t-65 p-b-65 m-r-' "
|
||||
+" data-item-code='"+ menu_items[field].code +"' "
|
||||
+" data-name='"+ menu_items[field].name +"' "
|
||||
+" data-qty = '"+ qty +"' "
|
||||
+" data-price = '" + price +"' "
|
||||
+" data-instance-code = '"+ code +"' "
|
||||
+" data-instance = '" + name +"' "
|
||||
+" data-promotion-price = '"+ promotion_price +"' "
|
||||
+" data-attributes = '" + 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='"+data_modal+"' "
|
||||
+" data-target='."+data_target+"' "
|
||||
+" data-item-sets = '"+JSON.stringify(menu_items[field].item_sets)+""
|
||||
+" 'data-instances = '"+JSON.stringify(menu_items[field].instances)+"'>"
|
||||
+'</div>'
|
||||
+'<div class="card-footer custom-card-footer custom-flex-footer" style="opacity:0.7">'
|
||||
+'<span style="font-weight:900;flex-grow:1;">'+ price +'</span>'
|
||||
+ "<div class='col-md-2 "+menu_item_box
|
||||
+ "' data-item-code='" + menu_items[field].code
|
||||
+ "' data-instance='" + JSON.stringify(menu_items[field].instances)
|
||||
+ "' data-id='" + JSON.stringify(menu_items[field].attributes)
|
||||
+ "' data-item='" + 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].item_sets)
|
||||
+ "' data-toggle='modal'"
|
||||
+ " data-target='." + data_target +"'"
|
||||
+ " style='padding:0px 5px 0px 5px' >"
|
||||
+ "<i class='m-l--5 fa " + fa_plus + "'>"
|
||||
+ add
|
||||
+ "</i>"
|
||||
+'</div>'
|
||||
|
||||
+'</div>'
|
||||
+'</div>'; ;
|
||||
}else{
|
||||
row = '<div class="col-md-6 col-sm-6 col-lg-3 mt-1">'
|
||||
+'<div class="card custom-card testimonial-card fadeInRight" style="height:100%;">'
|
||||
+'<div class="custom-card-no-img-head card-head '+add_icon+' " style="margin:0px;display:flex;!important "'
|
||||
+" data-item-code='"+ menu_items[field].code +"' "
|
||||
+" data-name='" + menu_items[field].name +"' "
|
||||
+" data-qty = '"+ qty +"' "
|
||||
+" data-price = '" + price +"' "
|
||||
+" data-instance-code = '"+ code +"' "
|
||||
+" data-instance = '" + name +"' "
|
||||
+" data-promotion-price = '"+ promotion_price +"' "
|
||||
+" data-attributes = '" + JSON.stringify(item_attributes) +"' "
|
||||
+" data-options = '"+ JSON.stringify(menu_items[field].options) +"' "
|
||||
+" data-opt = '"+ JSON.stringify(menu_items[field].options) +"' "
|
||||
+" data-image='' data-toggle='"+data_modal+"' "
|
||||
+" data-target='."+data_target+"' "
|
||||
+" data-item-sets = '"+JSON.stringify(menu_items[field].item_sets)+"'"
|
||||
+" data-instances = '"+JSON.stringify(menu_items[field].instances)+"'>"
|
||||
|
||||
+'<div class="product_box" style="width:100%;"><span>'+ menu_items[field].name +'<span></div>'
|
||||
+'</div>'
|
||||
+"<div class='"+add_icon+"' "
|
||||
+" data-item-code='"+ menu_items[field].code +"' "
|
||||
+" data-name='" + menu_items[field].name +"' "
|
||||
+" data-qty = '"+ qty +"' "
|
||||
+" data-price = '" + price +"' "
|
||||
+" data-instance-code = '"+ code +"' "
|
||||
+" data-instance = '" + name +"' "
|
||||
+" data-promotion-price = '"+ promotion_price +"' "
|
||||
+" data-attributes = '" + JSON.stringify(item_attributes) +"' "
|
||||
+" data-options = '"+ JSON.stringify(menu_items[field].options) +"' "
|
||||
+" data-opt = '"+ JSON.stringify(menu_items[field].options) +"' "
|
||||
+" data-image='' data-toggle='"+data_modal+"' "
|
||||
+" data-target='."+data_target+"' "
|
||||
+" data-item-sets = '"+JSON.stringify(menu_items[field].item_sets)+"'"
|
||||
+" data-instances = '"+JSON.stringify(menu_items[field].instances)+"'>"
|
||||
+'</div>'
|
||||
+'<div class="card-footer custom-card-no-img-footer custom-flex-footer">'
|
||||
+'<span style="font-weight:900;flex-grow:1;">'+ price + '</span>'
|
||||
+" <div class='offset-4 col-2 menu_item_no_img_box "+menu_item_box+" ' "
|
||||
+" data-item-code='"+ menu_items[field].code +"' "
|
||||
+" data-instance = '" +JSON.stringify(menu_items[field].instances)+"' "
|
||||
+" data-id = '"+JSON.stringify(menu_items[field].attributes)+"' "
|
||||
+" data-item = '" +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].item_sets)+"' "
|
||||
+" data-toggle='modal' "
|
||||
+" data-target='."+data_target+"' "
|
||||
+" style='padding:0px 5px 0px 5px'>"
|
||||
+"<i class='m-l--5 fa "+fa_plus+" '>"
|
||||
+add+ '</i>'
|
||||
+'</div>'
|
||||
+'</div>'
|
||||
|
||||
|
||||
+'</div>'
|
||||
+'</div>';
|
||||
}
|
||||
|
||||
row = '<div class="col-md-3">'
|
||||
+'<div class="card custom-card testimonial-card 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="col-md-10 " style="padding:0px !important;">'+ menu_items[field].name +'</div>'
|
||||
+"<div class='col-md-2 "+menu_item_box+" ' data-item-code='"
|
||||
+ menu_items[field].code +"' data-instance = '"
|
||||
+JSON.stringify(menu_items[field].instances)+"' data-id = '"
|
||||
+JSON.stringify(menu_items[field].attributes)+"' data-item = '"
|
||||
+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].item_sets)+"' data-toggle='modal' data-target='."+data_target+"' style='padding:0px 5px 0px 5px'>"
|
||||
+"<i class='m-l--5 fa "+fa_plus+" '>"
|
||||
+add+ '</i>'
|
||||
+'</div>'
|
||||
+'</div>'
|
||||
+"<div class='"+add_icon+" p-t-65 m-r-' data-item-code='"
|
||||
+ menu_items[field].code +"' data-name='"
|
||||
+ menu_items[field].name +"' data-qty = '"+ qty +"' data-price = '"
|
||||
+ price +"' data-instance-code = '"+ code +"' data-instance = '"
|
||||
+ name +"' data-promotion-price = '"+ promotion_price +"' data-attributes = '"
|
||||
+ 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='"
|
||||
+data_modal+"' data-target='."+data_target+"' data-item-sets = '"
|
||||
+JSON.stringify(menu_items[field].item_sets)+"'data-instances = '"
|
||||
+JSON.stringify(menu_items[field].instances)+"'>"
|
||||
|
||||
// +"<div class='card-block custom-card-block'>"
|
||||
// +"<img id='logo' height='' src='"+image_path+"'>"
|
||||
// +"</div>"
|
||||
|
||||
+'<div class="card-footer custom-card-footer" style="opacity:0.7">'
|
||||
+'<span>'+ price +'</span>'
|
||||
+'</div>'
|
||||
+'</div>'
|
||||
+'</div>'; ;
|
||||
$('.menu_items_list').append(row);
|
||||
}
|
||||
//end instances in menu-items alest 1 instance
|
||||
|
||||
@@ -3,12 +3,12 @@ section .content{
|
||||
}
|
||||
.custom-card-head{
|
||||
height: 40px;
|
||||
#background-color: #54A5AF;
|
||||
background-color: #a1aade;
|
||||
background-color: #79D0F2;
|
||||
color :#fff;
|
||||
#background-color: #a1aade;
|
||||
opacity: 0.8;
|
||||
padding:5px;
|
||||
color :#000000;
|
||||
|
||||
font-weight:400;
|
||||
}
|
||||
.custom-card {
|
||||
border: 2px solid rgba(0, 0, 0, 0.125) !important;
|
||||
@@ -16,6 +16,10 @@ section .content{
|
||||
}
|
||||
.custom-card-footer{
|
||||
padding:0.35rem 1.25rem !important;
|
||||
bottom:0;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
font-weight:900;
|
||||
}
|
||||
|
||||
.custom-card-block {
|
||||
@@ -192,7 +196,7 @@ section.content{
|
||||
}
|
||||
|
||||
.menu_item_box{
|
||||
cursor: pointer;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/*Logout Icon*/
|
||||
@@ -300,4 +304,33 @@ i.logout_icon{
|
||||
.ls-closed section.content {
|
||||
margin-left: 15px !important;
|
||||
margin-right: 15px !important;
|
||||
}
|
||||
}
|
||||
.product_box{
|
||||
position:relative;
|
||||
text-align:center;
|
||||
font-weight:900;
|
||||
color:#fff;
|
||||
font-size:1.5em;
|
||||
margin:auto;
|
||||
}
|
||||
.custom-card-no-img-head{
|
||||
#background-color: #54A5AF;
|
||||
opacity: 0.8;
|
||||
padding:5px;
|
||||
color :#273040;
|
||||
min-height:100px;
|
||||
height: 150px;
|
||||
background-color:#79D0F2;
|
||||
|
||||
}
|
||||
.menu_item_no_img_box{
|
||||
cursor: pointer;
|
||||
|
||||
}
|
||||
.custom-card-no-img-footer{
|
||||
padding:0.35rem 1.25rem !important;
|
||||
|
||||
}
|
||||
.custom-flex-footer{
|
||||
display:flex;
|
||||
}
|
||||
|
||||
@@ -39,4 +39,4 @@
|
||||
|
||||
/* Support for IE. */
|
||||
font-feature-settings: 'liga';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,20 +38,20 @@ class Printer::PrinterWorker
|
||||
end
|
||||
|
||||
def print(file_path,printer_destination = nil )
|
||||
# if printer_destination.nil?
|
||||
# printer_destination = self.printer_destination
|
||||
# end
|
||||
if printer_destination.nil?
|
||||
printer_destination = self.printer_destination
|
||||
end
|
||||
|
||||
# puts printer_destination
|
||||
# puts '........Printer Destination..........'
|
||||
puts printer_destination
|
||||
puts '........Printer Destination..........'
|
||||
|
||||
# copy = self.print_copies
|
||||
# #Print only when printer information is not null
|
||||
# if !self.printer_destination.nil?
|
||||
# (1..copy).each do
|
||||
# page = Cups::PrintJob.new(file_path, printer_destination)
|
||||
# page.print
|
||||
# end
|
||||
# end
|
||||
copy = self.print_copies
|
||||
#Print only when printer information is not null
|
||||
if !self.printer_destination.nil?
|
||||
(1..copy).each do
|
||||
page = Cups::PrintJob.new(file_path, printer_destination)
|
||||
page.print
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
<% type = request.path_info.include?('quick_service') || request.path_info.include?('food_court')%>
|
||||
<% modify_order = request.path_info.include?('modify_order')%>
|
||||
|
||||
<div class="container-fluid " style="padding:0px 3px 0px 3px;">
|
||||
<div id="oqs_loading_wrapper" style="display:none;">
|
||||
<div id="oqs_loading"></div>
|
||||
|
||||
@@ -19,12 +19,12 @@ class ActionController::Base
|
||||
render :json => [{ status: false, message: 'Invalid Access!'}]
|
||||
end
|
||||
else
|
||||
# check for license file
|
||||
# if check_license
|
||||
# current_license(ENV["SX_PROVISION_URL"])
|
||||
# else
|
||||
# redirect_to activate_path
|
||||
# end
|
||||
check for license file
|
||||
if check_license
|
||||
current_license(ENV["SX_PROVISION_URL"])
|
||||
else
|
||||
redirect_to activate_path
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
# application_path="#{File.expand_path("../..", __FILE__)}"
|
||||
# directory application_path
|
||||
# #environment ENV.fetch("RAILS_ENV") { "production" }
|
||||
# environment "production"
|
||||
# pidfile "#{application_path}/tmp/puma/pid"
|
||||
# state_path "#{application_path}/tmp/puma/state"
|
||||
# stdout_redirect "#{application_path}/log/puma.stdout.log", "#{application_path}/log/puma.stderr.log"
|
||||
# port ENV.fetch("PORT") { 62158 }
|
||||
# workers 2
|
||||
# preload_app!
|
||||
application_path="#{File.expand_path("../..", __FILE__)}"
|
||||
directory application_path
|
||||
#environment ENV.fetch("RAILS_ENV") { "production" }
|
||||
environment "production"
|
||||
pidfile "#{application_path}/tmp/puma/pid"
|
||||
state_path "#{application_path}/tmp/puma/state"
|
||||
stdout_redirect "#{application_path}/log/puma.stdout.log", "#{application_path}/log/puma.stderr.log"
|
||||
port ENV.fetch("PORT") { 62158 }
|
||||
workers 2
|
||||
preload_app!
|
||||
|
||||
Reference in New Issue
Block a user