fix for tax inclusive
This commit is contained in:
@@ -196,10 +196,12 @@ end
|
||||
# PATCH/PUT /crm/customers/1
|
||||
# PATCH/PUT /crm/customers/1.json
|
||||
def update
|
||||
|
||||
# Remove "" default first
|
||||
params[:customer][:tax_profiles].delete_at(0)
|
||||
respond_to do |format|
|
||||
if @crm_customer.update(customer_params)
|
||||
|
||||
# update tax profile
|
||||
@crm_customer.update_attributes(tax_profiles: params[:customer][:tax_profiles])
|
||||
name = customer_params[:name]
|
||||
phone = customer_params[:contact_no]
|
||||
email = customer_params[:email]
|
||||
|
||||
@@ -290,14 +290,13 @@ class Sale < ApplicationRecord
|
||||
sale_tax.tax_payable_amount = total_tax / 21
|
||||
else
|
||||
sale_tax.tax_payable_amount = total_tax * tax.rate / 100
|
||||
total_tax_amount = total_tax_amount + sale_tax.tax_payable_amount
|
||||
end
|
||||
#new taxable amount is standard rule for step by step
|
||||
# total_taxable = total_taxable + sale_tax.tax_payable_amount
|
||||
|
||||
sale_tax.inclusive = tax.inclusive
|
||||
sale_tax.save
|
||||
|
||||
total_tax_amount = total_tax_amount + sale_tax.tax_payable_amount
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -334,6 +333,7 @@ class Sale < ApplicationRecord
|
||||
sale_tax.tax_payable_amount = total_tax / 21
|
||||
else
|
||||
sale_tax.tax_payable_amount = total_tax * tax.rate / 100
|
||||
total_tax_amount = total_tax_amount + sale_tax.tax_payable_amount
|
||||
end
|
||||
|
||||
#new taxable amount is standard rule for step by step
|
||||
@@ -341,8 +341,6 @@ class Sale < ApplicationRecord
|
||||
|
||||
sale_tax.inclusive = tax.inclusive
|
||||
sale_tax.save
|
||||
|
||||
total_tax_amount = total_tax_amount + sale_tax.tax_payable_amount
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= dashboard_path %>">Home</a></li>
|
||||
<li>Credit Payment List Report</li>
|
||||
<li>Void Sale Report</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user