Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Rails plugin providing financal accounting models and helpers

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 app
Octocat-spinner-32 config
Octocat-spinner-32 db
Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .rspec
Octocat-spinner-32 .travis.yml
Octocat-spinner-32 CHANGELOG
Octocat-spinner-32 Gemfile
Octocat-spinner-32 Gemfile.lock
Octocat-spinner-32 MIT-LICENSE
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 has_accounts.gemspec
Octocat-spinner-32 init.rb
README.md

has_accounts

Build Status

Rails plugin providing financal accounting models and helpers.

Install

In Rails 3 simply add

gem 'has_accounts'

Integration

Generate and run migrations

rake has_accounts:install:migrations
rake db:migrate

Seed basic account data

AccountType.create!([
  {:name => "current_assets", :title => "Umlaufvermögen"},
  {:name => "capital_assets", :title => "Anlagevermögen"},
  {:name => "outside_capital", :title => "Fremdkapital"},
  {:name => "equity_capital", :title => "Eigenkapital"},
  {:name => "costs", :title => "Aufwand"},
  {:name => "earnings", :title => "Ertrag"},
])

Add specific seed depending on the needs of your project, e.g.:

current_assets = AccountType.find_by_name('current_assets')
capital_assets = AccountType.find_by_name('capital_assets')
earnings = AccountType.find_by_name('earnings')
costs = AccountType.find_by_name('costs')

Account.create!([
  {:code => "1000", :title => "Kasse", :account_type => current_assets},
  {:code => "1100", :title => "Debitoren", :account_type => current_assets},
  {:code => "3200", :title => "Dienstleistungsertrag", :account_type => earnings},
  {:code => "3900", :title => "Debitorenverlust", :account_type => costs},
  {:code => "8000", :title => "Ausserordentlicher Ertrag", :account_type => earnings}
])

Example

A few models are available:

class Booking
class Account
class AccountType

There's also a ready to use module available to attach accountable functionality to existing models.

To use it, simply add the following to your Model:

include HasAccounts::Model

License

Released under the MIT license.

Something went wrong with that request. Please try again.