blawzoo-plutus 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.yardopts +2 -0
- data/LICENSE +23 -0
- data/README.markdown +197 -0
- data/Rakefile +11 -0
- data/VERSION.yml +5 -0
- data/app/controllers/accounts_controller.rb +43 -0
- data/app/controllers/transactions_controller.rb +42 -0
- data/app/models/account.rb +57 -0
- data/app/models/asset.rb +81 -0
- data/app/models/equity.rb +82 -0
- data/app/models/expense.rb +81 -0
- data/app/models/liability.rb +76 -0
- data/app/models/revenue.rb +81 -0
- data/app/models/transaction.rb +27 -0
- data/app/views/accounts/index.html.erb +27 -0
- data/app/views/accounts/show.html.erb +69 -0
- data/app/views/layouts/accounts.html.erb +68 -0
- data/app/views/layouts/transactions.html.erb +68 -0
- data/app/views/transactions/index.html.erb +27 -0
- data/app/views/transactions/show.html.erb +24 -0
- data/doc/Account.html +300 -0
- data/doc/AccountsController.html +317 -0
- data/doc/Asset.html +610 -0
- data/doc/Equity.html +610 -0
- data/doc/Expense.html +610 -0
- data/doc/Liability.html +588 -0
- data/doc/Revenue.html +610 -0
- data/doc/Transaction.html +156 -0
- data/doc/TransactionsController.html +317 -0
- data/doc/_index.html +204 -0
- data/doc/class_list.html +36 -0
- data/doc/file.README.html +250 -0
- data/doc/file_list.html +38 -0
- data/doc/frames.html +13 -0
- data/doc/index.html +250 -0
- data/doc/js/app.js +202 -0
- data/doc/js/full_list.js +149 -0
- data/doc/js/jquery.js +154 -0
- data/doc/method_list.html +275 -0
- data/doc/top-level-namespace.html +90 -0
- data/lib/plutus.rb +6 -0
- data/plutus.gemspec +116 -0
- data/spec/controllers/accounts_controller_spec.rb +26 -0
- data/spec/controllers/transactions_controller_spec.rb +26 -0
- data/spec/factories/account_factory.rb +31 -0
- data/spec/factories/transaction_factory.rb +6 -0
- data/spec/lib/plutus_spec.rb +0 -0
- data/spec/models/account_spec.rb +43 -0
- data/spec/models/asset_spec.rb +46 -0
- data/spec/models/equity_spec.rb +46 -0
- data/spec/models/expense_spec.rb +46 -0
- data/spec/models/liability_spec.rb +46 -0
- data/spec/models/revenue_spec.rb +46 -0
- data/spec/models/transaction_spec.rb +48 -0
- data/spec/rcov.opts +2 -0
- data/spec/routing/accounts_routing_spec.rb +30 -0
- data/spec/routing/transactions_routing_spec.rb +30 -0
- data/spec/schema.rb +31 -0
- data/spec/spec.opts +4 -0
- data/spec/spec_helper.rb +14 -0
- data/tasks/plutus_tasks.rake +4 -0
- metadata +204 -0
data/doc/Liability.html
ADDED
@@ -0,0 +1,588 @@
|
|
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: Liability</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 (L)</a> »
|
27
|
+
|
28
|
+
|
29
|
+
<span class="title">Liability</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: Liability
|
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">Liability</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/liability.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 Liability class is an account type used to represents debts owed to
|
90
|
+
outsiders.
|
91
|
+
</p>
|
92
|
+
<h3>Normal Balance</h3>
|
93
|
+
<p>
|
94
|
+
The normal balance on Liability accounts is a <b>Credit</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/Liability_(financial_accounting)" target="_parent" title="Liability">Liability</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)">+ (Object) <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
|
+
Balance of all Liability 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>Object</tt>) <strong>balance</strong>
|
271
|
+
|
272
|
+
|
273
|
+
|
274
|
+
</p><div class="docstring">
|
275
|
+
<div class="discussion">
|
276
|
+
<p>
|
277
|
+
Balance of all Liability accounts
|
278
|
+
</p>
|
279
|
+
|
280
|
+
|
281
|
+
</div>
|
282
|
+
</div>
|
283
|
+
<div class="tags">
|
284
|
+
|
285
|
+
<div class="examples">
|
286
|
+
<h3>Examples:</h3>
|
287
|
+
|
288
|
+
<h4><div class='inline'></div></h4>
|
289
|
+
<pre class="example code"><span class='rshft op'>>></span> <span class='Liability constant id'>Liability</span><span class='dot token'>.</span><span class='balance identifier id'>balance</span>
|
290
|
+
<span class='assign token'>=</span><span class='gt op'>></span> <span class='comment val'>#<BigDecimal:1030fcc98,'0.82875E5',8(20)></span>
|
291
|
+
</pre>
|
292
|
+
|
293
|
+
</div>
|
294
|
+
|
295
|
+
</div><table class="source_code">
|
296
|
+
<tr>
|
297
|
+
<td>
|
298
|
+
<pre class="lines">
|
299
|
+
|
300
|
+
|
301
|
+
64
|
302
|
+
65
|
303
|
+
66
|
304
|
+
67
|
305
|
+
68
|
306
|
+
69
|
307
|
+
70
|
308
|
+
71
|
309
|
+
72
|
310
|
+
73
|
311
|
+
74
|
312
|
+
75</pre>
|
313
|
+
</td>
|
314
|
+
<td>
|
315
|
+
<pre class="code"><span class="info file"># File 'app/models/liability.rb', line 64</span>
|
316
|
+
|
317
|
+
<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>
|
318
|
+
<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>
|
319
|
+
<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>
|
320
|
+
<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='liability identifier id'>liability</span><span class='bitor op'>|</span>
|
321
|
+
<span class='unless unless kw'>unless</span> <span class='liability identifier id'>liability</span><span class='dot token'>.</span><span class='contra identifier id'>contra</span>
|
322
|
+
<span class='accounts_balance identifier id'>accounts_balance</span> <span class='opasgn op'>+=</span> <span class='liability identifier id'>liability</span><span class='dot token'>.</span><span class='balance identifier id'>balance</span>
|
323
|
+
<span class='else else kw'>else</span>
|
324
|
+
<span class='accounts_balance identifier id'>accounts_balance</span> <span class='opasgn op'>-=</span> <span class='liability identifier id'>liability</span><span class='dot token'>.</span><span class='balance identifier id'>balance</span>
|
325
|
+
<span class='end end kw'>end</span>
|
326
|
+
<span class='end end kw'>end</span>
|
327
|
+
<span class='accounts_balance identifier id'>accounts_balance</span>
|
328
|
+
<span class='end end kw'>end</span>
|
329
|
+
</pre>
|
330
|
+
</td>
|
331
|
+
</tr>
|
332
|
+
</table>
|
333
|
+
</div>
|
334
|
+
|
335
|
+
</div>
|
336
|
+
|
337
|
+
<div id="instance_method_details" class="method_details_list">
|
338
|
+
<h2>Instance Method Details</h2>
|
339
|
+
|
340
|
+
|
341
|
+
<div class="method_details first">
|
342
|
+
<p class="signature first" id="balance-instance_method">
|
343
|
+
|
344
|
+
- (<tt>BigDecimal</tt>) <strong>balance</strong>
|
345
|
+
|
346
|
+
|
347
|
+
|
348
|
+
</p><div class="docstring">
|
349
|
+
<div class="discussion">
|
350
|
+
<p>
|
351
|
+
The balance of the account.
|
352
|
+
</p>
|
353
|
+
<p>
|
354
|
+
Liability accounts have normal credit balances, so the debits are
|
355
|
+
subtracted from the credits unless this is a contra account, in which
|
356
|
+
credits are subtracted from debits
|
357
|
+
</p>
|
358
|
+
|
359
|
+
|
360
|
+
</div>
|
361
|
+
</div>
|
362
|
+
<div class="tags">
|
363
|
+
|
364
|
+
<div class="examples">
|
365
|
+
<h3>Examples:</h3>
|
366
|
+
|
367
|
+
<h4><div class='inline'></div></h4>
|
368
|
+
<pre class="example code"><span class='rshft op'>>></span> <span class='liability identifier id'>liability</span><span class='dot token'>.</span><span class='balance identifier id'>balance</span>
|
369
|
+
<span class='assign token'>=</span><span class='gt op'>></span> <span class='comment val'>#<BigDecimal:103259bb8,'0.2E4',4(12)> </span>
|
370
|
+
</pre>
|
371
|
+
|
372
|
+
</div>
|
373
|
+
<h3>Returns:</h3>
|
374
|
+
<ul class="return">
|
375
|
+
|
376
|
+
<li>
|
377
|
+
|
378
|
+
<span class='type'>(<tt>BigDecimal</tt>)</span>
|
379
|
+
|
380
|
+
|
381
|
+
|
382
|
+
|
383
|
+
—
|
384
|
+
<div class='inline'><p>
|
385
|
+
The decimal value balance
|
386
|
+
</p>
|
387
|
+
</div>
|
388
|
+
|
389
|
+
</li>
|
390
|
+
|
391
|
+
</ul>
|
392
|
+
|
393
|
+
</div><table class="source_code">
|
394
|
+
<tr>
|
395
|
+
<td>
|
396
|
+
<pre class="lines">
|
397
|
+
|
398
|
+
|
399
|
+
51
|
400
|
+
52
|
401
|
+
53
|
402
|
+
54
|
403
|
+
55
|
404
|
+
56
|
405
|
+
57</pre>
|
406
|
+
</td>
|
407
|
+
<td>
|
408
|
+
<pre class="code"><span class="info file"># File 'app/models/liability.rb', line 51</span>
|
409
|
+
|
410
|
+
<span class='def def kw'>def</span> <span class='balance identifier id'>balance</span>
|
411
|
+
<span class='unless unless kw'>unless</span> <span class='contra identifier id'>contra</span>
|
412
|
+
<span class='credits_balance identifier id'>credits_balance</span> <span class='minus op'>-</span> <span class='debits_balance identifier id'>debits_balance</span>
|
413
|
+
<span class='else else kw'>else</span>
|
414
|
+
<span class='debits_balance identifier id'>debits_balance</span> <span class='minus op'>-</span> <span class='credits_balance identifier id'>credits_balance</span>
|
415
|
+
<span class='end end kw'>end</span>
|
416
|
+
<span class='end end kw'>end</span>
|
417
|
+
</pre>
|
418
|
+
</td>
|
419
|
+
</tr>
|
420
|
+
</table>
|
421
|
+
</div>
|
422
|
+
|
423
|
+
<div class="method_details ">
|
424
|
+
<p class="signature " id="credits_balance-instance_method">
|
425
|
+
|
426
|
+
- (<tt>BigDecimal</tt>) <strong>credits_balance</strong>
|
427
|
+
|
428
|
+
|
429
|
+
|
430
|
+
</p><div class="docstring">
|
431
|
+
<div class="discussion">
|
432
|
+
<p>
|
433
|
+
The credit balance for the account.
|
434
|
+
</p>
|
435
|
+
|
436
|
+
|
437
|
+
</div>
|
438
|
+
</div>
|
439
|
+
<div class="tags">
|
440
|
+
|
441
|
+
<div class="examples">
|
442
|
+
<h3>Examples:</h3>
|
443
|
+
|
444
|
+
<h4><div class='inline'></div></h4>
|
445
|
+
<pre class="example code"><span class='rshft op'>>></span> <span class='liability identifier id'>liability</span><span class='dot token'>.</span><span class='credits_balance identifier id'>credits_balance</span>
|
446
|
+
<span class='assign token'>=</span><span class='gt op'>></span> <span class='comment val'>#<BigDecimal:103259bb8,'0.3E4',4(12)> </span>
|
447
|
+
</pre>
|
448
|
+
|
449
|
+
</div>
|
450
|
+
<h3>Returns:</h3>
|
451
|
+
<ul class="return">
|
452
|
+
|
453
|
+
<li>
|
454
|
+
|
455
|
+
<span class='type'>(<tt>BigDecimal</tt>)</span>
|
456
|
+
|
457
|
+
|
458
|
+
|
459
|
+
|
460
|
+
—
|
461
|
+
<div class='inline'><p>
|
462
|
+
The decimal value credit balance
|
463
|
+
</p>
|
464
|
+
</div>
|
465
|
+
|
466
|
+
</li>
|
467
|
+
|
468
|
+
</ul>
|
469
|
+
|
470
|
+
</div><table class="source_code">
|
471
|
+
<tr>
|
472
|
+
<td>
|
473
|
+
<pre class="lines">
|
474
|
+
|
475
|
+
|
476
|
+
18
|
477
|
+
19
|
478
|
+
20
|
479
|
+
21
|
480
|
+
22
|
481
|
+
23
|
482
|
+
24</pre>
|
483
|
+
</td>
|
484
|
+
<td>
|
485
|
+
<pre class="code"><span class="info file"># File 'app/models/liability.rb', line 18</span>
|
486
|
+
|
487
|
+
<span class='def def kw'>def</span> <span class='credits_balance identifier id'>credits_balance</span>
|
488
|
+
<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>
|
489
|
+
<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>
|
490
|
+
<span class='credits_balance identifier id'>credits_balance</span> <span class='assign token'>=</span> <span class='credits_balance identifier id'>credits_balance</span> <span class='plus op'>+</span> <span class='credit_transaction identifier id'>credit_transaction</span><span class='dot token'>.</span><span class='amount identifier id'>amount</span>
|
491
|
+
<span class='end end kw'>end</span>
|
492
|
+
<span class='return return kw'>return</span> <span class='credits_balance identifier id'>credits_balance</span>
|
493
|
+
<span class='end end kw'>end</span>
|
494
|
+
</pre>
|
495
|
+
</td>
|
496
|
+
</tr>
|
497
|
+
</table>
|
498
|
+
</div>
|
499
|
+
|
500
|
+
<div class="method_details ">
|
501
|
+
<p class="signature " id="debits_balance-instance_method">
|
502
|
+
|
503
|
+
- (<tt>BigDecimal</tt>) <strong>debits_balance</strong>
|
504
|
+
|
505
|
+
|
506
|
+
|
507
|
+
</p><div class="docstring">
|
508
|
+
<div class="discussion">
|
509
|
+
<p>
|
510
|
+
The debit balance for the account.
|
511
|
+
</p>
|
512
|
+
|
513
|
+
|
514
|
+
</div>
|
515
|
+
</div>
|
516
|
+
<div class="tags">
|
517
|
+
|
518
|
+
<div class="examples">
|
519
|
+
<h3>Examples:</h3>
|
520
|
+
|
521
|
+
<h4><div class='inline'></div></h4>
|
522
|
+
<pre class="example code"><span class='rshft op'>>></span> <span class='liability identifier id'>liability</span><span class='dot token'>.</span><span class='debits_balance identifier id'>debits_balance</span>
|
523
|
+
<span class='assign token'>=</span><span class='gt op'>></span> <span class='comment val'>#<BigDecimal:103259bb8,'0.1E4',4(12)> </span>
|
524
|
+
</pre>
|
525
|
+
|
526
|
+
</div>
|
527
|
+
<h3>Returns:</h3>
|
528
|
+
<ul class="return">
|
529
|
+
|
530
|
+
<li>
|
531
|
+
|
532
|
+
<span class='type'>(<tt>BigDecimal</tt>)</span>
|
533
|
+
|
534
|
+
|
535
|
+
|
536
|
+
|
537
|
+
—
|
538
|
+
<div class='inline'><p>
|
539
|
+
The decimal value credit balance
|
540
|
+
</p>
|
541
|
+
</div>
|
542
|
+
|
543
|
+
</li>
|
544
|
+
|
545
|
+
</ul>
|
546
|
+
|
547
|
+
</div><table class="source_code">
|
548
|
+
<tr>
|
549
|
+
<td>
|
550
|
+
<pre class="lines">
|
551
|
+
|
552
|
+
|
553
|
+
33
|
554
|
+
34
|
555
|
+
35
|
556
|
+
36
|
557
|
+
37
|
558
|
+
38
|
559
|
+
39</pre>
|
560
|
+
</td>
|
561
|
+
<td>
|
562
|
+
<pre class="code"><span class="info file"># File 'app/models/liability.rb', line 33</span>
|
563
|
+
|
564
|
+
<span class='def def kw'>def</span> <span class='debits_balance identifier id'>debits_balance</span>
|
565
|
+
<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>
|
566
|
+
<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>
|
567
|
+
<span class='debits_balance identifier id'>debits_balance</span> <span class='assign token'>=</span> <span class='debits_balance identifier id'>debits_balance</span> <span class='plus op'>+</span> <span class='debit_transaction identifier id'>debit_transaction</span><span class='dot token'>.</span><span class='amount identifier id'>amount</span>
|
568
|
+
<span class='end end kw'>end</span>
|
569
|
+
<span class='return return kw'>return</span> <span class='debits_balance identifier id'>debits_balance</span>
|
570
|
+
<span class='end end kw'>end</span>
|
571
|
+
</pre>
|
572
|
+
</td>
|
573
|
+
</tr>
|
574
|
+
</table>
|
575
|
+
</div>
|
576
|
+
|
577
|
+
</div>
|
578
|
+
|
579
|
+
</div>
|
580
|
+
|
581
|
+
<div id="footer">
|
582
|
+
Generated on Fri Dec 3 14:35:09 2010 by
|
583
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
584
|
+
0.6.2 (ruby-1.8.7).
|
585
|
+
</div>
|
586
|
+
|
587
|
+
</body>
|
588
|
+
</html>
|