Merge branch 'foodcourt' of https://gitlab.com/code2lab/SXRestaurant into foodcourt

This commit is contained in:
Nweni
2019-11-27 15:51:14 +06:30
14 changed files with 82 additions and 67 deletions

View File

@@ -1,5 +1,5 @@
class Origami::BankIntegrationController < ApplicationController #BaseOrigamiController
def settle_trans
if(params[:type] == 'request')
card_settle_trans = CardSettleTran.new()
@@ -35,7 +35,7 @@ class Origami::BankIntegrationController < ApplicationController #BaseOrigamiCon
card_settle_trans.save()
response = {status: 'success'}
end
render json: response
render json: response
end
def sale_trans
@@ -93,7 +93,7 @@ class Origami::BankIntegrationController < ApplicationController #BaseOrigamiCon
response = {status: 'success'}
end
render json: response
render json: response
end
end

View File

@@ -17,14 +17,14 @@ class Origami::FoodCourtController < ApplicationController
# @menus = Menu.all
# @menu = MenuCategory.active.where("menu_id =#{@menus[0].id}").order('order_by asc')
# end
@zone = Zone.all
@zone = Zone.all.where("shop_code='#{@shop.shop_code}' and is_active= true")
@customer = Customer.all
@tables = Table.all.active.order('status desc')
@rooms = Room.all.active.order('status desc')
@tables = Table.all.active.where("shop_code='#{@shop.shop_code}'").order('status desc')
@rooms = Room.all.active.where("shop_code='#{@shop.shop_code}'").order('status desc')
@cashier_type = "food_court"
#checked quick_service only
@quick_service_only = true
lookup_dine_in = Lookup.collection_of('dinein_cashier')
lookup_dine_in = Lookup.where("shop_code='#{@shop.shop_code}'").collection_of('dinein_cashier')
if !lookup_dine_in.empty?
lookup_dine_in.each do |dine_in|
if dine_in[0].downcase == "dineincashier"
@@ -156,7 +156,7 @@ class Origami::FoodCourtController < ApplicationController
end
def get_all_product()
@product = Product.all
@product = Product..where("shop_code='#{@shop.shop_code}'")
end
# render json for http status code
@@ -186,12 +186,6 @@ class Origami::FoodCourtController < ApplicationController
end
end
end
def check_user
if current_user.nil?
redirect_to root_path
end
end
# this can always true
def check_order_with_booking(booking)
if booking.sale.sale_status == "completed" || booking.sale.sale_status == "new"

View File

@@ -33,9 +33,9 @@ class Origami::PaymalController < BaseOrigamiController
if customer_data
@membership_id = customer_data.membership_id
if !@membership_id.nil?
membership_setting = MembershipSetting.find_by_membership_type("paypar_url")
membership_setting = MembershipSetting.find_by_membership_type_and_shop_code("paypar_url",@shop.shop_code)
if membership_setting.gateway_url
member_actions =MembershipAction.find_by_membership_type("get_account_balance")
member_actions =MembershipAction.find_by_membership_type_and_shop_code("get_account_balance",@shop.shop_code)
if member_actions.gateway_url
@campaign_type_id = nil
url = membership_setting.gateway_url.to_s + member_actions.gateway_url.to_s
@@ -72,7 +72,6 @@ def create
sale_id = params[:sale_id]
transaction_ref = params[:transaction_ref]
account_no = params[:account_no]
puts params.to_json
if(Sale.exists?(sale_id))
saleObj = Sale.find(sale_id)
# shop_details = Shop.first
@@ -87,6 +86,7 @@ def create
# saleObj = Sale.find(sale_id)
sale_payment = SalePayment.new
status, @sale,@membership_data = sale_payment.process_payment(saleObj, current_user, cash, "paymal",account_no)
if status == true && @membership_data["status"] == true
@out = true, "Success!"
else