bookyt_salary 0.16.0 → 0.16.1
Sign up to get free protection for your applications and to get access to all the features.
data/app/models/salary.rb
CHANGED
@@ -78,15 +78,10 @@ class Salary < Invoice
|
|
78
78
|
# Line Items
|
79
79
|
def build_line_items
|
80
80
|
salary_template.salary_items.each do |salary_item|
|
81
|
-
line_item =
|
81
|
+
line_item = salary_item.build_line_item
|
82
82
|
|
83
|
-
|
84
|
-
line_item
|
85
|
-
|
86
|
-
# Overrides from salary_item
|
87
|
-
line_item.times = salary_item.times if salary_item.times.present?
|
88
|
-
line_item.price = salary_item.price if salary_item.price.present?
|
89
|
-
line_item.position = salary_item.position if salary_item.position.present?
|
83
|
+
line_item.date = self.value_date
|
84
|
+
self.line_items << line_item
|
90
85
|
end
|
91
86
|
end
|
92
87
|
|
data/app/models/salary_item.rb
CHANGED
@@ -5,4 +5,16 @@ class SalaryItem < ActiveRecord::Base
|
|
5
5
|
# Associations
|
6
6
|
belongs_to :salary_template
|
7
7
|
belongs_to :salary_booking_template
|
8
|
+
|
9
|
+
def build_line_item
|
10
|
+
# Defaults from booking_template
|
11
|
+
line_item = salary_booking_template.build_line_item
|
12
|
+
|
13
|
+
# Overrides from salary_item
|
14
|
+
line_item.times = self.times if self.times.present?
|
15
|
+
line_item.price = self.price if self.price.present?
|
16
|
+
line_item.position = self.position if self.position.present?
|
17
|
+
|
18
|
+
line_item
|
19
|
+
end
|
8
20
|
end
|
@@ -10,6 +10,7 @@
|
|
10
10
|
.span8= f.input :duration_from, :as => :date_field
|
11
11
|
.span8= f.input :duration_to, :as => :date_field
|
12
12
|
.row
|
13
|
+
.span16= f.input :text, :input_html => {:rows => 4, :class => 'span12'}
|
13
14
|
.span16= f.input :remarks, :input_html => {:rows => 4, :class => 'span12'}
|
14
15
|
|
15
16
|
= render 'line_items/list_form', :f => f, :invoice => resource
|
@@ -6,7 +6,8 @@ prawn_document(:filename => "#{resource.to_s}.pdf", :renderer => PayslipDocument
|
|
6
6
|
pdf.letter_header(employer, employee, resource.to_s)
|
7
7
|
|
8
8
|
# Free text with the socical security number
|
9
|
-
|
9
|
+
pdf.free_text(resource.text)
|
10
|
+
|
10
11
|
# Line Items
|
11
12
|
pdf.salary_table(resource)
|
12
13
|
|
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: 93
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 16
|
9
|
-
-
|
10
|
-
version: 0.16.
|
9
|
+
- 1
|
10
|
+
version: 0.16.1
|
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-02-
|
18
|
+
date: 2012-02-16 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: rails
|