bookyt_salary 0.18.0 → 0.19.0
Sign up to get free protection for your applications and to get access to all the features.
- data/app/controllers/salaries_controller.rb +3 -0
- data/app/models/salary.rb +5 -0
- data/app/views/filters/_salary_state.html.haml +4 -0
- data/app/views/salaries/_form.html.haml +3 -0
- data/app/views/salaries/_sidebar.html.haml +1 -4
- data/app/views/salaries/payslip.pdf.prawn +30 -1
- data/config/locales/bookyt_salary.de.yml +2 -0
- data/db/migrate/20120503120833_add_unused_leave_days_to_debit_invoices.rb +5 -0
- data/lib/bookyt_salary/version.rb +1 -1
- metadata +5 -3
@@ -40,6 +40,9 @@ class SalariesController < InvoicesController
|
|
40
40
|
@salary.title = "Lohn #{month_name} #{@salary.duration_from.year} - #{@salary.employee.vcard.full_name}"
|
41
41
|
@salary.duration_to = @salary.duration_from.end_of_month
|
42
42
|
|
43
|
+
@salary.leave_days_balance = @salary.previous.leave_days_balance || 0
|
44
|
+
@salary.used_leave_days = 0
|
45
|
+
|
43
46
|
# Prebuild line items
|
44
47
|
@salary.build_line_items
|
45
48
|
|
data/app/models/salary.rb
CHANGED
@@ -7,6 +7,9 @@
|
|
7
7
|
.row-fluid
|
8
8
|
.span6= f.input :duration_from, :as => :date_field
|
9
9
|
.span6= f.input :duration_to, :as => :date_field
|
10
|
+
.row-fluid
|
11
|
+
.span6= f.input :used_leave_days, :as => :string
|
12
|
+
.span6= f.input :leave_days_balance, :as => :string
|
10
13
|
.row-fluid
|
11
14
|
.span12= f.input :text, :input_html => {:rows => 4}
|
12
15
|
.row-fluid
|
@@ -25,6 +25,8 @@ prawn_document(:filename => "#{resource.to_s}.pdf", :renderer => PayslipDocument
|
|
25
25
|
|
26
26
|
unless resource.employment.hourly_paid
|
27
27
|
pdf.move_down 20
|
28
|
+
|
29
|
+
top_y = pdf.y
|
28
30
|
pdf.text "Stundenabrechnung", :style => :bold
|
29
31
|
|
30
32
|
month_name = t('date.month_names')[@salary.duration_from.month]
|
@@ -35,7 +37,7 @@ prawn_document(:filename => "#{resource.to_s}.pdf", :renderer => PayslipDocument
|
|
35
37
|
["Aktueller Stundensaldo", "%0.2f" % @hours_saldo],
|
36
38
|
]
|
37
39
|
|
38
|
-
pdf.table rows, :width =>
|
40
|
+
pdf.table rows, :width => 8.cm do
|
39
41
|
cells.valign = :top
|
40
42
|
cells.borders = []
|
41
43
|
cells.padding_bottom = 2
|
@@ -47,6 +49,33 @@ prawn_document(:filename => "#{resource.to_s}.pdf", :renderer => PayslipDocument
|
|
47
49
|
|
48
50
|
rows(3).font_style = :bold
|
49
51
|
end
|
52
|
+
bottom_y = pdf.y
|
53
|
+
|
54
|
+
pdf.y = top_y
|
55
|
+
pdf.indent 10.cm do
|
56
|
+
pdf.text "Ferienabrechnung", :style => :bold
|
57
|
+
|
58
|
+
month_name = t('date.month_names')[@salary.duration_from.month]
|
59
|
+
rows = [
|
60
|
+
["#{t_attr(:used_leave_days)} #{month_name}", "%0.1f" % resource.used_leave_days],
|
61
|
+
[t_attr(:leave_days_balance), "%0.1f" % resource.leave_days_balance],
|
62
|
+
]
|
63
|
+
|
64
|
+
pdf.table rows, :width => 8.cm do
|
65
|
+
cells.valign = :top
|
66
|
+
cells.borders = []
|
67
|
+
cells.padding_bottom = 2
|
68
|
+
cells.padding_top = 2
|
69
|
+
|
70
|
+
columns(0).padding_left = 0
|
71
|
+
columns(0).width = 5.cm
|
72
|
+
columns(1).align = :right
|
73
|
+
|
74
|
+
rows(3).font_style = :bold
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
pdf.y = bottom_y
|
50
79
|
end
|
51
80
|
|
52
81
|
# Free text with the socical security number
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bookyt_salary
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 83
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
8
|
+
- 19
|
9
9
|
- 0
|
10
|
-
version: 0.
|
10
|
+
version: 0.19.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- "Simon H\xC3\xBCrlimann (CyT)"
|
@@ -111,6 +111,7 @@ files:
|
|
111
111
|
- app/models/salary_template.rb
|
112
112
|
- app/prawn/payslip_document.rb
|
113
113
|
- app/views/employees/_show_salaries.html.haml
|
114
|
+
- app/views/filters/_salary_state.html.haml
|
114
115
|
- app/views/salaries/_form.html.haml
|
115
116
|
- app/views/salaries/_list.html.haml
|
116
117
|
- app/views/salaries/_salary.html.haml
|
@@ -150,6 +151,7 @@ files:
|
|
150
151
|
- db/migrate/20120119223948_port_obligation_flags_to_tags.rb
|
151
152
|
- db/migrate/20120201104444_switch_to_translated_saldo_inclusion_flags.rb
|
152
153
|
- db/migrate/20120201125113_switch_line_items_to_translated_saldo_inclusion_flags.rb
|
154
|
+
- db/migrate/20120503120833_add_unused_leave_days_to_debit_invoices.rb
|
153
155
|
- db/seeds.rb
|
154
156
|
- db/seeds/locales/de-CH.rb
|
155
157
|
- lib/bookyt_salary.rb
|