|
|
@@ -32,10 +32,6 @@ class PreSale < ActiveRecord::Base
|
|
|
self.unit_price_w_discount = (unit_price - discount_per_unit).round(2)
|
|
|
self.discount = (discount_per_unit * quantity).round(2)
|
|
|
self.amount = (quantity * unit_price_w_discount)
|
|
|
- self.tax = 0.0
|
|
|
- if product.include_sale_tax?
|
|
|
- self.tax = ((PosConfig.first.tax_percent / 100) * amount).round(2)
|
|
|
- end
|
|
|
haggle_discount =
|
|
|
if haggle > 0
|
|
|
haggle.round(2)
|
|
|
@@ -45,6 +41,10 @@ class PreSale < ActiveRecord::Base
|
|
|
0
|
|
|
end
|
|
|
self.amount -= haggle_discount if haggle_discount.present?
|
|
|
+ self.tax = 0.0
|
|
|
+ if product.include_sale_tax?
|
|
|
+ self.tax = ((PosConfig.first.tax_percent / 100) * amount).round(2)
|
|
|
+ end
|
|
|
self.total = amount + tax
|
|
|
true
|
|
|
end
|