From 7d2ffcf9546d14f899f8310cb6794a5a3754dd9b Mon Sep 17 00:00:00 2001 From: Craig Barber Date: Mon, 15 Jun 2015 18:25:37 -0400 Subject: [PATCH] * Fixed - use plan inject since time_entries seems to be a relation --- app/views/timesheet/report.iif.riif | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/timesheet/report.iif.riif b/app/views/timesheet/report.iif.riif index 47b4cb9..8e5e748 100644 --- a/app/views/timesheet/report.iif.riif +++ b/app/views/timesheet/report.iif.riif @@ -28,7 +28,7 @@ iif.trns do date Time.now.strftime("%m/%d/%Y") accnt 'Accounts Receivable' name 'Customer' - amount timesheet.time_entries.map { |project, data| data[:logs].sum { |time_entry| amount_for(time_entry) } }.sum + amount timesheet.time_entries.map { |project, data| data[:logs].inject(0) { |sum, time_entry| sum + amount_for(time_entry) } }.sum docnum "#{date_from.year}-#{timesheet.projects.collect{|p| p.id.to_s.ljust(3, '0') }.join('')}-#{date_from.strftime('%m%d')}-#{date_to.strftime('%m%d')}" memo "Time entered for #{timesheet.time_entries.map { |project, data| project }.join(', ') } between #{date_from.strftime('%Y-%m-%d')} and #{date_to.strftime('%Y-%m-%d')}" clear 'N'