Update issues_save_hook_listener.rb

Removed un-needed code, and added parenthesis on line 33
This commit is contained in:
2016-01-21 13:37:30 -05:00
parent 0fb4ec1157
commit 0ed61b191f

View File

@@ -13,7 +13,6 @@ class IssuesSaveHookListener < Redmine::Hook::ViewListener
#Before Issue Saved #Before Issue Saved
def controller_issues_edit_before_save(context={}) def controller_issues_edit_before_save(context={})
issue = context[:issue] issue = context[:issue]
cf_estimate = CustomField.find_by_name("Estimate")
# Check to see if we have registered with QBO # Check to see if we have registered with QBO
if Qbo.first && issue.qbo_customer && issue.qbo_item if Qbo.first && issue.qbo_customer && issue.qbo_item
@@ -31,7 +30,7 @@ class IssuesSaveHookListener < Redmine::Hook::ViewListener
estimate.txn_date = Date.today estimate.txn_date = Date.today
# Create the line item for labor # Create the line item for labor
item = item_service.fetch_by_id issue.qbo_item_id item = item_service.fetch_by_id(issue.qbo_item_id)
line_item = Quickbooks::Model::InvoiceLineItem.new line_item = Quickbooks::Model::InvoiceLineItem.new
line_item.amount = item.unit_price * issue.estimated_hours line_item.amount = item.unit_price * issue.estimated_hours