Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant into adminbsb_material_ui
This commit is contained in:
@@ -62,9 +62,6 @@ $(document).ready(function() {
|
|||||||
clearButton: true,
|
clearButton: true,
|
||||||
date: false
|
date: false
|
||||||
});
|
});
|
||||||
|
|
||||||
// first input focus for all form
|
|
||||||
$("body").has("form").find("input:first").focus();
|
|
||||||
|
|
||||||
// Image Upload
|
// Image Upload
|
||||||
$("#simple_menu_item_image_path").fileinput({
|
$("#simple_menu_item_image_path").fileinput({
|
||||||
@@ -107,6 +104,9 @@ $(document).ready(function() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// first input focus for all form
|
||||||
|
$('form:first *input[data-behaviour!=datepicker]:input[type!=hidden]:first').focus();
|
||||||
|
|
||||||
// $(document).on("focus", "[data-behaviour~='datepicker']", function(e){
|
// $(document).on("focus", "[data-behaviour~='datepicker']", function(e){
|
||||||
// $(this).datepicker({"format": "yyyy-M-dd", "weekStart": 1, "autoclose": true});
|
// $(this).datepicker({"format": "yyyy-M-dd", "weekStart": 1, "autoclose": true});
|
||||||
// $('.dropdown-toggle').dropdown();
|
// $('.dropdown-toggle').dropdown();
|
||||||
|
|||||||
@@ -114,9 +114,11 @@
|
|||||||
.green{
|
.green{
|
||||||
background-color: #009900;
|
background-color: #009900;
|
||||||
}
|
}
|
||||||
.left{
|
|
||||||
|
.left-margin-1 {
|
||||||
margin-left:1px;
|
margin-left:1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.bottom{
|
.bottom{
|
||||||
margin-bottom:1px;
|
margin-bottom:1px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,3 +93,9 @@ nav.pagination .page a:hover,
|
|||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*Logout Icon*/
|
||||||
|
i.logout_icon{
|
||||||
|
position: relative;
|
||||||
|
top: 5px;
|
||||||
|
}
|
||||||
@@ -262,6 +262,10 @@ select.form-control {
|
|||||||
margin-left:1px;
|
margin-left:1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.dtp-date .left{
|
||||||
|
margin-left:0px;
|
||||||
|
}
|
||||||
|
|
||||||
.bottom{
|
.bottom{
|
||||||
margin-bottom:1px;
|
margin-bottom:1px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,9 +22,12 @@ class ApplicationController < ActionController::Base
|
|||||||
{ locale: I18n.locale }
|
{ locale: I18n.locale }
|
||||||
end
|
end
|
||||||
|
|
||||||
def lookup_domain
|
def lookup_domain
|
||||||
if request.subdomain.present? && request.subdomain != "www"
|
|
||||||
@license = cache_license(ENV["SX_PROVISION_URL"], request.subdomain.downcase) # request.subdomain.downcase
|
if request.subdomain.present? && request.subdomain != "www"
|
||||||
|
from = request.subdomain.downcase #+ "." + request.domain.downcase
|
||||||
|
puts from
|
||||||
|
@license = cache_license(ENV["SX_PROVISION_URL"], from) # request.subdomain.downcase
|
||||||
if (!@license.nil?)
|
if (!@license.nil?)
|
||||||
# logger.info "Location - " + @license.name
|
# logger.info "Location - " + @license.name
|
||||||
ActiveRecord::Base.establish_connection(website_connection(@license))
|
ActiveRecord::Base.establish_connection(website_connection(@license))
|
||||||
@@ -54,10 +57,18 @@ class ApplicationController < ActionController::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
def cache_license(url, lookup)
|
def cache_license(url, lookup)
|
||||||
@license = License.new(url, lookup)
|
flag = ENV["AES_IV"]
|
||||||
# Export for Key
|
@license = License.new(url, lookup)
|
||||||
aes = MyAesCrypt.new
|
|
||||||
aes_key, aes_iv = aes.export_key(lookup)
|
# Check Exists IV
|
||||||
|
if flag == "<%= ENV['AES_IV'] %>"
|
||||||
|
# Export for Key
|
||||||
|
aes = MyAesCrypt.new
|
||||||
|
aes_key, aes_iv = aes.export_key(lookup)
|
||||||
|
else
|
||||||
|
aes_key = ENV["AES_KEY"]
|
||||||
|
aes_iv = ENV["AES_IV"]
|
||||||
|
end
|
||||||
|
|
||||||
if (@license.detail_with_local_cache(lookup, aes_key, aes_iv) == true)
|
if (@license.detail_with_local_cache(lookup, aes_key, aes_iv) == true)
|
||||||
return @license
|
return @license
|
||||||
@@ -110,7 +121,7 @@ class ApplicationController < ActionController::Base
|
|||||||
if License.check_license_file
|
if License.check_license_file
|
||||||
return true
|
return true
|
||||||
else
|
else
|
||||||
redirect_to install_path
|
redirect_to activate_path
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,42 +1,77 @@
|
|||||||
class InstallController < BaseController
|
class InstallController < BaseController
|
||||||
|
skip_before_action :verify_authenticity_token
|
||||||
|
before_action :check_license
|
||||||
|
|
||||||
def index
|
def index
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def activate
|
||||||
|
flag = "<%= ENV['AES_IV'] %>"
|
||||||
|
key_base = "<%= ENV['secret_key_base'] %>"
|
||||||
|
|
||||||
restaurant = params[:restaurant_name]
|
restaurant = params[:restaurant_name]
|
||||||
license_key = params[:license_key]
|
license_key = params[:license_key]
|
||||||
admin_user = params[:admin_user]
|
# admin_user = params[:admin_user]
|
||||||
admin_password = params[:admin_password]
|
# admin_password = params[:admin_password]
|
||||||
|
db_host = params[:db_host]
|
||||||
|
db_schema = params[:db_schema]
|
||||||
|
db_user = params[:db_user]
|
||||||
|
db_password = params[:db_password]
|
||||||
|
phrase = key_base == "<%= ENV['secret_key_base'] %>"? license_key : "<%= ENV['secret_key_base'] %>"
|
||||||
|
|
||||||
|
# Check Exists IV
|
||||||
|
if flag == "<%= ENV['AES_IV'] %>"
|
||||||
|
# Export for Key
|
||||||
|
aes = MyAesCrypt.new
|
||||||
|
aes_key, aes_iv = aes.export_key(phrase)
|
||||||
|
else
|
||||||
|
aes_key = ENV["AES_KEY"]
|
||||||
|
aes_iv = ENV["AES_IV"]
|
||||||
|
end
|
||||||
|
|
||||||
|
@license = License.new(ENV["SX_PROVISION_URL"])
|
||||||
|
response = @license.license_activate(aes_key, aes_iv, license_key, db_host, db_schema, db_user, db_password)
|
||||||
|
if response[:status]
|
||||||
|
redirect_to root_url, notice: response["message"]
|
||||||
|
else
|
||||||
|
redirect_to activate_path, notice: response["message"]
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def lookup_domain
|
def check_license
|
||||||
if request.subdomain.present? && request.subdomain != "www"
|
if License.check_license_file
|
||||||
@license = current_license(ENV["SX_PROVISION_URL"], request.subdomain.downcase)
|
redirect_to root_url
|
||||||
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
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def current_license(url, key)
|
# def lookup_domain
|
||||||
@license = License.new(url, key)
|
# if request.subdomain.present? && request.subdomain != "www"
|
||||||
|
# @license = current_license(ENV["SX_PROVISION_URL"], 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
|
||||||
|
# end
|
||||||
|
# end
|
||||||
|
|
||||||
##creating md5 hash
|
# def current_license(url, key)
|
||||||
md5_hostname = Digest::MD5.new
|
# @license = License.new(url, key)
|
||||||
md5key = md5_hostname.update(request.host)
|
|
||||||
if (@license.detail_with_local_cache(key, md5key.to_s) == true)
|
|
||||||
#if (@license.detail == true)
|
|
||||||
|
|
||||||
return @license
|
# ##creating md5 hash
|
||||||
else
|
# md5_hostname = Digest::MD5.new
|
||||||
return nil
|
# md5key = md5_hostname.update(request.host)
|
||||||
end
|
# if (@license.detail_with_local_cache(key, md5key.to_s) == true)
|
||||||
end
|
# #if (@license.detail == true)
|
||||||
|
|
||||||
|
# return @license
|
||||||
|
# else
|
||||||
|
# return nil
|
||||||
|
# end
|
||||||
|
# end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ class Oqs::EditController < BaseOqsController
|
|||||||
def index
|
def index
|
||||||
assigned_item_id = params[:id]
|
assigned_item_id = params[:id]
|
||||||
assigned_item = AssignedOrderItem.find(assigned_item_id)
|
assigned_item = AssignedOrderItem.find(assigned_item_id)
|
||||||
@order_item = OrderItem.where("order_id='#{ assigned_item.order_id }' AND item_code='#{ assigned_item.item_code }'");
|
@order_item = OrderItem.where("order_id='#{ assigned_item.order_id }' AND item_instance_code='#{ assigned_item.instance_code }'");
|
||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
@@ -17,7 +17,7 @@ class Oqs::EditController < BaseOqsController
|
|||||||
order_item.save
|
order_item.save
|
||||||
|
|
||||||
# print
|
# print
|
||||||
assigned_item = AssignedOrderItem.find_by_item_code(order_item.item_code)
|
assigned_item = AssignedOrderItem.find_by_instance_code(order_item.item_instance_code)
|
||||||
# order queue stations
|
# order queue stations
|
||||||
oqs = assigned_item.order_queue_station
|
oqs = assigned_item.order_queue_station
|
||||||
|
|
||||||
@@ -25,6 +25,6 @@ class Oqs::EditController < BaseOqsController
|
|||||||
|
|
||||||
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||||
order_queue_printer= Printer::OrderQueuePrinter.new(print_settings)
|
order_queue_printer= Printer::OrderQueuePrinter.new(print_settings)
|
||||||
order_queue_printer.print_order_item(print_settings, oqs,assigned_item.order_id, assigned_item.item_code, print_status=" (Edited)" )
|
order_queue_printer.print_order_item(print_settings, oqs,assigned_item.order_id, assigned_item.instance_code, print_status=" (Edited)" )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ class Origami::CreditPaymentsController < BaseOrigamiController
|
|||||||
@creditcount = 0
|
@creditcount = 0
|
||||||
others = 0
|
others = 0
|
||||||
sale_data.sale_payments.each do |sale_payment|
|
sale_data.sale_payments.each do |sale_payment|
|
||||||
if sale_payment.payment_method == "visa"
|
if sale_payment.payment_method == "creditnote"
|
||||||
@creditcount = @creditcount + sale_payment.payment_amount
|
@creditcount = @creditcount + sale_payment.payment_amount
|
||||||
else
|
else
|
||||||
others = others + sale_payment.payment_amount
|
others = others + sale_payment.payment_amount
|
||||||
|
|||||||
@@ -161,9 +161,9 @@ class Origami::DiscountsController < BaseOrigamiController
|
|||||||
sale = Sale.find(sale_id)
|
sale = Sale.find(sale_id)
|
||||||
|
|
||||||
# Check for Card Payment
|
# Check for Card Payment
|
||||||
is_card_payment = SaleItem.get_sale_payments_by_card(sale.sale_payments)
|
is_card_payment = SalePayment.get_sale_payments_by_card(sale.sale_payments)
|
||||||
|
|
||||||
if is_card_payment != true
|
if is_card != "true"
|
||||||
account_types = Account.where("discount=?",true)
|
account_types = Account.where("discount=?",true)
|
||||||
table_id = sale.bookings[0].dining_facility_id
|
table_id = sale.bookings[0].dining_facility_id
|
||||||
table_type = DiningFacility.find(table_id).type
|
table_type = DiningFacility.find(table_id).type
|
||||||
|
|||||||
@@ -100,10 +100,5 @@ class Origami::VoidController < BaseOrigamiController
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def void_before_pay
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
@@ -67,7 +67,7 @@ class Settings::MenuItemInstancesController < ApplicationController
|
|||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @settings_menu_item_instances.save
|
if @settings_menu_item_instances.save
|
||||||
@settings_menu_item_instances.item_attributes = params[:menu_item_instance][:item_attributes].reject(&:blank?)
|
@settings_menu_item_instances.item_attributes = params[:menu_item_instance][:item_attributes].split(" ")
|
||||||
@settings_menu_item_instances.save
|
@settings_menu_item_instances.save
|
||||||
format.html { redirect_to settings_menu_category_simple_menu_item_path(category,catID), notice: 'Menu item instance was successfully created.' }
|
format.html { redirect_to settings_menu_category_simple_menu_item_path(category,catID), notice: 'Menu item instance was successfully created.' }
|
||||||
format.json { render :show, status: :created, location: @settings_menu_item_instances }
|
format.json { render :show, status: :created, location: @settings_menu_item_instances }
|
||||||
@@ -105,9 +105,9 @@ class Settings::MenuItemInstancesController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
|
|
||||||
if @settings_menu_item_instances.update(settings_menu_item_instance_params)
|
if @settings_menu_item_instances.update(settings_menu_item_instance_params)
|
||||||
@settings_menu_item_instances.item_attributes = params[:menu_item_instance][:item_attributes].reject(&:blank?)
|
#@settings_menu_item_instances.item_attributes = params[:menu_item_instance][:item_attributes].reject(&:blank?)
|
||||||
|
@settings_menu_item_instances.item_attributes = params[:menu_item_instance][:item_attributes].split(" ")
|
||||||
@settings_menu_item_instances.save
|
@settings_menu_item_instances.save
|
||||||
format.html { redirect_to settings_menu_category_simple_menu_item_path(category,catID), notice: 'Menu item instance was successfully updated.' }
|
format.html { redirect_to settings_menu_category_simple_menu_item_path(category,catID), notice: 'Menu item instance was successfully updated.' }
|
||||||
format.json { render :show, status: :ok, location: @settings_menu_item_instances }
|
format.json { render :show, status: :ok, location: @settings_menu_item_instances }
|
||||||
|
|||||||
@@ -29,8 +29,12 @@ class Settings::PromotionsController < ApplicationController
|
|||||||
def create
|
def create
|
||||||
@promotion = Promotion.new(promotion_params)
|
@promotion = Promotion.new(promotion_params)
|
||||||
@promotion.created_by = current_login_employee.id
|
@promotion.created_by = current_login_employee.id
|
||||||
@promotion.promo_start_hour = @promotion.promo_start_hour.to_datetime.advance(hours: +6, minutes: +30)
|
if !@promotion.promo_start_hour.nil?
|
||||||
@promotion.promo_end_hour = @promotion.promo_end_hour.to_datetime.advance(hours: +6, minutes: +30)
|
@promotion.promo_start_hour = @promotion.promo_start_hour.to_datetime.advance(hours: +6, minutes: +30)
|
||||||
|
end
|
||||||
|
if !@promotion.promo_end_hour.nil?
|
||||||
|
@promotion.promo_end_hour = @promotion.promo_end_hour.to_datetime.advance(hours: +6, minutes: +30)
|
||||||
|
end
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @promotion.save
|
if @promotion.save
|
||||||
promo_pros = @promotion.promotion_products
|
promo_pros = @promotion.promotion_products
|
||||||
@@ -95,16 +99,23 @@ class Settings::PromotionsController < ApplicationController
|
|||||||
|
|
||||||
def find_parent_item
|
def find_parent_item
|
||||||
res = []
|
res = []
|
||||||
item = MenuItemInstance.find_by_item_instance_code(params[:item_instance_code])
|
arr_inst = []
|
||||||
if item.nil?
|
item_inst = MenuItemInstance.find_by_item_instance_code(params[:item_instance_code])
|
||||||
|
if item_inst.nil?
|
||||||
product = Product.where("item_code = ?",params[:item_instance_code]).pluck(:name,:item_code)
|
product = Product.where("item_code = ?",params[:item_instance_code]).pluck(:name,:item_code)
|
||||||
res.push(product.name)
|
res.push(product.name)
|
||||||
res.push(product.item_code)
|
res.push(product.item_code)
|
||||||
else
|
else
|
||||||
# menu_item = item.menu_item.pluck(:name,:item_code)
|
# menu_item = item_inst.menu_item.pluck(:name,:item_code)
|
||||||
res.push(item.item_instance_name)
|
# res.push(item_inst.item_instance_name)
|
||||||
res.push(item.menu_item.item_code)
|
# res.push(item_inst.menu_item.item_code)
|
||||||
|
item_inst.menu_item.menu_item_instances.each do |inst|
|
||||||
|
arr_inst.push({inst.item_instance_code => inst.item_instance_name})
|
||||||
|
end
|
||||||
|
res.push({item_inst.menu_item.item_code => arr_inst})
|
||||||
end
|
end
|
||||||
|
puts "res"
|
||||||
|
p res
|
||||||
render json: res
|
render json: res
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ class Transactions::BookingsController < ApplicationController
|
|||||||
|
|
||||||
def index
|
def index
|
||||||
|
|
||||||
filter = params[:filter]
|
filter = params[:receipt_no]
|
||||||
from = params[:from]
|
from = params[:from]
|
||||||
to = params[:to]
|
to = params[:to]
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,8 @@ class Transactions::CreditNotesController < ApplicationController
|
|||||||
to = params[:to]
|
to = params[:to]
|
||||||
|
|
||||||
if filter.nil? && from.nil? && to.nil? && customer.nil?
|
if filter.nil? && from.nil? && to.nil? && customer.nil?
|
||||||
@credit_notes = Sale.where('payment_status = ?', Sale::SALE_STATUS_OUTSTANDING)
|
@credit_notes = Sale.where('payment_status = ?', Sale::SALE_STATUS_OUTSTANDING)
|
||||||
|
@credit_notes = Kaminari.paginate_array(@credit_notes).page(params[:page]).per(20)
|
||||||
else
|
else
|
||||||
sale = Sale.search_credit_sales(customer,filter,from,to)
|
sale = Sale.search_credit_sales(customer,filter,from,to)
|
||||||
if sale.count > 0
|
if sale.count > 0
|
||||||
|
|||||||
@@ -3,16 +3,13 @@ class Transactions::OrdersController < ApplicationController
|
|||||||
def index
|
def index
|
||||||
|
|
||||||
filter = params[:filter]
|
filter = params[:filter]
|
||||||
count = params[:count]
|
|
||||||
from = params[:from]
|
from = params[:from]
|
||||||
to = params[:to]
|
to = params[:to]
|
||||||
|
|
||||||
if filter.nil? && from.nil? && to.nil? && count.nil?
|
if filter.nil? && from.nil? && to.nil?
|
||||||
orders = Order.order("order_id desc")
|
orders = Order.order("order_id desc")
|
||||||
|
|
||||||
else
|
else
|
||||||
orders = Order.search(filter,from,to,count)
|
orders = Order.search(filter,from,to)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if !orders.nil?
|
if !orders.nil?
|
||||||
|
|||||||
@@ -3,9 +3,8 @@ class OrderQueueProcessorJob < ApplicationJob
|
|||||||
|
|
||||||
def perform(order_id, table_id)
|
def perform(order_id, table_id)
|
||||||
# Do something later
|
# Do something later
|
||||||
#Order ID
|
#Order ID
|
||||||
|
order = Order.find(order_id)
|
||||||
order = Order.find(order_id)
|
|
||||||
|
|
||||||
#Execute orders and send to order stations
|
#Execute orders and send to order stations
|
||||||
if order
|
if order
|
||||||
|
|||||||
@@ -21,14 +21,6 @@ class License
|
|||||||
|
|
||||||
# @secret = ENV["aes_key"]
|
# @secret = ENV["aes_key"]
|
||||||
# @params = { query: { device: "SX", token: SECRETS_CONFIG['provision_key'] } }
|
# @params = { query: { device: "SX", token: SECRETS_CONFIG['provision_key'] } }
|
||||||
end
|
|
||||||
|
|
||||||
def shop_code
|
|
||||||
if ( self.subdomain.length > 3)
|
|
||||||
return self.subdomain[0,3].upcase
|
|
||||||
else
|
|
||||||
return self.subdomain.upcase
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def detail_with_local_cache(lookup, key, iv)
|
def detail_with_local_cache(lookup, key, iv)
|
||||||
@@ -41,9 +33,11 @@ class License
|
|||||||
cache_license = nil
|
cache_license = nil
|
||||||
|
|
||||||
##Get redis connection from connection pool
|
##Get redis connection from connection pool
|
||||||
Redis.current do |conn|
|
redis = Redis.new
|
||||||
cache_license = conn.get(cache_key)
|
cache_license = redis.get(cache_key)
|
||||||
end
|
# Redis.current do |conn|
|
||||||
|
# cache_license = conn.get(cache_key)
|
||||||
|
# end
|
||||||
|
|
||||||
Rails.logger.info "Cache key - " + cache_key.to_s
|
Rails.logger.info "Cache key - " + cache_key.to_s
|
||||||
if cache_license.nil?
|
if cache_license.nil?
|
||||||
@@ -54,22 +48,27 @@ class License
|
|||||||
@license = response.parsed_response
|
@license = response.parsed_response
|
||||||
|
|
||||||
if (@license["status"] == true)
|
if (@license["status"] == true)
|
||||||
|
|
||||||
assign()
|
assign()
|
||||||
|
|
||||||
Rails.logger.info "License - " + response.parsed_response.to_s
|
Rails.logger.info "License - " + response.parsed_response.to_s
|
||||||
|
|
||||||
Redis.current do |conn|
|
redis = Redis.new
|
||||||
##Remote - store the remote response in local redis cache
|
redis.set(cache_key, Marshal.dump(@license))
|
||||||
conn.set(cache_key, Marshal.dump(@license))
|
# redis.sadd("License:cache:keys", cache_key)
|
||||||
##ADD to List to remove later
|
# Redis.current do |conn|
|
||||||
conn.sadd("License:cache:keys", cache_key)
|
# ##Remote - store the remote response in local redis cache
|
||||||
end
|
# conn.set(cache_key, Marshal.dump(@license))
|
||||||
|
# ##ADD to List to remove later
|
||||||
|
# conn.sadd("License:cache:keys", cache_key)
|
||||||
|
# end
|
||||||
|
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
else
|
||||||
Rails.logger.info 'API License'
|
@license = Marshal.load(cache_license)
|
||||||
|
assign()
|
||||||
|
Rails.logger.info 'API License'
|
||||||
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -80,65 +79,35 @@ class License
|
|||||||
if has_license
|
if has_license
|
||||||
# puts "VERIFIED"
|
# puts "VERIFIED"
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# if cache_license.nil?
|
# License Activation
|
||||||
# ##change the d/e key
|
def license_activate (key, iv, license_key, db_host, db_schema, db_user, db_password)
|
||||||
# @params = { query: { lookup_type: self.server_mode, lookup: lookup, encrypted_key: key, iv_key: iv} }
|
@params = { query: { lookup_type: self.server_mode, encrypted_key: key, iv_key: iv, license_key: license_key } }
|
||||||
|
response = self.class.get("/activate", @params)
|
||||||
|
@activate = response.parsed_response
|
||||||
|
|
||||||
# response = self.class.get("/request_license", @params)
|
Rails.logger.debug "License Remote Response - " + response.parsed_response.to_s
|
||||||
# @license = response.parsed_response
|
|
||||||
|
|
||||||
# if (@license["status"] == true)
|
if (@activate["status"])
|
||||||
|
response = create_license_file(@activate)
|
||||||
# assign()
|
if(response["status"])
|
||||||
|
sym_path = "/home/yan/symmetric/"
|
||||||
# Rails.logger.info "License - " + response.parsed_response.to_s
|
response = create_symmetric_config(sym_path, db_host, db_schema, db_user, db_password)
|
||||||
|
if(response["status"])
|
||||||
# Redis.current do |conn|
|
response = run_symmetric(sym_path)
|
||||||
# ##Remote - store the remote response in local redis cache
|
end
|
||||||
# conn.set(cache_key, Marshal.dump(@license))
|
end
|
||||||
# ##ADD to List to remove later
|
else
|
||||||
# conn.sadd("License:cache:keys", cache_key)
|
response = { "status": false, "message": "Activation Failed! Please contact code2lab call center!"}
|
||||||
# end
|
end
|
||||||
|
return response
|
||||||
# return true
|
|
||||||
# end
|
|
||||||
|
|
||||||
# Rails.logger.info 'API License'
|
|
||||||
|
|
||||||
# else
|
|
||||||
# @license = Marshal.load(cache_license) if cache_license
|
|
||||||
|
|
||||||
# Rails.logger.info 'Cache License'
|
|
||||||
|
|
||||||
# if (@license["status"] == true)
|
|
||||||
# assign()
|
|
||||||
# return true
|
|
||||||
# end
|
|
||||||
# end
|
|
||||||
# return false
|
|
||||||
end
|
|
||||||
|
|
||||||
def detail
|
|
||||||
response = self.class.get("/subdomain", @options)
|
|
||||||
@license = response.parsed_response
|
|
||||||
|
|
||||||
Rails.logger.debug "License - " + response.parsed_response.to_s
|
|
||||||
|
|
||||||
|
|
||||||
if (@license["status"] == true)
|
|
||||||
assign()
|
|
||||||
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
|
|
||||||
return false
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def verify_license
|
def verify_license
|
||||||
api_token = read_license("api_token")
|
api_token = read_license("api_token")
|
||||||
@options = { query: {lookup_type: "application", token: api_token} }
|
@params = { query: {lookup_type: "application", token: api_token} }
|
||||||
response = self.class.get("/verify", @options)
|
response = self.class.get("/verify", @params)
|
||||||
@varified = response.parsed_response
|
@varified = response.parsed_response
|
||||||
|
|
||||||
Rails.logger.debug "License Remote Response - " + response.parsed_response.to_s
|
Rails.logger.debug "License Remote Response - " + response.parsed_response.to_s
|
||||||
@@ -152,37 +121,7 @@ class License
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
def check_remote_license(license_key)
|
# Check License expired date from PROVISION SERVER
|
||||||
# @options = { query: {device: "cloud", key: license_key, skey: @secret, token: Rails.application.secrets.provision_key} }
|
|
||||||
@options = { query: {lookup_type: "application", encrypted_key: @secret, token: SECRETS_CONFIG['provision_key']} }
|
|
||||||
response = self.class.get("/license", @options)
|
|
||||||
|
|
||||||
@license = response.parsed_response
|
|
||||||
|
|
||||||
Rails.logger.debug "License Remote Response - " + response.parsed_response.to_s
|
|
||||||
if (@license["status"])
|
|
||||||
assign()
|
|
||||||
end
|
|
||||||
return @license["status"]
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
def verify_by_api_token(api_token)
|
|
||||||
@options = { query: {device: "SX", api_token: api_token, skey: @secret, token: SECRETS_CONFIG['provision_key']} }
|
|
||||||
response = self.class.get("/verify", @options)
|
|
||||||
|
|
||||||
@license = response.parsed_response
|
|
||||||
|
|
||||||
Rails.logger.debug "License Remote Response - " + response.parsed_response.to_s
|
|
||||||
if (@license["status"])
|
|
||||||
assign()
|
|
||||||
end
|
|
||||||
|
|
||||||
return @license["status"]
|
|
||||||
end
|
|
||||||
#Load License is remove from the cloud license because - this license is must be validated against subdmain instead of license.data from file.
|
|
||||||
|
|
||||||
|
|
||||||
def check_expired(renewal_date)
|
def check_expired(renewal_date)
|
||||||
if (renewal_date < Date.today)
|
if (renewal_date < Date.today)
|
||||||
return true
|
return true
|
||||||
@@ -191,6 +130,7 @@ class License
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Check License File exists
|
||||||
def self.check_license_file
|
def self.check_license_file
|
||||||
return File.exist?("config/license.yml")
|
return File.exist?("config/license.yml")
|
||||||
end
|
end
|
||||||
@@ -202,13 +142,156 @@ class License
|
|||||||
File.open("config/license.yml").each do |line|
|
File.open("config/license.yml").each do |line|
|
||||||
if line.include? (key)
|
if line.include? (key)
|
||||||
decrypted_line_array = line.split(":")
|
decrypted_line_array = line.split(":")
|
||||||
decrypted_line = AESCrypt.decrypt(decrypted_line_array[1])
|
decrypted_line = AESCrypt.decrypt_data(decode_str(decrypted_line_array[1]), decode_str(ENV['AES_KEY']), decode_str(ENV['AES_IV']), ENV['CIPHER_TYPE'])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
def decode_str(str)
|
||||||
|
return Base64.decode64(str)
|
||||||
|
end
|
||||||
|
|
||||||
|
# License File Creation
|
||||||
|
def create_license_file(response_data)
|
||||||
|
if File.exist?("config/license.yml")
|
||||||
|
delete_license_file
|
||||||
|
end
|
||||||
|
|
||||||
|
begin
|
||||||
|
# Licese File Creation
|
||||||
|
f = File.open("config/license.yml", "w")
|
||||||
|
f.write("iv_key: #{response_data['iv_key']}\n")
|
||||||
|
f.write("shop_name: #{response_data['shop_name']}\n")
|
||||||
|
f.write("email: #{response_data['email']}\n")
|
||||||
|
f.write("telephone: #{response_data['telephone']}\n")
|
||||||
|
f.write("fax: #{response_data['fax']}\n")
|
||||||
|
f.write("address: #{response_data['address']}\n")
|
||||||
|
f.write("dbhost: #{response_data['dbhost']}\n")
|
||||||
|
f.write("dbschema: #{response_data['dbschema']}\n")
|
||||||
|
f.write("dbusername: #{response_data['dbusername']}\n")
|
||||||
|
f.write("dbpassword: #{response_data['dbpassword']}\n")
|
||||||
|
f.write("api_token: #{response_data['api_token']}\n")
|
||||||
|
f.write("app_token: #{response_data['app_token']}\n")
|
||||||
|
f.close
|
||||||
|
rescue IOError
|
||||||
|
response = { "status": false, "message": "Activation is success but something is wrong. \n Please contact code2lab call center!"}
|
||||||
|
end
|
||||||
|
response = { "status": true, "message": "Success Activation. License also created."}
|
||||||
|
end
|
||||||
|
|
||||||
|
# Symmetric Configuration
|
||||||
|
def create_symmetric_config(sym_location, db_host, db_schema, db_user, db_password)
|
||||||
|
if File.directory? (sym_location)
|
||||||
|
begin
|
||||||
|
# sx properties create
|
||||||
|
f = File.open(sym_location + "engines/sx.properties", "w")
|
||||||
|
f.write("engine.name=sx\n")
|
||||||
|
f.write("db.driver=com.mysql.jdbc.Driver\n")
|
||||||
|
f.write("db.url=jdbc:mysql://#{db_host}/#{db_schema}?tinyInt1isBit=false\n")
|
||||||
|
f.write("db.user=#{db_user}\n")
|
||||||
|
f.write("db.password=#{db_password}\n")
|
||||||
|
f.write("registration.url=\n")
|
||||||
|
f.write("sync.url=http://#{db_host}:31415/sync/sx\n")
|
||||||
|
f.write("group.id=sx\n")
|
||||||
|
f.write("external.id=000\n")
|
||||||
|
f.write("job.purge.period.time.ms=7200000\n")
|
||||||
|
f.write("job.routing.period.time.ms=5000\n")
|
||||||
|
f.write("job.push.period.time.ms=10000\n")
|
||||||
|
f.write("job.pull.period.time.ms=10000\n")
|
||||||
|
f.write("initial.load.create.first=true\n")
|
||||||
|
f.write("initial.load.use.extract.job.enabled=true\n")
|
||||||
|
f.close
|
||||||
|
|
||||||
|
# read from license file
|
||||||
|
shop_name = read_license("shop_name")
|
||||||
|
dbhost = read_license("dbhost")
|
||||||
|
dbschema = read_license("dbschema")
|
||||||
|
dbusername = read_license("dbusername")
|
||||||
|
dbpassword = read_license("dbpassword")
|
||||||
|
|
||||||
|
# shop properties create
|
||||||
|
f = File.open(sym_location + "/#{shop_name}.properties", "w")
|
||||||
|
f.write("engine.name=#{shop_name}\n")
|
||||||
|
f.write("db.driver=com.mysql.jdbc.Driver\n")
|
||||||
|
f.write("db.url=jdbc:mysql://#{dbhost}/#{dbschema}?tinyInt1isBit=false\n")
|
||||||
|
f.write("db.user=#{dbusername}\n")
|
||||||
|
f.write("db.password=#{dbpassword}\n")
|
||||||
|
f.write("registration.url=http://#{db_host}:31415/sync/sx\n")
|
||||||
|
f.write("group.id=store\n")
|
||||||
|
f.write("external.id=001\n")
|
||||||
|
f.write("job.routing.period.time.ms=5000\n")
|
||||||
|
f.write("job.push.period.time.ms=10000\n")
|
||||||
|
f.write("job.pull.period.time.ms=10000\n")
|
||||||
|
# f.write("initial.load.create.first=true\n")
|
||||||
|
# f.write("initial.load.use.extract.job.enabled=true\n")
|
||||||
|
f.close
|
||||||
|
rescue IOError
|
||||||
|
response = { "status": false, "message": "Activation is success but something is wrong. \n Please contact code2lab call center!"}
|
||||||
|
end
|
||||||
|
response = { "status": true, "message": "Success Activation. License also created."}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Run Symmetric
|
||||||
|
def run_symmetric(sym_path)
|
||||||
|
check_sym_proc_str = `#{sym_path + "bin/sym_service status"}`
|
||||||
|
check_sym_proc_str = check_sym_proc_str.split("\n")
|
||||||
|
sym_install_status = check_sym_proc_str[0].split(": ")
|
||||||
|
# sym_run_status = check_sym_proc_str[1].split(": ")
|
||||||
|
|
||||||
|
# Check Sym Installed
|
||||||
|
if sym_install_status[1] == "false"
|
||||||
|
response = { "status": false, "message": "Activation is success but Symmetric service not Installed. \n Please contact code2lab call center!"}
|
||||||
|
end
|
||||||
|
|
||||||
|
# Run Sym Service
|
||||||
|
sym_run_status = check_sym_running(check_sym_proc_str[1], sym_path)
|
||||||
|
if sym_run_status
|
||||||
|
# Create Sym Table
|
||||||
|
check_sym_table = system(sym_path + "bin/symadmin --engine sx create-sym-tables")
|
||||||
|
if check_sym_table
|
||||||
|
sym_sql = Rails.root + "db/sym_master.sql"
|
||||||
|
if File.exist? (sym_sql)
|
||||||
|
# Import Sym Sql to db and start sym
|
||||||
|
run_sym_sql = system(sym_path + "bin/dbimport --engine sx " + sym_sql)
|
||||||
|
run_sym = system(sym_path + "bin/sym")
|
||||||
|
if run_sym
|
||||||
|
response = { "status": true, "message": "Activation is success and Configuration done..."}
|
||||||
|
end
|
||||||
|
else
|
||||||
|
response = { "status": false, "message": "Activation is success but Symmetric Sql not Found. \n Please contact code2lab call center!"}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
# Check Symmetric Running
|
||||||
|
def check_sym_running(status, sym_path)
|
||||||
|
# Run Sym Service
|
||||||
|
if status.include? "Server is already running"
|
||||||
|
return true
|
||||||
|
elsif status.include? "false"
|
||||||
|
sym_start_str = `#{sym_path + "bin/sym_service start"}`
|
||||||
|
if sym_start_str.include? "Started"
|
||||||
|
return true
|
||||||
|
else
|
||||||
|
check_sym_running(sym_start_status[0])
|
||||||
|
end
|
||||||
|
else
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Delete License File
|
||||||
|
def delete_license_file
|
||||||
|
File.delete("config/license.yml") if File.exist?("config/license.yml")
|
||||||
|
end
|
||||||
|
|
||||||
|
# Assign db info for Cloud
|
||||||
def assign
|
def assign
|
||||||
# self.name = @license["name"]
|
# self.name = @license["name"]
|
||||||
# self.address_1 = @license["address_1"]
|
# self.address_1 = @license["address_1"]
|
||||||
@@ -228,17 +311,24 @@ class License
|
|||||||
## self.plan_activation_date = Date.strptime(@license["plan_activation_date"], "%Y-%m-%d")
|
## self.plan_activation_date = Date.strptime(@license["plan_activation_date"], "%Y-%m-%d")
|
||||||
## self.plan_next_renewal_date = Date.strptime(@license["plan_next_renewal_date"], "%Y-%m-%d")
|
## self.plan_next_renewal_date = Date.strptime(@license["plan_next_renewal_date"], "%Y-%m-%d")
|
||||||
|
|
||||||
|
|
||||||
# self.plan_max_products = @license["plan_max_products"].to_i
|
# self.plan_max_products = @license["plan_max_products"].to_i
|
||||||
# self.plan_max_customers = @license["plan_max_customers"].to_i
|
# self.plan_max_customers = @license["plan_max_customers"].to_i
|
||||||
# self.plan_active_connections = @license["plan_active_connections"].to_i
|
# self.plan_active_connections = @license["plan_active_connections"].to_i
|
||||||
salt = @license["secret_key"]
|
# salt = @license["secret_key"]
|
||||||
|
|
||||||
if (@license["dbhost"] || @license["dbschema"] || @license["dbusername"] || @license["dbpassword"] )
|
key = Base64.decode64(ENV['AES_KEY'])
|
||||||
self.dbhost = AESCrypt.decrypt(@license["dbhost"], salt)
|
iv = Base64.decode64(ENV['AES_IV'])
|
||||||
self.dbschema = AESCrypt.decrypt(@license["dbschema"], salt)
|
|
||||||
self.dbusername = AESCrypt.decrypt(@license["dbusername"], salt)
|
if (@license["dbhost"] || @license["dbschema"] || @license["dbusername"] || @license["dbpassword"] )
|
||||||
self.dbpassword = AESCrypt.decrypt(@license["dbpassword"], salt)
|
host = Base64.decode64(@license["dbhost"])
|
||||||
|
dbschema = Base64.decode64(@license["dbschema"])
|
||||||
|
dbusername = Base64.decode64(@license["dbusername"])
|
||||||
|
dbpassword = Base64.decode64(@license["dbpassword"])
|
||||||
|
|
||||||
|
self.dbhost = AESCrypt.decrypt_data(host, key, iv, ENV['CIPHER_TYPE'])
|
||||||
|
self.dbschema = AESCrypt.decrypt_data(dbschema, key, iv, ENV['CIPHER_TYPE'])
|
||||||
|
self.dbusername = AESCrypt.decrypt_data(dbusername, key, iv, ENV['CIPHER_TYPE'])
|
||||||
|
self.dbpassword = AESCrypt.decrypt_data(dbpassword, key, iv, ENV['CIPHER_TYPE'])
|
||||||
end
|
end
|
||||||
|
|
||||||
# self.exchange_unqiue_id = @license["exchange_unqiue_id"]
|
# self.exchange_unqiue_id = @license["exchange_unqiue_id"]
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
require 'openssl'
|
||||||
|
require 'base64'
|
||||||
|
|
||||||
class MyAesCrypt
|
class MyAesCrypt
|
||||||
@cipher = ""
|
@cipher = ""
|
||||||
|
|
||||||
@@ -7,11 +10,16 @@ class MyAesCrypt
|
|||||||
|
|
||||||
def export_key(passphrase)
|
def export_key(passphrase)
|
||||||
# We want a 256 bit key symetric key based on passphrase
|
# We want a 256 bit key symetric key based on passphrase
|
||||||
|
# for cloud is lookup
|
||||||
|
# for local is license_key
|
||||||
|
# iv_salt = passphrase+"c2l"
|
||||||
digest = Digest::SHA256.new
|
digest = Digest::SHA256.new
|
||||||
key = digest.update(passphrase)
|
key_digest = digest.update(passphrase)
|
||||||
key = digest.digest
|
# iv_digest = digest.update(iv_salt)
|
||||||
ENV['AES_KEY'] = cipher_key = key # stores the key in key, and also sets the generated key on the @cipher
|
key = key_digest.digest
|
||||||
ENV['AES_IV'] = cipher_iv = @cipher.random_iv # stores the iv in iv, and also sets the generated iv on the @cipher
|
# iv = iv_digest.digest
|
||||||
|
ENV['AES_KEY'] = cipher_key = Base64.encode64(key) # stores the key in key, and also sets the generated key on the @cipher
|
||||||
|
ENV['AES_IV'] = cipher_iv = Base64.encode64(@cipher.random_iv) # stores the iv in iv, and also sets the generated iv on the @cipher
|
||||||
return cipher_key, cipher_iv
|
return cipher_key, cipher_iv
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -363,18 +363,18 @@ class Order < ApplicationRecord
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.search(filter,from,to,count)
|
def self.search(filter,from,to)
|
||||||
if count.to_i > 0
|
if filter.blank?
|
||||||
item_count = "and item_count = '#{count}'"
|
keyword = ''
|
||||||
else
|
else
|
||||||
item_count = ''
|
keyword = "order_id LIKE ? OR status LIKE ? OR order_type LIKE ? OR source='#{filter}'","%#{filter}%","%#{filter}%","%#{filter}%"
|
||||||
end
|
end
|
||||||
if from.present? && to.present?
|
|
||||||
Order.where("DATE_FORMAT(date,'%d-%m-%Y') >= ?" + " AND DATE_FORMAT(date,'%d-%m-%Y') <= ? #{item_count}", from,to)
|
if from.present? && to.present?
|
||||||
elsif !from.present? && !to.present? && count.present?
|
order = Order.where("DATE_FORMAT(date,'%d-%m-%Y') >= ?" + " AND DATE_FORMAT(date,'%d-%m-%Y') <= ?", from,to)
|
||||||
Order.where("item_count = '#{count}'")
|
query = order.where(keyword)
|
||||||
else
|
else
|
||||||
Order.where("order_id LIKE ? OR status LIKE ? OR order_type LIKE ? OR source='#{filter}'","%#{filter}%","%#{filter}%","%#{filter}%",)
|
where("order_id LIKE ? OR status LIKE ? OR order_type LIKE ? OR source='#{filter}'","%#{filter}%","%#{filter}%","%#{filter}%")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class PrintSetting < ApplicationRecord
|
class PrintSetting < ApplicationRecord
|
||||||
# validations
|
# validations
|
||||||
validates_presence_of :name, :unique_code, :printer_name, :page_width, :page_height
|
validates_presence_of :name, :unique_code, :printer_name, :page_width, :page_height, :print_copies
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,10 +1,16 @@
|
|||||||
class Printer::OrderQueuePrinter < Printer::PrinterWorker
|
class Printer::OrderQueuePrinter < Printer::PrinterWorker
|
||||||
|
|
||||||
def print_order_item(print_settings,oqs,order_id, item_code, print_status, options="")
|
def print_order_item(print_settings,oqs,order_id, instance_code, print_status, options="")
|
||||||
#Use CUPS service
|
#Use CUPS service
|
||||||
#Generate PDF
|
#Generate PDF
|
||||||
#Print
|
#Print
|
||||||
order_item = print_query('order_item', item_code) #OrderItem.find_by_item_code(item_code)
|
# Must be one print
|
||||||
|
if print_settings.print_copies == 0
|
||||||
|
print_settings.print_copies = 1
|
||||||
|
print_settings.save!
|
||||||
|
end
|
||||||
|
|
||||||
|
order_item = print_query('order_item', instance_code) #OrderItem.find_by_item_code(item_code)
|
||||||
|
|
||||||
filename = "tmp/order_item.pdf"
|
filename = "tmp/order_item.pdf"
|
||||||
|
|
||||||
@@ -14,12 +20,13 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
|
|||||||
pdf.render_file filename
|
pdf.render_file filename
|
||||||
|
|
||||||
if oqs.print_copy
|
if oqs.print_copy
|
||||||
self.print(filename, oqs.printer_name)
|
self.print(filename, oqs.printer_name)
|
||||||
self.print(filename, oqs.printer_name)
|
|
||||||
#For print copy
|
#For print copy
|
||||||
# pdf.render_file filename.gsub(".","-copy.")
|
# pdf.render_file filename.gsub(".","-copy.")
|
||||||
# self.print(filename.gsub(".","-copy."), oqs.printer_name)
|
# self.print(filename.gsub(".","-copy."), oqs.printer_name)
|
||||||
else
|
else
|
||||||
|
print_settings.print_copies = 1
|
||||||
|
print_settings.save!
|
||||||
self.print(filename, oqs.printer_name)
|
self.print(filename, oqs.printer_name)
|
||||||
end
|
end
|
||||||
# end
|
# end
|
||||||
@@ -29,9 +36,14 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
|
|||||||
def print_order_summary(print_settings,oqs, order_id, order_items, print_status)
|
def print_order_summary(print_settings,oqs, order_id, order_items, print_status)
|
||||||
#Use CUPS service
|
#Use CUPS service
|
||||||
#Generate PDF
|
#Generate PDF
|
||||||
#Print
|
#Print
|
||||||
order=print_query('order_summary', order_id)
|
# Must be one print
|
||||||
|
if print_settings.print_copies == 0
|
||||||
|
print_settings.print_copies = 1
|
||||||
|
print_settings.save!
|
||||||
|
end
|
||||||
|
|
||||||
|
order=print_query('order_summary', order_id)
|
||||||
# For Print Per Item
|
# For Print Per Item
|
||||||
if oqs.cut_per_item
|
if oqs.cut_per_item
|
||||||
order.each do|odi|
|
order.each do|odi|
|
||||||
@@ -44,11 +56,12 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
|
|||||||
pdf = OrderItemPdf.new(print_settings,odi, print_status, options, oqs.use_alternate_name)
|
pdf = OrderItemPdf.new(print_settings,odi, print_status, options, oqs.use_alternate_name)
|
||||||
# pdf.render_file "tmp/order_item.pdf"
|
# pdf.render_file "tmp/order_item.pdf"
|
||||||
pdf.render_file filename
|
pdf.render_file filename
|
||||||
if oqs.print_copy
|
if oqs.print_copy
|
||||||
self.print(filename, oqs.printer_name)
|
|
||||||
self.print(filename, oqs.printer_name)
|
self.print(filename, oqs.printer_name)
|
||||||
# self.print(filename.gsub(".","-copy."), oqs.printer_name)
|
# self.print(filename.gsub(".","-copy."), oqs.printer_name)
|
||||||
else
|
else
|
||||||
|
print_settings.print_copies = 1
|
||||||
|
print_settings.save!
|
||||||
self.print(filename, oqs.printer_name)
|
self.print(filename, oqs.printer_name)
|
||||||
end
|
end
|
||||||
#end
|
#end
|
||||||
@@ -59,12 +72,13 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
|
|||||||
pdf = OrderSummaryPdf.new(print_settings,order, print_status, order_items, oqs.use_alternate_name)
|
pdf = OrderSummaryPdf.new(print_settings,order, print_status, order_items, oqs.use_alternate_name)
|
||||||
pdf.render_file filename
|
pdf.render_file filename
|
||||||
if oqs.print_copy
|
if oqs.print_copy
|
||||||
self.print(filename, oqs.printer_name)
|
self.print(filename, oqs.printer_name)
|
||||||
self.print(filename, oqs.printer_name)
|
|
||||||
#For print copy
|
#For print copy
|
||||||
# pdf.render_file filename.gsub(".","-copy.")
|
# pdf.render_file filename.gsub(".","-copy.")
|
||||||
# self.print(filename.gsub(".","-copy."), oqs.printer_name)
|
# self.print(filename.gsub(".","-copy."), oqs.printer_name)
|
||||||
else
|
else
|
||||||
|
print_settings.print_copies = 1
|
||||||
|
print_settings.save!
|
||||||
self.print(filename, oqs.printer_name)
|
self.print(filename, oqs.printer_name)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -72,6 +86,12 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
|
|||||||
|
|
||||||
# Print for orders in booking
|
# Print for orders in booking
|
||||||
def print_booking_summary(print_settings,oqs, booking_id, print_status)
|
def print_booking_summary(print_settings,oqs, booking_id, print_status)
|
||||||
|
# Must be one print
|
||||||
|
if print_settings.print_copies == 0
|
||||||
|
print_settings.print_copies = 1
|
||||||
|
print_settings.save!
|
||||||
|
end
|
||||||
|
|
||||||
order=print_query('booking_summary', booking_id)
|
order=print_query('booking_summary', booking_id)
|
||||||
# For Print Per Item
|
# For Print Per Item
|
||||||
if oqs.cut_per_item
|
if oqs.cut_per_item
|
||||||
@@ -89,9 +109,11 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
|
|||||||
self.print(filename, oqs.printer_name)
|
self.print(filename, oqs.printer_name)
|
||||||
|
|
||||||
#For print copy
|
#For print copy
|
||||||
pdf.render_file filename.gsub(".","-copy.")
|
# pdf.render_file filename.gsub(".","-copy.")
|
||||||
self.print(filename.gsub(".","-copy."), oqs.printer_name)
|
# self.print(filename.gsub(".","-copy."), oqs.printer_name)
|
||||||
else
|
else
|
||||||
|
print_settings.print_copies = 1
|
||||||
|
print_settings.save!
|
||||||
self.print(filename, oqs.printer_name)
|
self.print(filename, oqs.printer_name)
|
||||||
end
|
end
|
||||||
#end
|
#end
|
||||||
@@ -105,9 +127,11 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
|
|||||||
self.print(filename, oqs.printer_name)
|
self.print(filename, oqs.printer_name)
|
||||||
|
|
||||||
#For print copy
|
#For print copy
|
||||||
pdf.render_file filename.gsub(".","-copy.")
|
# pdf.render_file filename.gsub(".","-copy.")
|
||||||
self.print(filename.gsub(".","-copy."), oqs.printer_name)
|
# self.print(filename.gsub(".","-copy."), oqs.printer_name)
|
||||||
else
|
else
|
||||||
|
print_settings.print_copies = 1
|
||||||
|
print_settings.save!
|
||||||
self.print(filename, oqs.printer_name)
|
self.print(filename, oqs.printer_name)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ class Printer::PrinterWorker
|
|||||||
end
|
end
|
||||||
|
|
||||||
def print(file_path,printer_destination = nil )
|
def print(file_path,printer_destination = nil )
|
||||||
|
|
||||||
if printer_destination.nil?
|
if printer_destination.nil?
|
||||||
printer_destination = self.printer_destination
|
printer_destination = self.printer_destination
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -74,6 +74,10 @@ class Printer::ReceiptPrinter < Printer::PrinterWorker
|
|||||||
|
|
||||||
# print as print copies in printer setting
|
# print as print copies in printer setting
|
||||||
count = printer_settings.print_copies
|
count = printer_settings.print_copies
|
||||||
|
|
||||||
|
# override print copies for print worker loop
|
||||||
|
print_settings.print_copies = 1
|
||||||
|
print_settings.save!
|
||||||
begin
|
begin
|
||||||
if count == 1
|
if count == 1
|
||||||
pdf.render_file "tmp/receipt_bill_#{sale_data.receipt_no}.pdf"
|
pdf.render_file "tmp/receipt_bill_#{sale_data.receipt_no}.pdf"
|
||||||
@@ -100,7 +104,7 @@ class Printer::ReceiptPrinter < Printer::PrinterWorker
|
|||||||
#Generate PDF
|
#Generate PDF
|
||||||
#Print
|
#Print
|
||||||
pdf = QueueNoPdf.new(printer_settings,queue)
|
pdf = QueueNoPdf.new(printer_settings,queue)
|
||||||
pdf.render_file "tmp/print_queue_no.pdf"
|
pdf.render_file "tmp/print_queue_no.pdf"
|
||||||
self.print("tmp/print_queue_no.pdf")
|
self.print("tmp/print_queue_no.pdf")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -449,7 +449,7 @@ class Sale < ApplicationRecord
|
|||||||
sale = Sale.where("DATE_FORMAT(receipt_date,'%d-%m-%Y') >= ?" + " AND DATE_FORMAT(receipt_date,'%d-%m-%Y') <= ? and NOT sale_status = 'void' ", from,to)
|
sale = Sale.where("DATE_FORMAT(receipt_date,'%d-%m-%Y') >= ?" + " AND DATE_FORMAT(receipt_date,'%d-%m-%Y') <= ? and NOT sale_status = 'void' ", from,to)
|
||||||
query = sale.where(keyword)
|
query = sale.where(keyword)
|
||||||
else
|
else
|
||||||
where("receipt_no LIKE ? OR cashier_name LIKE ? OR sale_status ='#{filter}'","%#{filter}%","%#{filter}%",)
|
where("receipt_no LIKE ? OR cashier_name LIKE ? OR sale_status ='#{filter}'","%#{filter}%","%#{filter}%")
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ class SaleItem < ApplicationRecord
|
|||||||
def self.update_existing_item(qty, item, sale_id, type, item_price, price)
|
def self.update_existing_item(qty, item, sale_id, type, item_price, price)
|
||||||
sale_item = SaleItem.new
|
sale_item = SaleItem.new
|
||||||
sale_item.product_code = item.product_code
|
sale_item.product_code = item.product_code
|
||||||
|
sale_item.item_instance_code = item.item_instance_code
|
||||||
sale_item.product_name = item.product_name + "(#{type})"
|
sale_item.product_name = item.product_name + "(#{type})"
|
||||||
sale_item.product_alt_name = item.product_alt_name
|
sale_item.product_alt_name = item.product_alt_name
|
||||||
sale_item.account_id = item.account_id
|
sale_item.account_id = item.account_id
|
||||||
@@ -145,17 +146,6 @@ class SaleItem < ApplicationRecord
|
|||||||
return price,type
|
return price,type
|
||||||
end
|
end
|
||||||
|
|
||||||
# Check for Card Payment
|
|
||||||
def self.get_sale_payments_by_card(sale_payments)
|
|
||||||
|
|
||||||
# Check for Card Payment
|
|
||||||
sale_payments.each do |sp|
|
|
||||||
if sp.payment_method == "jcb" || sp.payment_method == "mpu" || sp.payment_method == "visa" || sp.payment_method == "master"
|
|
||||||
return true;
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
||||||
# def self.get_overall_discount(sale_id)
|
# def self.get_overall_discount(sale_id)
|
||||||
# price = 0.0
|
# price = 0.0
|
||||||
# item=SaleItem.where("product_code=?", sale_id)
|
# item=SaleItem.where("product_code=?", sale_id)
|
||||||
@@ -170,6 +160,5 @@ class SaleItem < ApplicationRecord
|
|||||||
private
|
private
|
||||||
def generate_custom_id
|
def generate_custom_id
|
||||||
self.sale_item_id = SeedGenerator.generate_id(self.class.name, "SLI")
|
self.sale_item_id = SeedGenerator.generate_id(self.class.name, "SLI")
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -155,6 +155,16 @@ class SalePayment < ApplicationRecord
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Check for Card Payment
|
||||||
|
def self.get_sale_payments_by_card(sale_payments)
|
||||||
|
# Check for Card Payment
|
||||||
|
sale_payments.each do |sp|
|
||||||
|
if sp.payment_method == "jcb" || sp.payment_method == "mpu" || sp.payment_method == "visa" || sp.payment_method == "master"
|
||||||
|
return true;
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
def cash_payment
|
def cash_payment
|
||||||
payment_status = false
|
payment_status = false
|
||||||
@@ -497,8 +507,6 @@ class SalePayment < ApplicationRecord
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private
|
private
|
||||||
def generate_custom_id
|
def generate_custom_id
|
||||||
self.sale_payment_id = SeedGenerator.generate_id(self.class.name, "SPI")
|
self.sale_payment_id = SeedGenerator.generate_id(self.class.name, "SPI")
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ class CloseCashierPdf < Prawn::Document
|
|||||||
self.page_width = printer_settings.page_width #PrintSetting.where("name = ?","Close Cashier").first.page_width
|
self.page_width = printer_settings.page_width #PrintSetting.where("name = ?","Close Cashier").first.page_width
|
||||||
self.page_height = printer_settings.page_height
|
self.page_height = printer_settings.page_height
|
||||||
self.margin = 5
|
self.margin = 5
|
||||||
self.price_width = 40
|
self.price_width = 60
|
||||||
self.qty_width = 20
|
self.qty_width = 20
|
||||||
self.total_width = 40
|
self.total_width = 40
|
||||||
self.item_width = self.page_width - ((self.price_width + self.qty_width + self.total_width))
|
self.item_width = self.page_width - ((self.price_width + self.qty_width + self.total_width))
|
||||||
@@ -133,7 +133,6 @@ class CloseCashierPdf < Prawn::Document
|
|||||||
text "#{shift_sale.cash_in}", :size => self.item_font_size, :align => :right
|
text "#{shift_sale.cash_in}", :size => self.item_font_size, :align => :right
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
y_position = cursor
|
y_position = cursor
|
||||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
|
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
|
||||||
text "Cash Out:", :size => self.item_font_size, :align => :right
|
text "Cash Out:", :size => self.item_font_size, :align => :right
|
||||||
@@ -142,26 +141,11 @@ class CloseCashierPdf < Prawn::Document
|
|||||||
text "#{shift_sale.cash_out}", :size => self.item_font_size, :align => :right
|
text "#{shift_sale.cash_out}", :size => self.item_font_size, :align => :right
|
||||||
end
|
end
|
||||||
|
|
||||||
y_position = cursor
|
|
||||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
|
|
||||||
text "Net Sales:", :size => self.item_font_size, :align => :right
|
|
||||||
end
|
|
||||||
bounding_box([self.item_description_width,y_position], :width =>self.price_width, :height => 20) do
|
|
||||||
text "#{shift_sale.nett_sales}", :size => self.item_font_size, :align => :right
|
|
||||||
end
|
|
||||||
|
|
||||||
y_position = cursor
|
|
||||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
|
|
||||||
text "Total Tax :", :size => self.item_font_size, :align => :right
|
|
||||||
end
|
|
||||||
bounding_box([self.item_description_width,y_position], :width =>self.price_width, :height => 20) do
|
|
||||||
text "#{shift_sale.total_taxes}", :size => self.item_font_size, :align => :right
|
|
||||||
end
|
|
||||||
|
|
||||||
move_down -5
|
move_down -5
|
||||||
stroke_horizontal_rule
|
stroke_horizontal_rule
|
||||||
move_down 7
|
move_down 7
|
||||||
|
|
||||||
|
@total_foc = 0
|
||||||
y_position = cursor
|
y_position = cursor
|
||||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
|
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
|
||||||
text "Cash Payment :", :size => self.item_font_size, :align => :right
|
text "Cash Payment :", :size => self.item_font_size, :align => :right
|
||||||
@@ -180,14 +164,7 @@ class CloseCashierPdf < Prawn::Document
|
|||||||
#start other payment details
|
#start other payment details
|
||||||
if shift_sale.other_sales > 0
|
if shift_sale.other_sales > 0
|
||||||
other_payment.each do |other|
|
other_payment.each do |other|
|
||||||
y_position = cursor
|
@total_foc = other.foc_amount.round(2)
|
||||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
|
|
||||||
text "Other Payment Details", :size => self.item_font_size, :align => :right
|
|
||||||
end
|
|
||||||
bounding_box([self.item_description_width,y_position], :width =>self.price_width, :height => 20) do
|
|
||||||
text "", :size => self.item_font_size, :align => :right
|
|
||||||
end
|
|
||||||
|
|
||||||
y_position = cursor
|
y_position = cursor
|
||||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
|
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
|
||||||
text "MPU Payment :", :size => self.item_font_size, :align => :right
|
text "MPU Payment :", :size => self.item_font_size, :align => :right
|
||||||
@@ -204,14 +181,6 @@ class CloseCashierPdf < Prawn::Document
|
|||||||
text "#{other.visa_amount.round(2)}", :size => self.item_font_size, :align => :right
|
text "#{other.visa_amount.round(2)}", :size => self.item_font_size, :align => :right
|
||||||
end
|
end
|
||||||
|
|
||||||
y_position = cursor
|
|
||||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
|
|
||||||
text "JCB Payment :", :size => self.item_font_size, :align => :right
|
|
||||||
end
|
|
||||||
bounding_box([self.item_description_width,y_position], :width =>self.price_width, :height => 20) do
|
|
||||||
text "#{other.jcb_amount.round(2)}", :size => self.item_font_size, :align => :right
|
|
||||||
end
|
|
||||||
|
|
||||||
y_position = cursor
|
y_position = cursor
|
||||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
|
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
|
||||||
text "Master Payment :", :size => self.item_font_size, :align => :right
|
text "Master Payment :", :size => self.item_font_size, :align => :right
|
||||||
@@ -220,6 +189,14 @@ class CloseCashierPdf < Prawn::Document
|
|||||||
text "#{other.master_amount.round(2)}", :size => self.item_font_size, :align => :right
|
text "#{other.master_amount.round(2)}", :size => self.item_font_size, :align => :right
|
||||||
end
|
end
|
||||||
|
|
||||||
|
y_position = cursor
|
||||||
|
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
|
||||||
|
text "JCB Payment :", :size => self.item_font_size, :align => :right
|
||||||
|
end
|
||||||
|
bounding_box([self.item_description_width,y_position], :width =>self.price_width, :height => 20) do
|
||||||
|
text "#{other.jcb_amount.round(2)}", :size => self.item_font_size, :align => :right
|
||||||
|
end
|
||||||
|
|
||||||
y_position = cursor
|
y_position = cursor
|
||||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
|
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
|
||||||
text "Reedem Payment :", :size => self.item_font_size, :align => :right
|
text "Reedem Payment :", :size => self.item_font_size, :align => :right
|
||||||
@@ -227,15 +204,6 @@ class CloseCashierPdf < Prawn::Document
|
|||||||
bounding_box([self.item_description_width,y_position], :width =>self.price_width, :height => 20) do
|
bounding_box([self.item_description_width,y_position], :width =>self.price_width, :height => 20) do
|
||||||
text "#{other.paypar_amount.round(2)}", :size => self.item_font_size, :align => :right
|
text "#{other.paypar_amount.round(2)}", :size => self.item_font_size, :align => :right
|
||||||
end
|
end
|
||||||
|
|
||||||
y_position = cursor
|
|
||||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
|
|
||||||
text "FOC :", :size => self.item_font_size, :align => :right
|
|
||||||
end
|
|
||||||
bounding_box([self.item_description_width,y_position], :width =>self.price_width, :height => 20) do
|
|
||||||
text "#{other.foc_amount.round(2)}", :size => self.item_font_size, :align => :right
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
y_position = cursor
|
y_position = cursor
|
||||||
@@ -247,22 +215,54 @@ class CloseCashierPdf < Prawn::Document
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
y_position = cursor
|
||||||
|
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
|
||||||
|
text "Rounding Adjustments :", :size => self.item_font_size, :align => :right
|
||||||
|
end
|
||||||
|
bounding_box([self.item_description_width,y_position], :width =>self.price_width, :height => 20) do
|
||||||
|
text "#{shift_sale.total_rounding.round(2)}", :size => self.item_font_size, :align => :right
|
||||||
|
end
|
||||||
|
|
||||||
|
y_position = cursor
|
||||||
|
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
|
||||||
|
text "Total :", :style => :bold, :size => self.header_font_size - 1, :align => :right
|
||||||
|
end
|
||||||
|
bounding_box([self.item_description_width,y_position], :width =>self.price_width, :height => 20) do
|
||||||
|
text "#{shift_sale.grand_total.round(2)}", :style => :bold, :size => self.header_font_size - 1, :align => :right
|
||||||
|
end
|
||||||
|
|
||||||
# end other payment details
|
# end other payment details
|
||||||
move_down -5
|
move_down -5
|
||||||
stroke_horizontal_rule
|
stroke_horizontal_rule
|
||||||
move_down 7
|
move_down 7
|
||||||
#start total amount by Account Like Food / Beverage /..
|
|
||||||
total_amount_by_account.each do |amount|
|
#start service charges and commercial tax
|
||||||
|
sale_taxes.each do |tax|
|
||||||
y_position = cursor
|
y_position = cursor
|
||||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
|
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
|
||||||
text "Total #{amount.account_name} Amount:", :size => self.item_font_size, :align => :right
|
text "#{tax.tax_name} :", :size => self.item_font_size, :align => :right
|
||||||
end
|
end
|
||||||
bounding_box([self.item_description_width,y_position], :width =>self.price_width, :height => 20) do
|
bounding_box([self.item_description_width,y_position], :width =>self.price_width, :height => 20) do
|
||||||
text "#{amount.total_price.round(2)} ", :size => self.item_font_size, :align => :right
|
text "#{tax.st_amount.round(2)}", :size => self.item_font_size, :align => :right
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
#end total amount by Account
|
|
||||||
|
|
||||||
|
y_position = cursor
|
||||||
|
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
|
||||||
|
text "Total Taxes :", :size => self.item_font_size, :align => :right
|
||||||
|
end
|
||||||
|
bounding_box([self.item_description_width,y_position], :width =>self.price_width, :height => 20) do
|
||||||
|
text "#{shift_sale.total_taxes}", :size => self.item_font_size, :align => :right
|
||||||
|
end
|
||||||
|
|
||||||
|
y_position = cursor
|
||||||
|
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
|
||||||
|
text "Net Sales :", :style => :bold, :size => self.header_font_size - 1, :align => :right
|
||||||
|
end
|
||||||
|
bounding_box([self.item_description_width,y_position], :width =>self.price_width, :height => 20) do
|
||||||
|
text "#{shift_sale.nett_sales}", :style => :bold , :size => self.header_font_size - 1, :align => :right
|
||||||
|
end
|
||||||
|
#end for service charges and commercial tax
|
||||||
#COMMENTED FOR NO NEED AND NOT CORRECT WHEN OTHER CHARGES
|
#COMMENTED FOR NO NEED AND NOT CORRECT WHEN OTHER CHARGES
|
||||||
# y_position = cursor
|
# y_position = cursor
|
||||||
# bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
|
# bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
|
||||||
@@ -305,47 +305,66 @@ class CloseCashierPdf < Prawn::Document
|
|||||||
|
|
||||||
y_position = cursor
|
y_position = cursor
|
||||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
|
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
|
||||||
text "Total Overall Discount :", :size => self.item_font_size, :align => :right
|
text "Total Discount :", :size => self.item_font_size, :align => :right
|
||||||
end
|
end
|
||||||
bounding_box([self.item_description_width,y_position], :width =>self.price_width, :height => 20) do
|
bounding_box([self.item_description_width,y_position], :width =>self.price_width, :height => 20) do
|
||||||
text "#{@overall}", :size => self.item_font_size, :align => :right
|
text "#{@overall}", :size => self.item_font_size, :align => :right
|
||||||
|
end
|
||||||
|
|
||||||
|
y_position = cursor
|
||||||
|
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
|
||||||
|
text "Total FOC :", :size => self.item_font_size, :align => :right
|
||||||
|
end
|
||||||
|
bounding_box([self.item_description_width,y_position], :width =>self.price_width, :height => 20) do
|
||||||
|
text "(#{@total_foc})", :size => self.item_font_size, :align => :right
|
||||||
end
|
end
|
||||||
|
|
||||||
y_position = cursor
|
y_position = cursor
|
||||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
|
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
|
||||||
text "Total Discount Amount :", :size => self.item_font_size, :align => :right
|
text "Total Void :", :size => self.item_font_size, :align => :right
|
||||||
end
|
end
|
||||||
bounding_box([self.item_description_width,y_position], :width =>self.price_width, :height => 20) do
|
bounding_box([self.item_description_width,y_position], :width =>self.price_width, :height => 20) do
|
||||||
text "#{shift_sale.total_discounts}", :size => self.item_font_size, :align => :right
|
text "(#{shift_sale.total_void})", :size => self.item_font_size, :align => :right
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# y_position = cursor
|
||||||
|
# bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
|
||||||
|
# text "Grand Total :", :size => self.item_font_size, :align => :right
|
||||||
|
# end
|
||||||
|
# bounding_box([self.item_description_width,y_position], :width =>self.price_width, :height => 20) do
|
||||||
|
# text "#{shift_sale.grand_total}", :size => self.item_font_size, :align => :right
|
||||||
|
# end
|
||||||
|
|
||||||
move_down -5
|
move_down -5
|
||||||
stroke_horizontal_rule
|
stroke_horizontal_rule
|
||||||
move_down 7
|
move_down 7
|
||||||
|
|
||||||
sale_taxes.each do |tax|
|
#start total amount by Account Like Food / Beverage /..
|
||||||
|
total_amount_by_account.each do |amount|
|
||||||
y_position = cursor
|
y_position = cursor
|
||||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
|
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
|
||||||
text "#{tax.tax_name} :", :size => self.item_font_size, :align => :right
|
text "Total #{amount.account_name} Amount :", :size => self.item_font_size, :align => :right
|
||||||
end
|
end
|
||||||
bounding_box([self.item_description_width,y_position], :width =>self.price_width, :height => 20) do
|
bounding_box([self.item_description_width,y_position], :width =>self.price_width, :height => 20) do
|
||||||
text "#{tax.st_amount.round(2)}", :size => self.item_font_size, :align => :right
|
text "#{amount.total_price.round(2)} ", :size => self.item_font_size, :align => :right
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
#end total amount by Account
|
||||||
|
|
||||||
y_position = cursor
|
y_position = cursor
|
||||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
|
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
|
||||||
text "Rounding Adjustment :", :size => self.item_font_size, :align => :right
|
text "Total Dine-in Count :", :size => self.item_font_size, :align => :right
|
||||||
end
|
end
|
||||||
bounding_box([self.item_description_width,y_position], :width =>self.price_width, :height => 20) do
|
bounding_box([self.item_description_width,y_position], :width =>self.price_width, :height => 20) do
|
||||||
text "#{shift_sale.total_rounding.round(2)}", :size => self.item_font_size, :align => :right
|
text "#{shift_sale.dining_count}", :size => self.item_font_size, :align => :right
|
||||||
end
|
end
|
||||||
y_position = cursor
|
|
||||||
|
y_position = cursor
|
||||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
|
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
|
||||||
text "Grand Total :", :size => self.item_font_size, :align => :right
|
text "Total Takeaway Count :", :size => self.item_font_size, :align => :right
|
||||||
end
|
end
|
||||||
bounding_box([self.item_description_width,y_position], :width =>self.price_width, :height => 20) do
|
bounding_box([self.item_description_width,y_position], :width =>self.price_width, :height => 20) do
|
||||||
text "#{shift_sale.grand_total}", :size => self.item_font_size, :align => :right
|
text "#{shift_sale.takeaway_count}", :size => self.item_font_size, :align => :right
|
||||||
end
|
end
|
||||||
|
|
||||||
y_position = cursor
|
y_position = cursor
|
||||||
@@ -356,31 +375,7 @@ class CloseCashierPdf < Prawn::Document
|
|||||||
text "#{shift_sale.total_receipt}", :size => self.item_font_size, :align => :right
|
text "#{shift_sale.total_receipt}", :size => self.item_font_size, :align => :right
|
||||||
end
|
end
|
||||||
|
|
||||||
y_position = cursor
|
move_down 5
|
||||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
|
|
||||||
text "Dining Count :", :size => self.item_font_size, :align => :right
|
|
||||||
end
|
|
||||||
bounding_box([self.item_description_width,y_position], :width =>self.price_width, :height => 20) do
|
|
||||||
text "#{shift_sale.dining_count}", :size => self.item_font_size, :align => :right
|
|
||||||
end
|
|
||||||
|
|
||||||
y_position = cursor
|
|
||||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
|
|
||||||
text "Takeaway Count :", :size => self.item_font_size, :align => :right
|
|
||||||
end
|
|
||||||
bounding_box([self.item_description_width,y_position], :width =>self.price_width, :height => 20) do
|
|
||||||
text "#{shift_sale.takeaway_count}", :size => self.item_font_size, :align => :right
|
|
||||||
end
|
|
||||||
|
|
||||||
y_position = cursor
|
|
||||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
|
|
||||||
text "Total Void:", :size => self.item_font_size, :align => :right
|
|
||||||
end
|
|
||||||
bounding_box([self.item_description_width,y_position], :width =>self.price_width, :height => 20) do
|
|
||||||
text "(#{shift_sale.total_void})", :size => self.item_font_size, :align => :right
|
|
||||||
end
|
|
||||||
|
|
||||||
move_down 5
|
|
||||||
stroke_horizontal_rule
|
stroke_horizontal_rule
|
||||||
move_down 5
|
move_down 5
|
||||||
move_down 5
|
move_down 5
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row clearfix">
|
<div class="row clearfix">
|
||||||
<div class="col-lg-9 col-md-9 col-sm-9">
|
<div class="col-lg-8 col-md-8 col-sm-8">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="body table-responsive">
|
<div class="body table-responsive">
|
||||||
<table class="table table-hover table-striped">
|
<table class="table table-hover table-striped">
|
||||||
@@ -83,7 +83,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-3 col-md-3 col-sm-3">
|
<div class="col-lg-4 col-md-4 col-sm-4">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="body" id="custom-slimscroll">
|
<div class="body" id="custom-slimscroll">
|
||||||
<%= render 'new_form', crm_customer: @crm_customer, taxes: @taxes %>
|
<%= render 'new_form', crm_customer: @crm_customer, taxes: @taxes %>
|
||||||
|
|||||||
@@ -29,9 +29,9 @@
|
|||||||
<div class="row bottom">
|
<div class="row bottom">
|
||||||
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 m-l--5">
|
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 m-l--5">
|
||||||
<div class="row m-l--5">
|
<div class="row m-l--5">
|
||||||
<div class="col-md-3 left cashier_number" data-value="1" data-type="num">1</div>
|
<div class="col-md-3 left-margin-1 cashier_number" data-value="1" data-type="num">1</div>
|
||||||
<div class="col-md-3 left cashier_number" data-value="2" data-type="num">2</div>
|
<div class="col-md-3 left-margin-1 cashier_number" data-value="2" data-type="num">2</div>
|
||||||
<div class="col-md-3 left cashier_number" data-value="3" data-type="num">3</div>
|
<div class="col-md-3 left-margin-1 cashier_number" data-value="3" data-type="num">3</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -39,9 +39,9 @@
|
|||||||
<div class="row bottom">
|
<div class="row bottom">
|
||||||
<div class="col-md-12 m-l--5">
|
<div class="col-md-12 m-l--5">
|
||||||
<div class="row m-l--5">
|
<div class="row m-l--5">
|
||||||
<div class="col-md-3 left cashier_number" data-value="4" data-type="num">4</div>
|
<div class="col-md-3 left-margin-1 cashier_number" data-value="4" data-type="num">4</div>
|
||||||
<div class="col-md-3 left cashier_number" data-value="5" data-type="num">5</div>
|
<div class="col-md-3 left-margin-1 cashier_number" data-value="5" data-type="num">5</div>
|
||||||
<div class="col-md-3 left cashier_number" data-value="6" data-type="num">6</div>
|
<div class="col-md-3 left-margin-1 cashier_number" data-value="6" data-type="num">6</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -49,9 +49,9 @@
|
|||||||
<div class="row bottom">
|
<div class="row bottom">
|
||||||
<div class="col-md-12 m-l--5">
|
<div class="col-md-12 m-l--5">
|
||||||
<div class="row m-l--5">
|
<div class="row m-l--5">
|
||||||
<div class="col-md-3 left cashier_number" data-value="7" data-type="num">7</div>
|
<div class="col-md-3 left-margin-1 cashier_number" data-value="7" data-type="num">7</div>
|
||||||
<div class="col-md-3 left cashier_number" data-value="8" data-type="num">8</div>
|
<div class="col-md-3 left-margin-1 cashier_number" data-value="8" data-type="num">8</div>
|
||||||
<div class="col-md-3 left cashier_number" data-value="9" data-type="num">9</div>
|
<div class="col-md-3 left-margin-1 cashier_number" data-value="9" data-type="num">9</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -59,9 +59,9 @@
|
|||||||
<div class="row bottom">
|
<div class="row bottom">
|
||||||
<div class="col-md-12 m-l--5">
|
<div class="col-md-12 m-l--5">
|
||||||
<div class="row m-l--5">
|
<div class="row m-l--5">
|
||||||
<div class="col-md-3 left cashier_number" data-value="0" data-type="num">0</div>
|
<div class="col-md-3 left-margin-1 cashier_number" data-value="0" data-type="num">0</div>
|
||||||
<div class="col-md-3 left cashier_number" data-value="." data-type="num">.</div>
|
<div class="col-md-3 left-margin-1 cashier_number" data-value="." data-type="num">.</div>
|
||||||
<div class="col-md-3 left cashier_number" data-value="00" data-type="num">00</div>
|
<div class="col-md-3 left-margin-1 cashier_number" data-value="00" data-type="num">00</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -69,9 +69,9 @@
|
|||||||
<div class="row bottom">
|
<div class="row bottom">
|
||||||
<div class="col-md-12 m-l--5">
|
<div class="col-md-12 m-l--5">
|
||||||
<div class="row m-l--5">
|
<div class="row m-l--5">
|
||||||
<div class="col-md-3 left cashier_number"></div>
|
<div class="col-md-3 left-margin-1 cashier_number"></div>
|
||||||
<div class="col-md-3 left cashier_number red" data-type="del">DEL</div>
|
<div class="col-md-3 left-margin-1 cashier_number red" data-type="del">DEL</div>
|
||||||
<div class="col-md-3 left cashier_number green" data-type="clr">CLR</div>
|
<div class="col-md-3 left-margin-1 cashier_number green" data-type="clr">CLR</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -100,8 +100,8 @@
|
|||||||
<%= link_to t("views.btn.new"),new_crm_dining_queue_path,:class => 'btn bg-green btn-block btn-lg btn-block', 'data-no-turbolink' => true %>
|
<%= link_to t("views.btn.new"),new_crm_dining_queue_path,:class => 'btn bg-green btn-block btn-lg btn-block', 'data-no-turbolink' => true %>
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
<button type="button" id="assign" class="btn btn-primary btn-block btn-lg waves-effect" disabled>Assign</button>
|
<button type="button" id="assign" class="btn btn-primary btn-block btn-lg waves-effect" style="font-size: 11px" disabled>Assign</button>
|
||||||
<button type="button" id="cancel" class="btn btn-danger btn-block btn-lg waves-effect" disabled>Cancel</button>
|
<button type="button" id="cancel" class="btn btn-danger btn-block btn-lg waves-effect" style="font-size: 11px" disabled>Cancel</button>
|
||||||
<!-- <a href="<%= dashboard_path %>" class="btn btn-default btn-block waves-effect" role="button" aria-haspopup="true" aria-expanded="false"> Back </a> -->
|
<!-- <a href="<%= dashboard_path %>" class="btn btn-default btn-block waves-effect" role="button" aria-haspopup="true" aria-expanded="false"> Back </a> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -118,7 +118,7 @@
|
|||||||
</button> -->
|
</button> -->
|
||||||
<!-- <button type="button" class="btn btn-primary btn-lg btn-block" disabled>Print <br/>Order<br/>Summary</button> -->
|
<!-- <button type="button" class="btn btn-primary btn-lg btn-block" disabled>Print <br/>Order<br/>Summary</button> -->
|
||||||
<button id="assign" value="" disabled="disabled" data-type="assign" class="btn assign btn-primary btn-lg btn-block">ASSIGN</button>
|
<button id="assign" value="" disabled="disabled" data-type="assign" class="btn assign btn-primary btn-lg btn-block">ASSIGN</button>
|
||||||
<button id="cancel" value="" disabled="disabled" data-type="cancel" class="btn btn-danger cancel btn-lg btn-block">CANCLE</button>
|
<button id="cancel" value="" disabled="disabled" data-type="cancel" class="btn btn-danger cancel btn-lg btn-block">CANCEL</button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -144,16 +144,7 @@
|
|||||||
<% if !(@total_payment_methods.nil?) %>
|
<% if !(@total_payment_methods.nil?) %>
|
||||||
<% @total_payment_methods.each do |payment| %>
|
<% @total_payment_methods.each do |payment| %>
|
||||||
<% if !@sale_data[0].empty? %>
|
<% if !@sale_data[0].empty? %>
|
||||||
<% if payment.payment_method == 'mpu' || payment.payment_method == 'visa' || payment.payment_method == 'master' || payment.payment_method == 'jcb' %>
|
<% if payment.payment_method != 'mpu' && payment.payment_method != 'visa' && payment.payment_method != 'master' && payment.payment_method != 'jcb' %>
|
||||||
<tr>
|
|
||||||
<td>Card Sale : </td>
|
|
||||||
<td align="right">
|
|
||||||
<% @sale_data.each do |data| %>
|
|
||||||
<%= data["card"] %>
|
|
||||||
<% end %>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<% else %>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><%= payment.payment_method.to_s.capitalize %> Sale : </td>
|
<td><%= payment.payment_method.to_s.capitalize %> Sale : </td>
|
||||||
<td align="right">
|
<td align="right">
|
||||||
@@ -167,6 +158,16 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<tr>
|
||||||
|
<td>Card Sale : </td>
|
||||||
|
<td align="right">
|
||||||
|
<% total_card = 0.0 %>
|
||||||
|
<% @sale_data.each do |data| %>
|
||||||
|
<% total_card = data["card"] %>
|
||||||
|
<% break end %>
|
||||||
|
<%= total_card.to_f %>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<form action="/install" method="POST" class="row">
|
<form action="/activate" method="POST" class="row">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="exampleInputEmail1">Business Name</label>
|
<label for="exampleInputEmail1">Business Name</label>
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
<input type="text" class="form-control" name="license_key" aria-describedby="license_key" placeholder="Add License Key">
|
<input type="text" class="form-control" name="license_key" aria-describedby="license_key" placeholder="Add License Key">
|
||||||
<small class="form-text text-muted">Add License Key from Email</small>
|
<small class="form-text text-muted">Add License Key from Email</small>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<!-- <div class="form-group">
|
||||||
<label for="lblAdministrator">Administrator Username</label>
|
<label for="lblAdministrator">Administrator Username</label>
|
||||||
<input type="text" class="form-control" name="admin_user" aria-describedby="admin_user" placeholder="Administrator Username">
|
<input type="text" class="form-control" name="admin_user" aria-describedby="admin_user" placeholder="Administrator Username">
|
||||||
<small id="admin_user" class="form-text text-muted">First Employee who will be assign as administrator</small>
|
<small id="admin_user" class="form-text text-muted">First Employee who will be assign as administrator</small>
|
||||||
@@ -18,9 +18,17 @@
|
|||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="admin_password">Password</label>
|
<label for="admin_password">Password</label>
|
||||||
<input type="password" class="form-control" name="admin_password" placeholder="Password">
|
<input type="password" class="form-control" name="admin_password" placeholder="Password">
|
||||||
</div>
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="lblDBHost">Database Host</label>
|
||||||
|
<input type="text" class="form-control" name="db_host" aria-describedby="db_host" placeholder="Database Host" />
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="lblDBName">Database Schema</label>
|
||||||
|
<input type="text" class="form-control" name="db_schema" aria-describedby="db_schema" placeholder="Database Schema">
|
||||||
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="lblAdministrator">Database Username</label>
|
<label for="lblAdministrator">Database Username</label>
|
||||||
<input type="text" class="form-control" name="db_user" aria-describedby="db_user" placeholder="Database Username">
|
<input type="text" class="form-control" name="db_user" aria-describedby="db_user" placeholder="Database Username">
|
||||||
|
|||||||
@@ -30,9 +30,9 @@
|
|||||||
<ul class="dropdown-menu">
|
<ul class="dropdown-menu">
|
||||||
<li>
|
<li>
|
||||||
<%if current_login_employee.role !="waiter" %>
|
<%if current_login_employee.role !="waiter" %>
|
||||||
<p class="delete waves-effect waves-block p-l-30 m-t-15" data-ref="<%=logout_path%>" data-method="delete">
|
<p class="delete waves-effect waves-block p-l-30 m-b-5" data-ref="<%=logout_path%>" data-method="delete">
|
||||||
<i class="material-icons">exit_to_app</i>
|
<i class="material-icons font-10 logout_icon">exit_to_app</i>
|
||||||
<span class="font-18 m-b-5">Logout</span>
|
<span class="font-18">Logout</span>
|
||||||
</p>
|
</p>
|
||||||
<span class="hidden" id="delete_text">
|
<span class="hidden" id="delete_text">
|
||||||
<h6>Are you sure you want to Logout ?</h6>
|
<h6>Are you sure you want to Logout ?</h6>
|
||||||
|
|||||||
@@ -70,7 +70,7 @@
|
|||||||
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 p-t-20 p-l-10 p-r-10 p-b-50 bg-white">
|
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 p-t-20 p-l-10 p-r-10 p-b-50 bg-white">
|
||||||
<div class="row justify-content-center form-group">
|
<div class="row justify-content-center form-group">
|
||||||
<!-- <span class="col-md-4"></span> -->
|
<!-- <span class="col-md-4"></span> -->
|
||||||
<input type="text" class="form-control col-4" id="emp_id" onkeypress="empID()" placeholder="Access PIN">
|
<input type="text" class="form-control col-4" id="emp_id" onkeypress="empID()" placeholder="Employee ID">
|
||||||
<!-- <span class="col-md-4"></span> -->
|
<!-- <span class="col-md-4"></span> -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -40,15 +40,13 @@
|
|||||||
<!-- </div> -->
|
<!-- </div> -->
|
||||||
<% end %>
|
<% end %>
|
||||||
<!-- <div class="row"> -->
|
<!-- <div class="row"> -->
|
||||||
<div class="row">
|
<!-- <div class="row">
|
||||||
<div class="col-lg-5 col-md-5 col-sm-5">
|
<div class="col-lg-5 col-md-5 col-sm-5">
|
||||||
<label >Recent Credit Amount</label>
|
<label >Recent Credit Amount</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||||
<input type="text" name="valid_amount" id="valid_amount" class="form-control" value="" data-value="<%=@sale_id %>" data-member-value="">
|
<input type="text" name="valid_amount" id="valid_amount" class="form-control" value="" data-value="<%=@sale_id %>" data-member-value="">
|
||||||
</div>
|
</div> -->
|
||||||
</div>
|
|
||||||
<hr>
|
|
||||||
<!-- </div> -->
|
<!-- </div> -->
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-5 col-md-5 col-sm-5">
|
<div class="col-lg-5 col-md-5 col-sm-5">
|
||||||
|
|||||||
@@ -167,7 +167,7 @@
|
|||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: "/origami/" + sale_id + "/member_discount",
|
url: "/origami/" + sale_id + "/member_discount",
|
||||||
data: {'sale_id':sale_id, 'sub_total':sub_total,'is_card':false },
|
data: {'sale_id':sale_id, 'sub_total':sub_total,'is_card':true },
|
||||||
// success:function(result){
|
// success:function(result){
|
||||||
// }
|
// }
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
<%= f.input :api_settings %>
|
<%= f.input :api_settings %>
|
||||||
<%= f.input :page_width %>
|
<%= f.input :page_width %>
|
||||||
<%= f.input :page_height %>
|
<%= f.input :page_height %>
|
||||||
<%= f.input :print_copies %>
|
<%= f.input :print_copies, input_html: { min: '1', step: '1', :onkeypress => "return isNumberKey(event);", :onkeyup => "greaterThanOne(this.value);" } %>
|
||||||
<%= f.input :precision %>
|
<%= f.input :precision %>
|
||||||
<%= f.input :delimiter %>
|
<%= f.input :delimiter %>
|
||||||
<%= f.input :heading_space %>
|
<%= f.input :heading_space %>
|
||||||
@@ -58,4 +58,19 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
function isNumberKey(evt) {
|
||||||
|
var charCode = (evt.which) ? evt.which : event.keyCode;
|
||||||
|
if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57)) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function greaterThanOne(val){
|
||||||
|
if(parseInt(val)==0) $("#print_setting_print_copies").val(1);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<div class="p-l-15">
|
<div class="p-l-15">
|
||||||
<%= form_tag report_path, :method => :get, :id => "frm_report", :class => "form" do %>
|
<%= form_tag report_path, :method => :get, :id => "frm_report", :class => "form" do %>
|
||||||
<% if period_type != false %>
|
<% if period_type != false %>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
||||||
<!-- <div class="col-lg-2 col-md-2 col-sm-2">
|
<!-- <div class="col-lg-2 col-md-2 col-sm-2">
|
||||||
<label class="">Select Date Range</label>
|
<label class="">Select Date Range</label>
|
||||||
@@ -12,17 +12,17 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
</div> -->
|
</div> -->
|
||||||
<div class="col-lg-3 col-md-3 col-sm-3">
|
<div class="col-lg-3 col-md-3 col-sm-3">
|
||||||
<!-- <label class="">Select Shift Period</label> -->
|
<!-- <label class="">Select Shift Period</label> -->
|
||||||
<label class="font-14"><%= t("views.right_panel.detail.from") %></label>
|
<label class="font-14"><%= t("views.right_panel.detail.from") %></label>
|
||||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="from" id="from" type="text" placeholder="From date">
|
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="from" id="from" type="text" placeholder="From date" style="height: 34px;">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-3 col-md-3 col-sm-3">
|
<div class="col-lg-3 col-md-3 col-sm-3">
|
||||||
<label class="font-14"><%= t("views.right_panel.detail.to") %></label>
|
<label class="font-14"><%= t("views.right_panel.detail.to") %></label>
|
||||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="to" id="to" type="text" placeholder="To date">
|
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="to" id="to" type="text" placeholder="To date" style="height: 34px;">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||||
<label class="font-14"><%= t :commissioner %></label>
|
<label class="font-14"><%= t :commissioner %></label>
|
||||||
<select class="form-control" name="commissioner" id="commissioner">
|
<select class="form-control" name="commissioner" id="commissioner" style="height: 37px;">
|
||||||
<option value=""></option>
|
<option value=""></option>
|
||||||
<% @commissioner.each do |c| %>
|
<% @commissioner.each do |c| %>
|
||||||
<% if @com_id == c.id %>
|
<% if @com_id == c.id %>
|
||||||
@@ -34,16 +34,16 @@
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-2 col-md-2 col-sm-2 margin-top-20">
|
<div class="col-lg-2 col-md-2 col-sm-2 margin-top-20">
|
||||||
<br>
|
<br>
|
||||||
<input type="submit" value="Generate Report" class='btn btn-info wave-effects'>
|
<input type="submit" value="Generate Report" class='btn btn-info wave-effects'>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div class="col-lg-2 col-md-2 col-sm-2 margin-top-20">
|
<!-- <div class="col-lg-2 col-md-2 col-sm-2 margin-top-20">
|
||||||
<input type="button" value="Clear Filter" id="clear_filter" class='btn btn-danger'>
|
<input type="button" value="Clear Filter" id="clear_filter" class='btn btn-danger'>
|
||||||
</div> -->
|
</div> -->
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
<!-- <script type="text/javascript">
|
<!-- <script type="text/javascript">
|
||||||
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
|
|||||||
@@ -22,15 +22,15 @@
|
|||||||
<div class="form-group col-md-2">
|
<div class="form-group col-md-2">
|
||||||
<!-- <label class="">Select Shift Period</label> -->
|
<!-- <label class="">Select Shift Period</label> -->
|
||||||
<label class="font-20">From</label>
|
<label class="font-20">From</label>
|
||||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="from" id="from" type="text" placeholder="From date">
|
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="from" id="from" type="text" placeholder="From date" style="height: 34px;">
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-2">
|
<div class="form-group col-md-2">
|
||||||
<label class="font-20">To</label>
|
<label class="font-20">To</label>
|
||||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="to" id="to" type="text" placeholder="To date">
|
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="to" id="to" type="text" placeholder="To date" style="height: 34px;">
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label class="font-20">All Shift</label>
|
<label class="font-20">All Shift</label>
|
||||||
<select class="form-control select" name="shift_name" id="shift_name" >
|
<select class="form-control select" name="shift_name" id="shift_name" style="height: 37px;">
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-1 ">
|
<div class="form-group col-md-1 ">
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
<div class="page-header">
|
<div class="page-header" style="width:117%;">
|
||||||
<ol class="breadcrumb">
|
<ol class="breadcrumb">
|
||||||
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
|
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
|
||||||
<li class="breadcrumb-item active"><%= t("views.right_panel.detail.daily_sale_report") %></li>
|
<li class="breadcrumb-item active"><%= t("views.right_panel.detail.daily_sale_report") %></li>
|
||||||
@@ -10,7 +10,6 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12 col-lg-12 col-sm-12 ">
|
<div class="col-md-12 col-lg-12 col-sm-12 ">
|
||||||
|
|
||||||
<%= render :partial=>'shift_sale_report_filter',
|
<%= render :partial=>'shift_sale_report_filter',
|
||||||
:locals=>{ :period_type => true, :shift_name => false, :report_path =>reports_dailysale_index_path} %>
|
:locals=>{ :period_type => true, :shift_name => false, :report_path =>reports_dailysale_index_path} %>
|
||||||
<hr />
|
<hr />
|
||||||
@@ -20,7 +19,7 @@
|
|||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12 col-lg-12">
|
<div class="col-md-12 col-lg-12">
|
||||||
<div class="card ">
|
<div class="card" style="width:117%;">
|
||||||
<div class="body table-responsive">
|
<div class="body table-responsive">
|
||||||
<table class="table table-bordered">
|
<table class="table table-bordered">
|
||||||
<thead>
|
<thead>
|
||||||
|
|||||||
@@ -27,15 +27,15 @@
|
|||||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||||
<!-- <label class="">Select Shift Period</label> -->
|
<!-- <label class="">Select Shift Period</label> -->
|
||||||
<label class="font-14"><%= t("views.right_panel.detail.from") %></label>
|
<label class="font-14"><%= t("views.right_panel.detail.from") %></label>
|
||||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3 from" name="from" id="from" type="text" placeholder="From date">
|
<input data-behaviour='datepicker' class="form-control datepicker m-t-3 from" name="from" id="from" type="text" placeholder="From date" style="height: 34px;">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||||
<label class="font-14"><%= t("views.right_panel.detail.to") %></label>
|
<label class="font-14"><%= t("views.right_panel.detail.to") %></label>
|
||||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3 to" name="to" id="to" type="text" placeholder="To date">
|
<input data-behaviour='datepicker' class="form-control datepicker m-t-3 to" name="to" id="to" type="text" placeholder="To date" style="height: 34px;">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||||
<label class="font-14"><%= t("views.right_panel.detail.all_shift") %></label>
|
<label class="font-14"><%= t("views.right_panel.detail.all_shift") %></label>
|
||||||
<select class="form-control select" name="shift_name" id="shift_name" >
|
<select class="form-control select" name="shift_name" id="shift_name" style="height: 37px;" >
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-1 col-md-1 col-sm-1 margin-top-20">
|
<div class="col-lg-1 col-md-1 col-sm-1 margin-top-20">
|
||||||
|
|||||||
@@ -27,15 +27,15 @@
|
|||||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||||
<!-- <label class="">Select Shift Period</label> -->
|
<!-- <label class="">Select Shift Period</label> -->
|
||||||
<label class="font-14"><%= t("views.right_panel.detail.from") %></label>
|
<label class="font-14"><%= t("views.right_panel.detail.from") %></label>
|
||||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="from" id="from" type="text" placeholder="From date">
|
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="from" id="from" type="text" placeholder="From date" style="height: 33.5px;">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||||
<label class="font-14"><%= t("views.right_panel.detail.to") %></label>
|
<label class="font-14"><%= t("views.right_panel.detail.to") %></label>
|
||||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="to" id="to" type="text" placeholder="To date">
|
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="to" id="to" type="text" placeholder="To date" style="height: 33.5;">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||||
<label class="font-14"><%= t("views.right_panel.detail.all_shift") %></label>
|
<label class="font-14"><%= t("views.right_panel.detail.all_shift") %></label>
|
||||||
<select class="form-control select" name="shift_name" id="shift_name" >
|
<select class="form-control select" name="shift_name" id="shift_name" style="height: 36px;" >
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-1 col-md-1 col-sm-1 margin-top-20">
|
<div class="col-lg-1 col-md-1 col-sm-1 margin-top-20">
|
||||||
|
|||||||
@@ -21,15 +21,15 @@
|
|||||||
<div class="col-lg-3 col-md-3 col-sm-3">
|
<div class="col-lg-3 col-md-3 col-sm-3">
|
||||||
<!-- <label class="font-14">Select Shift Period</label> -->
|
<!-- <label class="font-14">Select Shift Period</label> -->
|
||||||
<label class="font-14"><%= t("views.right_panel.detail.from") %></label>
|
<label class="font-14"><%= t("views.right_panel.detail.from") %></label>
|
||||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="from" id="from" type="text" placeholder="From date">
|
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="from" id="from" type="text" placeholder="From date" style="height: 34px;">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-3 col-md-3 col-sm-3">
|
<div class="col-lg-3 col-md-3 col-sm-3">
|
||||||
<label class="font-14"><%= t("views.right_panel.detail.to") %></label>
|
<label class="font-14"><%= t("views.right_panel.detail.to") %></label>
|
||||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="to" id="to" type="text" placeholder="To date">
|
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="to" id="to" type="text" placeholder="To date" style="height: 34px;">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||||
<label class="font-14"><%= t("views.right_panel.detail.all_shift") %></label>
|
<label class="font-14"><%= t("views.right_panel.detail.all_shift") %></label>
|
||||||
<select class="form-control select" name="shift_name" id="shift_name" >
|
<select class="form-control select" name="shift_name" id="shift_name" style="height: 37px;" >
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-2 col-md-2 col-sm-2 margin-top-20"><br>
|
<div class="col-lg-2 col-md-2 col-sm-2 margin-top-20"><br>
|
||||||
|
|||||||
@@ -14,11 +14,11 @@
|
|||||||
<div class="col-lg-3 col-md-3 col-sm-3">
|
<div class="col-lg-3 col-md-3 col-sm-3">
|
||||||
<!-- <label class="">Select Shift Period</label> -->
|
<!-- <label class="">Select Shift Period</label> -->
|
||||||
<label class="font-14">From</label>
|
<label class="font-14">From</label>
|
||||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="from" id="from" type="text" placeholder="From date">
|
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="from" id="from" type="text" placeholder="From date" style="height: 35px;">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-3 col-md-3 col-sm-3">
|
<div class="col-lg-3 col-md-3 col-sm-3">
|
||||||
<label class="font-14">To</label>
|
<label class="font-14">To</label>
|
||||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="to" id="to" type="text" placeholder="To date">
|
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="to" id="to" type="text" placeholder="To date" style="height: 35px;">
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-4">
|
<div class="form-group col-md-4">
|
||||||
<label class="font-14">Definition Item</label>
|
<label class="font-14">Definition Item</label>
|
||||||
|
|||||||
@@ -22,15 +22,15 @@
|
|||||||
<div class="form-group col-lg-2 col-md-2 col-sm-2">
|
<div class="form-group col-lg-2 col-md-2 col-sm-2">
|
||||||
<!-- <label class="">Select Shift Period</label> -->
|
<!-- <label class="">Select Shift Period</label> -->
|
||||||
<label class="font-20"><%= t("views.right_panel.detail.from") %></label>
|
<label class="font-20"><%= t("views.right_panel.detail.from") %></label>
|
||||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="from" id="from" type="text" placeholder="From date">
|
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="from" id="from" type="text" placeholder="From date" style="height: 34px;">
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-lg-2 col-md-2 col-sm-2">
|
<div class="form-group col-lg-2 col-md-2 col-sm-2">
|
||||||
<label class="font-20"><%= t("views.right_panel.detail.to") %></label>
|
<label class="font-20"><%= t("views.right_panel.detail.to") %></label>
|
||||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="to" id="to" type="text" placeholder="To date">
|
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="to" id="to" type="text" placeholder="To date" style="height: 34px;">
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-lg-3 col-md-3 col-sm-3">
|
<div class="form-group col-lg-3 col-md-3 col-sm-3">
|
||||||
<label class="font-20"><%= t("views.right_panel.detail.all_shift") %></label>
|
<label class="font-20"><%= t("views.right_panel.detail.all_shift") %></label>
|
||||||
<select class="form-control select" name="shift_name" id="shift_name" >
|
<select class="form-control select" name="shift_name" id="shift_name" style="height: 37px;">
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class=" col-lg-1 col-md-1 col-sm-1 margin-top-20">
|
<div class=" col-lg-1 col-md-1 col-sm-1 margin-top-20">
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<%= f.input :item_instance_name %>
|
<%= f.input :item_instance_name %>
|
||||||
<%= f.input :price %>
|
<%= f.input :price %>
|
||||||
|
|
||||||
<%= f.input :item_attributes, collection: @item.item_attributes, input_html: { multiple: true } %>
|
<%= f.input :item_attributes, collection: @item.item_attributes, include_blank: false, include_hidden: false%>
|
||||||
|
|
||||||
<%= f.input :is_on_promotion %>
|
<%= f.input :is_on_promotion %>
|
||||||
<%= f.input :promotion_price %>
|
<%= f.input :promotion_price %>
|
||||||
|
|||||||
@@ -106,39 +106,39 @@
|
|||||||
</div>
|
</div>
|
||||||
-->
|
-->
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<% arr = MenuItem.active.order("name desc").pluck(:name,:item_code) %>
|
<% arr = MenuItem.active.joins("JOIN menu_item_instances as b ON b.menu_item_id=menu_items.id").group("menu_items.id").order("name desc").pluck(:name,:item_code) %>
|
||||||
<% Product.order("name desc").pluck(:name,:item_code).each do |p| %>
|
<% Product.order("name desc").pluck(:name,:item_code).each do |p| %>
|
||||||
<% arr.push(p) %>
|
<% arr.push(p) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<div class="col-md-3 form-group">
|
<div class="col-md-3 form-group">
|
||||||
<label class="control-label"><abbr title="required">*</abbr> Item</label>
|
<label class="control-label"><abbr title="required">*</abbr> Item</label>
|
||||||
<select class="form-control item_code_place">
|
<select class="form-control item_code_place">
|
||||||
<% if !@promotion.original_product.nil? %>
|
<% if !@promotion.original_product.nil? %>
|
||||||
<% menuiteminstance = MenuItemInstance.find_by_item_instance_code(@promotion.original_product) %>
|
<% menuiteminstance = MenuItemInstance.find_by_item_instance_code(@promotion.original_product) %>
|
||||||
<% if menuiteminstance.nil?%>
|
<% if menuiteminstance.nil?%>
|
||||||
<% code = @promotion.original_product %>
|
<% code = @promotion.original_product %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<% code = menuiteminstance.menu_item.item_code %>
|
<% code = menuiteminstance.menu_item.item_code %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<option value="" selected>Choose Something</option>
|
<option value="" selected>Choose Something</option>
|
||||||
<% arr.each do |a| %>
|
<% arr.each do |a| %>
|
||||||
<% if a[1] == code %>
|
<% if a[1] == code %>
|
||||||
<option value="<%= a[1]%>" selected><%= a[0] %></option>
|
<option value="<%= a[1]%>" selected><%= a[0] %></option>
|
||||||
<% else %>
|
<% else %>
|
||||||
<option value="<%= a[1]%>"><%= a[0] %></option>
|
<option value="<%= a[1]%>"><%= a[0] %></option>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<% sample = [] %>
|
<% sample = [] %>
|
||||||
<% if !@promotion.original_product.nil? %>
|
<% if !@promotion.original_product.nil? %>
|
||||||
<% if !MenuItemInstance.find_by_item_instance_code(@promotion.original_product).nil? %>
|
<% if !MenuItemInstance.find_by_item_instance_code(@promotion.original_product).nil? %>
|
||||||
<% sample = MenuItemInstance.where("item_instance_code=?",@promotion.original_product).pluck(:item_instance_name,:item_instance_code)%>
|
<% sample = MenuItemInstance.where("item_instance_code=?",@promotion.original_product).pluck(:item_instance_name,:item_instance_code)%>
|
||||||
<% else %>
|
<% else %>
|
||||||
<% sample = Product.where("item_code=?",@promotion.original_product).pluck(:name,:item_code)%>
|
<% sample = Product.where("item_code=?",@promotion.original_product).pluck(:name,:item_code)%>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<div class="col-md-3 form-group"><%= f.input :original_product,collection: sample %></div>
|
<div class="col-md-3 form-group"><%= f.input :original_product,collection: sample %></div>
|
||||||
<!-- <div class="col-md-6"><%= f.input :original_product,collection: MenuItemInstance.order("item_instance_name desc").pluck(:item_instance_name,:item_instance_code),input_html: { selected: 2 } %></div> -->
|
<!-- <div class="col-md-6"><%= f.input :original_product,collection: MenuItemInstance.order("item_instance_name desc").pluck(:item_instance_name,:item_instance_code),input_html: { selected: 2 } %></div> -->
|
||||||
@@ -160,7 +160,7 @@
|
|||||||
<%= f.fields_for :promotion_products do |pro| %>
|
<%= f.fields_for :promotion_products do |pro| %>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<%= pro.hidden_field :item_code,:class => "promo_product" %>
|
<%= pro.hidden_field :item_code,:class => "promo_product" %>
|
||||||
<% arr = MenuItem.active.order("name desc").pluck(:name,:item_code) %>
|
<% arr = MenuItem.joins("JOIN menu_item_instances as b ON b.menu_item_id=menu_items.id").group("menu_items.id").order("name desc").pluck(:name,:item_code) %>
|
||||||
<% Product.order("name desc").pluck(:name,:item_code).each do |p| %>
|
<% Product.order("name desc").pluck(:name,:item_code).each do |p| %>
|
||||||
<% arr.push(p) %>
|
<% arr.push(p) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
@@ -247,9 +247,10 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
|
if(($('.item_code_place').val()!=undefined) && ($('.item_code_place').val()!="")){
|
||||||
|
getItemInstance($('.item_code_place').val());
|
||||||
|
}
|
||||||
|
|
||||||
$('#promotion_promo_start_hour').on('change', function(event) {
|
$('#promotion_promo_start_hour').on('change', function(event) {
|
||||||
$('#promotion_promo_start_hour').val($('#promotion_promo_start_hour').val().split(":")[0]+":00");
|
$('#promotion_promo_start_hour').val($('#promotion_promo_start_hour').val().split(":")[0]+":00");
|
||||||
@@ -273,7 +274,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
var dayy = $("#promotion_promo_day").val().replace("[","").replace("]","");
|
var dayy = $("#promotion_promo_day").val().replace("[","").replace("]","");
|
||||||
jQuery.each( dayy.split(","), function( i, d ) {
|
$.each( dayy.split(","), function( i, d ) {
|
||||||
$("input.selectDay[value='"+d+"']").prop( "checked", true );
|
$("input.selectDay[value='"+d+"']").prop( "checked", true );
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -324,8 +325,13 @@
|
|||||||
// $(".item_code_place").select2();
|
// $(".item_code_place").select2();
|
||||||
|
|
||||||
$(".item_code_place").on('change', function(event) {
|
$(".item_code_place").on('change', function(event) {
|
||||||
var ajax_url = "<%= settings_find_item_instance_path %>";
|
|
||||||
var item_code = this.value;
|
var item_code = this.value;
|
||||||
|
getItemInstance(item_code);
|
||||||
|
});
|
||||||
|
|
||||||
|
function getItemInstance(item_code) {
|
||||||
|
var ajax_url = "<%= settings_find_item_instance_path %>";
|
||||||
|
var original_product = "<%= @promotion.original_product %>";
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "GET",
|
type: "GET",
|
||||||
url: ajax_url,
|
url: ajax_url,
|
||||||
@@ -334,13 +340,15 @@
|
|||||||
$("#promotion_original_product").empty();
|
$("#promotion_original_product").empty();
|
||||||
var itemlist;
|
var itemlist;
|
||||||
for (var i = 0; i < result.length; i++) {
|
for (var i = 0; i < result.length; i++) {
|
||||||
itemlist += "<option value ="+result[i][1]+">"+result[i][0]+"</option>"
|
var selected = "";
|
||||||
|
if(original_product == result[i][1]) selected = "selected";
|
||||||
|
itemlist += "<option value ="+result[i][1]+" "+selected+">"+result[i][0]+"</option>"
|
||||||
}
|
}
|
||||||
$("#promotion_original_product").append(itemlist);
|
$("#promotion_original_product").append(itemlist);
|
||||||
//$("#promotion_original_product").select2();
|
//$("#promotion_original_product").select2();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
|
|
||||||
//$(".promotion_promotion_products_item_code select").select2();
|
//$(".promotion_promotion_products_item_code select").select2();
|
||||||
//$(".item_code_place1").select2();
|
//$(".item_code_place1").select2();
|
||||||
@@ -356,7 +364,7 @@
|
|||||||
|
|
||||||
// for promotion products data showing
|
// for promotion products data showing
|
||||||
var promopdt = $(".promo_product");
|
var promopdt = $(".promo_product");
|
||||||
jQuery.each( promopdt, function( i, ppdt ) {
|
$.each( promopdt, function( i, ppdt ) {
|
||||||
var ajax_url = "<%= settings_find_parent_item_path %>";
|
var ajax_url = "<%= settings_find_parent_item_path %>";
|
||||||
var item_code = ppdt.value;
|
var item_code = ppdt.value;
|
||||||
var select_id = ppdt.id;
|
var select_id = ppdt.id;
|
||||||
@@ -365,14 +373,33 @@
|
|||||||
url: ajax_url,
|
url: ajax_url,
|
||||||
data: 'item_instance_code=' + item_code,
|
data: 'item_instance_code=' + item_code,
|
||||||
success: function (result) {
|
success: function (result) {
|
||||||
|
// console.log(result);
|
||||||
|
var par_item_code = "";
|
||||||
|
var arr_item_inst = "";
|
||||||
|
if((result[0]!=undefined) && (result[0]!="")){
|
||||||
|
$.each(result[0],function(k,val){
|
||||||
|
par_item_code = k;
|
||||||
|
arr_item_inst = val;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if(result.length > 0){
|
if(result.length > 0){
|
||||||
$("select#"+select_id).empty();
|
var iteminstlists;
|
||||||
$("select#"+select_id).append("<option value='"+item_code+"'>"+result[0]+"</option>");
|
$.each(arr_item_inst,function(k2,v2al){
|
||||||
$("select#"+select_id).parent().parent().siblings("div.menu_item_choose").find("select").find("option[value='"+result[1]+"']").attr("selected","true")
|
$("select#"+select_id).empty();
|
||||||
|
var selected = "";
|
||||||
|
$.each(v2al,function(k3,v3al){
|
||||||
|
if(k3 == item_code) selected = "selected";
|
||||||
|
iteminstlists += "<option value='"+k3+"' "+selected+">"+v3al+"</option>";
|
||||||
|
});
|
||||||
|
});
|
||||||
|
$("select#"+select_id).append(iteminstlists);
|
||||||
|
|
||||||
|
$("select#"+select_id).parent().parent().siblings("div.menu_item_choose").find("select").find("option[value='"+par_item_code+"']").attr("selected","true")
|
||||||
// $("select#"+select_id).parent().parent().siblings("div.menu_item_choose").find("select").select2();
|
// $("select#"+select_id).parent().parent().siblings("div.menu_item_choose").find("select").select2();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// promotion_promotion_products_attributes_0_item_code
|
// promotion_promotion_products_attributes_0_item_code
|
||||||
@@ -394,8 +421,8 @@
|
|||||||
}
|
}
|
||||||
$("select#"+id).append(itemlist);
|
$("select#"+id).append(itemlist);
|
||||||
//$("select#"+id).select2();
|
//$("select#"+id).select2();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
<%= f.input :item_code,:input_html => {:class => "col-md-9"} %>
|
<%= f.input :item_code,:input_html => {:class => "col-md-9"} %>
|
||||||
<%= f.input :name,:input_html => {:class => "col-md-9"} %>
|
<%= f.input :name,:input_html => {:class => "col-md-9"} %>
|
||||||
<%= f.input :alt_name,:input_html => {:class => "col-md-9"} %>
|
<%= f.input :alt_name,:input_html => {:class => "col-md-9"} %>
|
||||||
<%= f.input :type, :collection => ["SimpleMenuItem","SetMenuItem"], :input_html => {:class => "col-md-9"},:input_html => {:class => "col-md-9"} %>
|
<%= f.input :type, :collection => ["SimpleMenuItem","SetMenuItem"], :input_html => {:class => "col-md-9"},:input_html => {:class => "col-md-9"}, include_blank: false, include_hidden: false %>
|
||||||
<%= f.input :min_qty,:input_html => {:class => "col-md-9"} %>
|
<%= f.input :min_qty,:input_html => {:class => "col-md-9"} %>
|
||||||
<%= f.input :account_id, :label => "Account type", :collection => Account.collection,:input_html => {:class => "col-md-9"} %>
|
<%= f.input :account_id, :label => "Account type", :collection => Account.collection,:input_html => {:class => "col-md-9"} %>
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
<%= f.input :item_code,:input_html => {:class => "col-md-9"} %>
|
<%= f.input :item_code,:input_html => {:class => "col-md-9"} %>
|
||||||
<%= f.input :name,:input_html => {:class => "col-md-9"} %>
|
<%= f.input :name,:input_html => {:class => "col-md-9"} %>
|
||||||
<%= f.input :alt_name,:input_html => {:class => "col-md-9"} %>
|
<%= f.input :alt_name,:input_html => {:class => "col-md-9"} %>
|
||||||
<%= f.input :type, :collection => ["SimpleMenuItem","SetMenuItem"], :input_html => {:class => "col-md-9"} %>
|
<%= f.input :type, :collection => ["SimpleMenuItem","SetMenuItem"], :input_html => {:class => "col-md-9"}, include_blank: false, include_hidden: false %>
|
||||||
<%= f.input :min_qty,:input_html => {:class => "col-md-9"} %>
|
<%= f.input :min_qty,:input_html => {:class => "col-md-9"} %>
|
||||||
<%= f.input :account_id, :label => "Account type", :collection => Account.collection,:input_html => {:class => "col-md-9"} %>
|
<%= f.input :account_id, :label => "Account type", :collection => Account.collection,:input_html => {:class => "col-md-9"} %>
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
<div class="row clearfix">
|
<div class="row clearfix">
|
||||||
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4">
|
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4">
|
||||||
<label><%= t("views.right_panel.detail.enter_keyboards") %></label>
|
<label><%= t("views.right_panel.detail.enter_keyboards") %></label>
|
||||||
<input type="text" id="receipt_no" name="receipt_no" class="form-control" placeholder="" style="margin-right: 10px">
|
<input type="text" id="receipt_no" name="receipt_no" class="form-control" placeholder="Booking/Sale ID" style="margin-right: 10px">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
|
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
|
||||||
<label class=""><%= t("views.right_panel.detail.from") %></label>
|
<label class=""><%= t("views.right_panel.detail.from") %></label>
|
||||||
|
|||||||
@@ -70,7 +70,7 @@
|
|||||||
<td><%=shift_sale.cashier_terminal.name%></td>
|
<td><%=shift_sale.cashier_terminal.name%></td>
|
||||||
<td><%= shift_sale.shift_started_at.utc.getlocal.strftime('%d-%m-%Y %I:%M %p') %>
|
<td><%= shift_sale.shift_started_at.utc.getlocal.strftime('%d-%m-%Y %I:%M %p') %>
|
||||||
</td>
|
</td>
|
||||||
<td><%= shift_sale.shift_started_at.utc.getlocal.strftime('%d-%m-%Y %I:%M %p') rescue '-' %>
|
<td><%= shift_sale.shift_closed_at.utc.getlocal.strftime('%d-%m-%Y %I:%M %p') rescue '-' %>
|
||||||
</td>
|
</td>
|
||||||
<td><%=shift_sale.opening_balance %></td>
|
<td><%=shift_sale.opening_balance %></td>
|
||||||
<td><%=shift_sale.closing_balance %></td>
|
<td><%=shift_sale.closing_balance %></td>
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
config = YAML.load_file(Rails.root.join("config/license.yml"))
|
if File.exist?("config/license.yml")
|
||||||
config.fetch(Rails.env, {}).each do |key, value|
|
config = YAML.load_file(Rails.root.join("config/license.yml"))
|
||||||
ENV[key.upcase] = value.to_s
|
config.fetch(Rails.env, {}).each do |key, value|
|
||||||
|
ENV[key.upcase] = value.to_s
|
||||||
|
end
|
||||||
end
|
end
|
||||||
@@ -1,14 +1,17 @@
|
|||||||
development:
|
iv_key: vO8MJlASMmPRf6Ivw3QK+A==
|
||||||
server_mode: cloud
|
|
||||||
license_key: IAAXHpbSWAfvlWGYpDoXvZdmuRABNGk
|
|
||||||
|
|
||||||
|
shop_name: bitp
|
||||||
test:
|
email: yanaung.nyein@code2lab.com
|
||||||
sx_provision_url: "provision.test.ws/api"
|
telephone: 111111
|
||||||
|
fax: 111111
|
||||||
|
address: bitp
|
||||||
|
dbhost: vd52jkRoCOPpHX0tsYp1HQ==
|
||||||
|
|
||||||
# Do not keep production secrets in the repository,
|
dbschema: 7L5CvrQvsspSYgx5Ng3tDg==
|
||||||
# instead read values from the environment.
|
|
||||||
production:
|
|
||||||
server_mode: cloud
|
|
||||||
license_key: IAAXHpbSWAfvlWGYpDoXvZdmuRABNGk
|
|
||||||
|
|
||||||
|
dbusername: G0QLCPnSiRmGQ7ekVWy5wA==
|
||||||
|
|
||||||
|
dbpassword: ahQVj/eThBKnwpv1tcvNGA==
|
||||||
|
|
||||||
|
api_token:
|
||||||
|
app_token:
|
||||||
|
|||||||
@@ -9,9 +9,9 @@ scope "(:locale)", locale: /en|mm/ do
|
|||||||
# Action Cable Creation
|
# Action Cable Creation
|
||||||
mount ActionCable.server => "/cable"
|
mount ActionCable.server => "/cable"
|
||||||
|
|
||||||
#--------- SmartSales Installation ------------#
|
#--------- SmartSales Activation ------------#
|
||||||
get 'install' => 'install#index'
|
get 'activate' => 'install#index'
|
||||||
post 'install' => 'install#create'
|
post 'activate' => 'install#activate'
|
||||||
|
|
||||||
#--------- Login/Authentication ------------#
|
#--------- Login/Authentication ------------#
|
||||||
get 'auth/:emp_id' => 'home#show', as: :emp_login
|
get 'auth/:emp_id' => 'home#show', as: :emp_login
|
||||||
|
|||||||
@@ -12,8 +12,8 @@
|
|||||||
|
|
||||||
development:
|
development:
|
||||||
secret_key_base: b61d85f8ed2a1a9e0eeece3443b3e8f838d002cc1d9f32115d8e93db920e2957adfedc57501d44741211538f3108b742cdeada87d5bfae796c53da1f90a3cd61
|
secret_key_base: b61d85f8ed2a1a9e0eeece3443b3e8f838d002cc1d9f32115d8e93db920e2957adfedc57501d44741211538f3108b742cdeada87d5bfae796c53da1f90a3cd61
|
||||||
sx_provision_url: provision.zsai.ws/api #192.168.1.94:3002
|
sx_provision_url: 192.168.1.147:3002/api #provision.zsai.ws/api
|
||||||
server_mode: cloud
|
server_mode: application
|
||||||
cipher_type: AES-256-CBC
|
cipher_type: AES-256-CBC
|
||||||
aes_key: <%= ENV['AES_KEY'] %>
|
aes_key: <%= ENV['AES_KEY'] %>
|
||||||
aes_iv: <%= ENV['AES_IV'] %>
|
aes_iv: <%= ENV['AES_IV'] %>
|
||||||
|
|||||||
26
db/seeds.rb
26
db/seeds.rb
@@ -182,19 +182,19 @@ cashier_terminal = CashierTerminal.create({name:"Terminal 1", printer_name: "Cas
|
|||||||
|
|
||||||
zone = Zone.create({id:1, name: "H1", is_active:true, created_by: "SYSTEM DEFAULT"})
|
zone = Zone.create({id:1, name: "H1", is_active:true, created_by: "SYSTEM DEFAULT"})
|
||||||
|
|
||||||
member_setting = MembershipSetting.create({membership_type:"paypar_url",gateway_url: "http://staging.membership.paypar.ws",merchant_account_id:"RxzaYyAGzm7VqAZ4hKnv"})
|
member_setting = MembershipSetting.create({membership_type:"paypar_url",gateway_url: "https://staging.membership.paypar.ws",merchant_account_id:"RxzaYyAGzm7VqAZ4hKnv"})
|
||||||
|
|
||||||
member_actions= MembershipAction.create([{membership_type:"get_account_balance",gateway_url:"/api/membership_campaigns/get_correspond_account_data",additional_parameter:{campaign_type_id:1},merchant_account_id:"RxzaYyAGzm7VqAZ4hKnv",auth_token:"code2lab"},
|
member_actions= MembershipAction.create([{membership_type:"get_account_balance",is_active:1,gateway_url:"/api/membership_campaigns/get_correspond_account_data",additional_parameter:{campaign_type_id:1},merchant_account_id:"RxzaYyAGzm7VqAZ4hKnv",auth_token:"code2lab"},
|
||||||
{membership_type:"redeem",gateway_url:"/api/membership_campaigns/redeem",additional_parameter:{campaign_type_id:1},merchant_account_id:"RxzaYyAGzm7VqAZ4hKnv",auth_token:"code2lab"},
|
{membership_type:"redeem",is_active:1,gateway_url:"/api/membership_campaigns/redeem",additional_parameter:{campaign_type_id:1},merchant_account_id:"RxzaYyAGzm7VqAZ4hKnv",auth_token:"code2lab"},
|
||||||
{membership_type:"create_membership_customer",gateway_url:"/api/generic_customer/create_membership_customer",merchant_account_id:"RxzaYyAGzm7VqAZ4hKnv",auth_token:"code2lab"},
|
{membership_type:"create_membership_customer",is_active:1,gateway_url:"/api/generic_customer/create_membership_customer",merchant_account_id:"RxzaYyAGzm7VqAZ4hKnv",auth_token:"code2lab"},
|
||||||
{membership_type:"update_membership_customer",gateway_url:"/api/generic_customer/update_membership_customer",merchant_account_id:"RxzaYyAGzm7VqAZ4hKnv",auth_token:"code2lab"},
|
{membership_type:"update_membership_customer",is_active:1,gateway_url:"/api/generic_customer/update_membership_customer",merchant_account_id:"RxzaYyAGzm7VqAZ4hKnv",auth_token:"code2lab"},
|
||||||
{membership_type:"get_all_member_group",gateway_url:"/api/member_group/get_all_member_group",merchant_account_id:"RxzaYyAGzm7VqAZ4hKnv",auth_token:"code2lab"},
|
{membership_type:"get_all_member_group",is_active:1,gateway_url:"/api/member_group/get_all_member_group",merchant_account_id:"RxzaYyAGzm7VqAZ4hKnv",auth_token:"code2lab"},
|
||||||
{membership_type:"rebate",gateway_url:"/api/membership_campaigns/rebate",additional_parameter:{campaign_type_id:1},merchant_account_id:"RxzaYyAGzm7VqAZ4hKnv",auth_token:"code2lab"},
|
{membership_type:"rebate",is_active:1,gateway_url:"/api/membership_campaigns/rebate",additional_parameter:{campaign_type_id:1},merchant_account_id:"RxzaYyAGzm7VqAZ4hKnv",auth_token:"code2lab"},
|
||||||
{membership_type:"get_all_member_account",gateway_url:"/api/generic_customer/get_member_data",merchant_account_id:"RxzaYyAGzm7VqAZ4hKnv",auth_token:"code2lab"},
|
{membership_type:"get_all_member_account",is_active:1,gateway_url:"/api/generic_customer/get_member_data",merchant_account_id:"RxzaYyAGzm7VqAZ4hKnv",auth_token:"code2lab"},
|
||||||
{membership_type:"get_member_transactions",gateway_url:"/api/generic_customer/get_membership_transactions",merchant_account_id:"RxzaYyAGzm7VqAZ4hKnv",auth_token:"code2lab"},
|
{membership_type:"get_member_transactions",is_active:1,gateway_url:"/api/generic_customer/get_membership_transactions",merchant_account_id:"RxzaYyAGzm7VqAZ4hKnv",auth_token:"code2lab"},
|
||||||
{membership_type:"member_discount",gateway_url:"/api/membership_campaigns/discount",additional_parameter:{campaign_type_id:5},merchant_account_id:"RxzaYyAGzm7VqAZ4hKnv",auth_token:"code2lab"},
|
{membership_type:"member_discount",is_active:1,gateway_url:"/api/membership_campaigns/discount",additional_parameter:{campaign_type_id:5},merchant_account_id:"RxzaYyAGzm7VqAZ4hKnv",auth_token:"code2lab"},
|
||||||
{membership_type:"get_member_campaign",gateway_url:"/api/membership_campaigns/get_member_campaign",additional_parameter:{campaign_type_id:5},merchant_account_id:"RxzaYyAGzm7VqAZ4hKnv",auth_token:"code2lab"},
|
{membership_type:"get_member_campaign",is_active:1,gateway_url:"/api/membership_campaigns/get_member_campaign",additional_parameter:{campaign_type_id:5},merchant_account_id:"RxzaYyAGzm7VqAZ4hKnv",auth_token:"code2lab"},
|
||||||
{membership_type:"search_paypar_account_no",gateway_url:"/api/generic_customer/get_membership_customer_data",merchant_account_id:"RxzaYyAGzm7VqAZ4hKnv",auth_token:"code2lab"}
|
{membership_type:"search_paypar_account_no",is_active:1,gateway_url:"/api/generic_customer/get_membership_customer_data",merchant_account_id:"RxzaYyAGzm7VqAZ4hKnv",auth_token:"code2lab"}
|
||||||
])
|
])
|
||||||
|
|
||||||
payment_methods = PaymentMethodSetting.create({payment_method:"MPU",gateway_url: "http://membership.paypar.ws"})
|
payment_methods = PaymentMethodSetting.create({payment_method:"MPU",gateway_url: "http://membership.paypar.ws"})
|
||||||
@@ -213,4 +213,4 @@ zone_queue_station1 = OrderQueueProcessByZone.create({order_queue_station: order
|
|||||||
zone_queue_station2 = OrderQueueProcessByZone.create({order_queue_station: order_queue_station2, zone: zone})
|
zone_queue_station2 = OrderQueueProcessByZone.create({order_queue_station: order_queue_station2, zone: zone})
|
||||||
zone_queue_station3 = OrderQueueProcessByZone.create({order_queue_station: zone_order_queue_station, zone: zone})
|
zone_queue_station3 = OrderQueueProcessByZone.create({order_queue_station: zone_order_queue_station, zone: zone})
|
||||||
|
|
||||||
puts " Finished System Default Set Up Data vWSsseoZCzxd6xcNf_uS RxzaYyAGzm7VqAZ4hKnv "
|
puts " Finished System Default Set Up Data"
|
||||||
|
|||||||
@@ -23,8 +23,8 @@
|
|||||||
-- Sample Data
|
-- Sample Data
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
-- insert into item (item_id, name) values (11000001, 'Yummy Gum');
|
-- insert into item (item_id, name) values (11000001, 'Yummy Gum');
|
||||||
-- insert into item_selling_price (item_id, store_id, price, cost) values (11000001, '001',0.20, 0.10);
|
-- insert into item_selling_price (item_id, cloud_id, price, cost) values (11000001, '001',0.20, 0.10);
|
||||||
-- insert into item_selling_price (item_id, store_id, price, cost) values (11000001, '002',0.30, 0.20);
|
-- insert into item_selling_price (item_id, cloud_id, price, cost) values (11000001, '002',0.30, 0.20);
|
||||||
|
|
||||||
-- insert into sale_transaction (tran_id, store_id, workstation, day, seq)
|
-- insert into sale_transaction (tran_id, store_id, workstation, day, seq)
|
||||||
-- values (900, '001', '3', '2012-12-01', 90);
|
-- values (900, '001', '3', '2012-12-01', 90);
|
||||||
@@ -48,6 +48,10 @@ delete from sym_node;
|
|||||||
|
|
||||||
|
|
||||||
# Create Channels for logically grouped tables
|
# Create Channels for logically grouped tables
|
||||||
|
# For Initial Data Faster by bulk
|
||||||
|
update sym_channel set data_loader_type='mysql_bulk', max_batch_size=100000, max_data_to_route=100000
|
||||||
|
where channel_id = 'reload';
|
||||||
|
|
||||||
insert into sym_channel
|
insert into sym_channel
|
||||||
(channel_id, processing_order, max_batch_size, enabled, description)
|
(channel_id, processing_order, max_batch_size, enabled, description)
|
||||||
values('setting', 1, 100000, 1, 'All Settings');
|
values('setting', 1, 100000, 1, 'All Settings');
|
||||||
@@ -78,10 +82,10 @@ delete from sym_node;
|
|||||||
|
|
||||||
# Create Node Groups and Links
|
# Create Node Groups and Links
|
||||||
insert into sym_node_group (node_group_id) values ('sx');
|
insert into sym_node_group (node_group_id) values ('sx');
|
||||||
insert into sym_node_group (node_group_id) values ('store');
|
insert into sym_node_group (node_group_id) values ('cloud');
|
||||||
|
|
||||||
insert into sym_node_group_link (source_node_group_id, target_node_group_id, data_event_action) values ('sx', 'store', 'W');
|
insert into sym_node_group_link (source_node_group_id, target_node_group_id, data_event_action) values ('sx', 'cloud', 'W');
|
||||||
insert into sym_node_group_link (source_node_group_id, target_node_group_id, data_event_action) values ('store', 'sx', 'P');
|
insert into sym_node_group_link (source_node_group_id, target_node_group_id, data_event_action) values ('cloud', 'sx', 'P');
|
||||||
|
|
||||||
# Create Trigger for Setting Channel
|
# Create Trigger for Setting Channel
|
||||||
|
|
||||||
@@ -305,466 +309,466 @@ delete from sym_node;
|
|||||||
# Create Routers for Nodes
|
# Create Routers for Nodes
|
||||||
insert into sym_router
|
insert into sym_router
|
||||||
(router_id,source_node_group_id,target_node_group_id,router_type,create_time,last_update_time)
|
(router_id,source_node_group_id,target_node_group_id,router_type,create_time,last_update_time)
|
||||||
values('sx_2_store', 'sx', 'store', 'default',current_timestamp, current_timestamp);
|
values('sx_2_cloud', 'sx', 'cloud', 'default',current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_router
|
insert into sym_router
|
||||||
(router_id,source_node_group_id,target_node_group_id,router_type,sync_on_delete,create_time,last_update_time)
|
(router_id,source_node_group_id,target_node_group_id,router_type,sync_on_delete,create_time,last_update_time)
|
||||||
values('store_2_sx', 'store', 'sx', 'default',0,current_timestamp, current_timestamp);
|
values('cloud_2_sx', 'cloud', 'sx', 'default',0,current_timestamp, current_timestamp);
|
||||||
|
|
||||||
-- insert into sym_router
|
-- insert into sym_router
|
||||||
-- (router_id,source_node_group_id,target_node_group_id,router_type,router_expression,create_time,last_update_time)
|
-- (router_id,source_node_group_id,target_node_group_id,router_type,router_expression,create_time,last_update_time)
|
||||||
-- values('sx_2_one_store', 'sx', 'store', 'column','STORE_ID=:EXTERNAL_ID or OLD_STORE_ID=:EXTERNAL_ID',current_timestamp, current_timestamp);
|
-- values('sx_2_one_cloud', 'sx', 'cloud', 'column','cloud_ID=:EXTERNAL_ID or OLD_cloud_ID=:EXTERNAL_ID',current_timestamp, current_timestamp);
|
||||||
|
|
||||||
|
|
||||||
# Add triggers for tables with router
|
# Add triggers for tables with router
|
||||||
|
|
||||||
# Setting Channel # From Store to Master
|
# Setting Channel # From cloud to Master
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('lookups','store_2_sx', 100, current_timestamp, current_timestamp);
|
values('lookups','cloud_2_sx', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('membership_actions','store_2_sx', 100, current_timestamp, current_timestamp);
|
values('membership_actions','cloud_2_sx', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('membership_settings','store_2_sx', 100, current_timestamp, current_timestamp);
|
values('membership_settings','cloud_2_sx', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('payment_method_settings','store_2_sx', 100, current_timestamp, current_timestamp);
|
values('payment_method_settings','cloud_2_sx', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('print_settings','store_2_sx', 100, current_timestamp, current_timestamp);
|
values('print_settings','cloud_2_sx', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('shops','store_2_sx', 100, current_timestamp, current_timestamp);
|
values('shops','cloud_2_sx', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('customers','store_2_sx', 100, current_timestamp, current_timestamp);
|
values('customers','cloud_2_sx', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
# Setting Channel # From Master to Store
|
# Setting Channel # From Master to cloud
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('lookups','sx_2_store', 100, current_timestamp, current_timestamp);
|
values('lookups','sx_2_cloud', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('membership_actions','sx_2_store', 100, current_timestamp, current_timestamp);
|
values('membership_actions','sx_2_cloud', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('membership_settings','sx_2_store', 100, current_timestamp, current_timestamp);
|
values('membership_settings','sx_2_cloud', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('payment_method_settings','sx_2_store', 100, current_timestamp, current_timestamp);
|
values('payment_method_settings','sx_2_cloud', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('print_settings','sx_2_store', 100, current_timestamp, current_timestamp);
|
values('print_settings','sx_2_cloud', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('shops','sx_2_store', 100, current_timestamp, current_timestamp);
|
values('shops','sx_2_cloud', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('customers','sx_2_store', 100, current_timestamp, current_timestamp);
|
values('customers','sx_2_cloud', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
#End Setting Channel
|
#End Setting Channel
|
||||||
|
|
||||||
# Dining Channel # From Store to SX
|
# Dining Channel # From cloud to SX
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('zones','store_2_sx', 100, current_timestamp, current_timestamp);
|
values('zones','cloud_2_sx', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('dining_charges','store_2_sx', 100, current_timestamp, current_timestamp);
|
values('dining_charges','cloud_2_sx', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('dining_facilities','store_2_sx', 100, current_timestamp, current_timestamp);
|
values('dining_facilities','cloud_2_sx', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('dining_queues','store_2_sx', 100, current_timestamp, current_timestamp);
|
values('dining_queues','cloud_2_sx', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
# Dining Channel # From SX to Store
|
# Dining Channel # From SX to cloud
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('zones','sx_2_store', 100, current_timestamp, current_timestamp);
|
values('zones','sx_2_cloud', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('dining_charges','sx_2_store', 100, current_timestamp, current_timestamp);
|
values('dining_charges','sx_2_cloud', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('dining_facilities','sx_2_store', 100, current_timestamp, current_timestamp);
|
values('dining_facilities','sx_2_cloud', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('dining_queues','sx_2_store', 100, current_timestamp, current_timestamp);
|
values('dining_queues','sx_2_cloud', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
#end Dining Channel
|
#end Dining Channel
|
||||||
|
|
||||||
# Commission/Promotion/Product Channel # From Store to SX
|
# Commission/Promotion/Product Channel # From cloud to SX
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('commissioners','store_2_sx', 100, current_timestamp, current_timestamp);
|
values('commissioners','cloud_2_sx', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('commissions','store_2_sx', 100, current_timestamp, current_timestamp);
|
values('commissions','cloud_2_sx', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('employees','store_2_sx', 100, current_timestamp, current_timestamp);
|
values('employees','cloud_2_sx', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('in_duties','store_2_sx', 100, current_timestamp, current_timestamp);
|
values('in_duties','cloud_2_sx', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('inventory_definitions','store_2_sx', 100, current_timestamp, current_timestamp);
|
values('inventory_definitions','cloud_2_sx', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('product_commissions','store_2_sx', 100, current_timestamp, current_timestamp);
|
values('product_commissions','cloud_2_sx', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('products','store_2_sx', 100, current_timestamp, current_timestamp);
|
values('products','cloud_2_sx', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('promotion_products','store_2_sx', 100, current_timestamp, current_timestamp);
|
values('promotion_products','cloud_2_sx', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('promotions','store_2_sx', 100, current_timestamp, current_timestamp);
|
values('promotions','cloud_2_sx', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
# Commission/Promotion/Product Channel # From SX to Store
|
# Commission/Promotion/Product Channel # From SX to cloud
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('commissioners','sx_2_store', 100, current_timestamp, current_timestamp);
|
values('commissioners','sx_2_cloud', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('commissions','sx_2_store', 100, current_timestamp, current_timestamp);
|
values('commissions','sx_2_cloud', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('employees','sx_2_store', 100, current_timestamp, current_timestamp);
|
values('employees','sx_2_cloud', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('in_duties','sx_2_store', 100, current_timestamp, current_timestamp);
|
values('in_duties','sx_2_cloud', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('inventory_definitions','sx_2_store', 100, current_timestamp, current_timestamp);
|
values('inventory_definitions','sx_2_cloud', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('product_commissions','sx_2_store', 100, current_timestamp, current_timestamp);
|
values('product_commissions','sx_2_cloud', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('products','sx_2_store', 100, current_timestamp, current_timestamp);
|
values('products','sx_2_cloud', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('promotion_products','sx_2_store', 100, current_timestamp, current_timestamp);
|
values('promotion_products','sx_2_cloud', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('promotions','sx_2_store', 100, current_timestamp, current_timestamp);
|
values('promotions','sx_2_cloud', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
#end Commission/Promotion/Product Channel
|
#end Commission/Promotion/Product Channel
|
||||||
|
|
||||||
# Menu Channel # From Store to SX
|
# Menu Channel # From cloud to SX
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('accounts','store_2_sx', 100, current_timestamp, current_timestamp);
|
values('accounts','cloud_2_sx', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('menu_item_attributes','store_2_sx', 100, current_timestamp, current_timestamp);
|
values('menu_item_attributes','cloud_2_sx', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('menu_item_options','store_2_sx', 100, current_timestamp, current_timestamp);
|
values('menu_item_options','cloud_2_sx', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('menus','store_2_sx', 100, current_timestamp, current_timestamp);
|
values('menus','cloud_2_sx', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('menu_categories','store_2_sx', 100, current_timestamp, current_timestamp);
|
values('menu_categories','cloud_2_sx', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('menu_items','store_2_sx', 100, current_timestamp, current_timestamp);
|
values('menu_items','cloud_2_sx', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('menu_item_instances','store_2_sx', 100, current_timestamp, current_timestamp);
|
values('menu_item_instances','cloud_2_sx', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('item_sets','store_2_sx', 100, current_timestamp, current_timestamp);
|
values('item_sets','cloud_2_sx', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('menu_item_sets','store_2_sx', 100, current_timestamp, current_timestamp);
|
values('menu_item_sets','cloud_2_sx', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('menu_instance_item_sets','store_2_sx', 100, current_timestamp, current_timestamp);
|
values('menu_instance_item_sets','cloud_2_sx', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
# Menu Channel # From SX to Store
|
# Menu Channel # From SX to cloud
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('accounts','sx_2_store', 100, current_timestamp, current_timestamp);
|
values('accounts','sx_2_cloud', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('menu_item_attributes','sx_2_store', 100, current_timestamp, current_timestamp);
|
values('menu_item_attributes','sx_2_cloud', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('menu_item_options','sx_2_store', 100, current_timestamp, current_timestamp);
|
values('menu_item_options','sx_2_cloud', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('menus','sx_2_store', 100, current_timestamp, current_timestamp);
|
values('menus','sx_2_cloud', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('menu_categories','sx_2_store', 100, current_timestamp, current_timestamp);
|
values('menu_categories','sx_2_cloud', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('menu_items','sx_2_store', 100, current_timestamp, current_timestamp);
|
values('menu_items','sx_2_cloud', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('menu_item_instances','sx_2_store', 100, current_timestamp, current_timestamp);
|
values('menu_item_instances','sx_2_cloud', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('item_sets','sx_2_store', 100, current_timestamp, current_timestamp);
|
values('item_sets','sx_2_cloud', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('menu_item_sets','sx_2_store', 100, current_timestamp, current_timestamp);
|
values('menu_item_sets','sx_2_cloud', 100, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('menu_instance_item_sets','sx_2_store', 100, current_timestamp, current_timestamp);
|
values('menu_instance_item_sets','sx_2_cloud', 100, current_timestamp, current_timestamp);
|
||||||
#End Menu Channel
|
#End Menu Channel
|
||||||
|
|
||||||
# Order Channel # From Store to Sx
|
# Order Channel # From cloud to Sx
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('orders','store_2_sx', 200, current_timestamp, current_timestamp);
|
values('orders','cloud_2_sx', 200, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('order_items','store_2_sx', 200, current_timestamp, current_timestamp);
|
values('order_items','cloud_2_sx', 200, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('bookings','store_2_sx', 200, current_timestamp, current_timestamp);
|
values('bookings','cloud_2_sx', 200, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('booking_orders','store_2_sx', 200, current_timestamp, current_timestamp);
|
values('booking_orders','cloud_2_sx', 200, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
# Order Channel # From SX to Store
|
# Order Channel # From SX to cloud
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('orders','sx_2_store', 200, current_timestamp, current_timestamp);
|
values('orders','sx_2_cloud', 200, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('order_items','sx_2_store', 200, current_timestamp, current_timestamp);
|
values('order_items','sx_2_cloud', 200, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('bookings','sx_2_store', 200, current_timestamp, current_timestamp);
|
values('bookings','sx_2_cloud', 200, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('booking_orders','sx_2_store', 200, current_timestamp, current_timestamp);
|
values('booking_orders','sx_2_cloud', 200, current_timestamp, current_timestamp);
|
||||||
# End Order Channel
|
# End Order Channel
|
||||||
|
|
||||||
# Sale Channel # From Store to Sx
|
# Sale Channel # From cloud to Sx
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('sales','store_2_sx', 200, current_timestamp, current_timestamp);
|
values('sales','cloud_2_sx', 200, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('sale_items','store_2_sx', 200, current_timestamp, current_timestamp);
|
values('sale_items','cloud_2_sx', 200, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('sale_audits','store_2_sx', 200, current_timestamp, current_timestamp);
|
values('sale_audits','cloud_2_sx', 200, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('sale_orders','store_2_sx', 200, current_timestamp, current_timestamp);
|
values('sale_orders','cloud_2_sx', 200, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('sale_payments','store_2_sx', 200, current_timestamp, current_timestamp);
|
values('sale_payments','cloud_2_sx', 200, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('sale_taxes','store_2_sx', 200, current_timestamp, current_timestamp);
|
values('sale_taxes','cloud_2_sx', 200, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('payment_journals','store_2_sx', 200, current_timestamp, current_timestamp);
|
values('payment_journals','cloud_2_sx', 200, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('shift_sales','store_2_sx', 200, current_timestamp, current_timestamp);
|
values('shift_sales','cloud_2_sx', 200, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('stock_check_items','store_2_sx', 200, current_timestamp, current_timestamp);
|
values('stock_check_items','cloud_2_sx', 200, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('stock_checks','store_2_sx', 200, current_timestamp, current_timestamp);
|
values('stock_checks','cloud_2_sx', 200, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('stock_journals','store_2_sx', 200, current_timestamp, current_timestamp);
|
values('stock_journals','cloud_2_sx', 200, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('surveys','store_2_sx', 200, current_timestamp, current_timestamp);
|
values('surveys','cloud_2_sx', 200, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
# Sale Channel # From SX to Store
|
# Sale Channel # From SX to cloud
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('sales','sx_2_store', 200, current_timestamp, current_timestamp);
|
values('sales','sx_2_cloud', 200, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('sale_items','sx_2_store', 200, current_timestamp, current_timestamp);
|
values('sale_items','sx_2_cloud', 200, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('sale_audits','sx_2_store', 200, current_timestamp, current_timestamp);
|
values('sale_audits','sx_2_cloud', 200, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('sale_orders','sx_2_store', 200, current_timestamp, current_timestamp);
|
values('sale_orders','sx_2_cloud', 200, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('sale_payments','sx_2_store', 200, current_timestamp, current_timestamp);
|
values('sale_payments','sx_2_cloud', 200, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('sale_taxes','sx_2_store', 200, current_timestamp, current_timestamp);
|
values('sale_taxes','sx_2_cloud', 200, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('payment_journals','sx_2_store', 200, current_timestamp, current_timestamp);
|
values('payment_journals','sx_2_cloud', 200, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('shift_sales','sx_2_store', 200, current_timestamp, current_timestamp);
|
values('shift_sales','sx_2_cloud', 200, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('stock_check_items','sx_2_store', 200, current_timestamp, current_timestamp);
|
values('stock_check_items','sx_2_cloud', 200, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('stock_checks','sx_2_store', 200, current_timestamp, current_timestamp);
|
values('stock_checks','sx_2_cloud', 200, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('stock_journals','sx_2_store', 200, current_timestamp, current_timestamp);
|
values('stock_journals','sx_2_cloud', 200, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('surveys','sx_2_store', 200, current_timestamp, current_timestamp);
|
values('surveys','sx_2_cloud', 200, current_timestamp, current_timestamp);
|
||||||
# End Sale Channel
|
# End Sale Channel
|
||||||
|
|
||||||
# Oqs Channel # From Store to Sx
|
# Oqs Channel # From cloud to Sx
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('assigned_order_items','store_2_sx', 200, current_timestamp, current_timestamp);
|
values('assigned_order_items','cloud_2_sx', 200, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('cashier_terminals','store_2_sx', 200, current_timestamp, current_timestamp);
|
values('cashier_terminals','cloud_2_sx', 200, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('cashier_terminal_by_zones','store_2_sx', 200, current_timestamp, current_timestamp);
|
values('cashier_terminal_by_zones','cloud_2_sx', 200, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('cashier_login_logs','store_2_sx', 200, current_timestamp, current_timestamp);
|
values('cashier_login_logs','cloud_2_sx', 200, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('order_queue_process_by_zones','store_2_sx', 200, current_timestamp, current_timestamp);
|
values('order_queue_process_by_zones','cloud_2_sx', 200, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('order_queue_stations','store_2_sx', 200, current_timestamp, current_timestamp);
|
values('order_queue_stations','cloud_2_sx', 200, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
# Oqs Channel # From SX to Store
|
# Oqs Channel # From SX to cloud
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('assigned_order_items','sx_2_store', 200, current_timestamp, current_timestamp);
|
values('assigned_order_items','sx_2_cloud', 200, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('cashier_terminals','sx_2_store', 200, current_timestamp, current_timestamp);
|
values('cashier_terminals','sx_2_cloud', 200, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('cashier_terminal_by_zones','sx_2_store', 200, current_timestamp, current_timestamp);
|
values('cashier_terminal_by_zones','sx_2_cloud', 200, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('cashier_login_logs','sx_2_store', 200, current_timestamp, current_timestamp);
|
values('cashier_login_logs','sx_2_cloud', 200, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('order_queue_process_by_zones','sx_2_store', 200, current_timestamp, current_timestamp);
|
values('order_queue_process_by_zones','sx_2_cloud', 200, current_timestamp, current_timestamp);
|
||||||
|
|
||||||
insert into sym_trigger_router
|
insert into sym_trigger_router
|
||||||
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
|
||||||
values('order_queue_stations','sx_2_store', 200, current_timestamp, current_timestamp);
|
values('order_queue_stations','sx_2_cloud', 200, current_timestamp, current_timestamp);
|
||||||
# End Oqs Channel
|
# End Oqs Channel
|
||||||
|
|
||||||
|
|
||||||
insert into sym_node (node_id,node_group_id,external_id,sync_enabled,sync_url,schema_version,symmetric_version,database_type,database_version,heartbeat_time,timezone_offset,batch_to_send_count,batch_in_error_count,created_at_node_id)
|
insert into sym_node (node_id,node_group_id,external_id,sync_enabled,sync_url,schema_version,symmetric_version,database_type,database_version,heartbeat_time,timezone_offset,batch_to_send_count,batch_in_error_count,created_at_node_id)
|
||||||
values ('000','sx','000',1,null,null,null,null,null,current_timestamp,null,0,0,'000');
|
values ('000','sx','000',1,null,null,null,null,null,current_timestamp,null,0,0,'000');
|
||||||
insert into sym_node (node_id,node_group_id,external_id,sync_enabled,sync_url,schema_version,symmetric_version,database_type,database_version,heartbeat_time,timezone_offset,batch_to_send_count,batch_in_error_count,created_at_node_id)
|
insert into sym_node (node_id,node_group_id,external_id,sync_enabled,sync_url,schema_version,symmetric_version,database_type,database_version,heartbeat_time,timezone_offset,batch_to_send_count,batch_in_error_count,created_at_node_id)
|
||||||
values ('001','store','001',1,null,null,null,null,null,current_timestamp,null,0,0,'000');
|
values ('001','cloud','001',1,null,null,null,null,null,current_timestamp,null,0,0,'000');
|
||||||
-- insert into sym_node (node_id,node_group_id,external_id,sync_enabled,sync_url,schema_version,symmetric_version,database_type,database_version,heartbeat_time,timezone_offset,batch_to_send_count,batch_in_error_count,created_at_node_id)
|
-- insert into sym_node (node_id,node_group_id,external_id,sync_enabled,sync_url,schema_version,symmetric_version,database_type,database_version,heartbeat_time,timezone_offset,batch_to_send_count,batch_in_error_count,created_at_node_id)
|
||||||
-- values ('002','store','002',1,null,null,null,null,null,current_timestamp,null,0,0,'000');
|
-- values ('002','cloud','002',1,null,null,null,null,null,current_timestamp,null,0,0,'000');
|
||||||
|
|
||||||
|
|
||||||
insert into sym_node_security (node_id,node_password,registration_enabled,registration_time,initial_load_enabled,initial_load_time,created_at_node_id)
|
insert into sym_node_security (node_id,node_password,registration_enabled,registration_time,initial_load_enabled,initial_load_time,created_at_node_id)
|
||||||
|
|||||||
Reference in New Issue
Block a user