diff --git a/Gemfile b/Gemfile index 1ce29d7..4bcfc74 100644 --- a/Gemfile +++ b/Gemfile @@ -6,7 +6,7 @@ gem 'oauth-plugin' gem 'oauth' gem 'roxml' gem 'edmunds_vin' -gem 'will_paginate', '~> 3.1.0' +gem 'will_paginate' group :assets do gem 'coffee-rails' diff --git a/app/controllers/qbo_controller.rb b/app/controllers/qbo_controller.rb index 2c91e92..22abf7a 100644 --- a/app/controllers/qbo_controller.rb +++ b/app/controllers/qbo_controller.rb @@ -66,8 +66,12 @@ class QboController < ApplicationController # Manual Billing def bill i = Issue.find_by_id params[:id] - i.bill_time - redirect_to i, :flash => { :notice => "Successfully Billed #{i.customer.name}" } + if i.customer + i.bill_time + redirect_to i, :flash => { :notice => "Successfully Billed #{i.customer.name}" } + else + redirect_to i, :flash => { :error => "Cannot bill without a customer assigned" } + end end # Quickbooks Webhook Callback