update fixed conflicx

This commit is contained in:
Aung Myo
2017-11-25 16:51:11 +06:30
17 changed files with 69 additions and 100 deletions

View File

@@ -20,7 +20,7 @@ class SalePayment < ApplicationRecord
end
end
if (amount_due > 0)
if (amount_due >= 0)
payment_status = false
#route to payment type
case payment_method

View File

@@ -54,7 +54,7 @@ class ShiftSale < ApplicationRecord
self.cash_sales = self.cash_sales.to_f + cash.to_f
self.credit_sales = self.credit_sales.to_i + credit.to_f
self.other_sales = self.other_sales.to_i + other_sales.to_f
self.nett_sales = self.nett_sales + saleobj.total_amount.to_f #self.grand_total.to_i - self.commercial_taxes
self.nett_sales = self.nett_sales + (saleobj.total_amount.to_f - self.total_discounts) #self.grand_total.to_i - self.commercial_taxes
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
@@ -81,7 +81,7 @@ class ShiftSale < ApplicationRecord
self.cash_sales = self.cash_sales.to_f - cash.to_f
self.credit_sales = self.credit_sales.to_i - credit.to_f
self.other_sales = self.other_sales.to_i - other_sales.to_f
self.nett_sales = self.nett_sales - saleobj.total_amount.to_f #self.grand_total.to_i - self.commercial_taxes
self.nett_sales = self.nett_sales - (saleobj.total_amount.to_f - self.total_discounts) #self.grand_total.to_i - self.commercial_taxes
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