Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant
This commit is contained in:
@@ -446,7 +446,7 @@ function callback_url(callback,ref_no,order_id,status,min_type,time,exptime,reas
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: url,
|
||||
data: {order_id: order_id, status: status, min_type: min_type, expected_time: waiting_time, remark: reason, access_code: access_code},
|
||||
data: {order_id: order_id, ref_no: ref_no, status: status, min_type: min_type, expected_time: waiting_time, remark: reason, access_code: access_code},
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
if (data.status) {
|
||||
|
||||
@@ -20,6 +20,9 @@ class Origami::OrderReservationController < BaseOrigamiController
|
||||
access_code = params[:access_code]
|
||||
@order_reservation = OrderReservation.find(@id)
|
||||
|
||||
order_reserve = OrderReservation.find_by_transaction_ref(params[:ref_no])
|
||||
if !order_reserve.nil?
|
||||
if !ShiftSale.current_shift.nil?
|
||||
if @status == "processed"
|
||||
result = OrderReservation.create_doemal_order(@order_reservation,current_user)
|
||||
elsif @status == "delivery"
|
||||
@@ -38,6 +41,12 @@ class Origami::OrderReservationController < BaseOrigamiController
|
||||
response = OrderReservation.send_status_to_ordering(@order_reservation.callback_url,@order_reservation.transaction_ref,"accepted")
|
||||
result = {:status=> true, :message => "accepted" }
|
||||
end
|
||||
end
|
||||
else
|
||||
result = { status: false, message: 'No current shift open for this employee!'}
|
||||
end
|
||||
else
|
||||
result = { status: false, message: 'There is no order for '+params[:ref_no]+'!'}
|
||||
end
|
||||
render :json => result.to_json
|
||||
end
|
||||
|
||||
@@ -99,7 +99,7 @@ class Settings::MenusController < ApplicationController
|
||||
sheet.add_row ["Name",menu.name], :style=>title
|
||||
sheet.add_row
|
||||
|
||||
sheet.add_row ["Category Code", "Category Name", "Item Code", "Item Name", "Account", "Item AltName", "Taxable", "Attributes", "Options", "Instance Code", "Instance Name", "Instance Attribute", "Price", "Is Default"], :style=>header_text
|
||||
sheet.add_row ["Category Code", "Category Name", "Item Code", "Item Name", "Account", "Item AltName", "Taxable", "Attributes", "Options", "Instance Code", "Instance Name", "Instance Attribute", "Price", "Is Default", "Image Path"], :style=>header_text
|
||||
menu.menu_categories.each do |mc|
|
||||
mc.menu_items.each do |mi|
|
||||
attributes = ""
|
||||
@@ -135,7 +135,7 @@ class Settings::MenusController < ApplicationController
|
||||
if mii.item_attributes.length > 0
|
||||
attribute = MenuItemAttribute.find(mii.item_attributes[0]).name
|
||||
end
|
||||
sheet.add_row [ mc.code, mc.name, mi.item_code, mi.name, mi.account.title, mi.alt_name, mi.taxable, attributes, options, mii.item_instance_code, mii.item_instance_name, attribute, mii.price, mii.is_default], :style=>wrap_text
|
||||
sheet.add_row [ mc.code, mc.name, mi.item_code, mi.name, mi.account.title, mi.alt_name, mi.taxable, attributes, options, mii.item_instance_code, mii.item_instance_name, attribute, mii.price, mii.is_default, mi.image_path.to_s.remove("/image/menu_images/")], :style=>wrap_text
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -184,7 +184,11 @@ class Menu < ApplicationRecord
|
||||
account = Account.create({title: row["Account"], account_type: "0"})
|
||||
end
|
||||
|
||||
menu_itm = MenuItem.create(item_code: row["Item Code"], name: row["Item Name"], account_id: account.id, alt_name: row["Item AltName"], image_path: "", description: '', information: '', unit: '', type: "SimpleMenuItem", menu_category_id: menu_cat.id, item_attributes: item_attrs, item_options: item_opts, is_sub_item: 0, is_available: 1, created_by: created_by)
|
||||
image_path = row["Image Path"] ? row["Image Path"] : ""
|
||||
puts image_path
|
||||
menu_itm = MenuItem.create(item_code: row["Item Code"], name: row["Item Name"], account_id: account.id, alt_name: row["Item AltName"], image_path: image_path.to_s, description: '', information: '', unit: '', type: "SimpleMenuItem", menu_category_id: menu_cat.id, item_attributes: item_attrs, item_options: item_opts, is_sub_item: 0, is_available: 1, created_by: created_by)
|
||||
puts "menu_itm"
|
||||
puts menu_itm.to_json
|
||||
# else
|
||||
# status = status + "Item Code already exists for " + row["Item Name"] + "."
|
||||
end
|
||||
|
||||
@@ -825,55 +825,6 @@ delete from sym_node;
|
||||
values('order_queue_stations','sx_2_cloud', 200, current_timestamp, current_timestamp);
|
||||
# End Oqs Channel
|
||||
|
||||
### Batch Monitoring ######
|
||||
|
||||
#Monitor#
|
||||
insert into sym_monitor (monitor_id, node_group_id, external_id, type, threshold, run_period, run_count, severity_level, enabled, create_time, last_update_by, last_update_time)
|
||||
value ('SystemBatchErrorMonitor', 'All', 'All', 'batchError', 1, 1, 1, 300, 1, now(), 'admin', now());
|
||||
|
||||
insert into sym_monitor (monitor_id, node_group_id, external_id, type, threshold, run_period, run_count, severity_level, enabled, create_time, last_update_by, last_update_time)
|
||||
value ('SystemBatchUnsendMonitor', 'All', 'All', 'batchUnsent', 10, 1, 1, 100, 1, now(), 'admin', now());
|
||||
|
||||
insert into sym_monitor (monitor_id, node_group_id, external_id, type, threshold, run_period, run_count, severity_level, enabled, create_time, last_update_by, last_update_time)
|
||||
value ('SystemLogMonitor', 'All', 'All', 'log', 1, 1, 1, 300, 1, now(), 'admin', now());
|
||||
|
||||
#Parameter#
|
||||
insert into sym_parameter (external_id, node_group_id, param_key, param_value, create_time, last_update_by, last_update_time)
|
||||
value ('All', 'All', 'smtp.allow.untrusted.cert', 'true', now(), 'admin', now());
|
||||
|
||||
insert into sym_parameter (external_id, node_group_id, param_key, param_value, create_time, last_update_by, last_update_time)
|
||||
value ('All', 'All', 'smtp.auth', 'true', now(), 'admin', now());
|
||||
|
||||
insert into sym_parameter (external_id, node_group_id, param_key, param_value, create_time, last_update_by, last_update_time)
|
||||
value ('All', 'All', 'smtp.from', 'sym_alert@smartsales.asia', now(), 'admin', now());
|
||||
|
||||
insert into sym_parameter (external_id, node_group_id, param_key, param_value, create_time, last_update_by, last_update_time)
|
||||
value ('All', 'All', 'smtp.host', 'smtp.mailgun.org', now(), 'admin', now());
|
||||
|
||||
insert into sym_parameter (external_id, node_group_id, param_key, param_value, create_time, last_update_by, last_update_time)
|
||||
value ('All', 'All', 'smtp.password', '1cc051ec3edf699d17b78e5cd14ceb6b', now(), 'admin', now());
|
||||
|
||||
insert into sym_parameter (external_id, node_group_id, param_key, param_value, create_time, last_update_by, last_update_time)
|
||||
value ('All', 'All', 'smtp.port', '465', now(), 'admin', now());
|
||||
|
||||
insert into sym_parameter (external_id, node_group_id, param_key, param_value, create_time, last_update_by, last_update_time)
|
||||
value ('All', 'All', 'smtp.starttls', 'false', now(), 'admin', now());
|
||||
|
||||
insert into sym_parameter (external_id, node_group_id, param_key, param_value, create_time, last_update_by, last_update_time)
|
||||
value ('All', 'All', 'smtp.transport', 'smtps', now(), 'admin', now());
|
||||
|
||||
insert into sym_parameter (external_id, node_group_id, param_key, param_value, create_time, last_update_by, last_update_time)
|
||||
value ('All', 'All', 'smtp.user', 'postmaster@smartsales.asia', now(), 'admin', now());
|
||||
|
||||
insert into sym_notification (notification_id, node_group_id, external_id, severity_level, type, expression, enabled, create_time, last_update_by, last_update_time)
|
||||
value ('notify_info', 'ALL', 'ALL', 100, 'email', 'info@connect.smartsales.asia', 1, now(), 'admin', now());
|
||||
|
||||
insert into sym_notification (notification_id, node_group_id, external_id, severity_level, type, expression, enabled, create_time, last_update_by, last_update_time)
|
||||
value ('notify_severe', 'ALL', 'ALL', 300, 'email', 'info@connect.smartsales.asia', 1, now(), 'admin', now());
|
||||
|
||||
|
||||
|
||||
### End of Batch Monitoring ####
|
||||
|
||||
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');
|
||||
|
||||
Reference in New Issue
Block a user