Skip to content

Commit

Permalink
add documentation to readme for balance with date range
Browse files Browse the repository at this point in the history
  • Loading branch information
mbulat committed Jul 28, 2015
1 parent bcabf46 commit 0cefc27
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,13 @@ Each account can report on its own balance. This number should normally be posit
=> #<BigDecimal:103259bb8,'0.2E4',4(12)>
```

The balance can also be calculated within a specified date range. Dates can be strings in the format of "yyyy-mm-dd" or Ruby Date objects.

```ruby
>> cash = Plutus::Asset.find_by_name("Cash")
>> cash.balance(:from_date => "2014-01-01", to_date => Date.today)
=> #<BigDecimal:103259bb8,'0.2E4',4(12)>
```

Checking the Balance of an Account Type
---------------------------------------
Expand All @@ -178,6 +185,13 @@ Each subclass of accounts can report on the total balance of all the accounts of
=> #<BigDecimal:103259bb8,'0.2E4',4(12)>
```

Again, a date range can be given

```ruby
>> Plutus::Asset.balance(:from_date => "2014-01-01", to_date => Date.today)
=> #<BigDecimal:103259bb8,'0.2E4',4(12)>
```

Calculating the Trial Balance
-----------------------------

Expand Down

0 comments on commit 0cefc27

Please sign in to comment.