kaui 0.9.0 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -3
- data/Gemfile.lock +142 -89
- data/app/assets/javascripts/application.js +4 -1
- data/app/assets/javascripts/kaui/bootstrap-tweaks.js +1 -1
- data/app/assets/javascripts/kaui/datatables-tweaks.js +3 -0
- data/app/assets/stylesheets/application.css +2 -0
- data/app/assets/stylesheets/bootstrap_and_overrides.css +0 -41
- data/app/assets/stylesheets/datatables.scss +14 -0
- data/app/assets/stylesheets/layout.scss +19 -0
- data/app/controllers/kaui/account_timelines_controller.rb +6 -14
- data/app/controllers/kaui/sessions_controller.rb +3 -0
- data/app/controllers/kaui/subscriptions_controller.rb +8 -8
- data/app/models/kaui/ability.rb +1 -3
- data/app/models/kaui/allowed_user.rb +7 -2
- data/app/models/kaui/invoice.rb +21 -0
- data/app/views/kaui/account_emails/_account_emails_table.html.erb +1 -1
- data/app/views/kaui/account_timelines/show.html.erb +27 -27
- data/app/views/kaui/accounts/_form.html.erb +107 -111
- data/app/views/kaui/accounts/index.html.erb +1 -1
- data/app/views/kaui/accounts/show.html.erb +6 -6
- data/app/views/kaui/admin_allowed_users/new.html.erb +2 -2
- data/app/views/kaui/admin_tenants/new.html.erb +3 -3
- data/app/views/kaui/admin_tenants/show.html.erb +1 -1
- data/app/views/kaui/bundles/index.html.erb +1 -1
- data/app/views/kaui/bundles/show.html.erb +1 -1
- data/app/views/kaui/chargebacks/_form.html.erb +1 -1
- data/app/views/kaui/charges/_form.html.erb +2 -2
- data/app/views/kaui/credits/_form.html.erb +2 -2
- data/app/views/kaui/custom_fields/index.html.erb +1 -1
- data/app/views/kaui/home/index.html.erb +1 -1
- data/app/views/kaui/invoice_items/edit.html.erb +1 -1
- data/app/views/kaui/invoices/index.html.erb +1 -1
- data/app/views/kaui/invoices/show.html.erb +2 -2
- data/app/views/kaui/layouts/kaui_application.html.erb +14 -10
- data/app/views/kaui/payment_methods/_form.html.erb +3 -3
- data/app/views/kaui/payment_methods/_new_creditcard_payment_method.html.erb +2 -2
- data/app/views/kaui/payment_methods/_payment_methods_table.html.erb +5 -5
- data/app/views/kaui/payment_methods/index.html.erb +1 -1
- data/app/views/kaui/payments/index.html.erb +1 -1
- data/app/views/kaui/payments/new.html.erb +1 -1
- data/app/views/kaui/refunds/new.html.erb +2 -2
- data/app/views/kaui/subscriptions/_subscriptions_table.html.erb +5 -5
- data/app/views/kaui/subscriptions/new.html.erb +1 -1
- data/app/views/kaui/subscriptions/show.html.erb +5 -5
- data/app/views/kaui/tags/_tags_table.html.erb +2 -2
- data/app/views/kaui/tags/index.html.erb +1 -1
- data/app/views/kaui/tenants/index.html.erb +1 -1
- data/app/views/kaui/transactions/_form.html.erb +2 -2
- data/config/initializers/devise.rb +28 -243
- data/config/routes.rb +1 -1
- data/db/migrate/20150112232813_create_kaui_allowed_users.rb +2 -2
- data/kaui.gemspec +11 -5
- data/lib/kaui/engine.rb +2 -0
- data/lib/kaui/version.rb +1 -1
- data/test/dummy/.gitignore +1 -0
- data/test/dummy/config/database.yml +6 -2
- data/test/dummy/config/environments/development.rb +3 -8
- data/test/dummy/config/environments/production.rb +2 -0
- data/test/dummy/config/environments/test.rb +5 -4
- data/test/dummy/config/initializers/killbill_client.rb +0 -1
- data/test/dummy/config/initializers/secret_token.rb +1 -1
- data/test/dummy/db/schema.rb +27 -27
- data/test/functional/kaui/subscriptions_controller_test.rb +2 -2
- data/test/functional/kaui/tenants_controller_test.rb +1 -7
- data/test/integration/kaui/integration_test_helper.rb +4 -4
- data/test/killbill_test_helper.rb +7 -8
- data/test/test_helper.rb +1 -0
- data/test/unit/kaui/money_helper_test.rb +7 -1
- data/vendor/assets/stylesheets/css/bootstrap-datepicker.cd46d38.css +2 -2
- metadata +63 -24
- data/test/dummy/db/migrate/20150116052157_devise_create_kaui_users.kaui.rb +0 -13
- data/test/dummy/db/migrate/20150116052158_create_kaui_tenants.kaui.rb +0 -13
- data/test/dummy/db/migrate/20150116052159_create_kaui_allowed_users.kaui.rb +0 -20
- data/vendor/assets/javascripts/jquery.dataTables.min.js +0 -155
- data/vendor/assets/stylesheets/css/bootstrap.v2.2.1.min.css +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f5da37e2d8165a6c2c89ead5c48533481ac6c81
|
4
|
+
data.tar.gz: 5869633c618869d65bdd3a2c10a2cddec24ae499
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 430649a0642308886a6b93fa5e833470096f4f976af8c9a4ec41f851350a81a1f98bb7af8deca21e60e4afe592ffde6c7b968cce386f6b9149c1d72a5cb963bd
|
7
|
+
data.tar.gz: fb7a3088bfa85b4672a80ce863ed6ac4ed7db1fe75731a0103cca5823c5b733dd469e56a56c0508f9f72483d7c86547798154529645127aa8e52e385314e248e
|
data/.travis.yml
CHANGED
@@ -5,7 +5,6 @@ notifications:
|
|
5
5
|
- kill-bill-commits@googlegroups.com
|
6
6
|
|
7
7
|
rvm:
|
8
|
-
- 1.9.2
|
9
8
|
- 1.9.3
|
10
9
|
- 2.0.0
|
11
10
|
- ruby-head
|
@@ -19,9 +18,9 @@ jdk:
|
|
19
18
|
|
20
19
|
before_script:
|
21
20
|
- mysql -e 'create database kaui_test;'
|
21
|
+
- RAILS_ENV=test bundle exec rake db:migrate
|
22
22
|
|
23
23
|
script:
|
24
|
-
- pushd test/dummy && RAILS_ENV=test bundle exec rake db:migrate --trace && RAILS_ENV=test bundle exec rake db:test:prepare && popd
|
25
24
|
- bundle exec rake test:units
|
26
25
|
|
27
26
|
matrix:
|
@@ -30,7 +29,7 @@ matrix:
|
|
30
29
|
- rvm: jruby-head
|
31
30
|
|
32
31
|
env:
|
33
|
-
- MYSQL_PASSWORD=''
|
32
|
+
- MYSQL_PASSWORD='' MYSQL_USER='travis'
|
34
33
|
|
35
34
|
#force travis to use only 'bundle install' instead of 'bundle install --deployments'
|
36
35
|
bundler_args: ''
|
data/Gemfile.lock
CHANGED
@@ -1,157 +1,210 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
kaui (0.
|
4
|
+
kaui (0.10.0)
|
5
5
|
cancan (~> 1.6.10)
|
6
6
|
carmen-rails (~> 1.0.0)
|
7
7
|
d3_rails (~> 3.2.8)
|
8
|
-
devise (~> 3.
|
8
|
+
devise (~> 3.4.1)
|
9
|
+
jquery-datatables-rails (~> 3.3.0)
|
9
10
|
jquery-rails (~> 3.0.4)
|
10
11
|
killbill-client (~> 0.13.0)
|
11
|
-
money-rails (~>
|
12
|
-
|
12
|
+
money-rails (~> 1.3.0)
|
13
|
+
protected_attributes (~> 1.0.6)
|
14
|
+
rails (~> 4.2.0)
|
15
|
+
sass-rails (~> 5.0.2)
|
13
16
|
symmetric-encryption (~> 3.6.0)
|
14
|
-
twitter-bootstrap-rails (~>
|
17
|
+
twitter-bootstrap-rails (~> 3.2.0)
|
15
18
|
|
16
19
|
GEM
|
17
20
|
remote: http://rubygems.org/
|
18
21
|
specs:
|
19
|
-
actionmailer (
|
20
|
-
actionpack (=
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
22
|
+
actionmailer (4.2.1)
|
23
|
+
actionpack (= 4.2.1)
|
24
|
+
actionview (= 4.2.1)
|
25
|
+
activejob (= 4.2.1)
|
26
|
+
mail (~> 2.5, >= 2.5.4)
|
27
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
28
|
+
actionpack (4.2.1)
|
29
|
+
actionview (= 4.2.1)
|
30
|
+
activesupport (= 4.2.1)
|
31
|
+
rack (~> 1.6)
|
32
|
+
rack-test (~> 0.6.2)
|
33
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
34
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.1)
|
35
|
+
actionview (4.2.1)
|
36
|
+
activesupport (= 4.2.1)
|
37
|
+
builder (~> 3.1)
|
26
38
|
erubis (~> 2.7.0)
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
activemodel (
|
33
|
-
activesupport (=
|
34
|
-
builder (~> 3.
|
35
|
-
activerecord (
|
36
|
-
activemodel (=
|
37
|
-
activesupport (=
|
38
|
-
arel (~>
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
arel (3.0.3)
|
39
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
40
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.1)
|
41
|
+
activejob (4.2.1)
|
42
|
+
activesupport (= 4.2.1)
|
43
|
+
globalid (>= 0.3.0)
|
44
|
+
activemodel (4.2.1)
|
45
|
+
activesupport (= 4.2.1)
|
46
|
+
builder (~> 3.1)
|
47
|
+
activerecord (4.2.1)
|
48
|
+
activemodel (= 4.2.1)
|
49
|
+
activesupport (= 4.2.1)
|
50
|
+
arel (~> 6.0)
|
51
|
+
activesupport (4.2.1)
|
52
|
+
i18n (~> 0.7)
|
53
|
+
json (~> 1.7, >= 1.7.7)
|
54
|
+
minitest (~> 5.1)
|
55
|
+
thread_safe (~> 0.3, >= 0.3.4)
|
56
|
+
tzinfo (~> 1.1)
|
57
|
+
arel (6.0.0)
|
47
58
|
bcrypt (3.1.10)
|
48
|
-
|
49
|
-
bcrypt (>= 3.1.3)
|
50
|
-
builder (3.0.4)
|
59
|
+
builder (3.2.2)
|
51
60
|
cancan (1.6.10)
|
52
61
|
carmen (1.0.2)
|
53
62
|
activesupport (>= 3.0.0)
|
54
63
|
carmen-rails (1.0.1)
|
55
64
|
carmen (~> 1.0.0)
|
56
65
|
rails
|
66
|
+
coderay (1.1.0)
|
57
67
|
coercible (1.0.0)
|
58
68
|
descendants_tracker (~> 0.0.1)
|
59
69
|
d3_rails (3.2.8)
|
60
70
|
railties (>= 3.1.0)
|
61
71
|
descendants_tracker (0.0.4)
|
62
72
|
thread_safe (~> 0.3, >= 0.3.1)
|
63
|
-
devise (3.
|
64
|
-
bcrypt
|
73
|
+
devise (3.4.1)
|
74
|
+
bcrypt (~> 3.0)
|
65
75
|
orm_adapter (~> 0.1)
|
66
76
|
railties (>= 3.2.6, < 5)
|
77
|
+
responders
|
78
|
+
thread_safe (~> 0.1)
|
67
79
|
warden (~> 1.2.3)
|
68
80
|
docile (1.1.5)
|
69
81
|
erubis (2.7.0)
|
70
82
|
execjs (2.5.2)
|
71
83
|
fakeweb (1.3.0)
|
72
|
-
|
73
|
-
|
74
|
-
|
84
|
+
ffi (1.9.8-java)
|
85
|
+
globalid (0.3.5)
|
86
|
+
activesupport (>= 4.1.0)
|
87
|
+
i18n (0.7.0)
|
88
|
+
jquery-datatables-rails (3.3.0)
|
89
|
+
actionpack (>= 3.1)
|
90
|
+
jquery-rails
|
91
|
+
railties (>= 3.1)
|
92
|
+
sass-rails
|
75
93
|
jquery-rails (3.0.4)
|
76
94
|
railties (>= 3.0, < 5.0)
|
77
95
|
thor (>= 0.14, < 2.0)
|
78
|
-
json (1.8.
|
96
|
+
json (1.8.3)
|
79
97
|
killbill-client (0.13.0)
|
80
98
|
json (>= 1.2.0)
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
99
|
+
loofah (2.0.2)
|
100
|
+
nokogiri (>= 1.5.9)
|
101
|
+
mail (2.6.3)
|
102
|
+
mime-types (>= 1.16, < 3)
|
103
|
+
method_source (0.8.2)
|
104
|
+
mime-types (2.6.1)
|
105
|
+
mini_portile (0.6.2)
|
106
|
+
minitest (5.7.0)
|
107
|
+
monetize (1.1.0)
|
108
|
+
money (~> 6.5.0)
|
109
|
+
money (6.5.1)
|
110
|
+
i18n (>= 0.6.4, <= 0.7.0)
|
111
|
+
money-rails (1.3.0)
|
88
112
|
activesupport (>= 3.0)
|
89
|
-
|
113
|
+
monetize (~> 1.1.0)
|
114
|
+
money (~> 6.5.0)
|
90
115
|
railties (>= 3.0)
|
91
116
|
multi_json (1.10.1)
|
92
117
|
mysql2 (0.3.18)
|
118
|
+
nokogiri (1.6.6.2)
|
119
|
+
mini_portile (~> 0.6.0)
|
93
120
|
orm_adapter (0.5.0)
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
121
|
+
protected_attributes (1.0.9)
|
122
|
+
activemodel (>= 4.0.1, < 5.0)
|
123
|
+
pry (0.10.1)
|
124
|
+
coderay (~> 1.1.0)
|
125
|
+
method_source (~> 0.8.1)
|
126
|
+
slop (~> 3.4)
|
127
|
+
pry (0.10.1-java)
|
128
|
+
coderay (~> 1.1.0)
|
129
|
+
method_source (~> 0.8.1)
|
130
|
+
slop (~> 3.4)
|
131
|
+
spoon (~> 0.0)
|
132
|
+
pry-rails (0.3.4)
|
133
|
+
pry (>= 0.9.10)
|
134
|
+
rack (1.6.1)
|
100
135
|
rack-test (0.6.3)
|
101
136
|
rack (>= 1.0)
|
102
|
-
rails (
|
103
|
-
actionmailer (=
|
104
|
-
actionpack (=
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
137
|
+
rails (4.2.1)
|
138
|
+
actionmailer (= 4.2.1)
|
139
|
+
actionpack (= 4.2.1)
|
140
|
+
actionview (= 4.2.1)
|
141
|
+
activejob (= 4.2.1)
|
142
|
+
activemodel (= 4.2.1)
|
143
|
+
activerecord (= 4.2.1)
|
144
|
+
activesupport (= 4.2.1)
|
145
|
+
bundler (>= 1.3.0, < 2.0)
|
146
|
+
railties (= 4.2.1)
|
147
|
+
sprockets-rails
|
148
|
+
rails-deprecated_sanitizer (1.0.3)
|
149
|
+
activesupport (>= 4.2.0.alpha)
|
150
|
+
rails-dom-testing (1.0.6)
|
151
|
+
activesupport (>= 4.2.0.beta, < 5.0)
|
152
|
+
nokogiri (~> 1.6.0)
|
153
|
+
rails-deprecated_sanitizer (>= 1.0.1)
|
154
|
+
rails-html-sanitizer (1.0.2)
|
155
|
+
loofah (~> 2.0)
|
156
|
+
railties (4.2.1)
|
157
|
+
actionpack (= 4.2.1)
|
158
|
+
activesupport (= 4.2.1)
|
114
159
|
rake (>= 0.8.7)
|
115
|
-
|
116
|
-
thor (>= 0.14.6, < 2.0)
|
160
|
+
thor (>= 0.18.1, < 2.0)
|
117
161
|
rake (10.4.2)
|
118
|
-
|
119
|
-
|
120
|
-
|
162
|
+
responders (2.1.0)
|
163
|
+
railties (>= 4.2.0, < 5)
|
164
|
+
sass (3.4.14)
|
165
|
+
sass-rails (5.0.3)
|
166
|
+
railties (>= 4.0.0, < 5.0)
|
167
|
+
sass (~> 3.1)
|
168
|
+
sprockets (>= 2.8, < 4.0)
|
169
|
+
sprockets-rails (>= 2.0, < 4.0)
|
170
|
+
tilt (~> 1.1)
|
171
|
+
simplecov (0.9.1)
|
121
172
|
docile (~> 1.1.0)
|
122
173
|
multi_json (~> 1.0)
|
123
|
-
simplecov-html (~> 0.
|
124
|
-
simplecov-html (0.
|
125
|
-
|
126
|
-
|
127
|
-
|
174
|
+
simplecov-html (~> 0.8.0)
|
175
|
+
simplecov-html (0.8.0)
|
176
|
+
slop (3.6.0)
|
177
|
+
spoon (0.0.4)
|
178
|
+
ffi
|
179
|
+
sprockets (3.2.0)
|
128
180
|
rack (~> 1.0)
|
129
|
-
|
130
|
-
|
181
|
+
sprockets-rails (2.3.1)
|
182
|
+
actionpack (>= 3.0)
|
183
|
+
activesupport (>= 3.0)
|
184
|
+
sprockets (>= 2.8, < 4.0)
|
131
185
|
symmetric-encryption (3.6.0)
|
132
186
|
coercible (>= 1.0.0)
|
133
187
|
thor (0.19.1)
|
134
188
|
thread_safe (0.3.5)
|
135
189
|
tilt (1.4.1)
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
railties (>= 3.1)
|
144
|
-
tzinfo (0.3.44)
|
190
|
+
twitter-bootstrap-rails (3.2.0)
|
191
|
+
actionpack (~> 4.1)
|
192
|
+
execjs (~> 2.2)
|
193
|
+
rails (~> 4.1)
|
194
|
+
railties (~> 4.1)
|
195
|
+
tzinfo (1.2.2)
|
196
|
+
thread_safe (~> 0.1)
|
145
197
|
warden (1.2.3)
|
146
198
|
rack (>= 1.0)
|
147
199
|
|
148
200
|
PLATFORMS
|
201
|
+
java
|
149
202
|
ruby
|
150
203
|
|
151
204
|
DEPENDENCIES
|
152
205
|
fakeweb (~> 1.3)
|
153
206
|
kaui!
|
154
207
|
mysql2
|
208
|
+
pry-rails
|
155
209
|
rake (>= 0.8.7)
|
156
210
|
simplecov
|
157
|
-
sqlite3
|
@@ -6,8 +6,11 @@
|
|
6
6
|
//
|
7
7
|
//= require jquery
|
8
8
|
//= require jquery_ujs
|
9
|
+
//= require dataTables/jquery.dataTables
|
10
|
+
//= require dataTables/bootstrap/3/jquery.dataTables.bootstrap
|
11
|
+
//= require dataTables/jquery.dataTables
|
9
12
|
//= require d3
|
10
13
|
//= require twitter/bootstrap
|
11
|
-
//= require jquery.dataTables.min
|
12
14
|
//= require kaui/bootstrap-tweaks
|
13
15
|
//= require kaui/validation
|
16
|
+
//= require kaui/datatables-tweaks
|
@@ -28,7 +28,7 @@ function makeDataTable(tableObj) {
|
|
28
28
|
}
|
29
29
|
}
|
30
30
|
tableObj.dataTable({
|
31
|
-
"sDom": "<'row
|
31
|
+
"sDom": "<'row'<'col-md-6'l><'col-md-6'f>r>t<'row'<'col-md-6'i><'col-md-6'p>>",
|
32
32
|
"sPaginationType": "bootstrap",
|
33
33
|
"oLanguage": {
|
34
34
|
"sLengthMenu": "_MENU_ records per page"
|
@@ -5,44 +5,3 @@
|
|
5
5
|
To use Glyphicons sprites instead of Font Awesome, replace with "require twitter-bootstrap-static/sprites"
|
6
6
|
=require twitter-bootstrap-static/fontawesome
|
7
7
|
*/
|
8
|
-
|
9
|
-
/* Fixing corners on nav */
|
10
|
-
.kauiNav .navbar-inner {
|
11
|
-
border-radius: 0;
|
12
|
-
-moz-border-radius: 0;
|
13
|
-
-webkit-border-radius: 0;
|
14
|
-
}
|
15
|
-
|
16
|
-
/* Moving pagination to right side of page */
|
17
|
-
.pagination {
|
18
|
-
margin: 0;
|
19
|
-
}
|
20
|
-
.pagination ul {
|
21
|
-
float: right;
|
22
|
-
}
|
23
|
-
|
24
|
-
/* Moving search to right side of page */
|
25
|
-
.dataTables_filter label {
|
26
|
-
float: right;
|
27
|
-
}
|
28
|
-
|
29
|
-
.dataTables_length select {
|
30
|
-
width: auto;
|
31
|
-
}
|
32
|
-
|
33
|
-
/* Removing header margin */
|
34
|
-
.pageHeader {
|
35
|
-
margin: 0 0 20px 0;
|
36
|
-
line-height: 30px;
|
37
|
-
}
|
38
|
-
|
39
|
-
/* Removing form action background and border */
|
40
|
-
.form-actions {
|
41
|
-
background: none;
|
42
|
-
border: none;
|
43
|
-
}
|
44
|
-
|
45
|
-
/** New account page **/
|
46
|
-
.groupWrapper {
|
47
|
-
margin: 0;
|
48
|
-
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
table.dataTable thead th {
|
2
|
+
position: relative;
|
3
|
+
}
|
4
|
+
|
5
|
+
table.dataTable thead th,
|
6
|
+
table.dataTable tbody td{
|
7
|
+
vertical-align: middle;
|
8
|
+
}
|
9
|
+
|
10
|
+
table.dataTable thead th.sorting:after,
|
11
|
+
table.dataTable thead th.sorting_asc:after,
|
12
|
+
table.dataTable thead th.sorting_desc:after {
|
13
|
+
content: '' !important;
|
14
|
+
}
|
@@ -32,13 +32,7 @@ class Kaui::AccountTimelinesController < Kaui::EngineController
|
|
32
32
|
end
|
33
33
|
|
34
34
|
# Lookup all invoices
|
35
|
-
|
36
|
-
@timeline.payments.each do |payment|
|
37
|
-
load_invoice_id_for_timeline(payment.target_invoice_id)
|
38
|
-
end
|
39
|
-
@timeline.invoices.each do |invoice|
|
40
|
-
load_invoice_id_for_timeline(invoice.invoice_id)
|
41
|
-
end
|
35
|
+
load_invoices_for_timeline
|
42
36
|
|
43
37
|
if params.has_key?(:external_key)
|
44
38
|
@selected_bundle = @bundle_names[params[:external_key]]
|
@@ -51,13 +45,11 @@ class Kaui::AccountTimelinesController < Kaui::EngineController
|
|
51
45
|
@bundle_names[bundle_key] ||= Kaui.bundle_key_display_string.call(bundle_key)
|
52
46
|
end
|
53
47
|
|
54
|
-
def
|
55
|
-
|
48
|
+
def load_invoices_for_timeline
|
49
|
+
all_invoices = @account.invoices(true, options_for_klient)
|
50
|
+
return {} if all_invoices.nil? || all_invoices.empty?
|
56
51
|
|
57
|
-
|
58
|
-
|
59
|
-
rescue => e
|
60
|
-
flash.now[:error] = "Could not get invoice information for the timeline #{@account_id}: #{as_string(e)}"
|
61
|
-
end
|
52
|
+
# Convert into Kaui::Invoice to benefit from additional methods xxx_to_money
|
53
|
+
@invoices_by_id = all_invoices.inject({}) {|hsh, invoice| hsh[invoice.invoice_id] = Kaui::Invoice.build_from_raw_invoice(invoice); hsh}
|
62
54
|
end
|
63
55
|
end
|
@@ -11,10 +11,10 @@ class Kaui::SubscriptionsController < Kaui::EngineController
|
|
11
11
|
|
12
12
|
begin
|
13
13
|
if @subscription.product_category == 'ADD_ON'
|
14
|
-
@bundle = Kaui::Bundle
|
15
|
-
plans_details = Kaui::Catalog
|
14
|
+
@bundle = Kaui::Bundle.find_by_id(@subscription.bundle_id, options_for_klient)
|
15
|
+
plans_details = Kaui::Catalog.available_addons(@base_product_name, options_for_klient)
|
16
16
|
else
|
17
|
-
plans_details = Kaui::Catalog
|
17
|
+
plans_details = Kaui::Catalog.available_base_plans(options_for_klient)
|
18
18
|
end
|
19
19
|
@plans = plans_details.map { |p| p.plan }
|
20
20
|
rescue => e
|
@@ -28,10 +28,10 @@ class Kaui::SubscriptionsController < Kaui::EngineController
|
|
28
28
|
|
29
29
|
begin
|
30
30
|
if @subscription.product_category == 'ADD_ON'
|
31
|
-
@bundle = Kaui::Bundle
|
32
|
-
plans_details = Kaui::Catalog
|
31
|
+
@bundle = Kaui::Bundle.find_by_id(@subscription.bundle_id, options_for_klient)
|
32
|
+
plans_details = Kaui::Catalog.available_addons(params[:base_product_name], options_for_klient)
|
33
33
|
else
|
34
|
-
plans_details = Kaui::Catalog
|
34
|
+
plans_details = Kaui::Catalog.available_base_plans(options_for_klient)
|
35
35
|
end
|
36
36
|
|
37
37
|
plan_details = plans_details.find { |p| p.plan == params[:plan_name] }
|
@@ -39,7 +39,7 @@ class Kaui::SubscriptionsController < Kaui::EngineController
|
|
39
39
|
@subscription.product_name = plan_details.product
|
40
40
|
@subscription.price_list = plan_details.price_list
|
41
41
|
|
42
|
-
@subscription = @subscription.create(current_user.kb_username, params[:reason], params[:comment], options_for_klient)
|
42
|
+
@subscription = @subscription.create(current_user.kb_username, params[:reason], params[:comment], nil, false, options_for_klient)
|
43
43
|
redirect_to bundle_path(@subscription.bundle_id), :notice => 'Subscription was successfully created'
|
44
44
|
rescue => e
|
45
45
|
@plans = plans_details.nil? ? [] : plans_details.map { |p| p.plan }
|
@@ -79,7 +79,7 @@ class Kaui::SubscriptionsController < Kaui::EngineController
|
|
79
79
|
billing_policy = params[:policy] unless params[:policy].blank?
|
80
80
|
wait_for_completion = params[:wait_for_completion] == '1'
|
81
81
|
|
82
|
-
subscription = Kaui::Subscription.
|
82
|
+
subscription = Kaui::Subscription.find_by_id(params[:id], options_for_klient)
|
83
83
|
|
84
84
|
begin
|
85
85
|
plans_details = Kaui::Catalog::available_base_plans(options_for_klient)
|
data/app/models/kaui/ability.rb
CHANGED
@@ -33,9 +33,7 @@ module Kaui
|
|
33
33
|
#
|
34
34
|
to_be_model, action = permission.split(':')
|
35
35
|
# Currently the only actions implemented for overdue and catalog (upload_config) are those implemented at the tenant level:
|
36
|
-
if
|
37
|
-
to_be_model == 'overdue' ||
|
38
|
-
to_be_model == 'catalog'
|
36
|
+
if ['tenant', 'overdue', 'catalog'].include?(to_be_model)
|
39
37
|
to_be_model = 'admin_tenant'
|
40
38
|
end
|
41
39
|
if to_be_model == 'entitlement'
|
@@ -2,7 +2,12 @@ module Kaui
|
|
2
2
|
class AllowedUser < ActiveRecord::Base
|
3
3
|
attr_accessible :kb_username, :description
|
4
4
|
|
5
|
-
has_many :kaui_allowed_user_tenants,
|
6
|
-
|
5
|
+
has_many :kaui_allowed_user_tenants,
|
6
|
+
:class_name => 'Kaui::AllowedUserTenant',
|
7
|
+
:foreign_key => 'kaui_allowed_user_id'
|
8
|
+
|
9
|
+
has_many :kaui_tenants, -> { uniq },
|
10
|
+
:through => :kaui_allowed_user_tenants,
|
11
|
+
:source => :kaui_tenant
|
7
12
|
end
|
8
13
|
end
|
data/app/models/kaui/invoice.rb
CHANGED
@@ -1,5 +1,26 @@
|
|
1
1
|
class Kaui::Invoice < KillBillClient::Model::Invoice
|
2
2
|
|
3
|
+
def self.build_from_raw_invoice(raw_invoice)
|
4
|
+
# There is probably a meta-programming trick to avoid writing that copy ctor by hand...
|
5
|
+
result = Kaui::Invoice.new
|
6
|
+
result.amount = raw_invoice.amount
|
7
|
+
result.currency = raw_invoice.currency
|
8
|
+
result.credit_adj = raw_invoice.credit_adj
|
9
|
+
result.refund_adj = raw_invoice.refund_adj
|
10
|
+
result.invoice_id = raw_invoice.invoice_id
|
11
|
+
result.invoice_date = raw_invoice.invoice_date
|
12
|
+
result.target_date = raw_invoice.target_date
|
13
|
+
result.invoice_number = raw_invoice.invoice_number
|
14
|
+
result.balance = raw_invoice.balance
|
15
|
+
result.account_id = raw_invoice.account_id
|
16
|
+
result.external_bundle_keys = raw_invoice.external_bundle_keys
|
17
|
+
result.credits = raw_invoice.credits
|
18
|
+
result.items = raw_invoice.items
|
19
|
+
result.audit_logs = raw_invoice.audit_logs
|
20
|
+
result
|
21
|
+
end
|
22
|
+
|
23
|
+
|
3
24
|
[:amount, :balance, :credits].each do |type|
|
4
25
|
define_method "#{type}_to_money" do
|
5
26
|
Kaui::Base.to_money(send(type), currency)
|