plutus 0.5.2 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +116 -69
- data/Rakefile +7 -20
- data/app/assets/javascripts/plutus/application.js +15 -0
- data/app/assets/stylesheets/plutus/application.css +13 -0
- data/app/assets/stylesheets/plutus/main.css.scss +86 -0
- data/app/controllers/plutus/accounts_controller.rb +45 -0
- data/app/controllers/plutus/transactions_controller.rb +44 -0
- data/app/models/plutus/account.rb +60 -0
- data/app/models/plutus/amount.rb +16 -0
- data/app/models/plutus/asset.rb +83 -0
- data/app/models/plutus/credit_amount.rb +10 -0
- data/app/models/plutus/debit_amount.rb +10 -0
- data/app/models/plutus/equity.rb +84 -0
- data/app/models/plutus/expense.rb +83 -0
- data/app/models/plutus/liability.rb +78 -0
- data/app/models/plutus/revenue.rb +83 -0
- data/app/models/plutus/transaction.rb +83 -0
- data/app/views/{accounts → plutus/accounts}/index.html.erb +4 -2
- data/app/views/{accounts → plutus/accounts}/show.html.erb +8 -18
- data/app/views/plutus/transactions/index.html.erb +48 -0
- data/app/views/plutus/transactions/show.html.erb +46 -0
- data/config/database.yml +5 -0
- data/config/routes.rb +6 -0
- data/lib/generators/plutus/templates/migration.rb +17 -13
- data/lib/plutus.rb +3 -2
- data/lib/plutus/version.rb +3 -0
- data/spec/controllers/accounts_controller_spec.rb +22 -19
- data/spec/controllers/transactions_controller_spec.rb +23 -20
- data/spec/factories/account_factory.rb +30 -24
- data/spec/factories/amount_factory.rb +19 -0
- data/spec/factories/transaction_factory.rb +11 -6
- data/spec/models/account_spec.rb +61 -40
- data/spec/models/amount_spec.rb +12 -0
- data/spec/models/asset_spec.rb +46 -39
- data/spec/models/credit_amount_spec.rb +22 -0
- data/spec/models/debit_amount_spec.rb +22 -0
- data/spec/models/equity_spec.rb +51 -43
- data/spec/models/expense_spec.rb +49 -41
- data/spec/models/liability_spec.rb +48 -40
- data/spec/models/revenue_spec.rb +48 -41
- data/spec/models/transaction_spec.rb +77 -42
- data/spec/routing/accounts_routing_spec.rb +23 -20
- data/spec/routing/transactions_routing_spec.rb +23 -20
- data/spec/spec_helper.rb +3 -1
- metadata +208 -139
- data/.yardopts +0 -2
- data/VERSION.yml +0 -5
- data/app/controllers/accounts_controller.rb +0 -43
- data/app/controllers/transactions_controller.rb +0 -42
- data/app/models/account.rb +0 -57
- data/app/models/asset.rb +0 -81
- data/app/models/equity.rb +0 -82
- data/app/models/expense.rb +0 -81
- data/app/models/liability.rb +0 -76
- data/app/models/revenue.rb +0 -81
- data/app/models/transaction.rb +0 -27
- data/app/views/layouts/accounts.html.erb +0 -68
- data/app/views/layouts/transactions.html.erb +0 -68
- data/app/views/transactions/index.html.erb +0 -27
- data/app/views/transactions/show.html.erb +0 -24
- data/doc/Account.html +0 -300
- data/doc/AccountsController.html +0 -317
- data/doc/Asset.html +0 -610
- data/doc/CreatePlutusTables.html +0 -265
- data/doc/Equity.html +0 -610
- data/doc/Expense.html +0 -610
- data/doc/Liability.html +0 -588
- data/doc/Plutus.html +0 -91
- data/doc/Plutus/Engine.html +0 -100
- data/doc/PlutusGenerator.html +0 -312
- data/doc/Revenue.html +0 -610
- data/doc/Transaction.html +0 -156
- data/doc/TransactionsController.html +0 -317
- data/doc/_index.html +0 -204
- data/doc/class_list.html +0 -36
- data/doc/css/common.css +0 -1
- data/doc/css/full_list.css +0 -53
- data/doc/css/style.css +0 -310
- data/doc/file.README.html +0 -250
- data/doc/file_list.html +0 -38
- data/doc/frames.html +0 -13
- data/doc/index.html +0 -250
- data/doc/js/app.js +0 -202
- data/doc/js/full_list.js +0 -149
- data/doc/js/jquery.js +0 -154
- data/doc/method_list.html +0 -275
- data/doc/top-level-namespace.html +0 -90
- data/fixture_rails_root/.gitignore +0 -4
- data/fixture_rails_root/Gemfile +0 -38
- data/fixture_rails_root/Gemfile.lock +0 -98
- data/fixture_rails_root/README +0 -256
- data/fixture_rails_root/Rakefile +0 -7
- data/fixture_rails_root/app/controllers/application_controller.rb +0 -3
- data/fixture_rails_root/app/helpers/application_helper.rb +0 -2
- data/fixture_rails_root/app/views/layouts/application.html.erb +0 -14
- data/fixture_rails_root/config.ru +0 -4
- data/fixture_rails_root/config/application.rb +0 -42
- data/fixture_rails_root/config/boot.rb +0 -13
- data/fixture_rails_root/config/database.yml +0 -22
- data/fixture_rails_root/config/environment.rb +0 -5
- data/fixture_rails_root/config/environments/development.rb +0 -26
- data/fixture_rails_root/config/environments/production.rb +0 -49
- data/fixture_rails_root/config/environments/test.rb +0 -35
- data/fixture_rails_root/config/initializers/backtrace_silencers.rb +0 -7
- data/fixture_rails_root/config/initializers/inflections.rb +0 -10
- data/fixture_rails_root/config/initializers/mime_types.rb +0 -5
- data/fixture_rails_root/config/initializers/secret_token.rb +0 -7
- data/fixture_rails_root/config/initializers/session_store.rb +0 -8
- data/fixture_rails_root/config/locales/en.yml +0 -5
- data/fixture_rails_root/config/routes.rb +0 -58
- data/fixture_rails_root/db/migrate/20101203193439_create_plutus_tables.rb +0 -33
- data/fixture_rails_root/db/schema.rb +0 -40
- data/fixture_rails_root/db/seeds.rb +0 -7
- data/fixture_rails_root/doc/README_FOR_APP +0 -2
- data/fixture_rails_root/lib/tasks/.gitkeep +0 -0
- data/fixture_rails_root/public/404.html +0 -26
- data/fixture_rails_root/public/422.html +0 -26
- data/fixture_rails_root/public/500.html +0 -26
- data/fixture_rails_root/public/favicon.ico +0 -0
- data/fixture_rails_root/public/images/rails.png +0 -0
- data/fixture_rails_root/public/index.html +0 -239
- data/fixture_rails_root/public/javascripts/application.js +0 -2
- data/fixture_rails_root/public/javascripts/controls.js +0 -965
- data/fixture_rails_root/public/javascripts/dragdrop.js +0 -974
- data/fixture_rails_root/public/javascripts/effects.js +0 -1123
- data/fixture_rails_root/public/javascripts/prototype.js +0 -6001
- data/fixture_rails_root/public/javascripts/rails.js +0 -175
- data/fixture_rails_root/public/robots.txt +0 -5
- data/fixture_rails_root/public/stylesheets/.gitkeep +0 -0
- data/fixture_rails_root/script/rails +0 -6
- data/fixture_rails_root/test/performance/browsing_test.rb +0 -9
- data/fixture_rails_root/test/test_helper.rb +0 -13
- data/fixture_rails_root/vendor/plugins/.gitkeep +0 -0
- data/plutus.gemspec +0 -176
- data/tasks/plutus_tasks.rake +0 -4
data/doc/AccountsController.html
DELETED
@@ -1,317 +0,0 @@
|
|
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>Class: AccountsController</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)</a> »
|
27
|
-
|
28
|
-
|
29
|
-
<span class="title">AccountsController</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>Class: AccountsController
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
</h1>
|
51
|
-
|
52
|
-
<dl class="box">
|
53
|
-
|
54
|
-
<dt class="r1">Inherits:</dt>
|
55
|
-
<dd class="r1">
|
56
|
-
<span class="inheritName">ApplicationController</span>
|
57
|
-
|
58
|
-
<ul class="fullTree">
|
59
|
-
<li>Object</li>
|
60
|
-
|
61
|
-
<li class="next">ApplicationController</li>
|
62
|
-
|
63
|
-
<li class="next">AccountsController</li>
|
64
|
-
|
65
|
-
</ul>
|
66
|
-
<a href="#" class="inheritanceTree">show all</a>
|
67
|
-
|
68
|
-
</dd>
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
<dt class="r2 last">Defined in:</dt>
|
79
|
-
<dd class="r2 last">app/controllers/accounts_controller.rb</dd>
|
80
|
-
|
81
|
-
</dl>
|
82
|
-
<div class="clear"></div>
|
83
|
-
|
84
|
-
<h2>Overview</h2><div class="docstring">
|
85
|
-
<div class="discussion">
|
86
|
-
<p>
|
87
|
-
This controller provides restful route handling for Accounts.
|
88
|
-
</p>
|
89
|
-
<p>
|
90
|
-
The controller supports ActiveResource, and provides for HMTL, XML, and
|
91
|
-
JSON presentation.
|
92
|
-
</p>
|
93
|
-
<h2>Security:</h2>
|
94
|
-
<p>
|
95
|
-
Only GET requests are supported. You should ensure that your application
|
96
|
-
controller enforces its own authentication and authorization, which this
|
97
|
-
controller will inherit.
|
98
|
-
</p>
|
99
|
-
|
100
|
-
|
101
|
-
</div>
|
102
|
-
</div>
|
103
|
-
<div class="tags">
|
104
|
-
<h3>Author:</h3>
|
105
|
-
<ul class="author">
|
106
|
-
|
107
|
-
<li>
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
<div class='inline'><p>
|
114
|
-
Michael Bulat
|
115
|
-
</p>
|
116
|
-
</div>
|
117
|
-
|
118
|
-
</li>
|
119
|
-
|
120
|
-
</ul>
|
121
|
-
|
122
|
-
</div>
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
<h2>
|
128
|
-
Instance Method Summary
|
129
|
-
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
130
|
-
</h2>
|
131
|
-
|
132
|
-
<ul class="summary">
|
133
|
-
|
134
|
-
<li class="public ">
|
135
|
-
<span class="summary_signature">
|
136
|
-
|
137
|
-
<a href="#index-instance_method" title="#index (instance method)">- (Object) <strong>index</strong> </a>
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
</span>
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
151
|
-
|
152
|
-
</li>
|
153
|
-
|
154
|
-
|
155
|
-
<li class="public ">
|
156
|
-
<span class="summary_signature">
|
157
|
-
|
158
|
-
<a href="#show-instance_method" title="#show (instance method)">- (Object) <strong>show</strong> </a>
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
</span>
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
172
|
-
|
173
|
-
</li>
|
174
|
-
|
175
|
-
|
176
|
-
</ul>
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
<div id="instance_method_details" class="method_details_list">
|
183
|
-
<h2>Instance Method Details</h2>
|
184
|
-
|
185
|
-
|
186
|
-
<div class="method_details first">
|
187
|
-
<p class="signature first" id="index-instance_method">
|
188
|
-
|
189
|
-
- (<tt>Object</tt>) <strong>index</strong>
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
</p><div class="docstring">
|
194
|
-
<div class="discussion">
|
195
|
-
|
196
|
-
|
197
|
-
</div>
|
198
|
-
</div>
|
199
|
-
<div class="tags">
|
200
|
-
|
201
|
-
<div class="examples">
|
202
|
-
<h3>Examples:</h3>
|
203
|
-
|
204
|
-
<h4><div class='inline'></div></h4>
|
205
|
-
<pre class="example code"><span class='GET constant id'>GET</span> <span class='regexp val'>/accounts
|
206
|
-
GET /</span><span class='accounts identifier id'>accounts</span><span class='dot token'>.</span><span class='xml identifier id'>xml</span>
|
207
|
-
<span class='GET constant id'>GET</span> <span class='regexp val'>/accounts.json
|
208
|
-
</span></pre>
|
209
|
-
|
210
|
-
</div>
|
211
|
-
|
212
|
-
</div><table class="source_code">
|
213
|
-
<tr>
|
214
|
-
<td>
|
215
|
-
<pre class="lines">
|
216
|
-
|
217
|
-
|
218
|
-
19
|
219
|
-
20
|
220
|
-
21
|
221
|
-
22
|
222
|
-
23
|
223
|
-
24
|
224
|
-
25
|
225
|
-
26
|
226
|
-
27</pre>
|
227
|
-
</td>
|
228
|
-
<td>
|
229
|
-
<pre class="code"><span class="info file"># File 'app/controllers/accounts_controller.rb', line 19</span>
|
230
|
-
|
231
|
-
<span class='def def kw'>def</span> <span class='index identifier id'>index</span>
|
232
|
-
<span class='@accounts ivar id'>@accounts</span> <span class='assign token'>=</span> <span class='Account constant id'>Account</span><span class='dot token'>.</span><span class='all identifier id'>all</span>
|
233
|
-
|
234
|
-
<span class='respond_to identifier id'>respond_to</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='format identifier id'>format</span><span class='bitor op'>|</span>
|
235
|
-
<span class='format identifier id'>format</span><span class='dot token'>.</span><span class='html identifier id'>html</span> <span class='comment val'># index.html.erb</span>
|
236
|
-
<span class='format identifier id'>format</span><span class='dot token'>.</span><span class='xml identifier id'>xml</span> <span class='lbrace token'>{</span> <span class='render identifier id'>render</span> <span class='symbol val'>:xml</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='@accounts ivar id'>@accounts</span> <span class='rbrace token'>}</span>
|
237
|
-
<span class='format identifier id'>format</span><span class='dot token'>.</span><span class='json identifier id'>json</span> <span class='lbrace token'>{</span> <span class='render identifier id'>render</span> <span class='symbol val'>:json</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='@accounts ivar id'>@accounts</span> <span class='rbrace token'>}</span>
|
238
|
-
<span class='end end kw'>end</span>
|
239
|
-
<span class='end end kw'>end</span>
|
240
|
-
</pre>
|
241
|
-
</td>
|
242
|
-
</tr>
|
243
|
-
</table>
|
244
|
-
</div>
|
245
|
-
|
246
|
-
<div class="method_details ">
|
247
|
-
<p class="signature " id="show-instance_method">
|
248
|
-
|
249
|
-
- (<tt>Object</tt>) <strong>show</strong>
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
</p><div class="docstring">
|
254
|
-
<div class="discussion">
|
255
|
-
|
256
|
-
|
257
|
-
</div>
|
258
|
-
</div>
|
259
|
-
<div class="tags">
|
260
|
-
|
261
|
-
<div class="examples">
|
262
|
-
<h3>Examples:</h3>
|
263
|
-
|
264
|
-
<h4><div class='inline'></div></h4>
|
265
|
-
<pre class="example code"><span class='GET constant id'>GET</span> <span class='regexp val'>/accounts/</span><span class='integer val'>1</span>
|
266
|
-
<span class='GET constant id'>GET</span> <span class='regexp val'>/accounts/</span><span class='float val'>1</span><span class='dot token'>.</span><span class='xml identifier id'>xml</span>
|
267
|
-
<span class='GET constant id'>GET</span> <span class='regexp val'>/accounts/</span><span class='float val'>1</span><span class='dot token'>.</span><span class='json identifier id'>json</span>
|
268
|
-
</pre>
|
269
|
-
|
270
|
-
</div>
|
271
|
-
|
272
|
-
</div><table class="source_code">
|
273
|
-
<tr>
|
274
|
-
<td>
|
275
|
-
<pre class="lines">
|
276
|
-
|
277
|
-
|
278
|
-
33
|
279
|
-
34
|
280
|
-
35
|
281
|
-
36
|
282
|
-
37
|
283
|
-
38
|
284
|
-
39
|
285
|
-
40
|
286
|
-
41</pre>
|
287
|
-
</td>
|
288
|
-
<td>
|
289
|
-
<pre class="code"><span class="info file"># File 'app/controllers/accounts_controller.rb', line 33</span>
|
290
|
-
|
291
|
-
<span class='def def kw'>def</span> <span class='show identifier id'>show</span>
|
292
|
-
<span class='@account ivar id'>@account</span> <span class='assign token'>=</span> <span class='Account constant id'>Account</span><span class='dot token'>.</span><span class='find identifier id'>find</span><span class='lparen token'>(</span><span class='params identifier id'>params</span><span class='lbrack token'>[</span><span class='symbol val'>:id</span><span class='rbrack token'>]</span><span class='rparen token'>)</span>
|
293
|
-
|
294
|
-
<span class='respond_to identifier id'>respond_to</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='format identifier id'>format</span><span class='bitor op'>|</span>
|
295
|
-
<span class='format identifier id'>format</span><span class='dot token'>.</span><span class='html identifier id'>html</span> <span class='comment val'># show.html.erb</span>
|
296
|
-
<span class='format identifier id'>format</span><span class='dot token'>.</span><span class='xml identifier id'>xml</span> <span class='lbrace token'>{</span> <span class='render identifier id'>render</span> <span class='symbol val'>:xml</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='@account ivar id'>@account</span> <span class='rbrace token'>}</span>
|
297
|
-
<span class='format identifier id'>format</span><span class='dot token'>.</span><span class='json identifier id'>json</span> <span class='lbrace token'>{</span> <span class='render identifier id'>render</span> <span class='symbol val'>:json</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='@account ivar id'>@account</span> <span class='rbrace token'>}</span>
|
298
|
-
<span class='end end kw'>end</span>
|
299
|
-
<span class='end end kw'>end</span>
|
300
|
-
</pre>
|
301
|
-
</td>
|
302
|
-
</tr>
|
303
|
-
</table>
|
304
|
-
</div>
|
305
|
-
|
306
|
-
</div>
|
307
|
-
|
308
|
-
</div>
|
309
|
-
|
310
|
-
<div id="footer">
|
311
|
-
Generated on Fri Dec 3 14:35:09 2010 by
|
312
|
-
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
313
|
-
0.6.2 (ruby-1.8.7).
|
314
|
-
</div>
|
315
|
-
|
316
|
-
</body>
|
317
|
-
</html>
|
data/doc/Asset.html
DELETED
@@ -1,610 +0,0 @@
|
|
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>Class: Asset</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)</a> »
|
27
|
-
|
28
|
-
|
29
|
-
<span class="title">Asset</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>Class: Asset
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
</h1>
|
51
|
-
|
52
|
-
<dl class="box">
|
53
|
-
|
54
|
-
<dt class="r1">Inherits:</dt>
|
55
|
-
<dd class="r1">
|
56
|
-
<span class="inheritName"><span class='object_link'><a href="Account.html" title="Account (class)">Account</a></span></span>
|
57
|
-
|
58
|
-
<ul class="fullTree">
|
59
|
-
<li>Object</li>
|
60
|
-
|
61
|
-
<li class="next">ActiveRecord::Base</li>
|
62
|
-
|
63
|
-
<li class="next"><span class='object_link'><a href="Account.html" title="Account (class)">Account</a></span></li>
|
64
|
-
|
65
|
-
<li class="next">Asset</li>
|
66
|
-
|
67
|
-
</ul>
|
68
|
-
<a href="#" class="inheritanceTree">show all</a>
|
69
|
-
|
70
|
-
</dd>
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
<dt class="r2 last">Defined in:</dt>
|
81
|
-
<dd class="r2 last">app/models/asset.rb</dd>
|
82
|
-
|
83
|
-
</dl>
|
84
|
-
<div class="clear"></div>
|
85
|
-
|
86
|
-
<h2>Overview</h2><div class="docstring">
|
87
|
-
<div class="discussion">
|
88
|
-
<p>
|
89
|
-
The Asset class is an account type used to represents resources owned by
|
90
|
-
the business entity.
|
91
|
-
</p>
|
92
|
-
<h3>Normal Balance</h3>
|
93
|
-
<p>
|
94
|
-
The normal balance on Asset accounts is a <b>Debit</b>.
|
95
|
-
</p>
|
96
|
-
|
97
|
-
|
98
|
-
</div>
|
99
|
-
</div>
|
100
|
-
<div class="tags">
|
101
|
-
|
102
|
-
<h3>See Also:</h3>
|
103
|
-
<ul class="see">
|
104
|
-
|
105
|
-
<li><a href="http://en.wikipedia.org/wiki/Asset" target="_parent" title="Assets">Assets</a></li>
|
106
|
-
|
107
|
-
</ul>
|
108
|
-
<h3>Author:</h3>
|
109
|
-
<ul class="author">
|
110
|
-
|
111
|
-
<li>
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
<div class='inline'><p>
|
118
|
-
Michael Bulat
|
119
|
-
</p>
|
120
|
-
</div>
|
121
|
-
|
122
|
-
</li>
|
123
|
-
|
124
|
-
</ul>
|
125
|
-
|
126
|
-
</div>
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
<h2>
|
136
|
-
Class Method Summary
|
137
|
-
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
138
|
-
</h2>
|
139
|
-
|
140
|
-
<ul class="summary">
|
141
|
-
|
142
|
-
<li class="public ">
|
143
|
-
<span class="summary_signature">
|
144
|
-
|
145
|
-
<a href="#balance-class_method" title="balance (class method)">+ (BigDecimal) <strong>balance</strong> </a>
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
</span>
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
<span class="summary_desc"><div class='inline'><p>
|
159
|
-
This class method is used to return the balance of all Asset accounts.
|
160
|
-
</p>
|
161
|
-
</div></span>
|
162
|
-
|
163
|
-
</li>
|
164
|
-
|
165
|
-
|
166
|
-
</ul>
|
167
|
-
|
168
|
-
<h2>
|
169
|
-
Instance Method Summary
|
170
|
-
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
171
|
-
</h2>
|
172
|
-
|
173
|
-
<ul class="summary">
|
174
|
-
|
175
|
-
<li class="public ">
|
176
|
-
<span class="summary_signature">
|
177
|
-
|
178
|
-
<a href="#balance-instance_method" title="#balance (instance method)">- (BigDecimal) <strong>balance</strong> </a>
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
</span>
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
<span class="summary_desc"><div class='inline'><p>
|
192
|
-
The balance of the account.
|
193
|
-
</p>
|
194
|
-
</div></span>
|
195
|
-
|
196
|
-
</li>
|
197
|
-
|
198
|
-
|
199
|
-
<li class="public ">
|
200
|
-
<span class="summary_signature">
|
201
|
-
|
202
|
-
<a href="#credits_balance-instance_method" title="#credits_balance (instance method)">- (BigDecimal) <strong>credits_balance</strong> </a>
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
</span>
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
<span class="summary_desc"><div class='inline'><p>
|
216
|
-
The credit balance for the account.
|
217
|
-
</p>
|
218
|
-
</div></span>
|
219
|
-
|
220
|
-
</li>
|
221
|
-
|
222
|
-
|
223
|
-
<li class="public ">
|
224
|
-
<span class="summary_signature">
|
225
|
-
|
226
|
-
<a href="#debits_balance-instance_method" title="#debits_balance (instance method)">- (BigDecimal) <strong>debits_balance</strong> </a>
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
</span>
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
<span class="summary_desc"><div class='inline'><p>
|
240
|
-
The debit balance for the account.
|
241
|
-
</p>
|
242
|
-
</div></span>
|
243
|
-
|
244
|
-
</li>
|
245
|
-
|
246
|
-
|
247
|
-
</ul>
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Account.html" title="Account (class)">Account</a></span></h3>
|
259
|
-
<p class="inherited"><span class='object_link'><a href="Account.html#trial_balance-class_method" title="Account.trial_balance (method)">trial_balance</a></span></p>
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
<div id="class_method_details" class="method_details_list">
|
264
|
-
<h2>Class Method Details</h2>
|
265
|
-
|
266
|
-
|
267
|
-
<div class="method_details first">
|
268
|
-
<p class="signature first" id="balance-class_method">
|
269
|
-
|
270
|
-
+ (<tt>BigDecimal</tt>) <strong>balance</strong>
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
</p><div class="docstring">
|
275
|
-
<div class="discussion">
|
276
|
-
<p>
|
277
|
-
This class method is used to return the balance of all Asset accounts.
|
278
|
-
</p>
|
279
|
-
<p>
|
280
|
-
Contra accounts are automatically subtracted from the balance.
|
281
|
-
</p>
|
282
|
-
|
283
|
-
|
284
|
-
</div>
|
285
|
-
</div>
|
286
|
-
<div class="tags">
|
287
|
-
|
288
|
-
<div class="examples">
|
289
|
-
<h3>Examples:</h3>
|
290
|
-
|
291
|
-
<h4><div class='inline'></div></h4>
|
292
|
-
<pre class="example code"><span class='rshft op'>>></span> <span class='Asset constant id'>Asset</span><span class='dot token'>.</span><span class='balance identifier id'>balance</span>
|
293
|
-
<span class='assign token'>=</span><span class='gt op'>></span> <span class='comment val'>#<BigDecimal:1030fcc98,'0.82875E5',8(20)></span>
|
294
|
-
</pre>
|
295
|
-
|
296
|
-
</div>
|
297
|
-
<h3>Returns:</h3>
|
298
|
-
<ul class="return">
|
299
|
-
|
300
|
-
<li>
|
301
|
-
|
302
|
-
<span class='type'>(<tt>BigDecimal</tt>)</span>
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
—
|
308
|
-
<div class='inline'><p>
|
309
|
-
The decimal value balance
|
310
|
-
</p>
|
311
|
-
</div>
|
312
|
-
|
313
|
-
</li>
|
314
|
-
|
315
|
-
</ul>
|
316
|
-
|
317
|
-
</div><table class="source_code">
|
318
|
-
<tr>
|
319
|
-
<td>
|
320
|
-
<pre class="lines">
|
321
|
-
|
322
|
-
|
323
|
-
69
|
324
|
-
70
|
325
|
-
71
|
326
|
-
72
|
327
|
-
73
|
328
|
-
74
|
329
|
-
75
|
330
|
-
76
|
331
|
-
77
|
332
|
-
78
|
333
|
-
79
|
334
|
-
80</pre>
|
335
|
-
</td>
|
336
|
-
<td>
|
337
|
-
<pre class="code"><span class="info file"># File 'app/models/asset.rb', line 69</span>
|
338
|
-
|
339
|
-
<span class='def def kw'>def</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='balance identifier id'>balance</span>
|
340
|
-
<span class='accounts_balance identifier id'>accounts_balance</span> <span class='assign token'>=</span> <span class='BigDecimal constant id'>BigDecimal</span><span class='dot token'>.</span><span class='new identifier id'>new</span><span class='lparen token'>(</span><span class='string val'>'0'</span><span class='rparen token'>)</span>
|
341
|
-
<span class='accounts identifier id'>accounts</span> <span class='assign token'>=</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='find identifier id'>find</span><span class='lparen token'>(</span><span class='symbol val'>:all</span><span class='rparen token'>)</span>
|
342
|
-
<span class='accounts identifier id'>accounts</span><span class='dot token'>.</span><span class='each identifier id'>each</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='asset identifier id'>asset</span><span class='bitor op'>|</span>
|
343
|
-
<span class='unless unless kw'>unless</span> <span class='asset identifier id'>asset</span><span class='dot token'>.</span><span class='contra identifier id'>contra</span>
|
344
|
-
<span class='accounts_balance identifier id'>accounts_balance</span> <span class='opasgn op'>+=</span> <span class='asset identifier id'>asset</span><span class='dot token'>.</span><span class='balance identifier id'>balance</span>
|
345
|
-
<span class='else else kw'>else</span>
|
346
|
-
<span class='accounts_balance identifier id'>accounts_balance</span> <span class='opasgn op'>-=</span> <span class='asset identifier id'>asset</span><span class='dot token'>.</span><span class='balance identifier id'>balance</span>
|
347
|
-
<span class='end end kw'>end</span>
|
348
|
-
<span class='end end kw'>end</span>
|
349
|
-
<span class='accounts_balance identifier id'>accounts_balance</span>
|
350
|
-
<span class='end end kw'>end</span>
|
351
|
-
</pre>
|
352
|
-
</td>
|
353
|
-
</tr>
|
354
|
-
</table>
|
355
|
-
</div>
|
356
|
-
|
357
|
-
</div>
|
358
|
-
|
359
|
-
<div id="instance_method_details" class="method_details_list">
|
360
|
-
<h2>Instance Method Details</h2>
|
361
|
-
|
362
|
-
|
363
|
-
<div class="method_details first">
|
364
|
-
<p class="signature first" id="balance-instance_method">
|
365
|
-
|
366
|
-
- (<tt>BigDecimal</tt>) <strong>balance</strong>
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
</p><div class="docstring">
|
371
|
-
<div class="discussion">
|
372
|
-
<p>
|
373
|
-
The balance of the account.
|
374
|
-
</p>
|
375
|
-
<p>
|
376
|
-
Assets have normal debit balances, so the credits are subtracted from the
|
377
|
-
debits unless this is a contra account, in which debits are subtracted from
|
378
|
-
credits
|
379
|
-
</p>
|
380
|
-
|
381
|
-
|
382
|
-
</div>
|
383
|
-
</div>
|
384
|
-
<div class="tags">
|
385
|
-
|
386
|
-
<div class="examples">
|
387
|
-
<h3>Examples:</h3>
|
388
|
-
|
389
|
-
<h4><div class='inline'></div></h4>
|
390
|
-
<pre class="example code"><span class='rshft op'>>></span> <span class='asset identifier id'>asset</span><span class='dot token'>.</span><span class='balance identifier id'>balance</span>
|
391
|
-
<span class='assign token'>=</span><span class='gt op'>></span> <span class='comment val'>#<BigDecimal:103259bb8,'0.2E4',4(12)> </span>
|
392
|
-
</pre>
|
393
|
-
|
394
|
-
</div>
|
395
|
-
<h3>Returns:</h3>
|
396
|
-
<ul class="return">
|
397
|
-
|
398
|
-
<li>
|
399
|
-
|
400
|
-
<span class='type'>(<tt>BigDecimal</tt>)</span>
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
—
|
406
|
-
<div class='inline'><p>
|
407
|
-
The decimal value balance
|
408
|
-
</p>
|
409
|
-
</div>
|
410
|
-
|
411
|
-
</li>
|
412
|
-
|
413
|
-
</ul>
|
414
|
-
|
415
|
-
</div><table class="source_code">
|
416
|
-
<tr>
|
417
|
-
<td>
|
418
|
-
<pre class="lines">
|
419
|
-
|
420
|
-
|
421
|
-
51
|
422
|
-
52
|
423
|
-
53
|
424
|
-
54
|
425
|
-
55
|
426
|
-
56
|
427
|
-
57</pre>
|
428
|
-
</td>
|
429
|
-
<td>
|
430
|
-
<pre class="code"><span class="info file"># File 'app/models/asset.rb', line 51</span>
|
431
|
-
|
432
|
-
<span class='def def kw'>def</span> <span class='balance identifier id'>balance</span>
|
433
|
-
<span class='unless unless kw'>unless</span> <span class='contra identifier id'>contra</span>
|
434
|
-
<span class='debits_balance identifier id'>debits_balance</span> <span class='minus op'>-</span> <span class='credits_balance identifier id'>credits_balance</span>
|
435
|
-
<span class='else else kw'>else</span>
|
436
|
-
<span class='credits_balance identifier id'>credits_balance</span> <span class='minus op'>-</span> <span class='debits_balance identifier id'>debits_balance</span>
|
437
|
-
<span class='end end kw'>end</span>
|
438
|
-
<span class='end end kw'>end</span>
|
439
|
-
</pre>
|
440
|
-
</td>
|
441
|
-
</tr>
|
442
|
-
</table>
|
443
|
-
</div>
|
444
|
-
|
445
|
-
<div class="method_details ">
|
446
|
-
<p class="signature " id="credits_balance-instance_method">
|
447
|
-
|
448
|
-
- (<tt>BigDecimal</tt>) <strong>credits_balance</strong>
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
</p><div class="docstring">
|
453
|
-
<div class="discussion">
|
454
|
-
<p>
|
455
|
-
The credit balance for the account.
|
456
|
-
</p>
|
457
|
-
|
458
|
-
|
459
|
-
</div>
|
460
|
-
</div>
|
461
|
-
<div class="tags">
|
462
|
-
|
463
|
-
<div class="examples">
|
464
|
-
<h3>Examples:</h3>
|
465
|
-
|
466
|
-
<h4><div class='inline'></div></h4>
|
467
|
-
<pre class="example code"><span class='rshft op'>>></span> <span class='asset identifier id'>asset</span><span class='dot token'>.</span><span class='credits_balance identifier id'>credits_balance</span>
|
468
|
-
<span class='assign token'>=</span><span class='gt op'>></span> <span class='comment val'>#<BigDecimal:103259bb8,'0.1E4',4(12)> </span>
|
469
|
-
</pre>
|
470
|
-
|
471
|
-
</div>
|
472
|
-
<h3>Returns:</h3>
|
473
|
-
<ul class="return">
|
474
|
-
|
475
|
-
<li>
|
476
|
-
|
477
|
-
<span class='type'>(<tt>BigDecimal</tt>)</span>
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
—
|
483
|
-
<div class='inline'><p>
|
484
|
-
The decimal value credit balance
|
485
|
-
</p>
|
486
|
-
</div>
|
487
|
-
|
488
|
-
</li>
|
489
|
-
|
490
|
-
</ul>
|
491
|
-
|
492
|
-
</div><table class="source_code">
|
493
|
-
<tr>
|
494
|
-
<td>
|
495
|
-
<pre class="lines">
|
496
|
-
|
497
|
-
|
498
|
-
18
|
499
|
-
19
|
500
|
-
20
|
501
|
-
21
|
502
|
-
22
|
503
|
-
23
|
504
|
-
24</pre>
|
505
|
-
</td>
|
506
|
-
<td>
|
507
|
-
<pre class="code"><span class="info file"># File 'app/models/asset.rb', line 18</span>
|
508
|
-
|
509
|
-
<span class='def def kw'>def</span> <span class='credits_balance identifier id'>credits_balance</span>
|
510
|
-
<span class='credits_balance identifier id'>credits_balance</span> <span class='assign token'>=</span> <span class='BigDecimal constant id'>BigDecimal</span><span class='dot token'>.</span><span class='new identifier id'>new</span><span class='lparen token'>(</span><span class='string val'>'0'</span><span class='rparen token'>)</span>
|
511
|
-
<span class='credit_transactions identifier id'>credit_transactions</span><span class='dot token'>.</span><span class='each identifier id'>each</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='credit_transaction identifier id'>credit_transaction</span><span class='bitor op'>|</span>
|
512
|
-
<span class='credits_balance identifier id'>credits_balance</span> <span class='opasgn op'>+=</span> <span class='credit_transaction identifier id'>credit_transaction</span><span class='dot token'>.</span><span class='amount identifier id'>amount</span>
|
513
|
-
<span class='end end kw'>end</span>
|
514
|
-
<span class='return return kw'>return</span> <span class='credits_balance identifier id'>credits_balance</span>
|
515
|
-
<span class='end end kw'>end</span>
|
516
|
-
</pre>
|
517
|
-
</td>
|
518
|
-
</tr>
|
519
|
-
</table>
|
520
|
-
</div>
|
521
|
-
|
522
|
-
<div class="method_details ">
|
523
|
-
<p class="signature " id="debits_balance-instance_method">
|
524
|
-
|
525
|
-
- (<tt>BigDecimal</tt>) <strong>debits_balance</strong>
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
</p><div class="docstring">
|
530
|
-
<div class="discussion">
|
531
|
-
<p>
|
532
|
-
The debit balance for the account.
|
533
|
-
</p>
|
534
|
-
|
535
|
-
|
536
|
-
</div>
|
537
|
-
</div>
|
538
|
-
<div class="tags">
|
539
|
-
|
540
|
-
<div class="examples">
|
541
|
-
<h3>Examples:</h3>
|
542
|
-
|
543
|
-
<h4><div class='inline'></div></h4>
|
544
|
-
<pre class="example code"><span class='rshft op'>>></span> <span class='asset identifier id'>asset</span><span class='dot token'>.</span><span class='debits_balance identifier id'>debits_balance</span>
|
545
|
-
<span class='assign token'>=</span><span class='gt op'>></span> <span class='comment val'>#<BigDecimal:103259bb8,'0.3E4',4(12)> </span>
|
546
|
-
</pre>
|
547
|
-
|
548
|
-
</div>
|
549
|
-
<h3>Returns:</h3>
|
550
|
-
<ul class="return">
|
551
|
-
|
552
|
-
<li>
|
553
|
-
|
554
|
-
<span class='type'>(<tt>BigDecimal</tt>)</span>
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
—
|
560
|
-
<div class='inline'><p>
|
561
|
-
The decimal value credit balance
|
562
|
-
</p>
|
563
|
-
</div>
|
564
|
-
|
565
|
-
</li>
|
566
|
-
|
567
|
-
</ul>
|
568
|
-
|
569
|
-
</div><table class="source_code">
|
570
|
-
<tr>
|
571
|
-
<td>
|
572
|
-
<pre class="lines">
|
573
|
-
|
574
|
-
|
575
|
-
33
|
576
|
-
34
|
577
|
-
35
|
578
|
-
36
|
579
|
-
37
|
580
|
-
38
|
581
|
-
39</pre>
|
582
|
-
</td>
|
583
|
-
<td>
|
584
|
-
<pre class="code"><span class="info file"># File 'app/models/asset.rb', line 33</span>
|
585
|
-
|
586
|
-
<span class='def def kw'>def</span> <span class='debits_balance identifier id'>debits_balance</span>
|
587
|
-
<span class='debits_balance identifier id'>debits_balance</span> <span class='assign token'>=</span> <span class='BigDecimal constant id'>BigDecimal</span><span class='dot token'>.</span><span class='new identifier id'>new</span><span class='lparen token'>(</span><span class='string val'>'0'</span><span class='rparen token'>)</span>
|
588
|
-
<span class='debit_transactions identifier id'>debit_transactions</span><span class='dot token'>.</span><span class='each identifier id'>each</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='debit_transaction identifier id'>debit_transaction</span><span class='bitor op'>|</span>
|
589
|
-
<span class='debits_balance identifier id'>debits_balance</span> <span class='opasgn op'>+=</span> <span class='debit_transaction identifier id'>debit_transaction</span><span class='dot token'>.</span><span class='amount identifier id'>amount</span>
|
590
|
-
<span class='end end kw'>end</span>
|
591
|
-
<span class='return return kw'>return</span> <span class='debits_balance identifier id'>debits_balance</span>
|
592
|
-
<span class='end end kw'>end</span>
|
593
|
-
</pre>
|
594
|
-
</td>
|
595
|
-
</tr>
|
596
|
-
</table>
|
597
|
-
</div>
|
598
|
-
|
599
|
-
</div>
|
600
|
-
|
601
|
-
</div>
|
602
|
-
|
603
|
-
<div id="footer">
|
604
|
-
Generated on Fri Dec 3 14:35:08 2010 by
|
605
|
-
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
606
|
-
0.6.2 (ruby-1.8.7).
|
607
|
-
</div>
|
608
|
-
|
609
|
-
</body>
|
610
|
-
</html>
|