add tax in charges

This commit is contained in:
phyusin
2018-03-22 11:09:12 +06:30
parent b8a71079f4
commit ebadfff25b
3 changed files with 6 additions and 4 deletions

View File

@@ -361,7 +361,6 @@ class Sale < ApplicationRecord
end
end
compute_tax(sale, total_taxable, total_discount, order_source)
sale.total_amount = subtotal_price
sale.total_discount = total_discount
sale.grand_total = (sale.total_amount - sale.total_discount) + sale.total_tax
@@ -372,8 +371,9 @@ class Sale < ApplicationRecord
# adjust_rounding
sale.rounding_adjustment = compute_adjust_rounding(sale.grand_total)
sale.save!
compute_tax(sale, total_taxable, total_discount, order_source)
sale.save!
end
# No Use too many wrong
@@ -454,6 +454,7 @@ class Sale < ApplicationRecord
# end
end
end
sale.total_tax = total_tax_amount
end