Class: Teri::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/teri/cli.rb

Instance Method Summary collapse

Instance Method Details

#balance_sheetObject



37
38
39
40
# File 'lib/teri/cli.rb', line 37

def balance_sheet
  accounting = Accounting.new(options)
  accounting.generate_balance_sheet
end

#check_uncodedObject



27
28
29
30
# File 'lib/teri/cli.rb', line 27

def check_uncoded
  accounting = Accounting.new(options)
  accounting.check_uncoded_transactions
end

#close_yearObject



54
55
56
57
58
# File 'lib/teri/cli.rb', line 54

def close_year
  year = options[:year] || (Date.today.year - 1)
  accounting = Accounting.new(options)
  accounting.close_year(year)
end

#codeObject



15
16
17
18
19
20
21
22
23
24
# File 'lib/teri/cli.rb', line 15

def code
  # Process options
  options_hash = options.dup

  # Convert disable_ai to use_ai_suggestions
  options_hash[:use_ai_suggestions] = !options_hash.delete(:disable_ai) if options_hash.key?(:disable_ai)

  accounting = Accounting.new(options_hash)
  accounting.code_transactions
end

#fix_balanceObject



61
62
63
64
# File 'lib/teri/cli.rb', line 61

def fix_balance
  accounting = Accounting.new(options)
  accounting.fix_balance
end

#income_statementObject



47
48
49
50
# File 'lib/teri/cli.rb', line 47

def income_statement
  accounting = Accounting.new(options)
  accounting.generate_income_statement
end

#versionObject



67
68
69
# File 'lib/teri/cli.rb', line 67

def version
  puts "Teri version #{Teri::VERSION}"
end