bookyt_salary 0.14.2 → 0.14.3
Sign up to get free protection for your applications and to get access to all the features.
- data/app/helpers/salary_booking_template_helper.rb +8 -1
- data/app/models/salary.rb +9 -17
- data/app/models/salary_booking_template.rb +1 -1
- data/app/prawn/payslip_document.rb +2 -1
- data/app/views/salaries/_list.html.haml +1 -1
- data/app/views/salaries/_salary.html.haml +2 -2
- data/app/views/salary_booking_templates/_form.html.haml +1 -1
- data/app/views/salary_booking_templates/_list.html.haml +1 -1
- data/app/views/salary_booking_templates/_salary_booking_template.html.haml +1 -1
- data/app/views/salary_items/_list_form.html.haml +1 -1
- data/config/locales/bookyt_salary.de.yml +7 -7
- data/lib/bookyt_salary/version.rb +1 -1
- metadata +4 -4
@@ -1,5 +1,12 @@
|
|
1
1
|
module SalaryBookingTemplateHelper
|
2
2
|
def saldo_inclusion_flag_collection
|
3
|
-
SalaryBookingTemplate.saldo_inclusion_flags.map{|flag| [
|
3
|
+
SalaryBookingTemplate.saldo_inclusion_flags.map{|flag| [t('activerecord.attributes.salary_booking_template.saldo_inclusion_flags.' + flag), flag]}
|
4
|
+
end
|
5
|
+
|
6
|
+
def amount_relates_to_collection
|
7
|
+
saldo_inclusion_flags = SalaryBookingTemplate.saldo_inclusion_flags.map{|flag| [t('activerecord.attributes.salary_booking_template.saldo_inclusion_flags.' + flag), flag]}
|
8
|
+
booking_templates = SalaryBookingTemplate.all.map{|template| [template.title, template.id]}
|
9
|
+
|
10
|
+
return saldo_inclusion_flags + booking_templates
|
4
11
|
end
|
5
12
|
end
|
data/app/models/salary.rb
CHANGED
@@ -39,29 +39,21 @@ class Salary < Invoice
|
|
39
39
|
|
40
40
|
# Calculations
|
41
41
|
def net_amount
|
42
|
-
|
43
|
-
|
42
|
+
# TODO: hardcoded salary_booking_template
|
43
|
+
line_item = line_items.where(:code => '6500').first
|
44
44
|
|
45
|
-
|
46
|
-
end
|
45
|
+
return 0.0 unless line_item
|
47
46
|
|
48
|
-
|
49
|
-
bookings.by_text("BVG").sum(:amount)
|
47
|
+
line_item.accounted_amount
|
50
48
|
end
|
51
49
|
|
52
|
-
def
|
53
|
-
|
54
|
-
|
55
|
-
result += bookings.by_text("NBU Arbeitnehmer").sum(:amount)
|
56
|
-
|
57
|
-
result
|
58
|
-
end
|
50
|
+
def gross_amount
|
51
|
+
# TODO: hardcoded salary_booking_template
|
52
|
+
line_item = line_items.where(:code => '5000').first
|
59
53
|
|
60
|
-
|
61
|
-
result = amount
|
62
|
-
result += bookings.where(:title => "Kinderzulage").sum(:amount)
|
54
|
+
return 0.0 unless line_item
|
63
55
|
|
64
|
-
|
56
|
+
line_item.accounted_amount
|
65
57
|
end
|
66
58
|
|
67
59
|
# Assignment proxies
|
@@ -1,7 +1,7 @@
|
|
1
1
|
class SalaryBookingTemplate < BookingTemplate
|
2
2
|
# Obligation flags
|
3
3
|
def self.saldo_inclusion_flags
|
4
|
-
['gross_income', 'net_income', 'ahv', 'uvg', 'uvgz', 'ktg', 'deduction_at_source']
|
4
|
+
['gross_income', 'net_income', 'payment', 'ahv', 'uvg', 'uvgz', 'ktg', 'deduction_at_source']
|
5
5
|
end
|
6
6
|
|
7
7
|
def to_s
|
@@ -27,6 +27,7 @@ class PayslipDocument < LetterDocument
|
|
27
27
|
cells.borders = []
|
28
28
|
cells.padding_bottom = 2
|
29
29
|
cells.padding_top = 2
|
30
|
+
columns(0).padding_left = 0
|
30
31
|
|
31
32
|
# Columns
|
32
33
|
columns(2..4).align = :right
|
@@ -34,7 +35,7 @@ class PayslipDocument < LetterDocument
|
|
34
35
|
# Saldo styling
|
35
36
|
saldo_rows.each do |index|
|
36
37
|
row(index).font_style = :bold
|
37
|
-
row(index).padding_bottom =
|
38
|
+
row(index).padding_bottom = 10
|
38
39
|
end
|
39
40
|
|
40
41
|
# Header styling
|
@@ -6,7 +6,7 @@
|
|
6
6
|
%th= t_attr :company, Invoice
|
7
7
|
%th= t_attr :title, Invoice
|
8
8
|
%th= t_attr :due_date, Invoice
|
9
|
-
%th.currency= t_attr :
|
9
|
+
%th.currency= t_attr :gross_amount, Salary
|
10
10
|
%th.currency= t_attr :net_amount, Salary
|
11
11
|
%th.currency= t_attr :balance, Invoice
|
12
12
|
%th.action-links
|
@@ -3,8 +3,8 @@
|
|
3
3
|
%td= link_to salary.company, salary.company
|
4
4
|
%td= link_to salary.title, salary, {'data-href-container' => 'tr'}
|
5
5
|
%td= salary.due_date
|
6
|
-
%td.currency= currency_fmt(salary.
|
6
|
+
%td.currency= currency_fmt(salary.gross_amount)
|
7
7
|
%td.currency= currency_fmt(salary.net_amount)
|
8
|
-
%td.currency= currency_fmt(salary.balance(
|
8
|
+
%td.currency= currency_fmt(salary.balance(nil, Account.find_by_code('2050')))
|
9
9
|
%td.action-links
|
10
10
|
= list_link_for(:edit, salary)
|
@@ -9,7 +9,7 @@
|
|
9
9
|
.span8= f.input :debit_account, :as => :combobox, :collection => accounts_as_collection
|
10
10
|
.row
|
11
11
|
.span8= f.input :amount
|
12
|
-
.span8= f.input :amount_relates_to
|
12
|
+
.span8= f.input :amount_relates_to, :collection => amount_relates_to_collection
|
13
13
|
.row
|
14
14
|
.span16= f.input :comments, :input_html => {:rows => 2, :class => 'span12'}
|
15
15
|
|
@@ -7,7 +7,7 @@
|
|
7
7
|
%th.currency= t_attr 'amount', SalaryBookingTemplate
|
8
8
|
%th= t_attr :amount_relates_to, SalaryBookingTemplate
|
9
9
|
- SalaryBookingTemplate.saldo_inclusion_flags.each do |flag|
|
10
|
-
%th=
|
10
|
+
%th= t('activerecord.attributes.salary_booking_template.saldo_inclusion_flags.' + flag)
|
11
11
|
%th.right= t_attr :salary_declaration_code, SalaryBookingTemplate
|
12
12
|
|
13
13
|
= render @salary_booking_templates
|
@@ -8,7 +8,7 @@
|
|
8
8
|
%td= link_to salary_booking_template.credit_account.code, account_path(salary_booking_template.credit_account), :title => salary_booking_template.credit_account.title unless salary_booking_template.credit_account.nil?
|
9
9
|
%td= link_to salary_booking_template.debit_account.code, account_path(salary_booking_template.debit_account), :title => salary_booking_template.debit_account.title unless salary_booking_template.debit_account.nil?
|
10
10
|
%td.currency= salary_booking_template.amount
|
11
|
-
%td=
|
11
|
+
%td= t('activerecord.attributes.salary_booking_template.saldo_inclusion_flags.' + salary_booking_template.amount_relates_to) if salary_booking_template.amount_relates_to.present?
|
12
12
|
- SalaryBookingTemplate.saldo_inclusion_flags.each do |flag|
|
13
13
|
%td= salary_booking_template.include_in_saldo_list.include?(flag) ? '<span class="label success">Ja</span>'.html_safe : ""
|
14
14
|
%td.right= salary_booking_template.salary_declaration_code
|
@@ -7,19 +7,19 @@ de:
|
|
7
7
|
|
8
8
|
attributes:
|
9
9
|
salary:
|
10
|
-
|
10
|
+
gross_amount: Bruttolohn
|
11
11
|
net_amount: Nettolohn
|
12
|
-
bvg_amount: BVG
|
13
|
-
social_amount: AHV/IV/EO/ALV/NBU
|
14
12
|
employer: Arbeitgeber
|
15
13
|
employee: Arbeitnehmer
|
16
14
|
salary_booking_template:
|
17
15
|
saldo_inclusion_flags:
|
18
|
-
ahv: AHV
|
19
|
-
ktg:
|
16
|
+
ahv: AHV
|
17
|
+
ktg: KTG
|
20
18
|
gross_income: Bruttolohn
|
21
|
-
|
22
|
-
|
19
|
+
net_income: Nettolohn
|
20
|
+
payment: Auszahlung
|
21
|
+
uvg: UVG
|
22
|
+
uvgz: UVGZ
|
23
23
|
deduction_at_source: Quellensteuer
|
24
24
|
include_in_saldo_list: Pflichtigkeit
|
25
25
|
salary_declaration_code: Lohnausweis
|
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: 33
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 14
|
9
|
-
-
|
10
|
-
version: 0.14.
|
9
|
+
- 3
|
10
|
+
version: 0.14.3
|
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-
|
18
|
+
date: 2012-01-30 00:00:00 +01:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|