Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant into adminbsb_ui_changes
This commit is contained in:
@@ -62,6 +62,9 @@ section .content{
|
|||||||
.nav-tabs {
|
.nav-tabs {
|
||||||
background-color: #eeeeee;
|
background-color: #eeeeee;
|
||||||
}
|
}
|
||||||
|
.nav-tabs .nav-link {
|
||||||
|
padding: 0.7286rem 0.2575
|
||||||
|
}
|
||||||
.nav-tabs .nav-link.active, .nav-tabs .nav-item.show .nav-link {
|
.nav-tabs .nav-link.active, .nav-tabs .nav-item.show .nav-link {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border-left: 6px solid #111;
|
border-left: 6px solid #111;
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
class ApplicationController < ActionController::Base
|
class ApplicationController < ActionController::Base
|
||||||
include LoginVerification
|
include LicenseVerification
|
||||||
|
|
||||||
#before_action :check_installation
|
#before_action :check_installation
|
||||||
protect_from_forgery with: :exception
|
protect_from_forgery with: :exception
|
||||||
|
|
||||||
# lookup domain for db from provision
|
# lookup domain for db from provision
|
||||||
before_action :lookup_domain, :set_locale
|
before_action :set_locale
|
||||||
|
|
||||||
helper_method :current_company,:current_login_employee,:current_user
|
helper_method :current_company,:current_login_employee,:current_user
|
||||||
# alias_method :current_user, :current_login_employee,:current_user
|
# alias_method :current_user, :current_login_employee,:current_user
|
||||||
@@ -22,67 +23,6 @@ class ApplicationController < ActionController::Base
|
|||||||
{ locale: I18n.locale }
|
{ locale: I18n.locale }
|
||||||
end
|
end
|
||||||
|
|
||||||
def lookup_domain
|
|
||||||
if request.subdomain.present? && request.subdomain != "www"
|
|
||||||
from = request.subdomain.downcase + "." + request.domain.downcase
|
|
||||||
@license = cache_license(ENV["SX_PROVISION_URL"], from) # request.subdomain.downcase
|
|
||||||
if (!@license.nil?)
|
|
||||||
# logger.info "Location - " + @license.name
|
|
||||||
ActiveRecord::Base.establish_connection(website_connection(@license))
|
|
||||||
# logger.info "Connecting to - " + @license.subdomain + " - "+ @license.dbhost + "@" + @license.dbschema
|
|
||||||
else
|
|
||||||
# reconnect_default_db
|
|
||||||
logger.info 'License is nil'
|
|
||||||
# redirect_to root_url(:host => request.domain) + "store_error"
|
|
||||||
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
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def current_license(url)
|
|
||||||
@license = License.new(url)
|
|
||||||
flag = @license.detail_with_local_file()
|
|
||||||
if (flag == 0)
|
|
||||||
flash[:notice] = 'Expired or No License!'
|
|
||||||
elsif (flag == 2)
|
|
||||||
flash[:notice] = 'Expiring! Please, License extend...'
|
|
||||||
else
|
|
||||||
puts "RUN SAY BYAR"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def cache_license(url, lookup)
|
|
||||||
@license = License.new(url, lookup)
|
|
||||||
|
|
||||||
if (@license.detail_with_local_cache(lookup) == true)
|
|
||||||
return @license
|
|
||||||
else
|
|
||||||
return nil
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def website_connection(license)
|
|
||||||
default_connection.dup.update(:host => license.dbhost, :database => license.dbschema.to_s.downcase,
|
|
||||||
:username => license.dbusername, :password => license.dbpassword)
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
def reconnect_default_db
|
|
||||||
ActiveRecord::Base.establish_connection(Rails.env)
|
|
||||||
end
|
|
||||||
|
|
||||||
# Regular database.yml configuration hash
|
|
||||||
def default_connection
|
|
||||||
@default_config ||= ActiveRecord::Base.connection.instance_variable_get("@config").dup
|
|
||||||
end
|
|
||||||
|
|
||||||
rescue_from CanCan::AccessDenied do |exception|
|
rescue_from CanCan::AccessDenied do |exception|
|
||||||
flash[:warning] = exception.message
|
flash[:warning] = exception.message
|
||||||
redirect_to root_path
|
redirect_to root_path
|
||||||
@@ -111,14 +51,6 @@ class ApplicationController < ActionController::Base
|
|||||||
@employee = Employee.find_by_token_session(session[:session_token])
|
@employee = Employee.find_by_token_session(session[:session_token])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
|
||||||
def check_license
|
|
||||||
if License.check_license_file
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
class BaseCrmController < ActionController::Base
|
class BaseCrmController < ApplicationController
|
||||||
include LoginVerification
|
|
||||||
layout "CRM"
|
layout "CRM"
|
||||||
|
|
||||||
#before_action :check_installation
|
#before_action :check_installation
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
class BaseInventoryController < ActionController::Base
|
class BaseInventoryController < ApplicationController
|
||||||
include LoginVerification
|
|
||||||
layout "inventory"
|
layout "inventory"
|
||||||
|
|
||||||
#before_action :check_installation
|
#before_action :check_installation
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
class BaseOqsController < ActionController::Base
|
class BaseOqsController < ApplicationController
|
||||||
include LoginVerification
|
|
||||||
layout "OQS"
|
layout "OQS"
|
||||||
|
|
||||||
#before_action :check_installation
|
#before_action :check_installation
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
class BaseOrigamiController < ActionController::Base
|
class BaseOrigamiController < ApplicationController
|
||||||
include LoginVerification
|
|
||||||
layout "origami"
|
layout "origami"
|
||||||
|
|
||||||
# before_action :checkin_process
|
# before_action :checkin_process
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
class BaseReportController < ActionController::Base
|
class BaseReportController < ApplicationController
|
||||||
include LoginVerification
|
|
||||||
layout "application"
|
layout "application"
|
||||||
|
|
||||||
#before_action :check_installation
|
#before_action :check_installation
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
class BaseWaiterController < ActionController::Base
|
class BaseWaiterController < ApplicationController
|
||||||
include LoginVerification
|
|
||||||
layout "waiter"
|
layout "waiter"
|
||||||
|
|
||||||
#before_action :check_installation
|
#before_action :check_installation
|
||||||
protect_from_forgery with: :exception
|
protect_from_forgery with: :exception
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
83
app/controllers/concerns/license_verification.rb
Normal file
83
app/controllers/concerns/license_verification.rb
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
module LicenseVerification
|
||||||
|
extend ActiveSupport::Concern
|
||||||
|
|
||||||
|
included do
|
||||||
|
before_action :lookup_domain
|
||||||
|
end
|
||||||
|
|
||||||
|
protected
|
||||||
|
def lookup_domain
|
||||||
|
if request.subdomain.present? && request.subdomain != "www"
|
||||||
|
from = request.subdomain.downcase + "." + request.domain.downcase
|
||||||
|
@license = cache_license(ENV["SX_PROVISION_URL"], from) # request.subdomain.downcase
|
||||||
|
if (!@license.nil?)
|
||||||
|
# logger.info "Location - " + @license.name
|
||||||
|
ActiveRecord::Base.establish_connection(website_connection(@license))
|
||||||
|
authenticate_session_token
|
||||||
|
# logger.info "Connecting to - " + @license.subdomain + " - "+ @license.dbhost + "@" + @license.dbschema
|
||||||
|
else
|
||||||
|
# reconnect_default_db
|
||||||
|
logger.info 'License is nil'
|
||||||
|
# redirect_to root_url(:host => request.domain) + "store_error"
|
||||||
|
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
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def authenticate_session_token
|
||||||
|
token = session[:session_token]
|
||||||
|
if (token)
|
||||||
|
#@current_user = User.find_by(api_key: token)
|
||||||
|
#Rails.logger.debug "token - " + token.to_s
|
||||||
|
|
||||||
|
@user = Employee.authenticate_by_token(token)
|
||||||
|
if !@user
|
||||||
|
flash[:notice] = 'Invalid Access!'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def current_license(url)
|
||||||
|
@license = License.new(url)
|
||||||
|
flag = @license.detail_with_local_file()
|
||||||
|
if (flag == 0)
|
||||||
|
flash[:notice] = 'Expired or No License!'
|
||||||
|
elsif (flag == 2)
|
||||||
|
flash[:notice] = 'Expiring! Please, License extend...'
|
||||||
|
else
|
||||||
|
puts "RUN SAY BYAR"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def cache_license(url, lookup)
|
||||||
|
@license = License.new(url, lookup)
|
||||||
|
|
||||||
|
if (@license.detail_with_local_cache(lookup) == true)
|
||||||
|
return @license
|
||||||
|
else
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def website_connection(license)
|
||||||
|
default_connection.dup.update(:host => license.dbhost, :database => license.dbschema.to_s.downcase,
|
||||||
|
:username => license.dbusername, :password => license.dbpassword)
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
def reconnect_default_db
|
||||||
|
ActiveRecord::Base.establish_connection(Rails.env)
|
||||||
|
end
|
||||||
|
|
||||||
|
# Regular database.yml configuration hash
|
||||||
|
def default_connection
|
||||||
|
@default_config ||= ActiveRecord::Base.connection.instance_variable_get("@config").dup
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -4,7 +4,6 @@ module LoginVerification
|
|||||||
included do
|
included do
|
||||||
before_action :authenticate
|
before_action :authenticate
|
||||||
helper_method :current_company,:current_login_employee
|
helper_method :current_company,:current_login_employee
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@@ -18,12 +17,14 @@ module LoginVerification
|
|||||||
token = session[:session_token]
|
token = session[:session_token]
|
||||||
if (token)
|
if (token)
|
||||||
#@current_user = User.find_by(api_key: token)
|
#@current_user = User.find_by(api_key: token)
|
||||||
Rails.logger.debug "token - " + token.to_s
|
#Rails.logger.debug "token - " + token.to_s
|
||||||
|
|
||||||
@user = Employee.authenticate_by_token(token)
|
@user = Employee.authenticate_by_token(token)
|
||||||
if @user
|
if @user
|
||||||
return true
|
return true
|
||||||
#Maybe log - login?
|
#Maybe log - login?
|
||||||
|
else
|
||||||
|
flash[:notice] = 'Invalid Access!'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -50,6 +51,10 @@ module LoginVerification
|
|||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
def check_license
|
||||||
|
License.check_license_file
|
||||||
|
end
|
||||||
|
|
||||||
def check_installation
|
def check_installation
|
||||||
if current_company.nil?
|
if current_company.nil?
|
||||||
redirect_to install_path
|
redirect_to install_path
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
class HomeController < ApplicationController
|
class HomeController < ApplicationController
|
||||||
# layout "application", except: [:index, :show]
|
# layout "application", except: [:index, :show]
|
||||||
skip_before_action :authenticate, only: [:index, :show, :create, :update, :destroy]
|
# skip_before_action only: [:index, :show, :create, :update, :destroy]
|
||||||
|
|
||||||
def index
|
def index
|
||||||
# @employees = Employee.all_emp_except_waiter.order("name asc")
|
# @employees = Employee.all_emp_except_waiter.order("name asc")
|
||||||
|
|||||||
@@ -88,10 +88,11 @@ class Sale < ApplicationRecord
|
|||||||
self.cashier_name = cashier.name
|
self.cashier_name = cashier.name
|
||||||
self.shift_sale_id = shift.id
|
self.shift_sale_id = shift.id
|
||||||
else
|
else
|
||||||
if open_cashier.nil?
|
if open_cashier.count>0
|
||||||
self.cashier_id = requested_by.id
|
self.cashier_id = open_cashier[0].id
|
||||||
self.cashier_name = requested_by.name
|
self.cashier_name = open_cashier[0].name
|
||||||
self.shift_sale_id = current_shift.id
|
shift_id = ShiftSale.current_open_shift(open_cashier[0].id)
|
||||||
|
self.shift_sale_id = shift_id.id
|
||||||
else
|
else
|
||||||
self.cashier_id = current_shift.employee_id
|
self.cashier_id = current_shift.employee_id
|
||||||
self.cashier_name = Employee.find(current_shift.employee_id).name
|
self.cashier_name = Employee.find(current_shift.employee_id).name
|
||||||
@@ -99,6 +100,7 @@ class Sale < ApplicationRecord
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
# set waiter
|
# set waiter
|
||||||
self.requested_by = requested_by.name
|
self.requested_by = requested_by.name
|
||||||
|
|
||||||
|
|||||||
@@ -29,12 +29,12 @@
|
|||||||
<table class="table " id="order-items-table">
|
<table class="table " id="order-items-table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th width="4%">#</th>
|
<th width="2%">#</th>
|
||||||
<th class="" width="20%">Items</th>
|
<th class="" width="20%">Items</th>
|
||||||
<th style="" width="13%">QTY
|
<th style="" width="5%">QTY
|
||||||
</td>
|
</th>
|
||||||
<th class="" width="13%">Price
|
<th class="" width="10%">Price
|
||||||
</td>
|
</th>
|
||||||
<!-- <th class='' width="17%"> Total </th> -->
|
<!-- <th class='' width="17%"> Total </th> -->
|
||||||
<th class='' width="20%"> Action</th>
|
<th class='' width="20%"> Action</th>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -53,46 +53,46 @@
|
|||||||
unless sale_item.price == 0
|
unless sale_item.price == 0
|
||||||
%>
|
%>
|
||||||
<tr>
|
<tr>
|
||||||
<td width="4%"><%= count %></td>
|
<td class="p-1" width="2%"><%= count %></td>
|
||||||
<td class='' width="20%">
|
<td class="p-2" width="20%">
|
||||||
<%= sale_item.product_name %>
|
<%= sale_item.product_name %>
|
||||||
</td>
|
</td>
|
||||||
<% if sale_item.remark != 'void' && sale_item.remark != 'edit' && sale_item.remark != 'foc' %>
|
<% if sale_item.remark != 'void' && sale_item.remark != 'edit' && sale_item.remark != 'foc' %>
|
||||||
<td class='' width="10%">
|
<td class="p-1" width="5%">
|
||||||
<input id="<%= sale_item.id %>_qty" data-id="<%= sale_item.id %>" type="text" value="<%= sale_item.qty %>" class="form-control "/>
|
<input id="<%= sale_item.id %>_qty" data-id="<%= sale_item.id %>" type="text" value="<%= sale_item.qty %>" class="form-control "/>
|
||||||
</td>
|
</td>
|
||||||
<td class='' width="13%">
|
<td class="p-1" width="10%">
|
||||||
<input id="<%= sale_item.id %>_price" data-id="<%= sale_item.id %>" type="text" value="<%= sale_item.unit_price %>" class="form-control"/>
|
<input id="<%= sale_item.id %>_price" data-id="<%= sale_item.id %>" type="text" value="<%= sale_item.unit_price %>" class="form-control"/>
|
||||||
</td>
|
</td>
|
||||||
<!-- <td class='' width="17%">
|
<!-- <td class='' width="17%">
|
||||||
<input id="<%= sale_item.id %>_price" data-id ="<%= sale_item.id %>" type="text" value="<%= sale_item.price %>" class="form-control"/>
|
<input id="<%= sale_item.id %>_price" data-id ="<%= sale_item.id %>" type="text" value="<%= sale_item.price %>" class="form-control"/>
|
||||||
</td> -->
|
</td> -->
|
||||||
<td class='' width="25%">
|
<td class="p-1" width="25%">
|
||||||
<button data-id="<%= sale_item.id %>" class='btn btn-lg bg-blue waves-effect update'>Update</button>
|
<button data-id="<%= sale_item.id %>" class='btn btn-lg bg-blue waves-effect update'>Update</button>
|
||||||
<button data-id="<%= sale_item.id %>" class='btn btn-lg bg-danger waves-effect void'>Void</button>
|
<button data-id="<%= sale_item.id %>" class='btn btn-lg bg-danger waves-effect void'>Void</button>
|
||||||
<button data-id="<%= sale_item.id %>" class='btn btn-lg bg-red waves-effect foc'>FOC</button>
|
<button data-id="<%= sale_item.id %>" class='btn btn-lg bg-red waves-effect foc'>FOC</button>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<% elsif sale_item.qty.to_i < 0 || sale_item.remark == 'edit' %>
|
<% elsif sale_item.qty.to_i < 0 || sale_item.remark == 'edit' %>
|
||||||
<td class='' width="10%">
|
<td class="p-1" width="5%">
|
||||||
<input data-id="<%= sale_item.id %>" type="text" value="<%= sale_item.qty %>" class="form-control" disabled/>
|
<input data-id="<%= sale_item.id %>" type="text" value="<%= sale_item.qty %>" class="form-control" disabled/>
|
||||||
</td>
|
</td>
|
||||||
<td class='' width="13%">
|
<td class='' width="10%">
|
||||||
<input data-id="<%= sale_item.id %>" type="text" value="<%= sale_item.unit_price %>" class="form-control" disabled/>
|
<input data-id="<%= sale_item.id %>" type="text" value="<%= sale_item.unit_price %>" class="form-control" disabled/>
|
||||||
</td>
|
</td>
|
||||||
<!-- <td class='' width="17%">
|
<!-- <td class='' width="17%">
|
||||||
<input data-id ="<%= sale_item.id %>" type="text" value="<%= sale_item.price %>" class="form-control" disabled/>
|
<input data-id ="<%= sale_item.id %>" type="text" value="<%= sale_item.price %>" class="form-control" disabled/>
|
||||||
</td> -->
|
</td> -->
|
||||||
<td class='' width="25%">
|
<td class="p-1" width="25%">
|
||||||
<button data-id="<%= sale_item.id %>" class='btn btn-lg bg-danger waves-effect cancel'>Cancel
|
<button data-id="<%= sale_item.id %>" class='btn btn-lg bg-danger waves-effect cancel'>Cancel
|
||||||
Void/Update
|
Void/Update
|
||||||
</button>
|
</button>
|
||||||
</td>
|
</td>
|
||||||
<% else %>
|
<% else %>
|
||||||
<td class='' width="13%">
|
<td class="p-1" width="5%">
|
||||||
<input data-id="<%= sale_item.id %>" type="text" value="<%= sale_item.qty %>" class="form-control" disabled/>
|
<input data-id="<%= sale_item.id %>" type="text" value="<%= sale_item.qty %>" class="form-control" disabled/>
|
||||||
</td>
|
</td>
|
||||||
<td class='' width="13%">
|
<td class="p-1" width="10%">
|
||||||
<input data-id="<%= sale_item.id %>" type="text" value="<%= sale_item.price %>" class="form-control" disabled/>
|
<input data-id="<%= sale_item.id %>" type="text" value="<%= sale_item.price %>" class="form-control" disabled/>
|
||||||
</td>
|
</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
@@ -108,7 +108,7 @@
|
|||||||
<div class="card-footer">
|
<div class="card-footer">
|
||||||
<table class="table" id="order-charges-table" border="0">
|
<table class="table" id="order-charges-table" border="0">
|
||||||
<tr>
|
<tr>
|
||||||
<td width="50%"><strong>Sub Total:</strong></td>
|
<td class="p-1" width="50%"><strong>Sub Total:</strong></td>
|
||||||
<td><strong id="order-sub-total"><%= sub_total %></strong></td>
|
<td><strong id="order-sub-total"><%= sub_total %></strong></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="rebate_amount"></tr>
|
<tr class="rebate_amount"></tr>
|
||||||
@@ -117,12 +117,42 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- <div class="col-md-3">
|
||||||
|
<div class="card p-l-15 p-r-15">
|
||||||
|
<div class="card-block">
|
||||||
|
<div class="row bottom">
|
||||||
|
<div class="col-md-4 cashier_number border-top border- border-left" data-value="1" data-type="num">1</div>
|
||||||
|
<div class="col-md-4 cashier_number border-top border- border-left" data-value="2" data-type="num">2</div>
|
||||||
|
<div class="col-md-4 cashier_number border-top border- border-left" data-value="3" data-type="num">3</div>
|
||||||
|
</div>
|
||||||
|
<div class="row bottom">
|
||||||
|
<div class="col-md-4 cashier_number border-top border- border-left" data-value="4" data-type="num">4</div>
|
||||||
|
<div class="col-md-4 cashier_number border-top border- border-left" data-value="5" data-type="num">5</div>
|
||||||
|
<div class="col-md-4 cashier_number border-top border- border-left" data-value="6" data-type="num">6</div>
|
||||||
|
</div>
|
||||||
|
<div class="row bottom">
|
||||||
|
<div class="col-md-4 cashier_number border-top border- border-left" data-value="7" data-type="num">7</div>
|
||||||
|
<div class="col-md-4 cashier_number border-top border- border-left" data-value="8" data-type="num">8</div>
|
||||||
|
<div class="col-md-4 cashier_number border-top border- border-left" data-value="9" data-type="num">9</div>
|
||||||
|
</div>
|
||||||
|
<div class="row bottom">
|
||||||
|
<div class="col-md-4 cashier_number border-top border- border-left" data-value="0" data-type="num">0</div>
|
||||||
|
<div class="col-md-4 cashier_number border-top border- border-left" data-value="." data-type="num">.</div>
|
||||||
|
<div class="col-md-4 cashier_number border-top border- border-left" data-value="00" data-type="num">00</div>
|
||||||
|
</div>
|
||||||
|
<div class="row bottom">
|
||||||
|
<div class="col-md-4 cashier_number border-top border- border-left green" data-type="nett">Nett</div>
|
||||||
|
<div class="col-md-4 cashier_number border-top border- border-left red" data-type="del">Del</div>
|
||||||
|
<div class="col-md-4 cashier_number border-top border- border-left orange" data-type="clr">Clr</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div> -->
|
||||||
<!-- Column Three -->
|
<!-- Column Three -->
|
||||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||||
<!-- Waiter Buttons -->
|
<!-- Waiter Buttons -->
|
||||||
<button type="button" class="btn btn-block btn-lg bg-default waves-effect" id='back'><i class="material-icons">reply</i>Back</button>
|
<button type="button" class="btn btn-block btn-lg bg-default waves-effect" id='back'><i class="material-icons">reply</i>Back</button>
|
||||||
<button type="button" class="btn btn-block btn-lg bg-danger waves-effect" id='cancel_all_void'>Cancel All Void</button>
|
<button type="button" class="btn btn-danger btn- action-btn" id='cancel_all_void'>Cancel All Void</button>
|
||||||
<button type="button" class="btn btn-block btn-lg bg-blue waves-effect" id='apply'>Apply</button>
|
<button type="button" class="btn btn-block btn-lg bg-blue waves-effect" id='apply'>Apply</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -225,4 +255,49 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|
||||||
|
$( "input" ).focusin(function() {
|
||||||
|
$('.addfocus').removeClass('addfocus');
|
||||||
|
$( this ).addClass('addfocus');
|
||||||
|
});
|
||||||
|
|
||||||
|
$(".cashier_number").on('click', function(event){
|
||||||
|
if(event.handled !== true) {
|
||||||
|
|
||||||
|
var original_value='';
|
||||||
|
original_value = $('.addfocus').val();
|
||||||
|
|
||||||
|
var input_type = $(this).attr("data-type");
|
||||||
|
|
||||||
|
switch (input_type) {
|
||||||
|
case 'num':
|
||||||
|
var input_value = $(this).attr("data-value");
|
||||||
|
if (original_value == "0.0"){
|
||||||
|
$('.addfocus').val(input_value);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$('.addfocus').val(original_value + '' + input_value);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'add':
|
||||||
|
var input_value = $(this).attr("data-value");
|
||||||
|
amount = parseInt(input_value);
|
||||||
|
$('.addfocus').val(amount);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'del' :
|
||||||
|
var discount_text=$('.addfocus').val();
|
||||||
|
$('.addfocus').val(discount_text.substr(0,discount_text.length-1));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'clr':
|
||||||
|
$('.addfocus').val("");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
event.handled = true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -12,8 +12,8 @@
|
|||||||
|
|
||||||
development:
|
development:
|
||||||
secret_key_base: b61d85f8ed2a1a9e0eeece3443b3e8f838d002cc1d9f32115d8e93db920e2957adfedc57501d44741211538f3108b742cdeada87d5bfae796c53da1f90a3cd61
|
secret_key_base: b61d85f8ed2a1a9e0eeece3443b3e8f838d002cc1d9f32115d8e93db920e2957adfedc57501d44741211538f3108b742cdeada87d5bfae796c53da1f90a3cd61
|
||||||
sx_provision_url: connect.smartsales.dev/api #connect.smartsales.asia/api #provision.zsai.ws/api
|
sx_provision_url: 192.168.1.125:3002/api #connect.smartsales.dev/api #connect.smartsales.asia/api #provision.zsai.ws/api
|
||||||
server_mode: application
|
server_mode: cloud
|
||||||
cipher_type: AES-256-CBC
|
cipher_type: AES-256-CBC
|
||||||
sx_key: Wh@t1$C2L
|
sx_key: Wh@t1$C2L
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,18 @@
|
|||||||
{
|
{
|
||||||
"data": []
|
"data": [
|
||||||
|
{
|
||||||
|
"lookup": "chromis-1.zsai.ws",
|
||||||
|
"value": {
|
||||||
|
"key": "877eY5iPvpVzaYnIkc2FgIy0U85FtqpTpQGqoM/RCG0=\n",
|
||||||
|
"iv": "qSVQaKzOm3TYmRP3DhHdig==\n"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"lookup": "gw2a-13.zsai.dev",
|
||||||
|
"value": {
|
||||||
|
"key": "R0uRkGlvCD5DGaPV4SkhGlwaMR0ohYBBmNna+tpRXMc=\n",
|
||||||
|
"iv": "AP5iuLM36oJmnvLsWCo9+Q==\n"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user