bookyt_salary 0.14.5 → 0.14.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -54,6 +54,12 @@ class SalariesController < InvoicesController
54
54
  end
55
55
 
56
56
  def payslip
57
+ @salary = Salary.find(params[:id])
58
+
59
+ @hours_due = @salary.work_days.sum(:hours_due)
60
+ @hours_worked = @salary.work_days.sum(:hours_worked)
61
+ @hours_saldo = @salary.work_days.last.overall_overtime
62
+
57
63
  show! do |format|
58
64
  format.html { redirect_to :action => :show }
59
65
  end
data/app/models/salary.rb CHANGED
@@ -121,4 +121,10 @@ class Salary < Invoice
121
121
  def self.default_debit_account
122
122
  self.direct_account
123
123
  end
124
+
125
+ # bookyt_projects
126
+ def work_days
127
+ WorkDay.create_or_update_upto(employee, duration_to)
128
+ employee.work_days.where(:date => duration_from..duration_to)
129
+ end
124
130
  end
@@ -14,6 +14,15 @@ prawn_document(:filename => "#{resource.to_s}.pdf", :renderer => PayslipDocument
14
14
  pdf.text "#{t_attr(:social_security_nr, Employee)}: #{employee.social_security_nr}"
15
15
  pdf.text "#{t_attr(:payment_to, Employment)}: #{resource.employment.payment_to}"
16
16
 
17
+ unless resource.employment.hourly_paid
18
+ pdf.move_down 20
19
+ pdf.text "Stundenabrechnung", :style => :bold
20
+ pdf.text "#{t_attr(:hours_due, Activity)}: #{@hours_due}"
21
+ pdf.text "#{t_attr(:hours_worked, Activity)}: #{@hours_worked}"
22
+ pdf.text " "
23
+ pdf.text "Aktueller Stundensaldo: #{@hours_saldo}"
24
+ end
25
+
17
26
  # Closing
18
27
  pdf.common_closing(employer)
19
28
  end
@@ -1,3 +1,3 @@
1
1
  module BookytSalary
2
- VERSION = '0.14.5'
2
+ VERSION = '0.14.6'
3
3
  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: 45
4
+ hash: 43
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 14
9
- - 5
10
- version: 0.14.5
9
+ - 6
10
+ version: 0.14.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - "Simon H\xC3\xBCrlimann (CyT)"