Sha256: 78ab98325b6be7edc75ab4a5d0df6c70fa05695490c90c55a6de702cdec57693

Contents?: true

Size: 847 Bytes

Versions: 30

Compression:

Stored size: 847 Bytes

Contents

module MnoEnterprise
  class InvoicesController < ApplicationController
    before_filter :authenticate_user!
    before_filter :redirect_to_lounge_if_unconfirmed
    
    # GET /mnoe/invoices/201504-NU4
    def show
      @invoice = MnoEnterprise::Invoice.where(slug: params[:id].upcase).reload.first
      authorize! :manage_billing, current_user.organizations.find(@invoice.organization_id)
    
      respond_to do |format|
        if @invoice
          filename = "Invoice - #{@invoice.slug}.pdf"
          pdf_view = MnoEnterprise::InvoicePdf.new(@invoice).render
          format.html { send_data pdf_view, filename: filename, type: "application/pdf", disposition: 'inline'  }
        else
          format.html { redirect_to root_path, :alert => 'Sorry, the page requested could not be displayed' }
        end
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
mno-enterprise-frontend-3.4.0 app/controllers/mno_enterprise/invoices_controller.rb
mno-enterprise-frontend-3.3.3 app/controllers/mno_enterprise/invoices_controller.rb
mno-enterprise-frontend-3.3.2 app/controllers/mno_enterprise/invoices_controller.rb
mno-enterprise-frontend-3.2.1 app/controllers/mno_enterprise/invoices_controller.rb
mno-enterprise-frontend-3.3.1 app/controllers/mno_enterprise/invoices_controller.rb
mno-enterprise-frontend-3.3.0 app/controllers/mno_enterprise/invoices_controller.rb
mno-enterprise-frontend-3.2.0 app/controllers/mno_enterprise/invoices_controller.rb
mno-enterprise-frontend-3.1.4 app/controllers/mno_enterprise/invoices_controller.rb
mno-enterprise-frontend-3.0.7 app/controllers/mno_enterprise/invoices_controller.rb
mno-enterprise-frontend-2.0.9 app/controllers/mno_enterprise/invoices_controller.rb
mno-enterprise-frontend-3.1.3 app/controllers/mno_enterprise/invoices_controller.rb
mno-enterprise-frontend-3.0.6 app/controllers/mno_enterprise/invoices_controller.rb
mno-enterprise-frontend-2.0.8 app/controllers/mno_enterprise/invoices_controller.rb
mno-enterprise-frontend-3.1.2 app/controllers/mno_enterprise/invoices_controller.rb
mno-enterprise-frontend-3.0.5 app/controllers/mno_enterprise/invoices_controller.rb
mno-enterprise-frontend-2.0.7 app/controllers/mno_enterprise/invoices_controller.rb
mno-enterprise-frontend-2.0.6 app/controllers/mno_enterprise/invoices_controller.rb
mno-enterprise-frontend-2.0.5 app/controllers/mno_enterprise/invoices_controller.rb
mno-enterprise-frontend-3.1.1 app/controllers/mno_enterprise/invoices_controller.rb
mno-enterprise-frontend-3.0.4 app/controllers/mno_enterprise/invoices_controller.rb