Class: StripeInvoice::InvoicesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/stripe_invoice/invoices_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



9
10
11
12
13
# File 'app/controllers/stripe_invoice/invoices_controller.rb', line 9

def index
  @subscription = @owner.subscription
  
  @invoices = Charge.where(owner_id: @owner.id).order('date DESC')
end

#showObject



15
16
17
18
19
20
21
22
# File 'app/controllers/stripe_invoice/invoices_controller.rb', line 15

def show
  @invoice = Charge.find(params[:id])

  respond_to do |format|
    format.html {render layout: false}
    format.pdf
  end
end

#tax_report(data) ⇒ Object



24
25
26
27
28
# File 'app/controllers/stripe_invoice/invoices_controller.rb', line 24

def tax_report(data)
  @_response = ActionDispatch::Response.new
  @data = data
  render template: 'stripe_invoice/invoices/tax_report', :formats => [:pdf], :locals => {sicharges: data}
end