Class: Vfwcash::Checkbook
- Inherits:
-
Thor
- Object
- Thor
- Vfwcash::Checkbook
- Defined in:
- lib/vfwcash/cli.rb
Instance Method Summary collapse
- #__print_date_help ⇒ Object
- #__print_version ⇒ Object
- #audit(date = nil) ⇒ Object
- #balance(date = nil) ⇒ Object
- #between(first, last) ⇒ Object
- #install ⇒ Object
- #ledger(date = nil) ⇒ Object
- #profit_loss ⇒ Object
- #register(date = nil) ⇒ Object
- #split(date = nil) ⇒ Object
- #summary(date = nil) ⇒ Object
Instance Method Details
#__print_date_help ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/vfwcash/cli.rb', line 15 def __print_date_help puts <<-DATE_HELP The DATE parameter is optional on all reports requiring a date and will default to the current date if not present. Most dates will be converted to the first of the month requardless of the date entered. Entered dates are parsed using Chronic (https://github.com/mojombo/chronic). Chronic provide a wide range options. Probably the easiest option is the yyyy-mm format (again day is optional) but you can do stuff like: last-may last-October 'oct 2014' DATE_HELP end |
#__print_version ⇒ Object
50 51 52 |
# File 'lib/vfwcash/cli.rb', line 50 def __print_version puts "Version: #{Vfwcash::VERSION}" end |
#audit(date = nil) ⇒ Object
183 184 185 186 |
# File 'lib/vfwcash/cli.rb', line 183 def audit( date=nil ) bom = get_date(date) Controller.new(bom).audit end |
#balance(date = nil) ⇒ Object
195 196 197 198 |
# File 'lib/vfwcash/cli.rb', line 195 def balance( date=nil ) bom = get_date(date) Controller.new(bom).balance end |
#between(first, last) ⇒ Object
38 39 40 41 42 43 |
# File 'lib/vfwcash/cli.rb', line 38 def between(first, last) sdate = get_date(first) edate = get_date(last) bom = sdate - sdate.day + 1 Controller.new(bom).between(sdate,edate) end |
#ledger(date = nil) ⇒ Object
153 154 155 156 |
# File 'lib/vfwcash/cli.rb', line 153 def ledger( date=nil ) bom = get_date(date) Controller.new(bom).ledger end |
#profit_loss ⇒ Object
67 68 69 70 71 72 73 74 |
# File 'lib/vfwcash/cli.rb', line 67 def profit_loss # puts "Generate profit_loss report with options #{options.inspect}" Controller.new(Date.today).profit_loss() # api = Api.new(Date.today.beginning_of_month) # pl = api.cash.profit_loss(options) # puts api.cash.profit_loss(options).inspect end |
#register(date = nil) ⇒ Object
117 118 119 120 |
# File 'lib/vfwcash/cli.rb', line 117 def register( date=nil ) bom = get_date(date) Controller.new(bom).cb_register end |
#split(date = nil) ⇒ Object
136 137 138 139 |
# File 'lib/vfwcash/cli.rb', line 136 def split( date=nil ) bom = get_date(date) Controller.new(bom).split end |
#summary(date = nil) ⇒ Object
169 170 171 172 |
# File 'lib/vfwcash/cli.rb', line 169 def summary( date=nil ) bom = get_date(date) Controller.new(bom).summary end |