Added Invoice Support

This commit is contained in:
2016-01-24 18:54:34 -05:00
parent 98b89e7875
commit 0b74f2cf52
10 changed files with 113 additions and 12 deletions

View File

@@ -70,6 +70,7 @@ class QboController < ApplicationController
QboItem.update_all
QboEmployee.update_all
QboEstimate.update_all
QboInvoice.update_all
end
redirect_to qbo_path(:redmine_qbo), :flash => { :notice => "Successfully synced to Quickbooks" }
@@ -84,4 +85,13 @@ class QboController < ApplicationController
send_data @pdf, filename: "estimate.pdf", :disposition => 'inline', :type => "application/pdf"
end
#
# Downloads and forwards the invoice pdf
#
def invoice_pdf
base = QboInvoice.get_base.service
@pdf = base.pdf(base.fetch_by_id(params[:id]))
send_data @pdf, filename: "invoice.pdf", :disposition => 'inline', :type => "application/pdf"
end
end