bookyt_salary 0.12.2 → 0.13.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,14 @@
1
+ class PayslipDocument < LetterDocument
2
+ def salary_table(direct_balance, direct_account, direct_bookings)
3
+ content = direct_bookings.inject([]) do |out, item|
4
+ title = item.title if item
5
+ out << [title, nil, nil, nil, currency_fmt(item.accounted_amount(direct_account))] if item.contra_account(direct_account)
6
+
7
+ out
8
+ end
9
+
10
+ rows = content + [total_row(currency_fmt(direct_balance))]
11
+
12
+ items_table(rows)
13
+ end
14
+ end
@@ -1,4 +1,4 @@
1
- prawn_document(:filename => "#{resource.to_s}.pdf", :renderer => Prawn::Payslip) do |pdf|
1
+ prawn_document(:filename => "#{resource.to_s}.pdf", :renderer => PayslipDocument) do |pdf|
2
2
  employer = resource.employer
3
3
  employee = resource.employee
4
4
  direct_account = Account.find_by_code("5000")
@@ -4,7 +4,5 @@ require 'rails'
4
4
  module BookytSalary
5
5
  class Railtie < Rails::Engine
6
6
  engine_name "bookyt_salary"
7
-
8
- config.autoload_paths << File.expand_path("../lib", __FILE__)
9
7
  end
10
8
  end
@@ -1,3 +1,3 @@
1
1
  module BookytSalary
2
- VERSION = '0.12.2'
2
+ VERSION = '0.13.0'
3
3
  end
metadata CHANGED
@@ -5,9 +5,9 @@ version: !ruby/object:Gem::Version
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 12
9
- - 2
10
- version: 0.12.2
8
+ - 13
9
+ - 0
10
+ version: 0.13.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - "Simon H\xC3\xBCrlimann (CyT)"
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-01-23 00:00:00 Z
18
+ date: 2012-01-24 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: rails
@@ -107,6 +107,7 @@ files:
107
107
  - app/models/salary_booking_template.rb
108
108
  - app/models/salary_item.rb
109
109
  - app/models/salary_template.rb
110
+ - app/prawn/payslip_document.rb
110
111
  - app/views/employees/_show_salaries.html.haml
111
112
  - app/views/salaries/_form.html.haml
112
113
  - app/views/salaries/_list.html.haml
@@ -150,7 +151,6 @@ files:
150
151
  - lib/bookyt_salary/navigation.rb
151
152
  - lib/bookyt_salary/railtie.rb
152
153
  - lib/bookyt_salary/version.rb
153
- - lib/prawn/payslip.rb
154
154
  homepage: https://github.com/huerlisi/bookyt_salary
155
155
  licenses:
156
156
  - MIT
@@ -180,7 +180,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
180
180
  requirements: []
181
181
 
182
182
  rubyforge_project:
183
- rubygems_version: 1.8.10
183
+ rubygems_version: 1.8.15
184
184
  signing_key:
185
185
  specification_version: 3
186
186
  summary: Salary plugin for bookyt
data/lib/prawn/payslip.rb DELETED
@@ -1,16 +0,0 @@
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