File tree 3 files changed +10
-10
lines changed
3 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -60,15 +60,15 @@ def total_hours
60
60
end
61
61
62
62
def overall_not_billable_hours
63
- total . order_info [ :overall_not_billable_hours ] . to_f
63
+ total . info [ :overall_not_billable_hours ] . to_f
64
64
end
65
65
66
66
def overall_billable_hours
67
67
overall_total_hours - overall_not_billable_hours
68
68
end
69
69
70
70
def overall_total_hours
71
- total . order_info [ :overall_supplied_services_hours ] . to_f
71
+ total . info [ :overall_supplied_services_hours ] . to_f
72
72
end
73
73
74
74
def build_rows ( period )
Original file line number Diff line number Diff line change 8
8
class Order
9
9
class Cockpit
10
10
class AccountingPostRow < Row
11
- attr_reader :cells , :accounting_post , :row_info
11
+ attr_reader :cells , :accounting_post , :info
12
12
13
13
def initialize ( accounting_post , period , label = nil )
14
14
super ( label || accounting_post . to_s )
15
15
@period = period
16
16
@accounting_post = accounting_post
17
17
@cells = build_cells
18
- @row_info = build_info
18
+ @info = build_info
19
19
end
20
20
21
21
def portfolio
Original file line number Diff line number Diff line change 8
8
class Order
9
9
class Cockpit
10
10
class TotalRow < Row
11
- attr_reader :order_info
11
+ attr_reader :info
12
12
13
13
def initialize ( rows )
14
14
super ( 'Total' )
15
15
@cells = build_total_cells ( rows )
16
- @order_info = build_order_info ( rows )
16
+ @info = build_info ( rows )
17
17
end
18
18
19
19
private
@@ -30,10 +30,10 @@ def build_total_cells(rows)
30
30
hash
31
31
end
32
32
33
- # collect the row_info hash of every row and sum the individual values up (per key)
34
- def build_order_info ( rows )
35
- row_infos = rows . collect ( &:row_info )
36
- row_infos . each_with_object ( Hash . new ( 0 ) ) do |row , acc |
33
+ # collect the info hash of every row and sum the individual values up (per key)
34
+ def build_info ( rows )
35
+ infos = rows . collect ( &:info )
36
+ infos . each_with_object ( Hash . new ( 0 ) ) do |row , acc |
37
37
row . each { |key , value | acc [ key ] += value }
38
38
end
39
39
end
You can’t perform that action at this time.
0 commit comments