From b1192a191275921f78699e37455182c179cacca7 Mon Sep 17 00:00:00 2001 From: Rick Barrette Date: Sun, 6 Feb 2022 16:37:00 -0500 Subject: [PATCH] Use host name from settings for auth & added exception handing in QboInvoice --- app/models/qbo_invoice.rb | 6 +++++- app/views/qbo/_settings.html.erb | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/models/qbo_invoice.rb b/app/models/qbo_invoice.rb index faa2f84..184e413 100644 --- a/app/models/qbo_invoice.rb +++ b/app/models/qbo_invoice.rb @@ -149,7 +149,11 @@ class QboInvoice < ActiveRecord::Base # Push updates #invoice.sync_token += 1 if is_changed - get_base.update(invoice) if is_changed + begin + get_base.update(invoice) if is_changed + rescue + # Do nothing, probaly too many vehicles on the invoice. This is a problem with how it's billed + # TODO Add notes in memo area end end diff --git a/app/views/qbo/_settings.html.erb b/app/views/qbo/_settings.html.erb index a998e42..838f80b 100644 --- a/app/views/qbo/_settings.html.erb +++ b/app/views/qbo/_settings.html.erb @@ -15,7 +15,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI