plutus 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. data/.yardopts +2 -0
  2. data/LICENSE +23 -0
  3. data/README.markdown +194 -0
  4. data/Rakefile +24 -0
  5. data/VERSION.yml +5 -0
  6. data/app/controllers/accounts_controller.rb +43 -0
  7. data/app/controllers/transactions_controller.rb +42 -0
  8. data/app/models/account.rb +57 -0
  9. data/app/models/asset.rb +81 -0
  10. data/app/models/equity.rb +82 -0
  11. data/app/models/expense.rb +81 -0
  12. data/app/models/liability.rb +76 -0
  13. data/app/models/revenue.rb +81 -0
  14. data/app/models/transaction.rb +27 -0
  15. data/app/views/accounts/index.html.erb +27 -0
  16. data/app/views/accounts/show.html.erb +69 -0
  17. data/app/views/layouts/accounts.html.erb +68 -0
  18. data/app/views/layouts/transactions.html.erb +68 -0
  19. data/app/views/transactions/index.html.erb +27 -0
  20. data/app/views/transactions/show.html.erb +24 -0
  21. data/doc/Account.html +300 -0
  22. data/doc/AccountsController.html +317 -0
  23. data/doc/Asset.html +610 -0
  24. data/doc/Equity.html +610 -0
  25. data/doc/Expense.html +610 -0
  26. data/doc/Liability.html +588 -0
  27. data/doc/Revenue.html +610 -0
  28. data/doc/Transaction.html +156 -0
  29. data/doc/TransactionsController.html +317 -0
  30. data/doc/_index.html +166 -0
  31. data/doc/class_list.html +36 -0
  32. data/doc/css/common.css +1 -0
  33. data/doc/css/full_list.css +53 -0
  34. data/doc/css/style.css +310 -0
  35. data/doc/file.README.html +250 -0
  36. data/doc/file_list.html +38 -0
  37. data/doc/frames.html +13 -0
  38. data/doc/index.html +250 -0
  39. data/doc/js/app.js +202 -0
  40. data/doc/js/full_list.js +149 -0
  41. data/doc/js/jquery.js +154 -0
  42. data/doc/method_list.html +235 -0
  43. data/doc/top-level-namespace.html +88 -0
  44. data/generators/plutus/USAGE +11 -0
  45. data/generators/plutus/plutus_generator.rb +9 -0
  46. data/generators/plutus/templates/plutus.rb +33 -0
  47. data/lib/plutus.rb +1 -0
  48. data/plutus.gemspec +122 -0
  49. data/rails/init.rb +1 -0
  50. data/spec/controllers/accounts_controller_spec.rb +25 -0
  51. data/spec/controllers/transactions_controller_spec.rb +25 -0
  52. data/spec/factories/account_factory.rb +29 -0
  53. data/spec/factories/transaction_factory.rb +6 -0
  54. data/spec/lib/plutus_spec.rb +0 -0
  55. data/spec/models/account_spec.rb +43 -0
  56. data/spec/models/asset_spec.rb +46 -0
  57. data/spec/models/equity_spec.rb +46 -0
  58. data/spec/models/expense_spec.rb +46 -0
  59. data/spec/models/liability_spec.rb +46 -0
  60. data/spec/models/revenue_spec.rb +46 -0
  61. data/spec/models/transaction_spec.rb +48 -0
  62. data/spec/rcov.opts +2 -0
  63. data/spec/routing/accounts_routing_spec.rb +29 -0
  64. data/spec/routing/transactions_routing_spec.rb +29 -0
  65. data/spec/schema.rb +31 -0
  66. data/spec/spec.opts +4 -0
  67. data/spec/spec_helper.rb +57 -0
  68. data/tasks/plutus_tasks.rake +4 -0
  69. metadata +150 -0
@@ -0,0 +1,235 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html>
4
+ <head>
5
+ <meta name="Content-Type" content="text/html; charset=utf-8" />
6
+ <link rel="stylesheet" href="css/full_list.css" type="text/css" media="screen" charset="utf-8" />
7
+ <link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
8
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
9
+ <script type="text/javascript" charset="utf-8" src="js/full_list.js"></script>
10
+ <base id="base_target" target="_parent" />
11
+ </head>
12
+ <body>
13
+ <script type="text/javascript" charset="utf-8">
14
+ if (window.top.frames.main) {
15
+ document.getElementById('base_target').target = 'main';
16
+ document.body.className = 'frames';
17
+ }
18
+ </script>
19
+ <div id="content">
20
+ <h1 id="full_list_header">Method List</h1>
21
+ <div id="nav">
22
+ <a target="_self" href="class_list.html">Classes</a> |
23
+ <a target="_self" href="method_list.html">Methods</a> |
24
+ <a target="_self" href="file_list.html">Files</a>
25
+ </div>
26
+ <div id="search">Search: <input type="text" /></div>
27
+
28
+ <ul id="full_list" class="methods">
29
+
30
+
31
+ <li class="r1 ">
32
+ <span class='object_link'><a href="Equity.html#balance-class_method" title="Equity.balance (method)">balance</a></span>
33
+
34
+ <small>Equity</small>
35
+
36
+ </li>
37
+
38
+
39
+ <li class="r2 ">
40
+ <span class='object_link'><a href="Asset.html#balance-instance_method" title="Asset#balance (method)">#balance</a></span>
41
+
42
+ <small>Asset</small>
43
+
44
+ </li>
45
+
46
+
47
+ <li class="r1 ">
48
+ <span class='object_link'><a href="Asset.html#balance-class_method" title="Asset.balance (method)">balance</a></span>
49
+
50
+ <small>Asset</small>
51
+
52
+ </li>
53
+
54
+
55
+ <li class="r2 ">
56
+ <span class='object_link'><a href="Revenue.html#balance-class_method" title="Revenue.balance (method)">balance</a></span>
57
+
58
+ <small>Revenue</small>
59
+
60
+ </li>
61
+
62
+
63
+ <li class="r1 ">
64
+ <span class='object_link'><a href="Liability.html#balance-instance_method" title="Liability#balance (method)">#balance</a></span>
65
+
66
+ <small>Liability</small>
67
+
68
+ </li>
69
+
70
+
71
+ <li class="r2 ">
72
+ <span class='object_link'><a href="Equity.html#balance-instance_method" title="Equity#balance (method)">#balance</a></span>
73
+
74
+ <small>Equity</small>
75
+
76
+ </li>
77
+
78
+
79
+ <li class="r1 ">
80
+ <span class='object_link'><a href="Expense.html#balance-instance_method" title="Expense#balance (method)">#balance</a></span>
81
+
82
+ <small>Expense</small>
83
+
84
+ </li>
85
+
86
+
87
+ <li class="r2 ">
88
+ <span class='object_link'><a href="Revenue.html#balance-instance_method" title="Revenue#balance (method)">#balance</a></span>
89
+
90
+ <small>Revenue</small>
91
+
92
+ </li>
93
+
94
+
95
+ <li class="r1 ">
96
+ <span class='object_link'><a href="Liability.html#balance-class_method" title="Liability.balance (method)">balance</a></span>
97
+
98
+ <small>Liability</small>
99
+
100
+ </li>
101
+
102
+
103
+ <li class="r2 ">
104
+ <span class='object_link'><a href="Expense.html#balance-class_method" title="Expense.balance (method)">balance</a></span>
105
+
106
+ <small>Expense</small>
107
+
108
+ </li>
109
+
110
+
111
+ <li class="r1 ">
112
+ <span class='object_link'><a href="Equity.html#credits_balance-instance_method" title="Equity#credits_balance (method)">#credits_balance</a></span>
113
+
114
+ <small>Equity</small>
115
+
116
+ </li>
117
+
118
+
119
+ <li class="r2 ">
120
+ <span class='object_link'><a href="Expense.html#credits_balance-instance_method" title="Expense#credits_balance (method)">#credits_balance</a></span>
121
+
122
+ <small>Expense</small>
123
+
124
+ </li>
125
+
126
+
127
+ <li class="r1 ">
128
+ <span class='object_link'><a href="Asset.html#credits_balance-instance_method" title="Asset#credits_balance (method)">#credits_balance</a></span>
129
+
130
+ <small>Asset</small>
131
+
132
+ </li>
133
+
134
+
135
+ <li class="r2 ">
136
+ <span class='object_link'><a href="Liability.html#credits_balance-instance_method" title="Liability#credits_balance (method)">#credits_balance</a></span>
137
+
138
+ <small>Liability</small>
139
+
140
+ </li>
141
+
142
+
143
+ <li class="r1 ">
144
+ <span class='object_link'><a href="Revenue.html#credits_balance-instance_method" title="Revenue#credits_balance (method)">#credits_balance</a></span>
145
+
146
+ <small>Revenue</small>
147
+
148
+ </li>
149
+
150
+
151
+ <li class="r2 ">
152
+ <span class='object_link'><a href="Liability.html#debits_balance-instance_method" title="Liability#debits_balance (method)">#debits_balance</a></span>
153
+
154
+ <small>Liability</small>
155
+
156
+ </li>
157
+
158
+
159
+ <li class="r1 ">
160
+ <span class='object_link'><a href="Equity.html#debits_balance-instance_method" title="Equity#debits_balance (method)">#debits_balance</a></span>
161
+
162
+ <small>Equity</small>
163
+
164
+ </li>
165
+
166
+
167
+ <li class="r2 ">
168
+ <span class='object_link'><a href="Revenue.html#debits_balance-instance_method" title="Revenue#debits_balance (method)">#debits_balance</a></span>
169
+
170
+ <small>Revenue</small>
171
+
172
+ </li>
173
+
174
+
175
+ <li class="r1 ">
176
+ <span class='object_link'><a href="Expense.html#debits_balance-instance_method" title="Expense#debits_balance (method)">#debits_balance</a></span>
177
+
178
+ <small>Expense</small>
179
+
180
+ </li>
181
+
182
+
183
+ <li class="r2 ">
184
+ <span class='object_link'><a href="Asset.html#debits_balance-instance_method" title="Asset#debits_balance (method)">#debits_balance</a></span>
185
+
186
+ <small>Asset</small>
187
+
188
+ </li>
189
+
190
+
191
+ <li class="r1 ">
192
+ <span class='object_link'><a href="TransactionsController.html#index-instance_method" title="TransactionsController#index (method)">#index</a></span>
193
+
194
+ <small>TransactionsController</small>
195
+
196
+ </li>
197
+
198
+
199
+ <li class="r2 ">
200
+ <span class='object_link'><a href="AccountsController.html#index-instance_method" title="AccountsController#index (method)">#index</a></span>
201
+
202
+ <small>AccountsController</small>
203
+
204
+ </li>
205
+
206
+
207
+ <li class="r1 ">
208
+ <span class='object_link'><a href="AccountsController.html#show-instance_method" title="AccountsController#show (method)">#show</a></span>
209
+
210
+ <small>AccountsController</small>
211
+
212
+ </li>
213
+
214
+
215
+ <li class="r2 ">
216
+ <span class='object_link'><a href="TransactionsController.html#show-instance_method" title="TransactionsController#show (method)">#show</a></span>
217
+
218
+ <small>TransactionsController</small>
219
+
220
+ </li>
221
+
222
+
223
+ <li class="r1 ">
224
+ <span class='object_link'><a href="Account.html#trial_balance-class_method" title="Account.trial_balance (method)">trial_balance</a></span>
225
+
226
+ <small>Account</small>
227
+
228
+ </li>
229
+
230
+
231
+ </ul>
232
+ </div>
233
+ </body>
234
+ </html>
235
+
@@ -0,0 +1,88 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta name="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>Top Level Namespace</title>
7
+ <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
8
+ <link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
9
+
10
+ <script type="text/javascript" charset="utf-8">
11
+ relpath = '';
12
+ if (relpath != '') relpath += '/';
13
+ </script>
14
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
15
+ <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
16
+
17
+ </head>
18
+ <body>
19
+ <script type="text/javascript" charset="utf-8">
20
+ if (window.top.frames.main) document.body.className = 'frames';
21
+ </script>
22
+
23
+ <div id="header">
24
+ <div id="menu">
25
+
26
+ <a href="_index.html">Index</a> &raquo;
27
+
28
+
29
+ <span class="title">Top Level Namespace</span>
30
+
31
+
32
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
33
+ </div>
34
+
35
+ <div id="search">
36
+ <a id="class_list_link" href="#">Class List</a>
37
+ <a id="method_list_link" href="#">Method List</a>
38
+ <a id ="file_list_link" href="#">File List</a>
39
+ </div>
40
+
41
+ <div class="clear"></div>
42
+ </div>
43
+
44
+ <iframe id="search_frame"></iframe>
45
+
46
+ <div id="content"><h1>Top Level Namespace
47
+
48
+
49
+
50
+ </h1>
51
+
52
+ <dl class="box">
53
+
54
+
55
+
56
+
57
+
58
+
59
+
60
+
61
+ </dl>
62
+ <div class="clear"></div>
63
+
64
+ <h2>Defined Under Namespace</h2>
65
+ <p class="children">
66
+
67
+
68
+
69
+
70
+ <strong class="classes">Classes:</strong> <span class='object_link'><a href="Account.html" title="Account (class)">Account</a></span>, <span class='object_link'><a href="AccountsController.html" title="AccountsController (class)">AccountsController</a></span>, <span class='object_link'><a href="Asset.html" title="Asset (class)">Asset</a></span>, <span class='object_link'><a href="Equity.html" title="Equity (class)">Equity</a></span>, <span class='object_link'><a href="Expense.html" title="Expense (class)">Expense</a></span>, <span class='object_link'><a href="Liability.html" title="Liability (class)">Liability</a></span>, <span class='object_link'><a href="Revenue.html" title="Revenue (class)">Revenue</a></span>, <span class='object_link'><a href="Transaction.html" title="Transaction (class)">Transaction</a></span>, <span class='object_link'><a href="TransactionsController.html" title="TransactionsController (class)">TransactionsController</a></span>
71
+
72
+
73
+ </p>
74
+
75
+
76
+
77
+
78
+
79
+ </div>
80
+
81
+ <div id="footer">
82
+ Generated on Fri Nov 19 14:05:59 2010 by
83
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
84
+ 0.6.2 (ruby-1.8.7).
85
+ </div>
86
+
87
+ </body>
88
+ </html>
@@ -0,0 +1,11 @@
1
+ Description:
2
+ Generator for Plutus Plugin
3
+
4
+ Example:
5
+ ./script/generate plutus plutus
6
+
7
+ This will create:
8
+ Create a migration in the application for the "Account" and Transaction" tables.
9
+
10
+ Once generated, simply run:
11
+ rake db:migrate
@@ -0,0 +1,9 @@
1
+ class PlutusGenerator < Rails::Generator::NamedBase
2
+ def manifest
3
+ record do |m|
4
+ # m.directory "lib"
5
+ # m.template 'README', "README"
6
+ m.migration_template 'plutus.rb', 'db/migrate'
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,33 @@
1
+ class Plutus < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :accounts do |t|
4
+ t.string :name
5
+ t.string :type
6
+ t.boolean :contra
7
+
8
+ t.timestamps
9
+ end
10
+
11
+ add_index :accounts, [:name, :type]
12
+
13
+ create_table :transactions do |t|
14
+ t.string :description
15
+ t.integer :credit_account_id
16
+ t.integer :debit_account_id
17
+ t.decimal :amount, :precision => 20, :scale => 10
18
+ t.integer :commercial_document_id
19
+ t.string :commercial_document_type
20
+
21
+ t.timestamps
22
+ end
23
+
24
+ add_index :transactions, :credit_account_id
25
+ add_index :transactions, :debit_account_id
26
+ add_index :transactions, [:commercial_document_id, :commercial_document_type], :name => "index_transactions_on_commercial_doc"
27
+ end
28
+
29
+ def self.down
30
+ drop_table :accounts
31
+ drop_table :transactions
32
+ end
33
+ end
data/lib/plutus.rb ADDED
@@ -0,0 +1 @@
1
+ # Plutus
data/plutus.gemspec ADDED
@@ -0,0 +1,122 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{plutus}
8
+ s.version = "0.4.2"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Michael Bulat"]
12
+ s.date = %q{2010-11-19}
13
+ s.description = %q{The plutus plugin provides a complete double entry accounting system for use in any Ruby on Rails application. The plugin follows general Double Entry Bookkeeping practices. All calculations are done using BigDecimal in order to prevent floating point rounding errors. The plugin requires a decimal type on your database as well.}
14
+ s.email = %q{mbulat@crazydogsoftware.com}
15
+ s.extra_rdoc_files = [
16
+ "LICENSE",
17
+ "README.markdown"
18
+ ]
19
+ s.files = [
20
+ ".yardopts",
21
+ "LICENSE",
22
+ "README.markdown",
23
+ "Rakefile",
24
+ "VERSION.yml",
25
+ "app/controllers/accounts_controller.rb",
26
+ "app/controllers/transactions_controller.rb",
27
+ "app/models/account.rb",
28
+ "app/models/asset.rb",
29
+ "app/models/equity.rb",
30
+ "app/models/expense.rb",
31
+ "app/models/liability.rb",
32
+ "app/models/revenue.rb",
33
+ "app/models/transaction.rb",
34
+ "app/views/accounts/index.html.erb",
35
+ "app/views/accounts/show.html.erb",
36
+ "app/views/layouts/accounts.html.erb",
37
+ "app/views/layouts/transactions.html.erb",
38
+ "app/views/transactions/index.html.erb",
39
+ "app/views/transactions/show.html.erb",
40
+ "doc/Account.html",
41
+ "doc/AccountsController.html",
42
+ "doc/Asset.html",
43
+ "doc/Equity.html",
44
+ "doc/Expense.html",
45
+ "doc/Liability.html",
46
+ "doc/Revenue.html",
47
+ "doc/Transaction.html",
48
+ "doc/TransactionsController.html",
49
+ "doc/_index.html",
50
+ "doc/class_list.html",
51
+ "doc/css/common.css",
52
+ "doc/css/full_list.css",
53
+ "doc/css/style.css",
54
+ "doc/file.README.html",
55
+ "doc/file_list.html",
56
+ "doc/frames.html",
57
+ "doc/index.html",
58
+ "doc/js/app.js",
59
+ "doc/js/full_list.js",
60
+ "doc/js/jquery.js",
61
+ "doc/method_list.html",
62
+ "doc/top-level-namespace.html",
63
+ "generators/plutus/USAGE",
64
+ "generators/plutus/plutus_generator.rb",
65
+ "generators/plutus/templates/plutus.rb",
66
+ "lib/plutus.rb",
67
+ "plutus.gemspec",
68
+ "rails/init.rb",
69
+ "spec/controllers/accounts_controller_spec.rb",
70
+ "spec/controllers/transactions_controller_spec.rb",
71
+ "spec/factories/account_factory.rb",
72
+ "spec/factories/transaction_factory.rb",
73
+ "spec/lib/plutus_spec.rb",
74
+ "spec/models/account_spec.rb",
75
+ "spec/models/asset_spec.rb",
76
+ "spec/models/equity_spec.rb",
77
+ "spec/models/expense_spec.rb",
78
+ "spec/models/liability_spec.rb",
79
+ "spec/models/revenue_spec.rb",
80
+ "spec/models/transaction_spec.rb",
81
+ "spec/rcov.opts",
82
+ "spec/routing/accounts_routing_spec.rb",
83
+ "spec/routing/transactions_routing_spec.rb",
84
+ "spec/schema.rb",
85
+ "spec/spec.opts",
86
+ "spec/spec_helper.rb",
87
+ "tasks/plutus_tasks.rake"
88
+ ]
89
+ s.homepage = %q{http://github.com/mbulat/Plutus}
90
+ s.require_paths = ["lib"]
91
+ s.rubygems_version = %q{1.3.7}
92
+ s.summary = %q{A Plugin providing a Double Entry Accounting Engine for Rails}
93
+ s.test_files = [
94
+ "spec/controllers/accounts_controller_spec.rb",
95
+ "spec/controllers/transactions_controller_spec.rb",
96
+ "spec/factories/account_factory.rb",
97
+ "spec/factories/transaction_factory.rb",
98
+ "spec/lib/plutus_spec.rb",
99
+ "spec/models/account_spec.rb",
100
+ "spec/models/asset_spec.rb",
101
+ "spec/models/equity_spec.rb",
102
+ "spec/models/expense_spec.rb",
103
+ "spec/models/liability_spec.rb",
104
+ "spec/models/revenue_spec.rb",
105
+ "spec/models/transaction_spec.rb",
106
+ "spec/routing/accounts_routing_spec.rb",
107
+ "spec/routing/transactions_routing_spec.rb",
108
+ "spec/schema.rb",
109
+ "spec/spec_helper.rb"
110
+ ]
111
+
112
+ if s.respond_to? :specification_version then
113
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
114
+ s.specification_version = 3
115
+
116
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
117
+ else
118
+ end
119
+ else
120
+ end
121
+ end
122
+