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
@@ -0,0 +1,68 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
+
<head>
|
6
|
+
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
|
7
|
+
<title>Accounts</title>
|
8
|
+
<style>
|
9
|
+
body {
|
10
|
+
font: normal 11px auto "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
|
11
|
+
color: #4f6b72;
|
12
|
+
background: #E6EAE9;
|
13
|
+
}
|
14
|
+
|
15
|
+
a {
|
16
|
+
color: #4f6b72;
|
17
|
+
}
|
18
|
+
|
19
|
+
table {
|
20
|
+
width: 100%;
|
21
|
+
padding: 0;
|
22
|
+
margin: 0;
|
23
|
+
}
|
24
|
+
th {
|
25
|
+
font: bold 11px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
|
26
|
+
color: #6D929B;
|
27
|
+
letter-spacing: 2px;
|
28
|
+
text-transform: uppercase;
|
29
|
+
text-align: left;
|
30
|
+
padding: 6px 6px 6px 12px;
|
31
|
+
background: #CAE8EA;
|
32
|
+
border-top: 1px solid #C1DAD7;
|
33
|
+
border-right: 1px solid #AAA;
|
34
|
+
border-bottom: 1px solid #AAA;
|
35
|
+
border-left: 1px solid #C1DAD7;
|
36
|
+
}
|
37
|
+
|
38
|
+
th.nobg {
|
39
|
+
border-top: 1px solid #C1DAD7;
|
40
|
+
border-right: 1px solid #AAA;
|
41
|
+
border-bottom: 1px solid #AAA;
|
42
|
+
border-left: 1px solid #C1DAD7;
|
43
|
+
background: #C1DAD7;
|
44
|
+
}
|
45
|
+
|
46
|
+
tr.odd td {
|
47
|
+
border: 1px solid #C1DAD7;
|
48
|
+
background: #fff;
|
49
|
+
padding: 6px 6px 6px 12px;
|
50
|
+
color: #6D929B;
|
51
|
+
}
|
52
|
+
|
53
|
+
tr.even td {
|
54
|
+
border: 1px solid #C1DAD7;
|
55
|
+
background: #fff;
|
56
|
+
padding: 6px 6px 6px 12px;
|
57
|
+
color: #B4AA9D;
|
58
|
+
}
|
59
|
+
</style>
|
60
|
+
</head>
|
61
|
+
<body>
|
62
|
+
|
63
|
+
<p style="color: green"><%= flash[:notice] %></p>
|
64
|
+
|
65
|
+
<%= yield %>
|
66
|
+
|
67
|
+
</body>
|
68
|
+
</html>
|
@@ -0,0 +1,68 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
+
<head>
|
6
|
+
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
|
7
|
+
<title>Transactions</title>
|
8
|
+
<style>
|
9
|
+
body {
|
10
|
+
font: normal 11px auto "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
|
11
|
+
color: #4f6b72;
|
12
|
+
background: #E6EAE9;
|
13
|
+
}
|
14
|
+
|
15
|
+
a {
|
16
|
+
color: #4f6b72;
|
17
|
+
}
|
18
|
+
|
19
|
+
table {
|
20
|
+
width: 100%;
|
21
|
+
padding: 0;
|
22
|
+
margin: 0;
|
23
|
+
}
|
24
|
+
th {
|
25
|
+
font: bold 11px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
|
26
|
+
color: #6D929B;
|
27
|
+
letter-spacing: 2px;
|
28
|
+
text-transform: uppercase;
|
29
|
+
text-align: left;
|
30
|
+
padding: 6px 6px 6px 12px;
|
31
|
+
background: #CAE8EA;
|
32
|
+
border-top: 1px solid #C1DAD7;
|
33
|
+
border-right: 1px solid #AAA;
|
34
|
+
border-bottom: 1px solid #AAA;
|
35
|
+
border-left: 1px solid #C1DAD7;
|
36
|
+
}
|
37
|
+
|
38
|
+
th.nobg {
|
39
|
+
border-top: 1px solid #C1DAD7;
|
40
|
+
border-right: 1px solid #AAA;
|
41
|
+
border-bottom: 1px solid #AAA;
|
42
|
+
border-left: 1px solid #C1DAD7;
|
43
|
+
background: #C1DAD7;
|
44
|
+
}
|
45
|
+
|
46
|
+
tr.odd td {
|
47
|
+
border: 1px solid #C1DAD7;
|
48
|
+
background: #fff;
|
49
|
+
padding: 6px 6px 6px 12px;
|
50
|
+
color: #6D929B;
|
51
|
+
}
|
52
|
+
|
53
|
+
tr.even td {
|
54
|
+
border: 1px solid #C1DAD7;
|
55
|
+
background: #fff;
|
56
|
+
padding: 6px 6px 6px 12px;
|
57
|
+
color: #B4AA9D;
|
58
|
+
}
|
59
|
+
</style>
|
60
|
+
</head>
|
61
|
+
<body>
|
62
|
+
|
63
|
+
<p style="color: green"><%= flash[:notice] %></p>
|
64
|
+
|
65
|
+
<%= yield %>
|
66
|
+
|
67
|
+
</body>
|
68
|
+
</html>
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<h1>Listing Transactions</h1>
|
2
|
+
|
3
|
+
<table>
|
4
|
+
<tr>
|
5
|
+
<th class="nobg">ID</th>
|
6
|
+
<th>Description</th>
|
7
|
+
<th>Credit Account</th>
|
8
|
+
<th>Debit Account</th>
|
9
|
+
<th>Amount</th>
|
10
|
+
<th>Date</th>
|
11
|
+
</tr>
|
12
|
+
|
13
|
+
<% @transactions.each do |transaction| %>
|
14
|
+
<tr class="<%= cycle("even", "odd") -%>">
|
15
|
+
<td><%=h transaction.id %></td>
|
16
|
+
<td><%=h transaction.description %></td>
|
17
|
+
<td><%=link_to(h(transaction.credit_account.name), account_path(transaction.credit_account)) %></td>
|
18
|
+
<td><%=link_to(h(transaction.debit_account.name), account_path(transaction.debit_account)) %></td>
|
19
|
+
<td><%=h transaction.amount %></td>
|
20
|
+
<td><%=h transaction.created_at %></td>
|
21
|
+
</tr>
|
22
|
+
<% end %>
|
23
|
+
</table>
|
24
|
+
|
25
|
+
<br />
|
26
|
+
|
27
|
+
<h3>Go to <%= link_to 'Accounts', accounts_path %></h3>
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<h1><%=h @transaction.description %> Transaction</h1>
|
2
|
+
|
3
|
+
<table>
|
4
|
+
<tr>
|
5
|
+
<th class="nobg">ID</th>
|
6
|
+
<th>Description</th>
|
7
|
+
<th>Credit Account</th>
|
8
|
+
<th>Debit Account</th>
|
9
|
+
<th>Amount</th>
|
10
|
+
<th>Date</th>
|
11
|
+
</tr>
|
12
|
+
|
13
|
+
<tr class="odd">
|
14
|
+
<td><%=h @transaction.id %></td>
|
15
|
+
<td><%=h @transaction.description %></td>
|
16
|
+
<td><%=link_to(h(@transaction.credit_account.name), account_path(@transaction.credit_account)) %></td>
|
17
|
+
<td><%=link_to(h(@transaction.debit_account.name), account_path(@transaction.debit_account)) %></td>
|
18
|
+
<td><%=h @transaction.amount %></td>
|
19
|
+
<td><%=h @transaction.created_at %></td>
|
20
|
+
</tr>
|
21
|
+
</table>
|
22
|
+
|
23
|
+
|
24
|
+
</table>
|
data/doc/Account.html
ADDED
@@ -0,0 +1,300 @@
|
|
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: Account</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">Account</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: Account
|
47
|
+
<span class="abstract note title">Abstract</span>
|
48
|
+
|
49
|
+
|
50
|
+
</h1>
|
51
|
+
|
52
|
+
<dl class="box">
|
53
|
+
|
54
|
+
<dt class="r1">Inherits:</dt>
|
55
|
+
<dd class="r1">
|
56
|
+
<span class="inheritName">ActiveRecord::Base</span>
|
57
|
+
|
58
|
+
<ul class="fullTree">
|
59
|
+
<li>Object</li>
|
60
|
+
|
61
|
+
<li class="next">ActiveRecord::Base</li>
|
62
|
+
|
63
|
+
<li class="next">Account</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/models/account.rb</dd>
|
80
|
+
|
81
|
+
</dl>
|
82
|
+
<div class="clear"></div>
|
83
|
+
|
84
|
+
<h2>Overview</h2><div class="docstring">
|
85
|
+
<div class="discussion">
|
86
|
+
<div class="note abstract">
|
87
|
+
<strong>This class is abstract.</strong>
|
88
|
+
<div class='inline'><p>
|
89
|
+
An account must be a subclass to be saved to the database. The Account
|
90
|
+
class has a singleton method <span class='object_link'><a href="#trial_balance-class_method" title="Account.trial_balance (method)">trial_balance</a></span> to calculate the balance on
|
91
|
+
all Accounts.
|
92
|
+
</p>
|
93
|
+
</div>
|
94
|
+
</div>
|
95
|
+
<h2>Overview:</h2>
|
96
|
+
<p>
|
97
|
+
The Account class represents accounts in the system. Each account must be
|
98
|
+
subclassed as one of the following types:
|
99
|
+
</p>
|
100
|
+
<pre class="code">
|
101
|
+
<span class='TYPE constant id'>TYPE</span> <span class='bitor op'>|</span> <span class='NORMAL constant id'>NORMAL</span> <span class='BALANCE constant id'>BALANCE</span> <span class='bitor op'>|</span> <span class='DESCRIPTION constant id'>DESCRIPTION</span>
|
102
|
+
<span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span><span class='minus op'>-</span>
|
103
|
+
<span class='Asset constant id'>Asset</span> <span class='bitor op'>|</span> <span class='Debit constant id'>Debit</span> <span class='bitor op'>|</span> <span class='Resources constant id'>Resources</span> <span class='owned identifier id'>owned</span> <span class='by identifier id'>by</span> <span class='the identifier id'>the</span> <span class='Business constant id'>Business</span> <span class='Entity constant id'>Entity</span>
|
104
|
+
<span class='Liability constant id'>Liability</span> <span class='bitor op'>|</span> <span class='Credit constant id'>Credit</span> <span class='bitor op'>|</span> <span class='Debts constant id'>Debts</span> <span class='owed identifier id'>owed</span> <span class='to identifier id'>to</span> <span class='outsiders identifier id'>outsiders</span>
|
105
|
+
<span class='Equity constant id'>Equity</span> <span class='bitor op'>|</span> <span class='Credit constant id'>Credit</span> <span class='bitor op'>|</span> <span class='Owners constant id'>Owners</span> <span class='rights identifier id'>rights</span> <span class='to identifier id'>to</span> <span class='the identifier id'>the</span> <span class='Assets constant id'>Assets</span>
|
106
|
+
<span class='Revenue constant id'>Revenue</span> <span class='bitor op'>|</span> <span class='Credit constant id'>Credit</span> <span class='bitor op'>|</span> <span class='Increases constant id'>Increases</span> <span class='in in kw'>in</span> <span class='owners identifier id'>owners</span> <span class='equity identifier id'>equity</span>
|
107
|
+
<span class='Expense constant id'>Expense</span> <span class='bitor op'>|</span> <span class='Debit constant id'>Debit</span> <span class='bitor op'>|</span> <span class='Assets constant id'>Assets</span> <span class='or or kw'>or</span> <span class='services identifier id'>services</span> <span class='consumed identifier id'>consumed</span> <span class='in in kw'>in</span> <span class='the identifier id'>the</span> <span class='generation identifier id'>generation</span> <span class='of identifier id'>of</span> <span class='revenue identifier id'>revenue</span>
|
108
|
+
</pre>
|
109
|
+
<p>
|
110
|
+
Each account can also be marked as a "Contra Account". A contra
|
111
|
+
account will have it’s normal balance swapped. For example, to remove
|
112
|
+
equity, a "Drawing" account may be created as a contra equity
|
113
|
+
account as follows:
|
114
|
+
</p>
|
115
|
+
<pre class="code">
|
116
|
+
<span class='Equity constant id'>Equity</span><span class='dot token'>.</span><span class='create identifier id'>create</span><span class='lparen token'>(</span><span class='symbol val'>:name</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='string val'>"Drawing"</span><span class='comma token'>,</span> <span class='contra identifier id'>contra</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='true true kw'>true</span><span class='rparen token'>)</span>
|
117
|
+
</pre>
|
118
|
+
<p>
|
119
|
+
At all times the balance of all accounts should conform to the
|
120
|
+
"accounting equation"
|
121
|
+
</p>
|
122
|
+
<pre class="code">
|
123
|
+
<span class='Assets constant id'>Assets</span> <span class='assign token'>=</span> <span class='Liabilties constant id'>Liabilties</span> <span class='plus op'>+</span> <span class='Owner constant id'>Owner</span><span class='string val'>'s Equity
|
124
|
+
</span></pre>
|
125
|
+
<p>
|
126
|
+
Each sublclass account acts as it’s own ledger. See the individual
|
127
|
+
subclasses for a description.
|
128
|
+
</p>
|
129
|
+
|
130
|
+
|
131
|
+
</div>
|
132
|
+
</div>
|
133
|
+
<div class="tags">
|
134
|
+
|
135
|
+
<h3>See Also:</h3>
|
136
|
+
<ul class="see">
|
137
|
+
|
138
|
+
<li><a href="http://en.wikipedia.org/wiki/Accounting_equation" target="_parent" title="Accounting Equation">Accounting Equation</a></li>
|
139
|
+
|
140
|
+
<li><a href="http://en.wikipedia.org/wiki/Debits_and_credits" target="_parent" title="Debits, Credits, and Contra Accounts">Debits, Credits, and Contra Accounts</a></li>
|
141
|
+
|
142
|
+
</ul>
|
143
|
+
<h3>Author:</h3>
|
144
|
+
<ul class="author">
|
145
|
+
|
146
|
+
<li>
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
<div class='inline'><p>
|
153
|
+
Michael Bulat
|
154
|
+
</p>
|
155
|
+
</div>
|
156
|
+
|
157
|
+
</li>
|
158
|
+
|
159
|
+
</ul>
|
160
|
+
|
161
|
+
</div><div id="subclasses">
|
162
|
+
<h2>Direct Known Subclasses</h2>
|
163
|
+
<p class="children"><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></p>
|
164
|
+
</div>
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
<h2>
|
171
|
+
Class Method Summary
|
172
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
173
|
+
</h2>
|
174
|
+
|
175
|
+
<ul class="summary">
|
176
|
+
|
177
|
+
<li class="public ">
|
178
|
+
<span class="summary_signature">
|
179
|
+
|
180
|
+
<a href="#trial_balance-class_method" title="trial_balance (class method)">+ (BigDecimal) <strong>trial_balance</strong> </a>
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
</span>
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
<span class="summary_desc"><div class='inline'><p>
|
194
|
+
The trial balance of all accounts in the system.
|
195
|
+
</p>
|
196
|
+
</div></span>
|
197
|
+
|
198
|
+
</li>
|
199
|
+
|
200
|
+
|
201
|
+
</ul>
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
<div id="class_method_details" class="method_details_list">
|
208
|
+
<h2>Class Method Details</h2>
|
209
|
+
|
210
|
+
|
211
|
+
<div class="method_details first">
|
212
|
+
<p class="signature first" id="trial_balance-class_method">
|
213
|
+
|
214
|
+
+ (<tt>BigDecimal</tt>) <strong>trial_balance</strong>
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
</p><div class="docstring">
|
219
|
+
<div class="discussion">
|
220
|
+
<p>
|
221
|
+
The trial balance of all accounts in the system. This should always equal
|
222
|
+
zero, otherwise there is an error in the system.
|
223
|
+
</p>
|
224
|
+
|
225
|
+
|
226
|
+
</div>
|
227
|
+
</div>
|
228
|
+
<div class="tags">
|
229
|
+
|
230
|
+
<div class="examples">
|
231
|
+
<h3>Examples:</h3>
|
232
|
+
|
233
|
+
<h4><div class='inline'></div></h4>
|
234
|
+
<pre class="example code"><span class='rshft op'>>></span> <span class='Account constant id'>Account</span><span class='dot token'>.</span><span class='trial_balance identifier id'>trial_balance</span><span class='dot token'>.</span><span class='to_i identifier id'>to_i</span>
|
235
|
+
<span class='assign token'>=</span><span class='gt op'>></span> <span class='integer val'>0</span>
|
236
|
+
</pre>
|
237
|
+
|
238
|
+
</div>
|
239
|
+
<h3>Returns:</h3>
|
240
|
+
<ul class="return">
|
241
|
+
|
242
|
+
<li>
|
243
|
+
|
244
|
+
<span class='type'>(<tt>BigDecimal</tt>)</span>
|
245
|
+
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
—
|
250
|
+
<div class='inline'><p>
|
251
|
+
The decimal value balance of all accounts
|
252
|
+
</p>
|
253
|
+
</div>
|
254
|
+
|
255
|
+
</li>
|
256
|
+
|
257
|
+
</ul>
|
258
|
+
|
259
|
+
</div><table class="source_code">
|
260
|
+
<tr>
|
261
|
+
<td>
|
262
|
+
<pre class="lines">
|
263
|
+
|
264
|
+
|
265
|
+
49
|
266
|
+
50
|
267
|
+
51
|
268
|
+
52
|
269
|
+
53
|
270
|
+
54
|
271
|
+
55</pre>
|
272
|
+
</td>
|
273
|
+
<td>
|
274
|
+
<pre class="code"><span class="info file"># File 'app/models/account.rb', line 49</span>
|
275
|
+
|
276
|
+
<span class='def def kw'>def</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='trial_balance identifier id'>trial_balance</span>
|
277
|
+
<span class='unless unless kw'>unless</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='new identifier id'>new</span><span class='dot token'>.</span><span class='class identifier id'>class</span> <span class='eq op'>==</span> <span class='Account constant id'>Account</span>
|
278
|
+
<span class='raise identifier id'>raise</span><span class='lparen token'>(</span><span class='NoMethodError constant id'>NoMethodError</span><span class='comma token'>,</span> <span class='string val'>"undefined method 'trial_balance'"</span><span class='rparen token'>)</span>
|
279
|
+
<span class='else else kw'>else</span>
|
280
|
+
<span class='Asset constant id'>Asset</span><span class='dot token'>.</span><span class='balance identifier id'>balance</span> <span class='minus op'>-</span> <span class='lparen token'>(</span><span class='Liability constant id'>Liability</span><span class='dot token'>.</span><span class='balance identifier id'>balance</span> <span class='plus op'>+</span> <span class='Equity constant id'>Equity</span><span class='dot token'>.</span><span class='balance identifier id'>balance</span> <span class='plus op'>+</span> <span class='Revenue constant id'>Revenue</span><span class='dot token'>.</span><span class='balance identifier id'>balance</span> <span class='minus op'>-</span> <span class='Expense constant id'>Expense</span><span class='dot token'>.</span><span class='balance identifier id'>balance</span><span class='rparen token'>)</span>
|
281
|
+
<span class='end end kw'>end</span>
|
282
|
+
<span class='end end kw'>end</span>
|
283
|
+
</pre>
|
284
|
+
</td>
|
285
|
+
</tr>
|
286
|
+
</table>
|
287
|
+
</div>
|
288
|
+
|
289
|
+
</div>
|
290
|
+
|
291
|
+
</div>
|
292
|
+
|
293
|
+
<div id="footer">
|
294
|
+
Generated on Fri Dec 3 14:35:08 2010 by
|
295
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
296
|
+
0.6.2 (ruby-1.8.7).
|
297
|
+
</div>
|
298
|
+
|
299
|
+
</body>
|
300
|
+
</html>
|