Class: HrLite::LoansController

Inherits:
ApplicationController show all
Defined in:
app/controllers/hr_lite/loans_controller.rb

Overview

What an employee owes and what is coming out of the next payslip. Read only: a loan is agreed with the company, not self-served.

Instance Method Summary collapse

Instance Method Details

#indexObject



5
6
7
8
9
# File 'app/controllers/hr_lite/loans_controller.rb', line 5

def index
  @loans = Loan.where(user_id: hr_current_user.id).order(starts_on: :desc)
  @outstanding = @loans.sum(BigDecimal(0), &:outstanding)
  @next_month = Date.current.next_month.beginning_of_month
end