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