sale tax order by

This commit is contained in:
phyusin
2018-11-16 15:45:16 +06:30
parent eaa1a693a2
commit b678d156f3

View File

@@ -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 = []