mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2025-11-08 17:04:23 -05:00
Update issues_save_hook_listener.rb
This commit is contained in:
@@ -55,12 +55,15 @@ class IssuesSaveHookListener < Redmine::Hook::ViewListener
|
|||||||
# Called After Issue Saved
|
# Called After Issue Saved
|
||||||
def controller_issues_edit_after_save(context={})
|
def controller_issues_edit_after_save(context={})
|
||||||
issue = context[:issue]
|
issue = context[:issue]
|
||||||
|
|
||||||
|
if issue.assigned_to
|
||||||
employee_id = issue.assigned_to.qbo_employee_id
|
employee_id = issue.assigned_to.qbo_employee_id
|
||||||
|
|
||||||
# Check to see if we have registered with QBO and if the issue is closed.
|
# Check to see if we have registered with QBO and if the issue is closed.
|
||||||
# If so then we need to create a new billable time activity for the customer
|
# If so then we need to create a new billable time activity for the customer
|
||||||
bill_time(issue, employee_id) if Qbo.first && issue.customer && issue.qbo_item && employee_id && issue.status.is_closed?
|
bill_time(issue, employee_id) if Qbo.first && issue.customer && issue.qbo_item && employee_id && issue.status.is_closed?
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# Create billable time entries
|
# Create billable time entries
|
||||||
def bill_time(issue, employee_id)
|
def bill_time(issue, employee_id)
|
||||||
|
|||||||
Reference in New Issue
Block a user