update customer tax calc
This commit is contained in:
@@ -277,8 +277,8 @@ class Sale < ApplicationRecord
|
||||
|
||||
# #Creat new tax records
|
||||
tax_profiles.each do |tax|
|
||||
customer.tax_profiles.each do |cus_tax|
|
||||
if cus_tax == tax.id
|
||||
customer.tax_profiles.each do |cus_tax|
|
||||
if cus_tax.to_i == tax.id
|
||||
sale_tax = SaleTax.new(:sale => sale)
|
||||
sale_tax.tax_name = tax.name
|
||||
sale_tax.tax_rate = tax.rate
|
||||
@@ -318,10 +318,11 @@ class Sale < ApplicationRecord
|
||||
tax_profiles = TaxProfile.all.order("order_by asc")
|
||||
|
||||
customer = Customer.find(self.customer_id)
|
||||
|
||||
# #Create new tax records
|
||||
tax_profiles.each do |tax|
|
||||
customer.tax_profiles.each do |cus_tax|
|
||||
if cus_tax == tax.id
|
||||
if cus_tax.to_i == tax.id
|
||||
sale_tax = SaleTax.new(:sale => self)
|
||||
sale_tax.tax_name = tax.name
|
||||
sale_tax.tax_rate = tax.rate
|
||||
|
||||
Reference in New Issue
Block a user