foodsoft/app/controllers/finance/base_controller.rb
Patrick Gansterer 1a49bee42d Adopt model to allow FinancialTransaction without an ordergroup
This will allow us to add accounting for the foodcoop itself, to support
listing for spendings independent of the order (e.g. rent, electricity).
2020-07-29 11:43:31 +02:00

11 lines
412 B
Ruby

class Finance::BaseController < ApplicationController
before_action :authenticate_finance
def index
@financial_transactions = FinancialTransaction.with_ordergroup.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