lohnausweis 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/lohnausweis/daten.rb +1 -1
- data/lib/lohnausweis/pdf_generator.rb +34 -42
- data/lib/lohnausweis/version.rb +1 -1
- data/locale/de.yml +2 -1
- data/locale/en.yml +134 -0
- data/mit_weiss_nicht_was_alles.pdf +1582 -215
- data/spec/lohnausweis/pdf_generator_spec.rb +28 -3
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c27f2a1bd4f53cfd0a102d63909b97e12d931fbe
|
4
|
+
data.tar.gz: 59dc6a9d903d4a8b81f8ef3a68dc29cba8a4bc33
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f56915c1b423c0ee46af2406c5215041f09a3e4479fe7e93b19129a05af8aa4f4aa79de3625a335d19464d500f541a78eb8900c343ce0a0b5f85db1dcc3e830
|
7
|
+
data.tar.gz: 785ede79119cf4ea9132d154ffe52f0cb6a86493c7097e9050d3201cb944cd9ebb59893adbb1411b8d8670edca0500763c8faa70db115b6da3dbc590dd21509d
|
data/Gemfile.lock
CHANGED
data/lib/lohnausweis/daten.rb
CHANGED
@@ -25,12 +25,11 @@ module Planik
|
|
25
25
|
next_y = 750
|
26
26
|
next_y = header_new(next_y)
|
27
27
|
next_y -= 50
|
28
|
-
next_y = arbeitsliste_new(next_y)
|
29
|
-
next_y -= 50
|
30
28
|
next_y = arbeitszeit_block(next_y)
|
31
|
-
|
32
29
|
next_y -= 50
|
33
|
-
zulagen_block(next_y)
|
30
|
+
next_y = zulagen_block(next_y)
|
31
|
+
next_y -= 50
|
32
|
+
next_y = arbeitsliste_new(next_y)
|
34
33
|
|
35
34
|
footer()
|
36
35
|
@pdf
|
@@ -50,7 +49,7 @@ module Planik
|
|
50
49
|
next_y = lohn_block(next_y)
|
51
50
|
next_y -= 50
|
52
51
|
next_y = ferien_block(next_y)
|
53
|
-
next_y -=
|
52
|
+
next_y -= 70
|
54
53
|
arbeitszeit_block(next_y)
|
55
54
|
|
56
55
|
footer()
|
@@ -80,7 +79,7 @@ module Planik
|
|
80
79
|
#@pdf.stroke_bounds
|
81
80
|
end
|
82
81
|
@pdf.move_down(50)
|
83
|
-
@pdf.text("Arbeitszeiten #{@daten.
|
82
|
+
@pdf.text("Arbeitszeiten #{@daten.monat_arbeit} #{@daten.jahr_arbeit}", style: :bold)
|
84
83
|
end
|
85
84
|
#@pdf.stroke_bounds
|
86
85
|
end
|
@@ -161,7 +160,7 @@ module Planik
|
|
161
160
|
# Neu
|
162
161
|
# Aenderung für MEDPHONE März 2015: Nur Arbeitsliste, Arbeitszeit und Zulagen
|
163
162
|
#@pdf.text("Anhang: Arbeitszeit von #{@daten.start_datum_for_arbeit} bis #{@daten.end_datum_for_arbeit}.")
|
164
|
-
@pdf.text("Generiert von Planik am #{Time.now.strftime("%d.%m.%Y um %H:%M Uhr")}"
|
163
|
+
@pdf.text("Generiert von Planik am #{Time.now.strftime("%d.%m.%Y um %H:%M Uhr")}")
|
165
164
|
end
|
166
165
|
end
|
167
166
|
end
|
@@ -184,49 +183,42 @@ module Planik
|
|
184
183
|
# Aenderung für MEDPHONE März 2015: Nur Arbeitsliste, Arbeitszeit und Zulagen
|
185
184
|
#
|
186
185
|
def arbeitsliste_new(ypos)
|
187
|
-
|
188
|
-
|
189
|
-
@pdf.text("Arbeitszeit von #{@daten.start_datum_for_arbeit} bis #{@daten.end_datum_for_arbeit}", style: :bold)
|
186
|
+
@pdf.move_down(50)
|
187
|
+
@pdf.text("Arbeitszeit von #{@daten.start_datum_for_arbeit} bis #{@daten.end_datum_for_arbeit}", style: :bold)
|
190
188
|
arbeitsliste = @daten.arbeitsliste
|
191
|
-
|
192
|
-
make_arbeitsliste_table(XPOS, inner_ypos, arbeitsliste, true)
|
193
|
-
# ypos = 18
|
194
|
-
# @pdf.bounding_box([XPOS, ypos], width: WIDTH) do
|
195
|
-
# @pdf.font("Helvetica", size: 8) do
|
196
|
-
# @pdf.text("Generiert von Planik am #{Time.now.strftime("%d.%m.%Y um %H:%M Uhr")}", align: :right)
|
197
|
-
# end
|
198
|
-
# end
|
199
|
-
end
|
200
|
-
bb.absolute_bottom
|
201
|
-
|
189
|
+
make_table_without_bounding_box(arbeitsliste, true)
|
202
190
|
end
|
203
191
|
|
204
192
|
|
205
193
|
def make_arbeitsliste_table(xpos, ypos, daten, title = false)
|
206
194
|
@pdf.bounding_box([xpos, ypos], width: WIDTH+30) do #height dynamisch
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
r3 = Rational(1, 4)
|
211
|
-
r4 = Rational(1, 9)
|
212
|
-
|
213
|
-
column_width = [p_width * r1, p_width * r3, p_width * r3, p_width * r2, p_width * r2, p_width * r4]
|
214
|
-
@pdf.table(daten, column_widths: column_width,
|
215
|
-
cell_style: {
|
216
|
-
borders: [], #keine Ränder
|
217
|
-
padding_top: 3, padding_bottom: 3
|
195
|
+
make_table_without_bounding_box(daten, title)
|
196
|
+
end
|
197
|
+
end
|
218
198
|
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
199
|
+
def make_table_without_bounding_box(daten, title)
|
200
|
+
p_width = @pdf.bounds.width
|
201
|
+
r1 = Rational(1, 6)
|
202
|
+
r2 = r1 * Rational(1, 2)
|
203
|
+
r3 = Rational(1, 4)
|
204
|
+
r4 = Rational(1, 9)
|
205
|
+
|
206
|
+
column_width = [p_width * r1, p_width * r3, p_width * r3, p_width * r2, p_width * r2, p_width * r4]
|
207
|
+
@pdf.table(daten, column_widths: column_width,
|
208
|
+
cell_style: {
|
209
|
+
borders: [], #keine Ränder
|
210
|
+
padding_top: 3, padding_bottom: 3
|
211
|
+
|
212
|
+
}
|
213
|
+
) do |t|
|
214
|
+
if title
|
215
|
+
t.row(0).style(font_style: :bold) #Titel bold
|
216
|
+
t.row(0).background_color = "D8D8D8"
|
229
217
|
end
|
218
|
+
t.column(5).style(align: :right)
|
219
|
+
t.cells[t.row_length-1, 0].font_style = :bold
|
220
|
+
t.cells[t.row_length-1, 5].borders = [:top]
|
221
|
+
t.cells[t.row_length-1, 5].font_style = :bold
|
230
222
|
end
|
231
223
|
end
|
232
224
|
|
data/lib/lohnausweis/version.rb
CHANGED
data/locale/de.yml
CHANGED
@@ -7,9 +7,10 @@ de:
|
|
7
7
|
default: "%Y-%m-%d"
|
8
8
|
short: "%b %d"
|
9
9
|
long: "%B %d, %Y"
|
10
|
+
mit_wochentag: "%a, %d.%m.%Y"
|
10
11
|
|
11
12
|
day_names: [Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday]
|
12
|
-
abbr_day_names: [
|
13
|
+
abbr_day_names: [So, Mo, Di, Mi, Do, Fr, Sa]
|
13
14
|
|
14
15
|
# Don't forget the nil at the beginning; there's no such thing as a 0th month
|
15
16
|
month_names: [~, Januar, Februar, März, April, Mai, Juni, Juli, August, September, Oktober, November, Dezember]
|
data/locale/en.yml
ADDED
@@ -0,0 +1,134 @@
|
|
1
|
+
en:
|
2
|
+
date:
|
3
|
+
formats:
|
4
|
+
# Use the strftime parameters for formats.
|
5
|
+
# When no format has been given, it uses default.
|
6
|
+
# You can provide other formats here if you like!
|
7
|
+
default: "%Y-%m-%d"
|
8
|
+
short: "%b %d"
|
9
|
+
long: "%B %d, %Y"
|
10
|
+
mit_wochentag: "%a, %d.%m.%Y"
|
11
|
+
|
12
|
+
day_names: [Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday]
|
13
|
+
abbr_day_names: [Sun, Mon, Tue, Wed, Thu, Fri, Sat]
|
14
|
+
|
15
|
+
# Don't forget the nil at the beginning; there's no such thing as a 0th month
|
16
|
+
month_names: [~, Januar, Februar, März, April, Mai, Juni, Juli, August, September, Oktober, November, Dezember]
|
17
|
+
abbr_month_names: [~, Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec]
|
18
|
+
# Used in date_select and datetime_select.
|
19
|
+
order:
|
20
|
+
- year
|
21
|
+
- month
|
22
|
+
- day
|
23
|
+
|
24
|
+
time:
|
25
|
+
formats:
|
26
|
+
default: "%a, %d %b %Y %H:%M:%S %z"
|
27
|
+
short: "%d %b %H:%M"
|
28
|
+
long: "%B %d, %Y %H:%M"
|
29
|
+
am: "am"
|
30
|
+
pm: "pm"
|
31
|
+
|
32
|
+
# Used in array.to_sentence.
|
33
|
+
support:
|
34
|
+
array:
|
35
|
+
words_connector: ", "
|
36
|
+
two_words_connector: " and "
|
37
|
+
last_word_connector: ", and "
|
38
|
+
number:
|
39
|
+
# Used in NumberHelper.number_to_delimited()
|
40
|
+
# These are also the defaults for 'currency', 'percentage', 'precision', and 'human'
|
41
|
+
format:
|
42
|
+
# Sets the separator between the units, for more precision (e.g. 1.0 / 2.0 == 0.5)
|
43
|
+
separator: "."
|
44
|
+
# Delimits thousands (e.g. 1,000,000 is a million) (always in groups of three)
|
45
|
+
delimiter: ","
|
46
|
+
# Number of decimals, behind the separator (the number 1 with a precision of 2 gives: 1.00)
|
47
|
+
precision: 3
|
48
|
+
# If set to true, precision will mean the number of significant digits instead
|
49
|
+
# of the number of decimal digits (1234 with precision 2 becomes 1200, 1.23543 becomes 1.2)
|
50
|
+
significant: false
|
51
|
+
# If set, the zeros after the decimal separator will always be stripped (eg.: 1.200 will be 1.2)
|
52
|
+
strip_insignificant_zeros: false
|
53
|
+
|
54
|
+
# Used in NumberHelper.number_to_currency()
|
55
|
+
currency:
|
56
|
+
format:
|
57
|
+
# Where is the currency sign? %u is the currency unit, %n the number (default: $5.00)
|
58
|
+
format: "%u%n"
|
59
|
+
unit: "$"
|
60
|
+
# These five are to override number.format and are optional
|
61
|
+
separator: "."
|
62
|
+
delimiter: ","
|
63
|
+
precision: 2
|
64
|
+
significant: false
|
65
|
+
strip_insignificant_zeros: false
|
66
|
+
|
67
|
+
# Used in NumberHelper.number_to_percentage()
|
68
|
+
percentage:
|
69
|
+
format:
|
70
|
+
# These five are to override number.format and are optional
|
71
|
+
# separator:
|
72
|
+
delimiter: ""
|
73
|
+
# precision:
|
74
|
+
# significant: false
|
75
|
+
# strip_insignificant_zeros: false
|
76
|
+
format: "%n%"
|
77
|
+
|
78
|
+
# Used in NumberHelper.number_to_rounded()
|
79
|
+
precision:
|
80
|
+
format:
|
81
|
+
# These five are to override number.format and are optional
|
82
|
+
# separator:
|
83
|
+
delimiter: ""
|
84
|
+
# precision:
|
85
|
+
# significant: false
|
86
|
+
# strip_insignificant_zeros: false
|
87
|
+
|
88
|
+
# Used in NumberHelper.number_to_human_size() and NumberHelper.number_to_human()
|
89
|
+
human:
|
90
|
+
format:
|
91
|
+
# These five are to override number.format and are optional
|
92
|
+
# separator:
|
93
|
+
delimiter: ""
|
94
|
+
precision: 3
|
95
|
+
significant: true
|
96
|
+
strip_insignificant_zeros: true
|
97
|
+
# Used in number_to_human_size()
|
98
|
+
storage_units:
|
99
|
+
# Storage units output formatting.
|
100
|
+
# %u is the storage unit, %n is the number (default: 2 MB)
|
101
|
+
format: "%n %u"
|
102
|
+
units:
|
103
|
+
byte:
|
104
|
+
one: "Byte"
|
105
|
+
other: "Bytes"
|
106
|
+
kb: "KB"
|
107
|
+
mb: "MB"
|
108
|
+
gb: "GB"
|
109
|
+
tb: "TB"
|
110
|
+
# Used in NumberHelper.number_to_human()
|
111
|
+
decimal_units:
|
112
|
+
format: "%n %u"
|
113
|
+
# Decimal units output formatting
|
114
|
+
# By default we will only quantify some of the exponents
|
115
|
+
# but the commented ones might be defined or overridden
|
116
|
+
# by the user.
|
117
|
+
units:
|
118
|
+
# femto: Quadrillionth
|
119
|
+
# pico: Trillionth
|
120
|
+
# nano: Billionth
|
121
|
+
# micro: Millionth
|
122
|
+
# mili: Thousandth
|
123
|
+
# centi: Hundredth
|
124
|
+
# deci: Tenth
|
125
|
+
unit: ""
|
126
|
+
# ten:
|
127
|
+
# one: Ten
|
128
|
+
# other: Tens
|
129
|
+
# hundred: Hundred
|
130
|
+
thousand: Thousand
|
131
|
+
million: Million
|
132
|
+
billion: Billion
|
133
|
+
trillion: Trillion
|
134
|
+
quadrillion: Quadrillion
|