foodsoft/app/controllers/finance/base_controller.rb
Patrick Gansterer 3fb3fa409b Limit financial overview items to speed up loading
If a foodcoop does not use the balancing feature the list of unfinished
orders will be very long and needs a significant amount of time to load.
2020-03-23 16:29:30 +01:00

11 lines
396 B
Ruby

class Finance::BaseController < ApplicationController
before_action :authenticate_finance
def index
@financial_transactions = FinancialTransaction.includes(:ordergroup).order('created_on DESC').limit(8)
@orders = Order.finished_not_closed.includes(:supplier).limit(8)
@unpaid_invoices = Invoice.unpaid.includes(:supplier).limit(8)
render template: 'finance/index'
end
end