From 3622f8cad7e388a865da28399d54c0a0ed1c8339 Mon Sep 17 00:00:00 2001 From: Ricky Barrette Date: Sat, 19 Mar 2022 05:16:26 -0400 Subject: [PATCH 1/3] Added space --- lib/issue_patch.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/issue_patch.rb b/lib/issue_patch.rb index b7c1ecd..6aac525 100644 --- a/lib/issue_patch.rb +++ b/lib/issue_patch.rb @@ -79,7 +79,7 @@ module IssuePatch next if item.nil? # Create the new billable time entry and upload it - time_entry.description = "#{tracker} ##{id}: #{subject} #{"(Partial @ #{done_ratio}%)" if not closed?}" + time_entry.description = "#{tracker} ##{id} : #{subject} #{"(Partial @ #{done_ratio}%)" if not closed?}" time_entry.employee_id = assigned_to.employee_id time_entry.customer_id = customer_id time_entry.billable_status = "Billable" From 8e329b2dd250692d4ff4e26852e827ae73d55f52 Mon Sep 17 00:00:00 2001 From: Ricky Barrette Date: Sat, 19 Mar 2022 05:29:59 -0400 Subject: [PATCH 2/3] Fix broken invoice processing --- app/models/invoice.rb | 20 ++++++++++---------- lib/issue_patch.rb | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/app/models/invoice.rb b/app/models/invoice.rb index 1910dc4..8644e72 100644 --- a/app/models/invoice.rb +++ b/app/models/invoice.rb @@ -70,26 +70,26 @@ class Invoice < ActiveRecord::Base end # processes the invoice into the database - def self.process_invoice(invoice) - logger.info "Processing invoice #{invoice.id}" + def self.process_invoice(i) + logger.info "Processing invoice #{i.id}" # Load the invoice into the database - invoice = Invoice.find_or_create_by(id: invoice.id) - invoice.doc_number = invoice.doc_number - invoice.id = invoice.id - invoice.customer_id = invoice.customer_ref - invoice.txn_date = invoice.txn_date + invoice = Invoice.find_or_create_by(id: i.id) + invoice.doc_number = i.doc_number + invoice.id = i.id + invoice.customer_id = i.customer_ref + invoice.txn_date = i.txn_date invoice.save! # Scan the private notes for hashtags and attach to the applicable issues - if not invoice.private_note.nil? - invoice.private_note.scan(/#(\w+)/).flatten.each { |issue| + if not i.private_note.nil? + i.private_note.scan(/#(\w+)/).flatten.each { |issue| attach_to_issue(Issue.find_by_id(issue.to_i), invoice) } end # Scan the line items for hashtags and attach to the applicable issues - invoice.line_items.each { |line| + i.line_items.each { |line| if line.description line.description.scan(/#(\w+)/).flatten.each { |issue| attach_to_issue(Issue.find_by_id(issue.to_i), invoice) diff --git a/lib/issue_patch.rb b/lib/issue_patch.rb index 6aac525..b7c1ecd 100644 --- a/lib/issue_patch.rb +++ b/lib/issue_patch.rb @@ -79,7 +79,7 @@ module IssuePatch next if item.nil? # Create the new billable time entry and upload it - time_entry.description = "#{tracker} ##{id} : #{subject} #{"(Partial @ #{done_ratio}%)" if not closed?}" + time_entry.description = "#{tracker} ##{id}: #{subject} #{"(Partial @ #{done_ratio}%)" if not closed?}" time_entry.employee_id = assigned_to.employee_id time_entry.customer_id = customer_id time_entry.billable_status = "Billable" From d8d1942673e5dd29fd21f0ca1ed89294e2f1553a Mon Sep 17 00:00:00 2001 From: Ricky Barrette Date: Sat, 19 Mar 2022 05:47:07 -0400 Subject: [PATCH 3/3] Version 1.1.6 --- init.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.rb b/init.rb index 45fd9e0..c79919d 100644 --- a/init.rb +++ b/init.rb @@ -22,7 +22,7 @@ Redmine::Plugin.register :redmine_qbo do name 'Redmine Quickbooks Online plugin' author 'Rick Barrette' description 'This is a plugin for Redmine to intergrate with Quickbooks Online to allow for seamless intergration CRM and invoicing of completed issues' - version '1.1.5' + version '1.1.6' url 'https://github.com/rickbarrette/redmine_qbo' author_url 'http://rickbarrette.org' settings :default => {'empty' => true}, :partial => 'qbo/settings'