Class: EmailParams::EmployeesWithoutTimesheetsEmailParams

Inherits:
BaseEmailParams
  • Object
show all
Defined in:
app/notifications/email_params/employees_without_timesheets_email_params.rb

Instance Attribute Summary

Attributes inherited from BaseEmailParams

#event_notification_configuration, #recipient, #reference_event

Instance Method Summary collapse

Methods inherited from BaseEmailParams

#from, #initialize, #template_name, #to

Constructor Details

This class inherits a constructor from EmailParams::BaseEmailParams

Instance Method Details

#company_nameObject



11
12
13
# File 'app/notifications/email_params/employees_without_timesheets_email_params.rb', line 11

def company_name
  company.company_name_e
end

#days_remaining_in_payroll_periodObject



35
36
37
# File 'app/notifications/email_params/employees_without_timesheets_email_params.rb', line 35

def days_remaining_in_payroll_period
  company.payroll_periods.find(payroll_period_id).remaining_days_count
end

#dearObject



7
8
9
# File 'app/notifications/email_params/employees_without_timesheets_email_params.rb', line 7

def dear
  recipient.user_name
end

#employees_urlObject



15
16
17
# File 'app/notifications/email_params/employees_without_timesheets_email_params.rb', line 15

def employees_url
  "#{AppMode.payroll.web_uri}/app/payroll/employees"
end

#employees_without_timesheetsObject



23
24
25
26
27
28
29
30
31
32
33
# File 'app/notifications/email_params/employees_without_timesheets_email_params.rb', line 23

def employees_without_timesheets
  company.employees.without_timesheets_for_period(payroll_period_id).as_json(
    only: [
      :employee_name,
      :employee_id
    ],
    methods: [
      :url
    ]
  )
end

#employees_without_timesheets_countObject



19
20
21
# File 'app/notifications/email_params/employees_without_timesheets_email_params.rb', line 19

def employees_without_timesheets_count
  company.employees.without_timesheets_for_period(payroll_period_id).count
end

#formatted_event_start_dateObject



39
40
41
# File 'app/notifications/email_params/employees_without_timesheets_email_params.rb', line 39

def formatted_event_start_date
  reference_event.formatted_created_date
end

#formatted_payroll_period_end_dateObject



47
48
49
# File 'app/notifications/email_params/employees_without_timesheets_email_params.rb', line 47

def formatted_payroll_period_end_date
  payroll_period.formatted_end_date
end

#formatted_payroll_period_start_dateObject



43
44
45
# File 'app/notifications/email_params/employees_without_timesheets_email_params.rb', line 43

def formatted_payroll_period_start_date
  payroll_period.formatted_start_date
end

#subjectObject



3
4
5
# File 'app/notifications/email_params/employees_without_timesheets_email_params.rb', line 3

def subject
  I18n.t('emails.employees_without_timesheets.subject')
end