From deb3b7cac5314d17dd8c5934f175dd4d40184d52 Mon Sep 17 00:00:00 2001 From: Rick Barrette Date: Sat, 9 Jan 2016 08:56:32 -0500 Subject: [PATCH] Check if spent hours is > 0 before billing --- lib/issues_save_hook_listener.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/issues_save_hook_listener.rb b/lib/issues_save_hook_listener.rb index dc83500..df4af63 100644 --- a/lib/issues_save_hook_listener.rb +++ b/lib/issues_save_hook_listener.rb @@ -43,7 +43,7 @@ class IssuesSaveHookListener < Redmine::Hook::ViewListener # If the issue is closed, then create a new billable time activty for the customer # TODO Add configuration settings for employee_id, hourly_rate, item_id - if issue.status.is_closed? and not issue.qbo_customer_id.nil? and not issue.qbo_item_id.nil? and not employee_id.nil? then + if issue.status.is_closed? and not issue.qbo_customer_id.nil? and not issue.qbo_item_id.nil? and not employee_id.nil? and spent_hours > 0 then time_entry.description = "Ticket ##{issue.id}: #{issue.subject}" time_entry.employee_id = employee_id time_entry.customer_id = issue.qbo_customer_id