plutus 0.14 → 0.17
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 +4 -4
- data/README.markdown +3 -3
- data/app/assets/javascripts/plutus/application.js +1 -1
- data/app/assets/stylesheets/plutus/application.css +0 -1
- data/app/controllers/plutus/accounts_controller.rb +1 -1
- data/app/controllers/plutus/reports_controller.rb +1 -1
- data/app/models/plutus/account.rb +11 -1
- data/app/models/plutus/amounts_extension.rb +1 -1
- data/app/models/plutus/asset.rb +1 -1
- data/app/models/plutus/credit_amount.rb +1 -1
- data/app/models/plutus/debit_amount.rb +1 -1
- data/app/models/plutus/equity.rb +1 -1
- data/app/models/plutus/expense.rb +1 -1
- data/app/models/plutus/liability.rb +1 -1
- data/app/models/plutus/revenue.rb +1 -1
- data/app/views/layouts/plutus/application.html.erb +0 -1
- data/app/views/plutus/reports/balance_sheet.html.erb +1 -1
- data/app/views/plutus/reports/income_statement.html.erb +2 -2
- data/lib/plutus/version.rb +1 -1
- data/spec/controllers/reports_controller_spec.rb +2 -2
- 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/models/account_spec.rb +7 -0
- metadata +7 -36
- data/app/assets/javascripts/plutus/reports.js +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d6d53fa47c9c392c0a240fadd36257b8716367a1694642d3597d338f6173a93
|
4
|
+
data.tar.gz: a918177e468ee3d2f47acd6fa62eeaceb1e2c604f86161e8c717c9b00927ced4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d84a78fe7b972cd457d27c9da70fac2c79dfeaf5bea80e26be2d131174c3750d4a59a3254214a96b51f871f1f7895a905811df8b25b2953587d77bce981108b1
|
7
|
+
data.tar.gz: cf15cc0e6c2492c7b15f1a2aba067737bc3816fabe59ee57f61f44f74ea84af417b7fc169d6028bf95de6bc693062586433d5fcbf55570c6292b722cdab1a40f
|
data/README.markdown
CHANGED
@@ -7,8 +7,8 @@ The Plutus plugin is a Ruby on Rails Engine which provides a double entry accoun
|
|
7
7
|
Compatibility
|
8
8
|
=============
|
9
9
|
|
10
|
-
* Ruby versions: MRI 2.
|
11
|
-
* Rails versions: ~>
|
10
|
+
* Ruby versions: MRI 2.5+
|
11
|
+
* Rails versions: ~> 6.0
|
12
12
|
|
13
13
|
For earlier versions, and upgrading, please see the section titled [Previous Versions](https://github.com/mbulat/plutus#previous-versions)
|
14
14
|
|
@@ -267,7 +267,7 @@ entry = Plutus::Entry.build(
|
|
267
267
|
Multitenancy Support
|
268
268
|
=====================
|
269
269
|
|
270
|
-
Plutus supports multitenant applications. Multitenancy is
|
270
|
+
Plutus supports multitenant applications. Multitenancy is achieved by associating all Accounts under `Plutus::Account` with a "Tenant" object (typically some model in your Rails application). To add multi-tenancy support to Plutus, you must do the following:
|
271
271
|
|
272
272
|
- Generate the migration which will add `tenant_id` to the plutus accounts table
|
273
273
|
|
@@ -41,6 +41,16 @@ module Plutus
|
|
41
41
|
|
42
42
|
validates_presence_of :type
|
43
43
|
|
44
|
+
def self.types
|
45
|
+
[
|
46
|
+
::Plutus::Asset,
|
47
|
+
::Plutus::Equity,
|
48
|
+
::Plutus::Expense,
|
49
|
+
::Plutus::Liability,
|
50
|
+
::Plutus::Revenue,
|
51
|
+
]
|
52
|
+
end
|
53
|
+
|
44
54
|
if Plutus.enable_tenancy
|
45
55
|
include Plutus::Tenancy
|
46
56
|
else
|
@@ -137,7 +147,7 @@ module Plutus
|
|
137
147
|
if self.new.class == Plutus::Account
|
138
148
|
raise(NoMethodError, "undefined method 'balance'")
|
139
149
|
else
|
140
|
-
accounts_balance = BigDecimal
|
150
|
+
accounts_balance = BigDecimal('0')
|
141
151
|
accounts = self.all
|
142
152
|
accounts.each do |account|
|
143
153
|
if account.contra
|
@@ -30,7 +30,7 @@ module Plutus
|
|
30
30
|
#
|
31
31
|
# Since this does not use the database for sumation, it may be used on non-persisted records.
|
32
32
|
def balance_for_new_record
|
33
|
-
balance = BigDecimal
|
33
|
+
balance = BigDecimal('0')
|
34
34
|
each do |amount_record|
|
35
35
|
if amount_record.amount && !amount_record.marked_for_destruction?
|
36
36
|
balance += amount_record.amount # unless amount_record.marked_for_destruction?
|
data/app/models/plutus/asset.rb
CHANGED
data/app/models/plutus/equity.rb
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
<%= form_tag({:action => 'balance_sheet'}, {:method => :get, :class => 'form-inline'}) do%>
|
6
6
|
<div class="form-group">
|
7
7
|
<%= label_tag :date, nil, class: 'sr-only'%>
|
8
|
-
<%=
|
8
|
+
<%= date_field_tag :date, @to_date, :class => 'form-control' %>
|
9
9
|
</div>
|
10
10
|
<button type="submit" class="btn btn-default">Get Report</button>
|
11
11
|
<% end %>
|
@@ -5,11 +5,11 @@
|
|
5
5
|
<%= form_tag({:action => 'income_statement'}, {:method => :get, :class => 'form-inline'}) do%>
|
6
6
|
<div class="form-group">
|
7
7
|
<%= label_tag :from_date, nil, class: 'sr-only'%>
|
8
|
-
<%=
|
8
|
+
<%= date_field_tag :from_date, @from_date, :class => 'form-control', :placeholder => "Date" %>
|
9
9
|
</div>
|
10
10
|
<div class="form-group">
|
11
11
|
<%= label_tag :to_date, nil, class: 'sr-only'%>
|
12
|
-
<%=
|
12
|
+
<%= date_field_tag :to_date, @to_date, :class => 'form-control', :placeholder => "Date" %>
|
13
13
|
</div>
|
14
14
|
<button type="submit" class="btn btn-default">Get Report</button>
|
15
15
|
<% end %>
|
data/lib/plutus/version.rb
CHANGED
@@ -12,12 +12,12 @@ module Plutus
|
|
12
12
|
it "renders when one entry exists" do
|
13
13
|
allow(Entry).to receive_message_chain(:order).and_return([mock_entry])
|
14
14
|
get :balance_sheet
|
15
|
-
|
15
|
+
assert_template 'reports/balance_sheet'
|
16
16
|
end
|
17
17
|
it "renders when no entries exist" do
|
18
18
|
allow(Entry).to receive_message_chain(:order).and_return([])
|
19
19
|
get :balance_sheet
|
20
|
-
|
20
|
+
assert_template 'reports/balance_sheet'
|
21
21
|
end
|
22
22
|
end
|
23
23
|
end
|
@@ -1,32 +1,32 @@
|
|
1
1
|
FactoryGirl.define do
|
2
2
|
factory :account, :class => Plutus::Account do |account|
|
3
3
|
account.name
|
4
|
-
account.contra false
|
4
|
+
account.contra { false }
|
5
5
|
end
|
6
6
|
|
7
7
|
factory :asset, :class => Plutus::Asset do |account|
|
8
8
|
account.name
|
9
|
-
account.contra false
|
9
|
+
account.contra { false }
|
10
10
|
end
|
11
11
|
|
12
12
|
factory :equity, :class => Plutus::Equity do |account|
|
13
13
|
account.name
|
14
|
-
account.contra false
|
14
|
+
account.contra { false }
|
15
15
|
end
|
16
16
|
|
17
17
|
factory :expense, :class => Plutus::Expense do |account|
|
18
18
|
account.name
|
19
|
-
account.contra false
|
19
|
+
account.contra { false }
|
20
20
|
end
|
21
21
|
|
22
22
|
factory :liability, :class => Plutus::Liability do |account|
|
23
23
|
account.name
|
24
|
-
account.contra false
|
24
|
+
account.contra { false }
|
25
25
|
end
|
26
26
|
|
27
27
|
factory :revenue, :class => Plutus::Revenue do |account|
|
28
28
|
account.name
|
29
|
-
account.contra false
|
29
|
+
account.contra { false }
|
30
30
|
end
|
31
31
|
|
32
32
|
sequence :name do |n|
|
@@ -1,18 +1,18 @@
|
|
1
1
|
FactoryGirl.define do
|
2
2
|
factory :amount, :class => Plutus::Amount do |amount|
|
3
|
-
amount.amount BigDecimal
|
3
|
+
amount.amount { BigDecimal('473') }
|
4
4
|
amount.association :entry, :factory => :entry_with_credit_and_debit
|
5
5
|
amount.association :account, :factory => :asset
|
6
6
|
end
|
7
7
|
|
8
8
|
factory :credit_amount, :class => Plutus::CreditAmount do |credit_amount|
|
9
|
-
credit_amount.amount BigDecimal
|
9
|
+
credit_amount.amount { BigDecimal('473') }
|
10
10
|
credit_amount.association :entry, :factory => :entry_with_credit_and_debit
|
11
11
|
credit_amount.association :account, :factory => :revenue
|
12
12
|
end
|
13
13
|
|
14
14
|
factory :debit_amount, :class => Plutus::DebitAmount do |debit_amount|
|
15
|
-
debit_amount.amount BigDecimal
|
15
|
+
debit_amount.amount { BigDecimal('473') }
|
16
16
|
debit_amount.association :entry, :factory => :entry_with_credit_and_debit
|
17
17
|
debit_amount.association :account, :factory => :asset
|
18
18
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
FactoryGirl.define do
|
2
2
|
factory :entry, :class => Plutus::Entry do |entry|
|
3
|
-
entry.description 'factory description'
|
3
|
+
entry.description { 'factory description' }
|
4
4
|
factory :entry_with_credit_and_debit, :class => Plutus::Entry do |entry_cd|
|
5
5
|
entry_cd.after_build do |t|
|
6
6
|
t.credit_amounts << FactoryGirl.build(:credit_amount, :entry => t)
|
data/spec/models/account_spec.rb
CHANGED
@@ -7,6 +7,13 @@ module Plutus
|
|
7
7
|
|
8
8
|
it { is_expected.not_to be_valid } # must construct a child type instead
|
9
9
|
|
10
|
+
describe ".types" do
|
11
|
+
it "lists the available types" do
|
12
|
+
expect(described_class.types).
|
13
|
+
to match_array([Asset, Equity, Expense, Liability, Revenue])
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
10
17
|
describe "when using a child type" do
|
11
18
|
let(:account) { FactoryGirl.create(:account, type: "Finance::Asset") }
|
12
19
|
it { is_expected.to be_valid }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: plutus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.17'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Bulat
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-09-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -16,56 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '6.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: jquery-rails
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '3.0'
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '3.0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: jquery-ui-rails
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: 4.2.2
|
48
|
-
type: :runtime
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: 4.2.2
|
26
|
+
version: '6.0'
|
55
27
|
- !ruby/object:Gem::Dependency
|
56
28
|
name: kaminari
|
57
29
|
requirement: !ruby/object:Gem::Requirement
|
58
30
|
requirements:
|
59
31
|
- - "~>"
|
60
32
|
- !ruby/object:Gem::Version
|
61
|
-
version: '1.
|
33
|
+
version: '1.2'
|
62
34
|
type: :runtime
|
63
35
|
prerelease: false
|
64
36
|
version_requirements: !ruby/object:Gem::Requirement
|
65
37
|
requirements:
|
66
38
|
- - "~>"
|
67
39
|
- !ruby/object:Gem::Version
|
68
|
-
version: '1.
|
40
|
+
version: '1.2'
|
69
41
|
- !ruby/object:Gem::Dependency
|
70
42
|
name: yard
|
71
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -110,7 +82,6 @@ files:
|
|
110
82
|
- README.markdown
|
111
83
|
- Rakefile
|
112
84
|
- app/assets/javascripts/plutus/application.js
|
113
|
-
- app/assets/javascripts/plutus/reports.js
|
114
85
|
- app/assets/stylesheets/bootstrap-theme.min.css
|
115
86
|
- app/assets/stylesheets/bootstrap.min.css
|
116
87
|
- app/assets/stylesheets/plutus/application.css
|
@@ -206,7 +177,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
206
177
|
version: 1.3.6
|
207
178
|
requirements: []
|
208
179
|
rubyforge_project:
|
209
|
-
rubygems_version: 2.7.6
|
180
|
+
rubygems_version: 2.7.6.2
|
210
181
|
signing_key:
|
211
182
|
specification_version: 3
|
212
183
|
summary: A Plugin providing a Double Entry Accounting Engine for Rails
|