add customer at first
This commit is contained in:
@@ -33,7 +33,7 @@ class Foodcourt::CustomersController < BaseFoodcourtController
|
||||
@crm_customers.membership_id = response["customer_data"]["id"]
|
||||
@crm_customers.membership_type = response["customer_data"]["member_group_id"]
|
||||
@crm_customers.customer_type = "Dinein"
|
||||
@crm_customers.tax_profiles = ["1", "2"]
|
||||
@crm_customers.tax_profiles = TaxProfile.where(group_type: 'food_court').pluck(:id)
|
||||
@crm_customers.save
|
||||
@crm_customers = Customer.search(filter)
|
||||
else
|
||||
|
||||
@@ -240,7 +240,7 @@ class Foodcourt::DiscountsController < BaseFoodcourtController
|
||||
# if is_card != "true"
|
||||
account_types = Account.where("discount=?",true)
|
||||
table_id = sale.bookings[0].dining_facility_id
|
||||
table_type = DiningFacility.find(table_id).type
|
||||
# table_type = DiningFacility.find(table_id).type
|
||||
|
||||
# Get Prices for each accounts (eg: food, beverage)
|
||||
account_price = SaleItem.calculate_price_by_accounts(sale.sale_items)
|
||||
@@ -279,7 +279,7 @@ class Foodcourt::DiscountsController < BaseFoodcourtController
|
||||
auth_token:auth_token}.to_json,
|
||||
:headers => {
|
||||
'Content-Type' => 'application/json',
|
||||
'Accept' => 'application/json; version=3'
|
||||
'Accept' => 'application/json; version=4'
|
||||
}, :timeout => 10)
|
||||
rescue HTTParty::Error
|
||||
response = {"status": false, "message": "Http party error" }
|
||||
@@ -304,11 +304,11 @@ class Foodcourt::DiscountsController < BaseFoodcourtController
|
||||
discount_amount = discount_amount + response["discount_bonus_earned"]
|
||||
end
|
||||
sale.compute_by_sale_items(discount_amount, 'member_discount', order_source, tax_type)
|
||||
result = {:status=> "Success",:title=>"Member Discount", :table_id => table_id,:table_type => table_type }
|
||||
result = {:status=> "Success",:title=>"Member Discount", :table_id => table_id }
|
||||
elsif response["status"] == "500"
|
||||
result = {:status=> response["error"],:title=>"Alert", :table_id => table_id,:table_type => table_type }
|
||||
result = {:status=> response["error"],:title=>"Alert", :table_id => table_id }
|
||||
else
|
||||
result = {:status=> response["message"],:title=>"Alert", :table_id => table_id,:table_type => table_type }
|
||||
result = {:status=> response["message"],:title=>"Alert", :table_id => table_id }
|
||||
end
|
||||
|
||||
render :json => result.to_json
|
||||
|
||||
@@ -184,7 +184,7 @@ class Foodcourt::OrdersController < BaseFoodcourtController
|
||||
end
|
||||
end
|
||||
|
||||
def request_bill
|
||||
def request_bill
|
||||
sale_data =[]
|
||||
if !ShiftSale.current_shift.nil?
|
||||
order_id = params[:order_id] # order_id
|
||||
@@ -265,7 +265,7 @@ class Foodcourt::OrdersController < BaseFoodcourtController
|
||||
@error_message = "No Current Open Shift for This Employee"
|
||||
end
|
||||
if ["quick_service", "food_court"].include? order.source
|
||||
redirect_to "/foodcourt/sale/#{sale_data.sale_id}/food_court/payment#"
|
||||
render :json => { :status => true, :sale_id => sale_data.sale_id }
|
||||
end
|
||||
#
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user