diff --git a/app/controllers/origami/shifts_controller.rb b/app/controllers/origami/shifts_controller.rb index 079b9e80..8649a0db 100644 --- a/app/controllers/origami/shifts_controller.rb +++ b/app/controllers/origami/shifts_controller.rb @@ -29,6 +29,7 @@ class Origami::ShiftsController < BaseOrigamiController end end + def edit end end diff --git a/app/models/shift_sale.rb b/app/models/shift_sale.rb index 5372864f..aa5265a2 100644 --- a/app/models/shift_sale.rb +++ b/app/models/shift_sale.rb @@ -52,4 +52,10 @@ class ShiftSale < ApplicationRecord self.save end + + def get_closing_balance(shift) + shiftobj = ShiftSale.find(shift) + closing_balance = shiftobj.grand_total + shiftobj.cash_in - shiftobj.cash_out + shiftobj.total_cash + return closing_balance + end end