Rails plugin providing financal accounting models and helpers
Ruby JavaScript HTML
Latest commit 2eba8a2 Oct 18, 2016 @huerlisi Bump to 3.1.0
Permalink
Failed to load latest commit information.
app/models fix(ruby): stay compatible with ruby 1.9 Dec 16, 2015
config/locales
db/migrate
lib Bump to 3.1.0 Oct 18, 2016
spec
.gitignore Cleanup gitignore. Jul 1, 2014
.rspec Update .rspec. Jul 1, 2014
.ruby-version chore(gems): update all gems, making ready for Ruby 2.2 Jun 28, 2015
.travis.yml chore(gems): update all gems, making ready for Ruby 2.2 Jun 28, 2015
CHANGELOG Update CHANGELOG. Nov 23, 2015
Gemfile fix(Gemfile): pin acts-as-taggable gem to compatible version Nov 23, 2015
Gemfile.lock fix(Gemfile): pin acts-as-taggable gem to compatible version Nov 23, 2015
MIT-LICENSE Move Copyright declarations from README to LICENSE. Jul 1, 2014
README.md Language fixes in gem description and README. Feb 21, 2015
Rakefile Autocorrect some syntax/style issues using rubocop. Feb 27, 2015
has_accounts.gemspec chore(gem): relax dependency on rails to allow Rails 4/5 Oct 18, 2016

README.md

has_accounts

Build Status

Rails plugin providing financal accounting models and helpers.

Install

In Rails simply add to your Gemfile:

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.