diff --git a/app/controllers/api/order_reserve/order_reservation_controller.rb b/app/controllers/api/order_reserve/order_reservation_controller.rb index 0093409c..957b84a9 100644 --- a/app/controllers/api/order_reserve/order_reservation_controller.rb +++ b/app/controllers/api/order_reserve/order_reservation_controller.rb @@ -2,7 +2,7 @@ class Api::OrderReserve::OrderReservationController < Api::ApiController # skip_before_action :authenticate ORDER = "order" RESERVATION = "reservation" - ORDER_RESERVATION = "order and reservation" + ORDER_RESERVATION = "order_and_reservation" def check_customer customer_id = 0 @@ -42,6 +42,8 @@ class Api::OrderReserve::OrderReservationController < Api::ApiController else status = true end + elsif !params[:callback_url] + render :json => { :status => false, :message => "callback_url is required!" } end if status == true diff --git a/app/controllers/origami/movetable_controller.rb b/app/controllers/origami/movetable_controller.rb index d6d1fc61..9cacd8f4 100755 --- a/app/controllers/origami/movetable_controller.rb +++ b/app/controllers/origami/movetable_controller.rb @@ -71,8 +71,10 @@ class Origami::MovetableController < BaseOrigamiController booking.booking_orders.each do |booking_order| order = Order.find(booking_order.order_id) - order.order_items.each do |order_item| - order_items.push(order_item) + if order.status == 'new' + order.order_items.each do |order_item| + order_items.push(order_item) + end end end end diff --git a/app/models/customer.rb b/app/models/customer.rb index 2ece4330..3eb51a24 100755 --- a/app/models/customer.rb +++ b/app/models/customer.rb @@ -360,7 +360,7 @@ class Customer < ApplicationRecord customer.contact_no = params[:contact_no] customer.gender = params[:gender] customer.address = params[:address] - customer.date_of_birth = Time.parse(params[:date_of_birth]).strftime("%Y-%m-%d") + customer.date_of_birth = params[:date_of_birth] ? Time.parse(params[:date_of_birth]).strftime("%Y-%m-%d") : '' customer.membership_id = params[:membership_id] customer.customer_type = "Takeaway" customer.tax_profiles = ["2"] diff --git a/app/models/order_reservation.rb b/app/models/order_reservation.rb index 0be5e4c8..84821314 100644 --- a/app/models/order_reservation.rb +++ b/app/models/order_reservation.rb @@ -13,6 +13,7 @@ class OrderReservation < ApplicationRecord order_reservation.customer_id = params[:cus_info] order_reservation.requested_time = Time.parse(params[:requested_time]).utc.strftime("%Y-%m-%d %H:%M:%S") if params[:order_info] + order_reservation.callback_url = params[:order_info][:callback_url] order_reservation.item_count = params[:order_info][:items].count order_reservation.payment_type = params[:payment_info][:payment_type] order_reservation.payment_status = params[:payment_info][:payment_status] @@ -21,7 +22,7 @@ class OrderReservation < ApplicationRecord order_reservation.total_tax = params[:payment_info][:total_tax] order_reservation.discount_amount = params[:payment_info][:discount_amount] order_reservation.grand_total = params[:payment_info][:grand_total] - order_reservation.order_remark = params[:payment_info][:order_remark] + order_reservation.order_remark = params[:order_info][:order_remark] end if params[:reservation_info] order_reservation.total_customer = params[:reservation_info][:total_user] diff --git a/app/views/reports/receipt_no/index.html.erb b/app/views/reports/receipt_no/index.html.erb index 9eee6ab9..567b056b 100755 --- a/app/views/reports/receipt_no/index.html.erb +++ b/app/views/reports/receipt_no/index.html.erb @@ -107,7 +107,7 @@ <%end%>