finished sale summary quick view

This commit is contained in:
Aung Myo
2017-08-10 11:59:15 +06:30
parent 13359cecba
commit 80d13ce1f9
8 changed files with 227 additions and 10 deletions

View File

@@ -57,6 +57,11 @@ class ShiftSale < ApplicationRecord
self.commercial_taxes = self.commercial_taxes.to_i + tax.to_f
self.total_rounding = self.total_rounding + saleobj.rounding_adjustment
self.total_receipt = self.total_receipt + 1
if saleobj.customer.customer_type == "Dinein"
self.dining_count = self.dining_count + 1
else
self.takeaway_count = self.takeaway_count + 1
end
self.save
end
@@ -79,6 +84,11 @@ class ShiftSale < ApplicationRecord
self.commercial_taxes = self.commercial_taxes.to_i - tax.to_f
self.total_rounding = self.total_rounding - saleobj.rounding_adjustment
self.total_void = self.total_void + saleobj.grand_total
if saleobj.customer.customer_type == "Dinein"
self.dining_count = self.dining_count - 1
else
self.takeaway_count = self.takeaway_count - 1
end
self.save
end
end