From b678d156f35b00ee6790373b8ba8acacb974956e Mon Sep 17 00:00:00 2001 From: phyusin Date: Fri, 16 Nov 2018 15:45:16 +0630 Subject: [PATCH] sale tax order by --- app/models/sale.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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 = []