Add total waste and spoil in close cashier and Closing Balance မွာ Character ေတြ ရိုက္လို႕ရေန

This commit is contained in:
San Wai Lwin
2018-05-14 15:31:00 +06:30
parent 49319d80cc
commit 8fda04372d
32 changed files with 549 additions and 205 deletions

View File

@@ -94,11 +94,6 @@ class ShiftSale < ApplicationRecord
end
end
def self.get_total_waste(shift)
total_waste = Sale.select(" SUM(grand_total) as total_waste")
.where("sales.payment_status ='waste' and sale_status = 'waste'", shift.id)
end
def get_closing_balance(shift)
shiftobj = ShiftSale.find(shift)
closing_balance = shiftobj.grand_total + shiftobj.cash_in - shiftobj.cash_out + shiftobj.total_cash