Added Invoice Support

This commit is contained in:
ricky committed 2016-01-24 18:54:34 -05:00
1 parent 98b89e7875
commit 0b74f2cf52
10 files changed
+113 -12

No files matched your search

+10
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