Pull From Master
This commit is contained in:
@@ -93,8 +93,7 @@ $(document).on('turbolinks:load', function() {
|
||||
var oqs_append = $('.oqs_append');
|
||||
oqs_append.empty();
|
||||
var filter = $('.filter').text();
|
||||
|
||||
console.log(table_id)
|
||||
|
||||
//Start Ajax
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
|
||||
@@ -12,6 +12,16 @@ $(function() {
|
||||
|
||||
var menu_list = $('.menu_items_list');
|
||||
menu_list.empty();
|
||||
|
||||
if (type != -1 && modify_order != -1) {
|
||||
url_item = '../../../../../'+url_item;
|
||||
}
|
||||
if(modify_order == -1 && type != -1){
|
||||
url_item = '../../../../'+url_item;
|
||||
}
|
||||
if (type ==-1 && modify_order == -1){
|
||||
url_item = url_item
|
||||
}
|
||||
//Start Ajax
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
@@ -31,37 +41,47 @@ $(function() {
|
||||
item_attributes = [];
|
||||
|
||||
if (product[field].image_path) {
|
||||
image_path = product[field].image_path.url;
|
||||
if (type != -1 && modify_order != -1) {
|
||||
image_path = '../../'+product[field].image_path.url;
|
||||
}
|
||||
if(modify_order == -1 && type != -1){
|
||||
image_path = '../../../../'+product[field].image_path.url;
|
||||
}
|
||||
if (type ==-1 && modify_order == -1){
|
||||
image_path = product[field].image_path.url;
|
||||
}
|
||||
}else{
|
||||
image_path = "/image/logo.png";
|
||||
}
|
||||
|
||||
row = '<div class="card custom-card testimonial-card fadeInRight" style="">'
|
||||
row = '<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-9">'+ product[field].name +'</div>'
|
||||
+"<div class='col-md-3 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 = '"
|
||||
+ options +"' data-image='"+image_path+"'>"
|
||||
+"<div class='col-md-3 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(menu_items[field].options)+"'data-opt = '"
|
||||
+JSON.stringify(menu_items[field].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'>"
|
||||
+'view_list</i>'
|
||||
+'</div>'
|
||||
+'</div>'
|
||||
|
||||
+"<div class='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(item_attributes)+"' data-item-sets = '"
|
||||
+JSON.stringify(item_attributes)+"' data-toggle='modal' data-target='.sx_item_detailModal'>"
|
||||
+"<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(menu_items[field].options) +"' data-opt = '"
|
||||
+ JSON.stringify(menu_items[field].options) +"' data-image='"+image_path+"'>"
|
||||
|
||||
+"<div class='card-block custom-card-block'>"
|
||||
+"<img id='logo' height='125px' src='"+image_path+"'>"
|
||||
+"</div>"
|
||||
// +"<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>'
|
||||
@@ -231,6 +251,7 @@ $(function() {
|
||||
$(document).on('click', '.set_item_box', function(event){
|
||||
$(".instance-list").empty();
|
||||
$(".options-list").empty();
|
||||
$(".selected-set-list").empty();
|
||||
$('.set_change_qty').val(1);
|
||||
change_qty_plus_minus("set_count","set_plus","set_minus");
|
||||
data = $(this).parent().children().children('.add_icon');
|
||||
@@ -353,7 +374,7 @@ $(function() {
|
||||
sub_total = $('#set_total_price').text();
|
||||
name = $(this).data('name');
|
||||
price = $(this).data('price');
|
||||
options = $(this).attr('data-options','');
|
||||
options = $(this).attr('data-options','[]');
|
||||
// qty = $('#set_change_qty').val();
|
||||
qty = document.getElementById("set_count").value;
|
||||
total = qty*price;
|
||||
@@ -364,7 +385,8 @@ $(function() {
|
||||
+"' data-name='"+$(this).data('name')
|
||||
+"' data-code='"+code
|
||||
+"' data-price='"+$(this).data('price')
|
||||
+"' data-option='"+JSON.stringify($(this).data('option'))
|
||||
+"' data-option='[]"
|
||||
+"' data-options='"+JSON.stringify($(this).data('options'))
|
||||
+"' data-min-qty='"+$(this).data('min-qty')
|
||||
+"' data-max-qty='"+$(this).data('max-qty')
|
||||
+"' data-parent-code='"+$(this).data('parent-code')
|
||||
@@ -387,7 +409,11 @@ $(function() {
|
||||
+'</div>'
|
||||
$(".selected-set-list").append(set);
|
||||
}else{
|
||||
<<<<<<< HEAD
|
||||
swal("Alert !", 'Maximum Qty is ' + max_qty + " items", "warning");
|
||||
=======
|
||||
swal("Alert !", 'Maximum Select is ' + max_qty + " items", "warning");
|
||||
>>>>>>> 8217b7c2f27f5b38b27425929d01b789da0583fd
|
||||
}
|
||||
// }
|
||||
$('#set_unit_price').text(price);
|
||||
@@ -419,8 +445,7 @@ $(function() {
|
||||
|
||||
default_instance = $('.set-item');
|
||||
|
||||
var items = $('.selected-instance');
|
||||
|
||||
var items = $('.selected-set');
|
||||
if (items.length >= min_qty) {
|
||||
|
||||
item = get_set_item(items);
|
||||
@@ -432,11 +457,10 @@ $(function() {
|
||||
code = $('.set-item').attr('data-code');
|
||||
name = $('.set-item').attr('data-name');
|
||||
price = $('.set-item').attr('data-price');
|
||||
option_name = ($('.set-item').attr('data-options') === 'undefined') ? '' :$('.set-item').attr('data-options');
|
||||
option_name = ($('.set-item').attr('data-options') === 'undefined') ? ' ' :$('.set-item').attr('data-options');
|
||||
option = ($('.set-item').attr('data-options') === '') ? '[]' :$('.set-item').attr('data-options');
|
||||
parent = $('.set-item').attr('data-parent');
|
||||
total = qty * price ;
|
||||
|
||||
row ="<tr class='item_box' data-price ='"
|
||||
+price+ "' data-toggle='modal' data-target='#sx_itemModal' 'data-instance ='"
|
||||
+name+ "' data-code='"+item_code+"' data-instance-code='"
|
||||
@@ -454,13 +478,14 @@ $(function() {
|
||||
var rowCount = $('.summary-items tbody tr').length+1;
|
||||
var set_option = []
|
||||
$(items).each(function(i){
|
||||
code = $(items[i]).attr('data-code');
|
||||
name = $(items[i]).attr('data-name');
|
||||
price = $(items[i]).attr('data-price');
|
||||
set_option_name = ($(items[i]).attr('data-options') === 'undefined') ? ' ' :$(items[i]).attr('data-options');
|
||||
set_option= ($(items[i]).attr('data-options') === '') ? '[]' :$(items[i]).attr('data-options');
|
||||
sub_item = $(items[i]).attr('data-sub-item');
|
||||
total = qty * price ;
|
||||
console.log($(items[0]).attr('data-name'))
|
||||
code = $(items[i]).attr('data-code');
|
||||
name = $(items[i]).attr('data-name');
|
||||
price = $(items[i]).attr('data-price');
|
||||
set_option_name = ($(items[i]).attr('data-options') === 'undefined') ? '' :$(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');
|
||||
total = qty * price ;
|
||||
|
||||
row ="<tr class='item_box' data-price ='"
|
||||
+price+ "' data-toggle='modal' data-target='#sx_itemModal' 'data-instance ='"
|
||||
@@ -711,6 +736,7 @@ $(function() {
|
||||
|
||||
attribute_arr = get_selected_attributes('selected-attribute');
|
||||
option_arr = get_selected_attributes('selected-option');
|
||||
console.log(option_arr)
|
||||
if (item_row.length>0) {
|
||||
var instances = jQuery.parseJSON(item_row.attr('data-instances'));
|
||||
|
||||
@@ -748,6 +774,7 @@ $(function() {
|
||||
$('.add_to_order').attr('data-name',$('#title_name').text());
|
||||
$('.add_to_order').attr('data-attributes',JSON.stringify(attribute_arr));
|
||||
$('.add_to_order').attr('data-options',JSON.stringify(option_arr));
|
||||
$('.add_to_order').attr('data-opt',JSON.stringify(option_arr));
|
||||
var item_data = $(this);
|
||||
item = get_item(item_data,"add_to_order");
|
||||
customer_display_view(item,"add");
|
||||
@@ -785,8 +812,7 @@ $(function() {
|
||||
option_name = ' ';
|
||||
data_option = '[]';
|
||||
}
|
||||
|
||||
|
||||
console.log(d_option)
|
||||
var rowCount = $('.summary-items tbody tr').length+1;
|
||||
var item_row = $('.summary-items tbody tr');
|
||||
|
||||
@@ -794,7 +820,8 @@ $(function() {
|
||||
item_code = $(item_row[i]).attr('data-code');
|
||||
instance_code = $(item_row[i]).attr('data-instance-code');
|
||||
r_option = $(item_row[i]).attr('data-opt');
|
||||
if (item_code == data.attr('data-item-code') && instance_code == data.attr('data-instance-code')&&r_option == d_option) {
|
||||
console.log(r_option)
|
||||
if (item_code == data.attr('data-item-code') && instance_code == data.attr('data-instance-code')&&r_option == d_option) {
|
||||
if (qty > 1) {
|
||||
qty = parseInt($(item_row[i]).children('#item_qty').text()) + qty;
|
||||
}else{
|
||||
@@ -804,7 +831,7 @@ $(function() {
|
||||
$(item_row[i]).children('#item_qty').text(qty);
|
||||
parseFloat($(item_row[i]).children('#item_price').text(parseFloat(price*qty).toFixed(2)));
|
||||
append =1;
|
||||
}else{
|
||||
}else{
|
||||
if (qty > 1) {
|
||||
qty = qty;
|
||||
}else{
|
||||
|
||||
@@ -387,3 +387,22 @@ function resCBPay(resMsg,card_sale_trans_id,cmd_type,payment_type,bnk_bill_amoun
|
||||
function setHeaderBreadCrumb(params){
|
||||
$("#others_payment").html(params);
|
||||
}
|
||||
|
||||
//show hide nav bar for webview
|
||||
function showHideNavbar(webview,page){
|
||||
if(webview){
|
||||
$("nav.navbar").addClass("hidden");
|
||||
$("section").addClass("section-margin");
|
||||
$(".page-loader-wrapper").addClass("hidden");
|
||||
if(page!=undefined){
|
||||
$("#back").hide();
|
||||
}
|
||||
}else{
|
||||
$("nav.navbar").removeClass("hidden");
|
||||
$("section").removeClass("section-margin");
|
||||
$(".page-loader-wrapper").removeClass("hidden");
|
||||
if(page!=undefined){
|
||||
$("#back").show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -431,4 +431,9 @@ iframe {
|
||||
width: 150%;
|
||||
height: 100%;
|
||||
}
|
||||
/* End iframe */
|
||||
/* End iframe */
|
||||
|
||||
/* section class for webview */
|
||||
.section-margin {
|
||||
margin-top: -50px;
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
class Api::SurveyController < Api::ApiController
|
||||
skip_before_action :authenticate
|
||||
|
||||
# before_action :authenticate
|
||||
|
||||
def index
|
||||
dining_facility = DiningFacility.find(params[:id])
|
||||
|
||||
@@ -7,7 +7,8 @@ class BaseOrigamiController < ActionController::Base
|
||||
#before_action :check_installation
|
||||
protect_from_forgery with: :exception
|
||||
|
||||
helper_method :shop_detail
|
||||
helper_method :shop_detail, :current_token
|
||||
|
||||
rescue_from CanCan::AccessDenied do |exception|
|
||||
flash[:warning] = exception.message
|
||||
# redirect_to origami_root_path
|
||||
@@ -33,5 +34,21 @@ class BaseOrigamiController < ActionController::Base
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
|
||||
|
||||
#check webview
|
||||
def check_mobile
|
||||
status = false
|
||||
authenticate_with_http_token do |token, options|
|
||||
if token
|
||||
session[:webview] = true
|
||||
end
|
||||
session[:session_token] = token
|
||||
end
|
||||
|
||||
if session[:webview] && request.user_agent =~ /android|blackberry|iphone|ipad|ipod|iemobile|mobile|webos/i
|
||||
status = true
|
||||
end
|
||||
|
||||
return status
|
||||
end
|
||||
end
|
||||
|
||||
@@ -2,13 +2,23 @@ class Origami::AddordersController < BaseOrigamiController
|
||||
# before_action :set_dining, only: [:detail]
|
||||
|
||||
def index
|
||||
@tables = Table.all.active.order('zone_id asc').group("zone_id")
|
||||
@rooms = Room.all.active.order('zone_id asc').group("zone_id")
|
||||
@all_table = Table.all.active.order('status desc')
|
||||
@all_room = Room.all.active.order('status desc')
|
||||
@webview = false
|
||||
if check_mobile
|
||||
@webview = true
|
||||
end
|
||||
|
||||
@tables = Table.all.active.order('zone_id asc').group("zone_id")
|
||||
@rooms = Room.all.active.order('zone_id asc').group("zone_id")
|
||||
@all_table = Table.all.active.order('status desc')
|
||||
@all_room = Room.all.active.order('status desc')
|
||||
end
|
||||
|
||||
def detail
|
||||
@webview = false
|
||||
if check_mobile
|
||||
@webview = true
|
||||
end
|
||||
|
||||
today = DateTime.now
|
||||
day = Date.today.wday
|
||||
@menus = Menu.all
|
||||
|
||||
@@ -9,7 +9,6 @@ class Origami::CustomersController < BaseOrigamiController
|
||||
end
|
||||
|
||||
def get_customer
|
||||
|
||||
filter = params[:filter]
|
||||
type = params[:type]
|
||||
|
||||
@@ -47,7 +46,11 @@ class Origami::CustomersController < BaseOrigamiController
|
||||
end
|
||||
|
||||
def add_customer
|
||||
|
||||
@webview = false
|
||||
if check_mobile
|
||||
@webview = true
|
||||
end
|
||||
|
||||
@sale_id = params[:sale_id]
|
||||
@cashier_type = params[:type]
|
||||
@page = params[:page]
|
||||
|
||||
@@ -3,6 +3,11 @@ class Origami::DiscountsController < BaseOrigamiController
|
||||
|
||||
#discount page show from origami index with selected order
|
||||
def index
|
||||
@webview = false
|
||||
if check_mobile
|
||||
@webview = true
|
||||
end
|
||||
|
||||
sale_id = params[:id]
|
||||
@cashier_type = params[:type]
|
||||
if Sale.exists?(sale_id)
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
class Origami::HomeController < BaseOrigamiController
|
||||
authorize_resource :class => false
|
||||
before_action :set_dining, only: [:show]
|
||||
before_action :set_dining, only: [:show]
|
||||
|
||||
def index
|
||||
@webview = false
|
||||
if check_mobile
|
||||
@webview = true
|
||||
end
|
||||
|
||||
@tables = Table.all.active.order('status desc')
|
||||
@rooms = Room.all.active.order('status desc')
|
||||
@complete = Sale.where("DATE_FORMAT(created_at,'%Y-%m-%d') = ? and sale_status != 'new'",DateTime.now.strftime('%Y-%m-%d'))
|
||||
@@ -14,6 +19,11 @@ class Origami::HomeController < BaseOrigamiController
|
||||
|
||||
# origami table detail
|
||||
def show
|
||||
@webview = false
|
||||
if check_mobile
|
||||
@webview = true
|
||||
end
|
||||
|
||||
@tables = Table.all.active.order('status desc')
|
||||
@rooms = Room.all.active.order('status desc')
|
||||
@complete = Sale.where("DATE_FORMAT(created_at,'%Y-%m-%d') = ? and sale_status != 'new'",DateTime.now.strftime('%Y-%m-%d'))
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
class Origami::OrdersController < BaseOrigamiController
|
||||
def show
|
||||
@webview = false
|
||||
if check_mobile
|
||||
@webview = true
|
||||
end
|
||||
|
||||
@tables = Table.all.active.order('status desc')
|
||||
@rooms = Room.all.active.order('status desc')
|
||||
@complete = Sale.where("DATE_FORMAT(created_at,'%Y-%m-%d') = ? and sale_status != 'new'",DateTime.now.strftime('%Y-%m-%d'))
|
||||
|
||||
@@ -2,6 +2,11 @@ class Origami::OtherChargesController < BaseOrigamiController
|
||||
authorize_resource :class => false
|
||||
|
||||
def index
|
||||
@webview = false
|
||||
if check_mobile
|
||||
@webview = true
|
||||
end
|
||||
|
||||
sale_id = params[:sale_id]
|
||||
@cashier_type = params[:type]
|
||||
if Sale.exists?(sale_id)
|
||||
|
||||
@@ -5,9 +5,18 @@ class Origami::RoomsController < BaseOrigamiController
|
||||
@complete = Sale.where("DATE_FORMAT(created_at,'%Y-%m-%d') = ? and sale_status != 'new'",DateTime.now.strftime('%Y-%m-%d'))
|
||||
@orders = Order.where("DATE_FORMAT(date,'%Y-%m-%d') = ? and status != 'billed'",DateTime.now.strftime('%Y-%m-%d')).order('date desc')
|
||||
# @shift = ShiftSale.current_open_shift(current_user.id)
|
||||
@webview = false
|
||||
if check_mobile
|
||||
@webview = true
|
||||
end
|
||||
end
|
||||
|
||||
def show
|
||||
@webview = false
|
||||
if check_mobile
|
||||
@webview = true
|
||||
end
|
||||
|
||||
@tables = Table.all.active.order('status desc')
|
||||
@rooms = Room.all.active.order('status desc')
|
||||
@complete = Sale.where("DATE_FORMAT(created_at,'%Y-%m-%d') = ? and sale_status != 'new'",DateTime.now.strftime('%Y-%m-%d'))
|
||||
|
||||
@@ -2,6 +2,11 @@ class Origami::SplitBillController < BaseOrigamiController
|
||||
authorize_resource :class => false
|
||||
|
||||
def index
|
||||
@webview = false
|
||||
if check_mobile
|
||||
@webview = true
|
||||
end
|
||||
|
||||
dining_id = params[:dining_id]
|
||||
@cashier_type = params[:type]
|
||||
@table = DiningFacility.find(dining_id)
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
class Origami::SurveysController < BaseOrigamiController
|
||||
def new
|
||||
|
||||
@webview = false
|
||||
if check_mobile
|
||||
@webview = true
|
||||
end
|
||||
|
||||
@survey = Survey.new
|
||||
@id = params[:id]
|
||||
@cashier_type = params[:type]
|
||||
|
||||
@@ -18,10 +18,12 @@ class PrintSettingsController < ApplicationController
|
||||
# GET /print_settings/new
|
||||
def new
|
||||
@print_setting = PrintSetting.new
|
||||
@server_mode = ENV["SERVER_MODE"]
|
||||
end
|
||||
|
||||
# GET /print_settings/1/edit
|
||||
def edit
|
||||
@server_mode = ENV["SERVER_MODE"]
|
||||
end
|
||||
|
||||
# POST /print_settings
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class PrintSetting < ApplicationRecord
|
||||
# validations
|
||||
validates_presence_of :name, :unique_code, :printer_name, :brand_name, :api_settings, :page_width, :page_height, :print_copies
|
||||
validates_presence_of :name, :unique_code, :printer_name, :brand_name, :api_settings, :page_width, :page_height, :print_copies, :header_font_size, :item_font_size
|
||||
|
||||
def self.get_precision_delimiter
|
||||
PrintSetting.find_by_unique_code("ReceiptBillPdf")
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
<link rel="icon" href="favicon.ico" type="image/x-icon">
|
||||
|
||||
<!-- Google Fonts -->
|
||||
<!-- <link href="https://fonts.googleapis.com/css?family=Roboto:400,700&subset=latin,cyrillic-ext" rel="stylesheet" type="text/css">
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" type="text/css">-->
|
||||
<!-- <link href="https://fonts.googleapis.com/css?family=Roboto:400,700&subset=latin,cyrillic-ext" rel="stylesheet" type="text/css">
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" type="text/css"> -->
|
||||
|
||||
<%= stylesheet_link_tag 'login', media: 'all', 'data-turbolinks-track': 'reload' %>
|
||||
|
||||
|
||||
@@ -405,7 +405,7 @@
|
||||
<p class="hidden" id="set_item_code"></p>
|
||||
<p></p>
|
||||
|
||||
<div class="" id="modal-slimscroll" data-height="250">
|
||||
<div class="" id="modal-slimscroll" data-height="100">
|
||||
<div class="options-list" style="margin-top:-5px">
|
||||
</div>
|
||||
|
||||
@@ -591,5 +591,12 @@
|
||||
//end Ajax
|
||||
}
|
||||
//end show list function
|
||||
|
||||
/* check webview loaded*/
|
||||
var webview = '';
|
||||
<%if @webview %>
|
||||
var webview = <%= @webview %>;
|
||||
showHideNavbar(webview);
|
||||
<% end %>
|
||||
});
|
||||
</script>
|
||||
@@ -274,6 +274,9 @@
|
||||
var cashier_type = "<%= @cashier_type %>";
|
||||
var page = "<%= @page %>";
|
||||
$(function() {
|
||||
/* check webview loaded*/
|
||||
var webview = <%= @webview %>;
|
||||
showHideNavbar(webview);
|
||||
/*$('.datepicker').datepicker({
|
||||
setDate: '12-12-1999',
|
||||
format : 'dd-mm-yyyy',
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
<div class="icon" >
|
||||
<i class="material-icons">arrow_forward</i>
|
||||
</div>
|
||||
<div class="text font-20 m-l-5" style="line-height: 80px;"><%= t :dine_in_order %></div>
|
||||
<div class="text font-20 m-l-5" style="line-height: 80px;"><%= t :dine_in_cashier %></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -257,6 +257,9 @@
|
||||
var cashier_type = "<%= @cashier_type %>";
|
||||
$(document).ready(function(){
|
||||
setHeaderBreadCrumb(_DISCOUNTS_);
|
||||
/* check webview loaded*/
|
||||
var webview = <%= @webview %>;
|
||||
showHideNavbar(webview);
|
||||
|
||||
$('#back').on('click',function(){
|
||||
var id = $("#table_id").text();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<!-- Column One -->
|
||||
<div class="col-lg-10 col-md-10 col-sm-10">
|
||||
<div class="<%= @webview==true ? 'col-lg-12 col-md-12 col-sm-12' : 'col-lg-10 col-md-10 col-sm-10' %>">
|
||||
|
||||
<!-- Nav tabs -->
|
||||
<ul class="nav nav-tabs tab-col-teal" role="tablist">
|
||||
@@ -116,7 +116,7 @@
|
||||
</div>
|
||||
<!-- tabs - End -->
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<div class="<%= @webview==true ? 'hidden' : 'col-lg-2 col-md-2 col-sm-2' %>">
|
||||
<!-- <button id="refreshbutton" type="button" class="btn btn-block radius-btn"> Refresh off </button> -->
|
||||
<button type="button" class="btn btn-block btn-default waves-effect" id='back'>
|
||||
<i class="material-icons">reply</i>
|
||||
@@ -139,6 +139,8 @@
|
||||
<!-- Column One -->
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
var webview = <%= @webview %>;
|
||||
showHideNavbar(webview,"index");
|
||||
$(".tables").on('click', function(){
|
||||
var dining_id = $(this).attr("data-id");
|
||||
window.location.href = '/origami/table/' + dining_id;
|
||||
|
||||
@@ -604,6 +604,9 @@
|
||||
<script>
|
||||
var cashier_type = "cashier";
|
||||
$(document).ready(function () {
|
||||
/* check webview loaded*/
|
||||
var webview = <%= @webview %>;
|
||||
showHideNavbar(webview);
|
||||
/* start check first bill or not*/
|
||||
var receipt_no = "";
|
||||
if(($("#receipt_no").html()!=undefined) && ($("#receipt_no").html()!="")){
|
||||
@@ -870,6 +873,8 @@
|
||||
})
|
||||
|
||||
$('#add_invoice').on('click', function () {
|
||||
$("#first_bill").prop('disabled',true);
|
||||
$("#pay").prop('disabled',true);
|
||||
var dining_id = "<%= @dining.id %>";
|
||||
var sale_id = $("#sale_id").val(); //<%= @obj_sale.sale_id rescue "" %>
|
||||
var ajax_url = "/origami/sale/append_order";
|
||||
@@ -886,6 +891,8 @@
|
||||
closeOnCancel: false,
|
||||
allowOutsideClick: false
|
||||
}, function () {
|
||||
$("#first_bill").removeAttr('disabled');
|
||||
$("#pay").removeAttr('disabled');
|
||||
window.location.reload();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -253,6 +253,10 @@
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
/* check webview loaded*/
|
||||
var webview = <%= @webview %>;
|
||||
showHideNavbar(webview);
|
||||
|
||||
$(".tables").on('click', function(){
|
||||
var dining_id = $(this).attr("data-id");
|
||||
window.location.href = '/origami/table/' + dining_id;
|
||||
|
||||
@@ -212,6 +212,10 @@ var cashier_type = "<%= @cashier_type %>";
|
||||
|
||||
$(document).ready(function(){
|
||||
setHeaderBreadCrumb(_OTHER_CHARGES_);
|
||||
/* check webview loaded*/
|
||||
var webview = <%= @webview %>;
|
||||
showHideNavbar(webview);
|
||||
|
||||
$(".cashier_number").on('click', function(event){
|
||||
if(event.handled !== true) {
|
||||
var original_value=0;
|
||||
|
||||
@@ -542,6 +542,9 @@
|
||||
<script>
|
||||
var cashier_type = "cashier";
|
||||
$(document).ready(function(){
|
||||
/* check webview loaded*/
|
||||
var webview = <%= @webview %>;
|
||||
showHideNavbar(webview);
|
||||
// $(".tables").on('click', function(){
|
||||
// var customer_id=$(".customer-id").text();
|
||||
// show_customer_details(customer_id);
|
||||
@@ -838,6 +841,8 @@ $('#back').on('click',function(){
|
||||
})
|
||||
|
||||
$('#add_invoice').on('click',function(){
|
||||
$("#first_bill").prop('disabled',true);
|
||||
$("#pay").prop('disabled',true);
|
||||
var dining_id = "<%= @room.id %>"
|
||||
var sale_id = $("#sale_id").val(); //<%= @obj_sale.sale_id rescue "" %>
|
||||
var ajax_url = "/origami/sale/append_order";
|
||||
@@ -854,6 +859,8 @@ $('#add_invoice').on('click',function(){
|
||||
closeOnCancel: false,
|
||||
allowOutsideClick: false
|
||||
}, function () {
|
||||
$("#first_bill").removeAttr('disabled');
|
||||
$("#pay").removeAttr('disabled');
|
||||
window.location.reload();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -336,6 +336,10 @@
|
||||
var cashier_type = '<%= @cashier_type %>';
|
||||
$(document).ready(function(){
|
||||
setHeaderBreadCrumb(_SPLIT_BILL_);
|
||||
/* check webview loaded*/
|
||||
var webview = <%= @webview %>;
|
||||
showHideNavbar(webview);
|
||||
|
||||
$('#back').on('click',function(){
|
||||
backToOrigami();
|
||||
})
|
||||
|
||||
@@ -245,6 +245,10 @@
|
||||
<script type="text/javascript">
|
||||
var cashier_type = "<%= @cashier_type %>";
|
||||
$(document).ready(function(){
|
||||
/* check webview loaded*/
|
||||
var webview = <%= @webview %>;
|
||||
showHideNavbar(webview);
|
||||
|
||||
$('.foreignerDiv').removeClass("hidden");
|
||||
setHeaderBreadCrumb(_SURVEY_);
|
||||
<% if !@survey_data.nil? %>
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-12 col-md-9 col-lg-9">
|
||||
<div class="card">
|
||||
@@ -11,7 +10,18 @@
|
||||
<%= f.input :unique_code %>
|
||||
<%= f.input :template %>
|
||||
<%= f.input :font %>
|
||||
<%= f.input :printer_name, :as => :select, :collection => Printer::PrinterWorker.printers, include_blank: false %>
|
||||
|
||||
<%= f.input :header_font_size %>
|
||||
<%= f.input :item_font_size %>
|
||||
<%
|
||||
if(@server_mode != 'cloud')
|
||||
%>
|
||||
<%= f.input :printer_name, :as => :select, :collection => Printer::PrinterWorker.printers, include_blank: false %>
|
||||
<%
|
||||
else
|
||||
%>
|
||||
<%= f.input :printer_name, :as => :select, :collection => [], include_blank: false %>
|
||||
<% end %>
|
||||
<%= f.input :brand_name %>
|
||||
<%= f.input :printer_type %>
|
||||
<%= f.input :api_settings %>
|
||||
@@ -64,20 +74,38 @@
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
var serverMode = "<%= @server_mode %>";
|
||||
if(serverMode == 'cloud'){
|
||||
var printers = code2lab.getPrinters();
|
||||
var printerInfo = JSON.parse([printers]);
|
||||
var select = $("#print_setting_printer_name");
|
||||
|
||||
$.each(printerInfo, function(key, value) {
|
||||
$('#print_setting_printer_name')
|
||||
.append($("<option></option>")
|
||||
.attr("value",value.target)
|
||||
.text(value.deviceName));
|
||||
});
|
||||
}
|
||||
|
||||
// if selected printer change call and bind
|
||||
$("#print_setting_printer_name").on("change", function(){
|
||||
var printer_name = $(this).val();
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "/get_printer_options/"+printer_name,
|
||||
success:function(result){
|
||||
$("#print_setting_brand_name").val(result.model);
|
||||
$("#print_setting_api_settings").val(result.url);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
$("#print_setting_printer_name").on("change", function(){
|
||||
if(serverMode != 'cloud'){
|
||||
var printer_name = $(this).val();
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "/get_printer_options/"+printer_name,
|
||||
success:function(result){
|
||||
$("#print_setting_brand_name").val(result.model);
|
||||
$("#print_setting_api_settings").val(result.url);
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
$("#print_setting_api_settings").val($(this).val());
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function isNumberKey(evt) {
|
||||
var charCode = (evt.which) ? evt.which : event.keyCode;
|
||||
|
||||
@@ -72,7 +72,7 @@ en:
|
||||
payment: "Payment"
|
||||
backend: "Backend"
|
||||
date_time: "DateTime"
|
||||
dine_in_order: "Dine In Order"
|
||||
dine_in_cashier: "Dine-in Cashier"
|
||||
quick_service: "Quick Service"
|
||||
|
||||
views:
|
||||
|
||||
@@ -67,7 +67,7 @@ mm:
|
||||
payment: "ငွေပေးချေမှု"
|
||||
backend: "နောက်ကွယ်"
|
||||
date_time: "ရက်စွဲအချိန်"
|
||||
dine_in_order: "Dine In Order"
|
||||
dine_in_cashier: "Dine-in Cashier"
|
||||
quick_service: "Quick Service"
|
||||
|
||||
views:
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
|
||||
development:
|
||||
secret_key_base: b61d85f8ed2a1a9e0eeece3443b3e8f838d002cc1d9f32115d8e93db920e2957adfedc57501d44741211538f3108b742cdeada87d5bfae796c53da1f90a3cd61
|
||||
sx_provision_url: connect.smartsales.asia/api #connect.smartsales.dev/api #connect.smartsales.asia/api #provision.zsai.ws/api
|
||||
server_mode: application
|
||||
sx_provision_url: connect.smartsales.dev/api #connect.smartsales.dev/api #connect.smartsales.asia/api #provision.zsai.ws/api
|
||||
server_mode: cloud
|
||||
cipher_type: AES-256-CBC
|
||||
sx_key: Wh@t1$C2L
|
||||
|
||||
|
||||
@@ -4,7 +4,9 @@ class CreatePrintSettings < ActiveRecord::Migration[5.1]
|
||||
t.string :name, :null => false
|
||||
t.string :unique_code, :null => false
|
||||
t.string :template
|
||||
t.string :font, :default => ""
|
||||
t.string :font, :default => ""
|
||||
t.integer :header_font_size, :null => false, :default => 11
|
||||
t.integer :item_font_size, :null => false, :default => 9
|
||||
t.string :printer_name, :null => false
|
||||
t.string :api_settings
|
||||
t.string :brand_name
|
||||
|
||||
Reference in New Issue
Block a user