bookyt_salary 0.10.0 → 0.10.1
Sign up to get free protection for your applications and to get access to all the features.
- data/app/models/salary.rb +3 -2
- data/app/models/salary_item.rb +4 -2
- data/app/views/salaries/payslip.pdf.prawn +1 -1
- data/lib/bookyt_salary/railtie.rb +2 -0
- data/lib/bookyt_salary/version.rb +1 -1
- data/lib/prawn/payslip.rb +16 -0
- metadata +5 -5
data/app/models/salary.rb
CHANGED
@@ -96,8 +96,9 @@ class Salary < Invoice
|
|
96
96
|
line_item.set_booking_template(salary_item.salary_booking_template)
|
97
97
|
|
98
98
|
# Overrides from salary_item
|
99
|
-
line_item.times
|
100
|
-
line_item.price
|
99
|
+
line_item.times = salary_item.times if salary_item.times.present?
|
100
|
+
line_item.price = salary_item.price if salary_item.price.present?
|
101
|
+
line_item.position = salary_item.position if salary_item.position.present?
|
101
102
|
end
|
102
103
|
end
|
103
104
|
|
data/app/models/salary_item.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
prawn_document(:filename => "#{resource.to_s}.pdf", :renderer => Prawn::
|
1
|
+
prawn_document(:filename => "#{resource.to_s}.pdf", :renderer => Prawn::Payslip) do |pdf|
|
2
2
|
employer = resource.employer
|
3
3
|
employee = resource.employee
|
4
4
|
direct_account = Account.find_by_code("5000")
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Prawn
|
2
|
+
class Payslip < LetterDocument
|
3
|
+
def salary_table(direct_balance, direct_account, direct_bookings)
|
4
|
+
content = direct_bookings.inject([]) do |out, item|
|
5
|
+
title = item.title if item
|
6
|
+
out << [title, nil, nil, nil, currency_fmt(item.accounted_amount(direct_account))] if item.contra_account(direct_account)
|
7
|
+
|
8
|
+
out
|
9
|
+
end
|
10
|
+
|
11
|
+
rows = content + [total_row(currency_fmt(direct_balance))]
|
12
|
+
|
13
|
+
items_table(rows)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
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: 53
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 10
|
9
|
-
-
|
10
|
-
version: 0.10.
|
9
|
+
- 1
|
10
|
+
version: 0.10.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- "Simon H\xC3\xBCrlimann (CyT)"
|
@@ -147,6 +147,7 @@ files:
|
|
147
147
|
- lib/bookyt_salary/navigation.rb
|
148
148
|
- lib/bookyt_salary/railtie.rb
|
149
149
|
- lib/bookyt_salary/version.rb
|
150
|
+
- lib/prawn/payslip.rb
|
150
151
|
homepage: https://github.com/huerlisi/bookyt_salary
|
151
152
|
licenses:
|
152
153
|
- MIT
|
@@ -176,10 +177,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
176
177
|
requirements: []
|
177
178
|
|
178
179
|
rubyforge_project:
|
179
|
-
rubygems_version: 1.8.
|
180
|
+
rubygems_version: 1.8.15
|
180
181
|
signing_key:
|
181
182
|
specification_version: 3
|
182
183
|
summary: Salary plugin for bookyt
|
183
184
|
test_files: []
|
184
185
|
|
185
|
-
has_rdoc:
|