add inclc in receipt bill
This commit is contained in:
@@ -421,7 +421,7 @@ class Sale < ApplicationRecord
|
||||
end
|
||||
|
||||
total_tax_amount = 0
|
||||
tax_incl_exec = "execulsive"
|
||||
tax_incl_exec = "exclusive"
|
||||
#tax_profile - list by order_by
|
||||
tax_profiles = TaxProfile.all.order("order_by asc")
|
||||
customer = Customer.find(sale.customer_id)
|
||||
@@ -440,6 +440,7 @@ class Sale < ApplicationRecord
|
||||
total_tax = total_taxable - total_discount
|
||||
#include or execulive
|
||||
if tax.inclusive
|
||||
tax_incl_exec = "inclusive"
|
||||
rate = tax.rate
|
||||
divided_value = (100 + rate)/rate
|
||||
sale_tax.tax_payable_amount = total_tax / divided_value
|
||||
@@ -465,6 +466,7 @@ class Sale < ApplicationRecord
|
||||
total_tax = total_taxable - total_discount
|
||||
#include or execulive
|
||||
if tax.inclusive
|
||||
tax_incl_exec = "inclusive"
|
||||
rate = tax.rate
|
||||
divided_value = (100 + rate)/rate
|
||||
sale_tax.tax_payable_amount = total_tax / divided_value
|
||||
@@ -484,7 +486,7 @@ class Sale < ApplicationRecord
|
||||
end
|
||||
end
|
||||
end
|
||||
sale.tax_type =
|
||||
sale.tax_type = tax_incl_exec
|
||||
sale.total_tax = total_tax_amount
|
||||
end
|
||||
|
||||
@@ -499,6 +501,7 @@ class Sale < ApplicationRecord
|
||||
end
|
||||
|
||||
total_tax_amount = 0
|
||||
tax_incl_exec = "exclusive"
|
||||
#tax_profile - list by order_by
|
||||
tax_profiles = TaxProfile.all.order("order_by asc")
|
||||
|
||||
@@ -520,6 +523,7 @@ class Sale < ApplicationRecord
|
||||
total_tax = total_taxable - self.total_discount
|
||||
#include or execulive
|
||||
if tax.inclusive
|
||||
tax_incl_exec = "inclusive"
|
||||
rate = tax.rate
|
||||
divided_value = (100 + rate)/rate
|
||||
sale_tax.tax_payable_amount = total_tax / divided_value
|
||||
@@ -539,6 +543,7 @@ class Sale < ApplicationRecord
|
||||
# end
|
||||
end
|
||||
end
|
||||
self.tax_type = tax_incl_exec
|
||||
self.total_tax = total_tax_amount
|
||||
end
|
||||
|
||||
|
||||
@@ -304,7 +304,7 @@ class ReceiptBillA5Pdf < Prawn::Document
|
||||
|
||||
if sale_data.sale_taxes.length > 0
|
||||
incl_tax = ""
|
||||
if sale_data.tax_type == "inculsive"
|
||||
if sale_data.tax_type == "inclusive"
|
||||
incl_tax = "Incl."
|
||||
end
|
||||
sale_data.sale_taxes.each do |st|
|
||||
|
||||
@@ -291,7 +291,7 @@ class ReceiptBillPdf < Prawn::Document
|
||||
|
||||
if sale_data.sale_taxes.length > 0
|
||||
incl_tax = ""
|
||||
if sale_data.tax_type == "inculsive"
|
||||
if sale_data.tax_type == "inclusive"
|
||||
incl_tax = "Incl."
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user