Class: CustomersController

Inherits:
PeopleController show all
Defined in:
app/controllers/customers_controller.rb

Instance Method Summary collapse

Methods inherited from AuthorizedController

#set_locale

Instance Method Details

#showObject



4
5
6
7
8
9
10
11
# File 'app/controllers/customers_controller.rb', line 4

def show
  # Invoice scoping by state
  by_state = params[:by_state] || 'all'
  @open_debit_invoices = resource.invoices.reorder('due_date DESC').by_state('booked')
  @paid_debit_invoices = resource.invoices.reorder('due_date DESC').by_state(['canceled', 'paid'])

  show!
end