diff --git a/tock/employees/models.py b/tock/employees/models.py index 1bc053fa..bfb943e4 100644 --- a/tock/employees/models.py +++ b/tock/employees/models.py @@ -156,6 +156,16 @@ def organization_name(self): return '' + @property + def unit_name(self): + """ + Returns the unit name associated with the employee or an empty string + if no unit is set. + """ + if self.unit is not None: + return self.unit.name + return '' + @property def is_late(self): """ diff --git a/tock/hours/tests/test_views.py b/tock/hours/tests/test_views.py index 4b6dfedc..e63c945c 100644 --- a/tock/hours/tests/test_views.py +++ b/tock/hours/tests/test_views.py @@ -107,7 +107,11 @@ def test_bulk_timecards(self): 'employee', 'start_date', 'end_date', + 'is_weekly_bill', 'hours_spent', + 'project_allocation', + 'billable_expectation', + 'target_hours', 'agency', 'flat_rate', 'active', @@ -118,6 +122,7 @@ def test_bulk_timecards(self): 'expense_profit_loss_account', 'expense_profit_loss_account_name', 'employee_organization', + 'employee_unit', 'project_organization', )) rows_read = 0 diff --git a/tock/hours/views.py b/tock/hours/views.py index c8eb6a53..e22d8de2 100644 --- a/tock/hours/views.py +++ b/tock/hours/views.py @@ -44,10 +44,20 @@ class BulkTimecardSerializer(serializers.Serializer): end_date = serializers.DateField( source='timecard.reporting_period.end_date' ) - hours_spent = serializers.DecimalField(max_digits=5, decimal_places=2) + is_weekly_bill = serializers.BooleanField( + source='project.is_weekly_bill' + ) + hours_spent = serializers.DecimalField(decimal_places=2, max_digits=5) + project_allocation = serializers.DecimalField(decimal_places=3, max_digits=6) billable = serializers.BooleanField( source='project.accounting_code.billable' ) + billable_expectation = serializers.DecimalField(decimal_places=2, + max_digits=3, + source='timecard.billable_expectation') + target_hours = serializers.DecimalField(decimal_places=2, + max_digits=5, + source='timecard.target_hours') agency = serializers.CharField( source='project.accounting_code.agency.name' ) @@ -76,6 +86,9 @@ class BulkTimecardSerializer(serializers.Serializer): employee_organization = serializers.CharField( source='timecard.user.user_data.organization_name' ) + employee_unit = serializers.CharField( + source='timecard.user.user_data.unit_name' + ) project_organization = serializers.CharField( source='project.organization_name' ) diff --git a/tock/tock/templates/hours/reports_list.html b/tock/tock/templates/hours/reports_list.html index 0de6356f..34ad6c4e 100644 --- a/tock/tock/templates/hours/reports_list.html +++ b/tock/tock/templates/hours/reports_list.html @@ -10,6 +10,13 @@

Tock Reports

Regular Reports

+
+
+

+ Large reports may fail to download. Change the date range in the report URL to work around this limitation. +

+
+