Pull from master
This commit is contained in:
@@ -412,13 +412,15 @@ class Sale < ApplicationRecord
|
||||
|
||||
# Tax Re-Calculte
|
||||
def compute_tax(sale, total_taxable, total_discount = 0, order_source = nil, tax_type=nil)
|
||||
shop = Shop.first();
|
||||
shop = Shop.first
|
||||
|
||||
#if tax is not apply create new record
|
||||
SaleTax.where("sale_id='#{sale.sale_id}'").find_each do |existing_tax|
|
||||
#delete existing and create new
|
||||
existing_tax.delete
|
||||
end
|
||||
# SaleTax.where("sale_id='#{sale.sale_id}'").find_each do |existing_tax|
|
||||
# #delete existing and create new
|
||||
# existing_tax.delete
|
||||
# end
|
||||
taxes = SaleTax.where("sale_id='#{sale.sale_id}'").pluck(:sale_tax_id)
|
||||
SaleTax.where("sale_tax_id IN (?)", taxes).destroy_all
|
||||
|
||||
total_tax_amount = 0
|
||||
tax_incl_exec = "exclusive"
|
||||
@@ -495,7 +497,7 @@ class Sale < ApplicationRecord
|
||||
|
||||
# Tax Calculate
|
||||
def apply_tax(total_taxable, order_source = nil)
|
||||
shop = Shop.first();
|
||||
shop = Shop.first
|
||||
|
||||
#if tax is not apply create new record
|
||||
SaleTax.where("sale_id='#{self.sale_id}'").find_each do |existing_tax|
|
||||
|
||||
Reference in New Issue
Block a user