plutus 0.11.0 → 0.16
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.
- checksums.yaml +5 -5
- data/README.markdown +66 -40
- data/app/assets/javascripts/plutus/application.js +5 -4
- data/app/assets/javascripts/plutus/reports.js +5 -0
- data/app/assets/stylesheets/bootstrap-theme.min.css +5 -0
- data/app/assets/stylesheets/bootstrap.min.css +5 -0
- data/app/assets/stylesheets/plutus/application.css +11 -5
- data/app/controllers/plutus/accounts_controller.rb +1 -16
- data/app/controllers/plutus/application_controller.rb +4 -0
- data/app/controllers/plutus/entries_controller.rb +7 -17
- data/app/controllers/plutus/reports_controller.rb +40 -0
- data/app/models/plutus/account.rb +92 -7
- data/app/models/plutus/amount.rb +2 -11
- data/app/models/plutus/amounts_extension.rb +31 -6
- data/app/models/plutus/asset.rb +21 -18
- data/app/models/plutus/entry.rb +15 -3
- data/app/models/plutus/equity.rb +22 -19
- data/app/models/plutus/expense.rb +21 -18
- data/app/models/plutus/liability.rb +27 -19
- data/app/models/plutus/revenue.rb +22 -19
- data/app/models/plutus/tenancy.rb +5 -1
- data/app/views/layouts/plutus/_messages.html.erb +9 -0
- data/app/views/layouts/plutus/_navigation.html.erb +19 -0
- data/app/views/layouts/plutus/_navigation_links.html.erb +5 -0
- data/app/views/layouts/plutus/application.html.erb +19 -0
- data/app/views/plutus/accounts/index.html.erb +9 -12
- data/app/views/plutus/entries/index.html.erb +22 -11
- data/app/views/plutus/reports/_account.html.erb +28 -0
- data/app/views/plutus/reports/balance_sheet.html.erb +21 -0
- data/app/views/plutus/reports/income_statement.html.erb +24 -0
- data/config/routes.rb +6 -3
- data/{lib/generators/plutus/templates/migration.rb → db/migrate/20160422010135_create_plutus_tables.rb} +6 -10
- data/lib/generators/plutus/add_date_upgrade_generator.rb +11 -0
- data/lib/generators/plutus/base_generator.rb +19 -0
- data/lib/generators/plutus/plutus_generator.rb +8 -22
- data/lib/generators/plutus/templates/add_date_migration.rb +12 -0
- data/lib/generators/plutus/templates/tenant_migration.rb +1 -1
- data/lib/generators/plutus/templates/update_migration.rb +2 -2
- data/lib/generators/plutus/tenancy_generator.rb +2 -17
- data/lib/generators/plutus/upgrade_plutus_generator.rb +6 -22
- data/lib/plutus.rb +2 -5
- data/lib/plutus/engine.rb +5 -0
- data/lib/plutus/version.rb +1 -1
- data/spec/controllers/accounts_controller_spec.rb +11 -20
- data/spec/controllers/entries_controller_spec.rb +11 -20
- data/spec/controllers/reports_controller_spec.rb +24 -0
- data/spec/factories/account_factory.rb +6 -6
- data/spec/factories/amount_factory.rb +3 -3
- data/spec/factories/entry_factory.rb +1 -1
- data/spec/factories/tenant_factory.rb +12 -0
- data/spec/models/account_spec.rb +71 -8
- data/spec/models/amount_spec.rb +6 -1
- data/spec/models/entry_spec.rb +35 -63
- data/spec/models/tenancy_spec.rb +26 -8
- data/spec/routing/accounts_routing_spec.rb +6 -25
- data/spec/routing/entries_routing_spec.rb +6 -25
- data/spec/spec_helper.rb +4 -2
- data/spec/support/account_shared_examples.rb +14 -10
- data/spec/support/amount_shared_examples.rb +4 -4
- data/spec/support/shoulda_matchers.rb +8 -0
- metadata +100 -28
- data/app/views/plutus/accounts/show.html.erb +0 -59
- data/app/views/plutus/entries/show.html.erb +0 -46
- data/spec/schema.rb +0 -31
@@ -1,59 +0,0 @@
|
|
1
|
-
<div class="plutus_container">
|
2
|
-
<h1><%=h @account.name %> Account</h1>
|
3
|
-
|
4
|
-
<table>
|
5
|
-
<tr>
|
6
|
-
<th class="nobg">ID</th>
|
7
|
-
<th>Name</th>
|
8
|
-
<th>Type</th>
|
9
|
-
<th>Credit Balance</th>
|
10
|
-
<th>Debit Balance</th>
|
11
|
-
<th>Balance</td>
|
12
|
-
</tr>
|
13
|
-
|
14
|
-
<tr class="odd">
|
15
|
-
<td><%=h @account.id %></td>
|
16
|
-
<td><%=h @account.name %></td>
|
17
|
-
<td><%=h @account.type.sub('Plutus::','') %></td>
|
18
|
-
<td><%=h @account.credits_balance %></td>
|
19
|
-
<td><%=h @account.debits_balance %></td>
|
20
|
-
<td><%=h @account.balance %></td>
|
21
|
-
</tr>
|
22
|
-
</table>
|
23
|
-
|
24
|
-
<h1>Credit Entries</h1>
|
25
|
-
|
26
|
-
<table>
|
27
|
-
<tr>
|
28
|
-
<th class="nobg">ID</th>
|
29
|
-
<th>Description</th>
|
30
|
-
<th>Date</th>
|
31
|
-
</tr>
|
32
|
-
|
33
|
-
<% @account.credit_entries.each do |entry| %>
|
34
|
-
<tr class="<%= cycle("even", "odd") -%>">
|
35
|
-
<td><%=h entry.id %></td>
|
36
|
-
<td><%=h entry.description %></td>
|
37
|
-
<td><%=h entry.created_at %></td>
|
38
|
-
</tr>
|
39
|
-
<% end %>
|
40
|
-
</table>
|
41
|
-
|
42
|
-
<h1>Debit Entries</h1>
|
43
|
-
|
44
|
-
<table>
|
45
|
-
<tr>
|
46
|
-
<th class="nobg">ID</th>
|
47
|
-
<th>Description</th>
|
48
|
-
<th>Date</th>
|
49
|
-
</tr>
|
50
|
-
|
51
|
-
<% @account.debit_entries.each do |tr| %>
|
52
|
-
<tr class="<%= cycle("even", "odd") -%>">
|
53
|
-
<td><%=h tr.id %></td>
|
54
|
-
<td><%=h tr.description %></td>
|
55
|
-
<td><%=h tr.created_at %></td>
|
56
|
-
</tr>
|
57
|
-
<% end %>
|
58
|
-
</table>
|
59
|
-
</div>
|
@@ -1,46 +0,0 @@
|
|
1
|
-
<div class="plutus_container">
|
2
|
-
<h1><%=h @entry.description %> Entry</h1>
|
3
|
-
|
4
|
-
<table cellspacing="0">
|
5
|
-
<thead>
|
6
|
-
<tr>
|
7
|
-
<th class="nobg">ID</th>
|
8
|
-
<th>Description</th>
|
9
|
-
<th>Debits</th>
|
10
|
-
<th>Credits</th>
|
11
|
-
<th>Date</th>
|
12
|
-
</tr>
|
13
|
-
</thead>
|
14
|
-
<tbody>
|
15
|
-
<tr class="<%= cycle("even", "odd") -%>">
|
16
|
-
<td><%=link_to(@entry.id, entry_path(@entry)) %></td>
|
17
|
-
<td><%=h @entry.description %></td>
|
18
|
-
<td></td>
|
19
|
-
<td></td>
|
20
|
-
<td><%=h @entry.created_at %></td>
|
21
|
-
</tr>
|
22
|
-
<% @entry.debit_amounts.each do |debit_amount| %>
|
23
|
-
<tr class="<%= cycle("odd", "odd") -%>">
|
24
|
-
<td></td>
|
25
|
-
<td> <%=h "#{debit_amount.account.name}" %></td>
|
26
|
-
<td><%=h debit_amount.amount %></td>
|
27
|
-
<td></td>
|
28
|
-
<td></td>
|
29
|
-
</tr>
|
30
|
-
<% end %>
|
31
|
-
<% @entry.credit_amounts.each do |credit_amount| %>
|
32
|
-
<tr class="<%= cycle("odd", "odd") -%>">
|
33
|
-
<td></td>
|
34
|
-
<td> <%=h "#{credit_amount.account.name}" %></td>
|
35
|
-
<td></td>
|
36
|
-
<td><%=h credit_amount.amount %></td>
|
37
|
-
<td></td>
|
38
|
-
</tr>
|
39
|
-
<% end %>
|
40
|
-
</tbody>
|
41
|
-
</table>
|
42
|
-
|
43
|
-
<br />
|
44
|
-
|
45
|
-
<h3>Go to <%= link_to 'Accounts', accounts_path %></h3>
|
46
|
-
</div>
|
data/spec/schema.rb
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
# This file is auto-generated from the current state of the database. Instead of editing this file,
|
2
|
-
# please use the migrations feature of Active Record to incrementally modify your database, and
|
3
|
-
# then regenerate this schema definition.
|
4
|
-
#
|
5
|
-
# Note that this schema.rb definition is the authoritative source for your database schema. If you need
|
6
|
-
# to create the application database on another system, you should be using db:schema:load, not running
|
7
|
-
# all the migrations from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
8
|
-
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
9
|
-
#
|
10
|
-
# It's strongly recommended to check this file into your version control system.
|
11
|
-
|
12
|
-
ActiveRecord::Schema.define(:version => 20100419190249) do
|
13
|
-
|
14
|
-
create_table "accounts", :force => true do |t|
|
15
|
-
t.string "name"
|
16
|
-
t.string "type"
|
17
|
-
t.datetime "created_at"
|
18
|
-
t.datetime "updated_at"
|
19
|
-
end
|
20
|
-
|
21
|
-
create_table "transactions", :force => true do |t|
|
22
|
-
t.string "description"
|
23
|
-
t.integer "credit_account_id"
|
24
|
-
t.decimal "credit_amount"
|
25
|
-
t.integer "debit_account_id"
|
26
|
-
t.decimal "debit_amount"
|
27
|
-
t.datetime "created_at"
|
28
|
-
t.datetime "updated_at"
|
29
|
-
end
|
30
|
-
|
31
|
-
end
|