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 !arr_tax.empty?
if tax_type.nil? if tax_type.nil?
tax_profiles = TaxProfile.unscoped.where(:id => arr_tax) tax_profiles = TaxProfile.where(:id => arr_tax)
else else
tax_profiles = TaxProfile.unscoped.where("group_type=?",order_source) tax_profiles = TaxProfile.where("group_type=?",order_source)
end end
else else
tax_profiles = TaxProfile.unscoped.where("group_type=?",order_source) tax_profiles = TaxProfile.where("group_type=?",order_source)
end end
# #Creat new tax records # #Creat new tax records
@@ -560,12 +560,12 @@ class Sale < ApplicationRecord
if !arr_tax.empty? if !arr_tax.empty?
if tax_type.nil? if tax_type.nil?
tax_profiles = TaxProfile.unscoped.where(:id => arr_tax) tax_profiles = TaxProfile.where(:id => arr_tax)
else else
tax_profiles = TaxProfile.unscoped.where("group_type=?",order_source) tax_profiles = TaxProfile.where("group_type=?",order_source)
end end
else else
tax_profiles = TaxProfile.unscoped.where("group_type=?",order_source) tax_profiles = TaxProfile.where("group_type=?",order_source)
end end
#Create new tax records #Create new tax records
tax_profiles.each do |tax| tax_profiles.each do |tax|
@@ -2977,7 +2977,7 @@ def self.get_sale_data_for_other_payment_credit(sale_id)
end end
def unique_tax_profiles(order_source, customer_id) 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 customer_tax_profiles = Customer.find(customer_id).tax_profiles
arr_data = [] arr_data = []