This commit is contained in:
Myat Zin Wai Maw
2020-01-13 15:08:04 +06:30
parent 45326750db
commit d794e023b8
6 changed files with 124 additions and 6 deletions

View File

@@ -25,7 +25,7 @@ class Customer < ApplicationRecord
self.email = pin.to_s + "@gmail.com"
self.pin_code = pin.to_s
self.pin_sent_at = Time.now
tax_profiles=TaxProfile.where(group_type: "food_court")
tax_profiles=TaxProfile.where(group_type: "online_order")
tax_ids =[]
tax_profiles.each {|tax| tax_ids << "#{tax.id}"}
self.tax_profiles = tax_ids

View File

@@ -528,7 +528,7 @@ class Sale < ApplicationRecord
if order_source.to_s == "emenu"
order_source = "cashier"
elsif order_source.to_s == "app"
order_source = "food_court"
order_source = "online_order"
end
tax_profiles = unique_tax_profiles(order_source, self.customer_id)
@@ -650,7 +650,7 @@ class Sale < ApplicationRecord
if order_source.to_s == "emenu"
order_source = "cashier"
elsif order_source.to_s == "app"
order_source = "food_court"
order_source = "online_order"
end
# tax_data = TaxProfile.unscope(:order).where("group_type=?",order_source).pluck(:id)