bookyt_salary 0.19.4 → 0.20.0
Sign up to get free protection for your applications and to get access to all the features.
- data/app/controllers/salary_reports_controller.rb +12 -0
- data/app/models/bookyt_salary/employee.rb +3 -0
- data/app/views/salary_reports/yearly_ahv_statement.html.haml +3 -0
- data/config/locales/bookyt_salary.de.yml +6 -1
- data/config/routes.rb +1 -0
- data/lib/bookyt_salary/version.rb +1 -1
- metadata +2 -2
@@ -9,4 +9,16 @@ class SalaryReportsController < ApplicationController
|
|
9
9
|
|
10
10
|
@employments = Employment.valid_during(@value_period).all
|
11
11
|
end
|
12
|
+
|
13
|
+
def salary_declaration
|
14
|
+
@value_period = Date.parse(params[:by_value_period][:from] || Date.today.beginning_of_year)..Date.parse(params[:by_value_period][:to] || Date.today.end_of_year) if params[:by_value_period]
|
15
|
+
@value_period ||= Date.today.beginning_of_year..Date.today.end_of_year
|
16
|
+
|
17
|
+
@employee = Employee.find(params[:employee_id])
|
18
|
+
@salaries = @employee.salaries.where(:value_date => @value_period)
|
19
|
+
@line_items = @salaries.collect{|salary| salary.line_items}.flatten
|
20
|
+
|
21
|
+
# TODO: better sorting
|
22
|
+
@salary_declaration_codes = SalaryBookingTemplate.pluck(:salary_declaration_code).uniq.select{|code| code.present?}
|
23
|
+
end
|
12
24
|
end
|
@@ -12,6 +12,7 @@
|
|
12
12
|
%th.currency ALV-Lohn
|
13
13
|
%th.currency ALVZ-Lohn
|
14
14
|
%th M/F
|
15
|
+
%th.action-links
|
15
16
|
%tbody
|
16
17
|
- ahv_total = 0
|
17
18
|
- for employment in @employments
|
@@ -27,6 +28,7 @@
|
|
27
28
|
%td.currency= currency_fmt(ahv_amount)
|
28
29
|
%td.currency= currency_fmt(0)
|
29
30
|
%td= employment.employee.sex_to_s
|
31
|
+
%td.action-links= link_to t_action(:salary_declaration), salary_declaration_path(:employee_id => employment.employee, :by_value_period => params[:by_value_period])
|
30
32
|
|
31
33
|
%tfoot
|
32
34
|
%tr
|
@@ -36,6 +38,7 @@
|
|
36
38
|
%th.currency= currency_fmt(ahv_total)
|
37
39
|
%th.currency= currency_fmt(0)
|
38
40
|
%th
|
41
|
+
%th.action-links
|
39
42
|
|
40
43
|
- content_for :sidebar do
|
41
44
|
.sub-tabs
|
@@ -48,9 +48,14 @@ de:
|
|
48
48
|
salary_reports:
|
49
49
|
yearly_ahv_statement:
|
50
50
|
title: AHV Lohnbescheinigung
|
51
|
+
salary_declaration:
|
52
|
+
title: Lohnausweis
|
51
53
|
|
52
54
|
overview:
|
53
55
|
bookyt:
|
54
56
|
overview:
|
55
57
|
title:
|
56
|
-
title: Übersicht
|
58
|
+
title: Übersicht
|
59
|
+
crud:
|
60
|
+
action:
|
61
|
+
salary_declaration: Lohnausweis
|
data/config/routes.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bookyt_salary
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.20.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-11-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|