Class: Backend::BankStatementsController

Inherits:
BaseController show all
Defined in:
app/controllers/backend/bank_statements_controller.rb

Instance Attribute Summary

Attributes inherited from ApplicationController

#current_theme

Instance Method Summary collapse

Methods inherited from BaseController

account_lettering_states_crit, accounts_range_crit, amount_range_crit, crit_params, journal_entries_states_crit, journal_letter_crit, journal_period_crit, journals_crit, search_conditions

Methods inherited from ApplicationController

#after_sign_in_path_for, #authorized?, human_action_name, #human_action_name, #session_controller?

Instance Method Details

#edit_intervalObject


69
# File 'app/controllers/backend/bank_statements_controller.rb', line 69

def edit_interval; end

#importObject


54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'app/controllers/backend/bank_statements_controller.rb', line 54

def import
  @cash = Cash.find_by(id: params[:cash_id])
  return unless request.post?
  file = params[:upload]
  @import = OfxImport.new(file, @cash)
  if @import.run
    redirect_to action: :show, id: @import.bank_statement.id
  elsif @import.recoverable?
    @cash = @import.cash
    @bank_statement = @import.bank_statement
    @bank_statement.errors.add(:cash, :no_cash_match_ofx) unless @cash.valid?
    render :new
  end
end

#indexObject

Displays the main page with the list of bank statements


42
43
44
# File 'app/controllers/backend/bank_statements_controller.rb', line 42

def index
  redirect_to backend_cashes_path
end