Merge branch 'adminbsb_ui_changes' of bitbucket.org:code2lab/sxrestaurant

This commit is contained in:
phyusin
2018-06-05 15:39:43 +06:30
5 changed files with 17 additions and 18 deletions

View File

@@ -157,15 +157,3 @@ $(document).ready(function() {
}
//end Notificaiotn message
});
/* start order reservation function */
function audioPlayBackground(shop_code,audio){
// console.log(shop_code);
//audio play
var audio = new Audio('/'+audio); // define your audio
// setTimeout(function(){
// audio.loop = true;
audio.play();
// },10000);
}
/* end order reservation function */

View File

@@ -579,4 +579,16 @@ function timeFormat(date){
(isPM ? ' PM' : ' AM');
return time;
}
/* end order reservation function */
/* start order reservation function */
function audioPlayBackground(shop_code,audio){
// console.log(shop_code);
//audio play
var audio = new Audio('/'+audio); // define your audio
// setTimeout(function(){
// audio.loop = true;
audio.play();
// },10000);
}
/* end order reservation function */

View File

@@ -15,7 +15,6 @@
//= require BSBMaterial/turbolink_admin.js
//= require BSBMaterial/demo.js
//= require custom.js
//= require order_reservation.js
/* Constant Varaibles */
_CREDIT_PAYMENTS_ = "/   CREDIT PAYMENTS";

View File

@@ -16,17 +16,18 @@ class Api::OrderReserve::OrderReservationController < Api::ApiController
if status
if params[:customer_id] && !params[:customer_id].nil?
customer = OrderReservation.addCustomer(params)
customer_id = customer.id
customer_id = customer.customer_id
else
check_customer = Customer.find_by_email_and_membership_id_and_customer_type(params[:email],params[:membership_id],'Doemal')
if !check_customer.nil?
customer_id = check_customer.customer_id
else
customer = OrderReservation.addCustomer(params)
customer_id = customer.id
customer_id = customer.customer_id
end
end
if !customer_id.nil?
if customer_id.nil?
render :json => { :status => false, :message => "email and customer are already existed!" }
else
render :json => { :status => true, :data => { :customer_id => customer_id} }

View File

@@ -22,7 +22,7 @@ class OrderReservation < ApplicationRecord
else
gender = "Male"
end
if params[:customer_id].nil?
if params[:customer_id] && !params[:customer_id].nil?
customer = Customer.find(params[:customer_id])
else
customer = Customer.new
@@ -37,7 +37,6 @@ class OrderReservation < ApplicationRecord
customer.customer_type = "Doemal"
customer.tax_profiles = ["2"]
customer.save
# unless customer.valid?
# render json: {
# status: 422,