diff --git a/app/models/sale.rb b/app/models/sale.rb index d283d62e..8f208dfc 100644 --- a/app/models/sale.rb +++ b/app/models/sale.rb @@ -455,12 +455,12 @@ class Sale < ApplicationRecord if !arr_tax.empty? if tax_type.nil? - tax_profiles = TaxProfile.unscoped.where(:id => arr_tax) + tax_profiles = TaxProfile.where(:id => arr_tax) else - tax_profiles = TaxProfile.unscoped.where("group_type=?",order_source) + tax_profiles = TaxProfile.where("group_type=?",order_source) end else - tax_profiles = TaxProfile.unscoped.where("group_type=?",order_source) + tax_profiles = TaxProfile.where("group_type=?",order_source) end # #Creat new tax records @@ -560,12 +560,12 @@ class Sale < ApplicationRecord if !arr_tax.empty? if tax_type.nil? - tax_profiles = TaxProfile.unscoped.where(:id => arr_tax) + tax_profiles = TaxProfile.where(:id => arr_tax) else - tax_profiles = TaxProfile.unscoped.where("group_type=?",order_source) + tax_profiles = TaxProfile.where("group_type=?",order_source) end else - tax_profiles = TaxProfile.unscoped.where("group_type=?",order_source) + tax_profiles = TaxProfile.where("group_type=?",order_source) end #Create new tax records tax_profiles.each do |tax| @@ -2977,7 +2977,7 @@ def self.get_sale_data_for_other_payment_credit(sale_id) end def unique_tax_profiles(order_source, customer_id) - tax_data = TaxProfile.unscoped.where("group_type='#{order_source}'").pluck(:id) + tax_data = TaxProfile.where("group_type='#{order_source}'").pluck(:id) customer_tax_profiles = Customer.find(customer_id).tax_profiles arr_data = []