uncomment for sale taxes
This commit is contained in:
@@ -23,6 +23,8 @@ class Sale < ApplicationRecord
|
|||||||
if (booking)
|
if (booking)
|
||||||
Rails.logger.debug "Booking -> Booking Order Count -> " + booking.booking_orders.count.to_s
|
Rails.logger.debug "Booking -> Booking Order Count -> " + booking.booking_orders.count.to_s
|
||||||
#get all order attached to this booking and combine into 1 invoice
|
#get all order attached to this booking and combine into 1 invoice
|
||||||
|
|
||||||
|
puts booking.booking_orders.length
|
||||||
booking.booking_orders.each do |order|
|
booking.booking_orders.each do |order|
|
||||||
if booking.sale_id
|
if booking.sale_id
|
||||||
status, sale_id = generate_invoice_from_order(order.order_id, nil, booking, requested_by)
|
status, sale_id = generate_invoice_from_order(order.order_id, nil, booking, requested_by)
|
||||||
@@ -195,28 +197,28 @@ class Sale < ApplicationRecord
|
|||||||
existing_tax.delete
|
existing_tax.delete
|
||||||
end
|
end
|
||||||
|
|
||||||
# total_tax_amount = 0
|
total_tax_amount = 0
|
||||||
# #tax_profile - list by order_by
|
#tax_profile - list by order_by
|
||||||
# tax_profiles = TaxProfile.all.order("order_by asc")
|
tax_profiles = TaxProfile.all.order("order_by asc")
|
||||||
|
|
||||||
# #Creat new tax records
|
# #Creat new tax records
|
||||||
# tax_profiles.each do |tax|
|
tax_profiles.each do |tax|
|
||||||
# sale_tax = SaleTax.new(:sale => self)
|
sale_tax = SaleTax.new(:sale => self)
|
||||||
# sale_tax.tax_name = tax.name
|
sale_tax.tax_name = tax.name
|
||||||
# sale_tax.tax_rate = tax.rate
|
sale_tax.tax_rate = tax.rate
|
||||||
# #include or execulive
|
#include or execulive
|
||||||
# # sale_tax.tax_payable_amount = total_taxable * tax.rate
|
# sale_tax.tax_payable_amount = total_taxable * tax.rate
|
||||||
# sale_tax.tax_payable_amount = total_taxable * tax.rate / 100
|
sale_tax.tax_payable_amount = total_taxable * tax.rate / 100
|
||||||
# #new taxable amount
|
#new taxable amount
|
||||||
# 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
|
total_tax_amount = total_tax_amount + sale_tax.tax_payable_amount
|
||||||
# end
|
end
|
||||||
|
|
||||||
# self.total_tax = total_tax_amount
|
self.total_tax = total_tax_amount
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user