plutus 0.16 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c15a4c67d742e40dabfdd3c72b9a6877f74589ba456ccbc6d0129d24183afcb4
4
- data.tar.gz: 36994885d6d3573d84791173d518290c6080df50f3ae3b240f2cbcdcbdebe82c
3
+ metadata.gz: 8d6d53fa47c9c392c0a240fadd36257b8716367a1694642d3597d338f6173a93
4
+ data.tar.gz: a918177e468ee3d2f47acd6fa62eeaceb1e2c604f86161e8c717c9b00927ced4
5
5
  SHA512:
6
- metadata.gz: f52a3430cb5ef405105c7fc0399538240c2217d98b70a7b0fbeb1b100d3676c37c18e9bfc18aa6cebdad10d1c7b2bd847f753289e5144aef44c07e2f27b17122
7
- data.tar.gz: b4f2424a9399b65a6259c9040c43852162a02cab2f86fb6cdf621fb7cae0c5c0ff5f78d0753eb713b1cd8b3c22fe225cb13c340e97ddee0a171f2f15ab21473b
6
+ metadata.gz: d84a78fe7b972cd457d27c9da70fac2c79dfeaf5bea80e26be2d131174c3750d4a59a3254214a96b51f871f1f7895a905811df8b25b2953587d77bce981108b1
7
+ data.tar.gz: cf15cc0e6c2492c7b15f1a2aba067737bc3816fabe59ee57f61f44f74ea84af417b7fc169d6028bf95de6bc693062586433d5fcbf55570c6292b722cdab1a40f
@@ -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.2.2+ (should work with earlier versions if using Rails 4)
11
- * Rails versions: ~> 5.0, ~> 4.0
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 acheived 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:
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
 
@@ -13,7 +13,6 @@
13
13
  *= require_tree .
14
14
  *= require bootstrap.min
15
15
  *= require bootstrap-theme.min
16
- *= require jquery-ui/datepicker
17
16
  *= require_self
18
17
  */
19
18
  body { padding-top: 60px; }
@@ -10,7 +10,7 @@ module Plutus
10
10
  # controller will inherit.
11
11
  #
12
12
  # @author Michael Bulat
13
- class AccountsController < Plutus::ApplicationController
13
+ class AccountsController < ::Plutus::ApplicationController
14
14
  unloadable
15
15
 
16
16
  # @example
@@ -5,7 +5,7 @@ module Plutus
5
5
  # controller will inherit.
6
6
  #
7
7
  # @author Michael Bulat
8
- class ReportsController < Plutus::ApplicationController
8
+ class ReportsController < ::Plutus::ApplicationController
9
9
  unloadable
10
10
 
11
11
  # @example
@@ -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
@@ -7,7 +7,7 @@ module Plutus
7
7
  # @see http://en.wikipedia.org/wiki/Asset Assets
8
8
  #
9
9
  # @author Michael Bulat
10
- class Asset < Plutus::Account
10
+ class Asset < ::Plutus::Account
11
11
 
12
12
  self.normal_credit_balance = false
13
13
 
@@ -5,6 +5,6 @@ module Plutus
5
5
  # credit_amount = Plutus::CreditAmount.new(:account => revenue, :amount => 1000)
6
6
  #
7
7
  # @author Michael Bulat
8
- class CreditAmount < Amount
8
+ class CreditAmount < ::Plutus::Amount
9
9
  end
10
10
  end
@@ -5,6 +5,6 @@ module Plutus
5
5
  # debit_amount = Plutus::DebitAmount.new(:account => cash, :amount => 1000)
6
6
  #
7
7
  # @author Michael Bulat
8
- class DebitAmount < Amount
8
+ class DebitAmount < ::Plutus::Amount
9
9
  end
10
10
  end
@@ -7,7 +7,7 @@ module Plutus
7
7
  # @see http://en.wikipedia.org/wiki/Equity_(finance) Equity
8
8
  #
9
9
  # @author Michael Bulat
10
- class Equity < Plutus::Account
10
+ class Equity < ::Plutus::Account
11
11
 
12
12
  self.normal_credit_balance = true
13
13
 
@@ -7,7 +7,7 @@ module Plutus
7
7
  # @see http://en.wikipedia.org/wiki/Expense Expenses
8
8
  #
9
9
  # @author Michael Bulat
10
- class Expense < Plutus::Account
10
+ class Expense < ::Plutus::Account
11
11
 
12
12
  self.normal_credit_balance = false
13
13
 
@@ -7,7 +7,7 @@ module Plutus
7
7
  # @see http://en.wikipedia.org/wiki/Liability_(financial_accounting) Liability
8
8
  #
9
9
  # @author Michael Bulat
10
- class Liability < Plutus::Account
10
+ class Liability < ::Plutus::Account
11
11
 
12
12
  self.normal_credit_balance = true
13
13
 
@@ -7,7 +7,7 @@ module Plutus
7
7
  # @see http://en.wikipedia.org/wiki/Revenue Revenue
8
8
  #
9
9
  # @author Michael Bulat
10
- class Revenue < Plutus::Account
10
+ class Revenue < ::Plutus::Account
11
11
 
12
12
  self.normal_credit_balance = true
13
13
 
@@ -4,7 +4,6 @@
4
4
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
5
5
  <title>Plutus</title>
6
6
  <%= stylesheet_link_tag "plutus/application", media: "all" %>
7
- <%= javascript_include_tag "plutus/application" %>
8
7
  <%= csrf_meta_tags %>
9
8
  </head>
10
9
  <body>
@@ -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
- <%= text_field_tag :date, @to_date, :class => 'datepicker form-control' %>
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
- <%= text_field_tag :from_date, @from_date, :class => 'datepicker form-control', :placeholder => "Date" %>
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
- <%= text_field_tag :to_date, @to_date, :class => 'datepicker form-control', :placeholder => "Date" %>
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 %>
@@ -1,3 +1,3 @@
1
1
  module Plutus
2
- VERSION = "0.16"
2
+ VERSION = "0.17"
3
3
  end
@@ -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.16'
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: 2020-06-22 00:00:00.000000000 Z
11
+ date: 2020-09-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -24,48 +24,20 @@ dependencies:
24
24
  - - ">"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '6.0'
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
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.0'
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.0'
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
@@ -152,9 +123,7 @@ files:
152
123
  - lib/generators/plutus/add_date_upgrade_generator.rb
153
124
  - lib/generators/plutus/base_generator.rb
154
125
  - lib/generators/plutus/plutus_generator.rb
155
- - lib/generators/plutus/templates/add_date_migration.rb
156
126
  - lib/generators/plutus/templates/tenant_migration.rb
157
- - lib/generators/plutus/templates/update_migration.rb
158
127
  - lib/generators/plutus/tenancy_generator.rb
159
128
  - lib/generators/plutus/upgrade_plutus_generator.rb
160
129
  - lib/plutus.rb
@@ -207,7 +176,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
207
176
  - !ruby/object:Gem::Version
208
177
  version: 1.3.6
209
178
  requirements: []
210
- rubygems_version: 3.1.2
179
+ rubyforge_project:
180
+ rubygems_version: 2.7.6.2
211
181
  signing_key:
212
182
  specification_version: 3
213
183
  summary: A Plugin providing a Double Entry Accounting Engine for Rails
@@ -1,5 +0,0 @@
1
- jQuery(function() {
2
- return $('.datepicker').datepicker({
3
- dateFormat: "yy-mm-dd"
4
- });
5
- });
@@ -1,12 +0,0 @@
1
- class AddDateToPlutusEntries < ActiveRecord::Migration[4.2]
2
- def change
3
- add_column :plutus_entries, :date, :date
4
- add_index :plutus_entries, :date
5
-
6
- execute <<-SQL
7
- UPDATE plutus_entries
8
- SET date = created_at
9
- WHERE date is null
10
- SQL
11
- end
12
- end
@@ -1,17 +0,0 @@
1
- class UpdatePlutusTables < ActiveRecord::Migration
2
- def change
3
- # we have to remove these indexes because the temporary
4
- # table index name is too long
5
- remove_index :plutus_amounts, [:account_id, :transaction_id]
6
- remove_index :plutus_amounts, [:transaction_id, :account_id]
7
- remove_index :plutus_transactions, column: [:commercial_document_id, :commercial_document_type], :name => "index_transactions_on_commercial_doc"
8
-
9
- rename_table :plutus_transactions, :plutus_entries
10
- rename_column :plutus_amounts, :transaction_id, :entry_id
11
-
12
- # adding the indexes back
13
- add_index :plutus_amounts, [:account_id, :entry_id]
14
- add_index :plutus_amounts, [:entry_id, :account_id]
15
- add_index :plutus_entries, [:commercial_document_id, :commercial_document_type], :name => "index_entries_on_commercial_doc"
16
- end
17
- end