bookyt_salary 0.14.0 → 0.14.1
Sign up to get free protection for your applications and to get access to all the features.
@@ -1,14 +1,30 @@
|
|
1
1
|
class PayslipDocument < LetterDocument
|
2
|
-
def salary_table(
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
2
|
+
def salary_table(salary)
|
3
|
+
head = [
|
4
|
+
t_attr(:code, LineItem),
|
5
|
+
t_attr(:title, LineItem),
|
6
|
+
t_attr(:price, LineItem),
|
7
|
+
t_attr(:times, LineItem),
|
8
|
+
t_attr(:accounted_amount, LineItem)
|
9
|
+
]
|
10
|
+
content = salary.line_items.collect do |item|
|
11
|
+
[item.code, item.title, currency_fmt(item.price), item.times, currency_fmt(item.accounted_amount)]
|
8
12
|
end
|
9
13
|
|
10
|
-
rows =
|
14
|
+
rows = [head] + content
|
15
|
+
|
16
|
+
table(rows, :width => bounds.width) do
|
17
|
+
# General cell styling
|
18
|
+
cells.valign = :top
|
19
|
+
cells.borders = []
|
20
|
+
cells.padding_bottom = 2
|
21
|
+
cells.padding_top = 2
|
11
22
|
|
12
|
-
|
23
|
+
# Columns
|
24
|
+
columns(2..4).align = :right
|
25
|
+
|
26
|
+
# Footer styling
|
27
|
+
row(-1).font_style = :bold
|
28
|
+
end
|
13
29
|
end
|
14
30
|
end
|
@@ -1,9 +1,6 @@
|
|
1
1
|
prawn_document(:filename => "#{resource.to_s}.pdf", :renderer => PayslipDocument) do |pdf|
|
2
2
|
employer = resource.employer
|
3
3
|
employee = resource.employee
|
4
|
-
direct_account = Account.find_by_code("5000")
|
5
|
-
direct_bookings = Booking.by_reference(resource)
|
6
|
-
direct_balance = direct_bookings.empty? ? 0.0 : direct_bookings.direct_balance(direct_account)
|
7
4
|
|
8
5
|
# Letter header
|
9
6
|
pdf.letter_header(employer, employee, resource.to_s)
|
@@ -12,7 +9,7 @@ prawn_document(:filename => "#{resource.to_s}.pdf", :renderer => PayslipDocument
|
|
12
9
|
pdf.free_text "#{t_attr(:social_security_nr, Employee)}: #{employee.social_security_nr}"
|
13
10
|
|
14
11
|
# Line Items
|
15
|
-
pdf.salary_table(
|
12
|
+
pdf.salary_table(resource)
|
16
13
|
|
17
14
|
# Closing
|
18
15
|
pdf.common_closing(employer)
|
@@ -1,9 +1,9 @@
|
|
1
1
|
module BookytSalary
|
2
2
|
module Navigation
|
3
3
|
def setup_bookyt_salary(navigation)
|
4
|
-
navigation.item :salaries,
|
4
|
+
navigation.item :salaries, t_title(:index, Salary), salaries_path,
|
5
5
|
:if => Proc.new { user_signed_in? } do |salaries|
|
6
|
-
salaries.item :salaries,
|
6
|
+
salaries.item :salaries, t_title(:index, Salary), salaries_path, :highlights_on => /\/salaries($|\/[0-9]*($|\/.*))/
|
7
7
|
salaries.item :new_salary, t_title(:new, Salary), select_employee_salaries_path
|
8
8
|
salaries.item :divider, "", :class => 'divider'
|
9
9
|
salaries.item :salary_statistics, t_title(:statistics, Salary), statistics_salaries_path
|
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: 37
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 14
|
9
|
-
-
|
10
|
-
version: 0.14.
|
9
|
+
- 1
|
10
|
+
version: 0.14.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- "Simon H\xC3\xBCrlimann (CyT)"
|
@@ -15,7 +15,8 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-01-
|
18
|
+
date: 2012-01-28 00:00:00 +01:00
|
19
|
+
default_executable:
|
19
20
|
dependencies:
|
20
21
|
- !ruby/object:Gem::Dependency
|
21
22
|
name: rails
|
@@ -151,6 +152,7 @@ files:
|
|
151
152
|
- lib/bookyt_salary/navigation.rb
|
152
153
|
- lib/bookyt_salary/railtie.rb
|
153
154
|
- lib/bookyt_salary/version.rb
|
155
|
+
has_rdoc: true
|
154
156
|
homepage: https://github.com/huerlisi/bookyt_salary
|
155
157
|
licenses:
|
156
158
|
- MIT
|
@@ -180,10 +182,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
180
182
|
requirements: []
|
181
183
|
|
182
184
|
rubyforge_project:
|
183
|
-
rubygems_version: 1.
|
185
|
+
rubygems_version: 1.5.2
|
184
186
|
signing_key:
|
185
187
|
specification_version: 3
|
186
188
|
summary: Salary plugin for bookyt
|
187
189
|
test_files: []
|
188
190
|
|
189
|
-
has_rdoc:
|