kaui 0.4.3 → 0.4.4
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.
- data/Gemfile.lock +3 -3
- data/app/controllers/kaui/account_tags_controller.rb +5 -4
- data/app/controllers/kaui/accounts_controller.rb +3 -1
- data/app/helpers/kaui/killbill_helper.rb +4 -4
- data/app/views/kaui/account_tags/_account_tags_table.html.erb +29 -10
- data/app/views/kaui/account_tags/show.html.erb +3 -0
- data/app/views/kaui/refunds/show.html.erb +1 -1
- data/app/views/kaui/tags/_tags_table.html.erb +1 -0
- data/kaui.gemspec +1 -1
- data/lib/kaui/version.rb +1 -1
- data/test/test_helper.rb +1 -1
- data/test/unit/kaui/date_helper_test.rb +1 -1
- metadata +6 -5
data/Gemfile.lock
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
kaui (0.4.
|
4
|
+
kaui (0.4.4)
|
5
5
|
cancan (~> 1.6.10)
|
6
6
|
d3_rails (~> 3.2.8)
|
7
7
|
devise (~> 3.0.2)
|
8
8
|
jquery-rails (~> 3.0.4)
|
9
|
-
killbill-client (~> 0.3.
|
9
|
+
killbill-client (~> 0.3.5)
|
10
10
|
money-rails (~> 0.8.1)
|
11
11
|
rails (~> 3.2.14)
|
12
12
|
rest-client (~> 1.6.7)
|
@@ -60,7 +60,7 @@ GEM
|
|
60
60
|
railties (>= 3.0, < 5.0)
|
61
61
|
thor (>= 0.14, < 2.0)
|
62
62
|
json (1.8.0)
|
63
|
-
killbill-client (0.3.
|
63
|
+
killbill-client (0.3.5)
|
64
64
|
mail (2.5.4)
|
65
65
|
mime-types (~> 1.16)
|
66
66
|
treetop (~> 1.4.8)
|
@@ -1,11 +1,12 @@
|
|
1
1
|
class Kaui::AccountTagsController < Kaui::EngineController
|
2
2
|
|
3
3
|
def show
|
4
|
-
account_id = params[:
|
4
|
+
account_id = params[:account_id]
|
5
5
|
|
6
6
|
if account_id.present?
|
7
7
|
begin
|
8
|
-
@tags = Kaui::KillbillHelper::get_tags_for_account(account_id, options_for_klient)
|
8
|
+
@tags = Kaui::KillbillHelper::get_tags_for_account(account_id, "FULL", options_for_klient)
|
9
|
+
@account = Kaui::KillbillHelper::get_account(account_id, false, false, options_for_klient)
|
9
10
|
rescue => e
|
10
11
|
flash.now[:error] = "Error while getting tags: #{as_string(e)}"
|
11
12
|
end
|
@@ -19,7 +20,7 @@ class Kaui::AccountTagsController < Kaui::EngineController
|
|
19
20
|
begin
|
20
21
|
@available_tags = Kaui::TagDefinition.all_for_account(options_for_klient).sort
|
21
22
|
@account = Kaui::KillbillHelper::get_account(@account_id, false, false, options_for_klient)
|
22
|
-
@tag_names = Kaui::KillbillHelper::get_tags_for_account(@account.account_id, options_for_klient).map { |tag| tag.tag_definition_name }
|
23
|
+
@tag_names = Kaui::KillbillHelper::get_tags_for_account(@account.account_id, "NONE", options_for_klient).map { |tag| tag.tag_definition_name }
|
23
24
|
rescue => e
|
24
25
|
flash.now[:error] = "Error while editing tags: #{as_string(e)}"
|
25
26
|
end
|
@@ -27,7 +28,7 @@ class Kaui::AccountTagsController < Kaui::EngineController
|
|
27
28
|
|
28
29
|
def update
|
29
30
|
begin
|
30
|
-
current_tags = Kaui::KillbillHelper::get_tags_for_account(params[:account_id], options_for_klient).map { |tag| tag.tag_definition_id }
|
31
|
+
current_tags = Kaui::KillbillHelper::get_tags_for_account(params[:account_id], "NONE", options_for_klient).map { |tag| tag.tag_definition_id }
|
31
32
|
|
32
33
|
new_tags = []
|
33
34
|
params.each do |tag, tag_name|
|
@@ -23,7 +23,9 @@ class Kaui::AccountsController < Kaui::EngineController
|
|
23
23
|
|
24
24
|
if @account.present? and @account.is_a? Kaui::Account
|
25
25
|
begin
|
26
|
-
@tags = Kaui::KillbillHelper::get_tags_for_account(@account.account_id, options_for_klient).
|
26
|
+
@tags = Kaui::KillbillHelper::get_tags_for_account(@account.account_id, "NONE", options_for_klient).sort_by do |tag|
|
27
|
+
@tag_definition_name <=> tag.tag_definition_name
|
28
|
+
end
|
27
29
|
@account_emails = Kaui::AccountEmail.where({ :account_id => @account.account_id }, options_for_klient)
|
28
30
|
@overdue_state = Kaui::KillbillHelper::get_overdue_state_for_account(@account.account_id, options_for_klient)
|
29
31
|
@payment_methods = Kaui::KillbillHelper::get_non_external_payment_methods(@account.account_id, options_for_klient)
|
@@ -211,7 +211,8 @@ module Kaui
|
|
211
211
|
|
212
212
|
entitlement = KillBillClient::Model::EntitlementNoEvents.new
|
213
213
|
entitlement.subscription_id = subscription_id
|
214
|
-
|
214
|
+
# We are using same entitlement/billing policy here for now
|
215
|
+
entitlement.cancel(extract_created_by(current_user), extract_reason_code(reason), comment, nil, policy, policy, options)
|
215
216
|
end
|
216
217
|
|
217
218
|
def self.compute_previous_ctd(ctd, billing_period, options = {})
|
@@ -457,9 +458,8 @@ module Kaui
|
|
457
458
|
build_audit_headers(current_user, reason, comment, options)
|
458
459
|
end
|
459
460
|
|
460
|
-
def self.get_tags_for_account(account_id, options = {})
|
461
|
-
|
462
|
-
process_response(data, :multiple) { |json| Kaui::Tag.new(json) }
|
461
|
+
def self.get_tags_for_account(account_id, audit = "NONE", options = {})
|
462
|
+
KillBillClient::Model::Tag.find_all_by_account_id account_id, audit, options
|
463
463
|
end
|
464
464
|
|
465
465
|
def self.get_tags_for_bundle(bundle_id, options = {})
|
@@ -1,10 +1,29 @@
|
|
1
|
-
<
|
2
|
-
<
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
</
|
1
|
+
<div class="page-header">
|
2
|
+
<h3>Tags for <%= (link_to @account.name, account_path(@account.account_id)) if @account.present? %></h3>
|
3
|
+
</div>
|
4
|
+
<table class="table table-condensed table-striped data-table">
|
5
|
+
<thead>
|
6
|
+
<tr>
|
7
|
+
<th>Tag Name</th>
|
8
|
+
<th>Executed date</th>
|
9
|
+
<th>Execution type</th>
|
10
|
+
<th>Executed by</th>
|
11
|
+
<th>Comments</th>
|
12
|
+
</tr>
|
13
|
+
</thead>
|
14
|
+
<tbody>
|
15
|
+
<% if @tags.present? %>
|
16
|
+
<% @tags.each do |tag| %>
|
17
|
+
<% log = tag.audit_logs.first if tag.audit_logs.present? %>
|
18
|
+
<tr>
|
19
|
+
<td><%= link_to tag.tag_definition_name, tag_definition_path(:id => tag.tag_definition_id) %></td>
|
20
|
+
<td><%= format_date(log.change_date, @account.timezone).html_safe if log.change_date.present? %></td>
|
21
|
+
<td><%= log.change_type if log.change_type.present? %></td>
|
22
|
+
<td><%= log.changed_by if log.changed_by.present? %></td>
|
23
|
+
<td><%= log.reason_code if log.reason_code.present? %> <%= log.comments if log.comments.present? %></td>
|
24
|
+
</tr>
|
25
|
+
<% end #end tag%>
|
26
|
+
<% end #end if tags present%>
|
27
|
+
</tbody>
|
28
|
+
</table>
|
29
|
+
|
data/kaui.gemspec
CHANGED
@@ -27,7 +27,7 @@ Gem::Specification.new do |s|
|
|
27
27
|
s.add_dependency 'rest-client', '~> 1.6.7'
|
28
28
|
s.add_dependency 'money-rails', '~> 0.8.1'
|
29
29
|
s.add_dependency 'd3_rails', '~> 3.2.8'
|
30
|
-
s.add_dependency 'killbill-client', '~> 0.3.
|
30
|
+
s.add_dependency 'killbill-client', '~> 0.3.5'
|
31
31
|
s.add_dependency 'devise', '~> 3.0.2'
|
32
32
|
s.add_dependency 'cancan', '~> 1.6.10'
|
33
33
|
|
data/lib/kaui/version.rb
CHANGED
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kaui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-09-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -98,7 +98,7 @@ dependencies:
|
|
98
98
|
requirements:
|
99
99
|
- - ~>
|
100
100
|
- !ruby/object:Gem::Version
|
101
|
-
version: 0.3.
|
101
|
+
version: 0.3.5
|
102
102
|
type: :runtime
|
103
103
|
prerelease: false
|
104
104
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -106,7 +106,7 @@ dependencies:
|
|
106
106
|
requirements:
|
107
107
|
- - ~>
|
108
108
|
- !ruby/object:Gem::Version
|
109
|
-
version: 0.3.
|
109
|
+
version: 0.3.5
|
110
110
|
- !ruby/object:Gem::Dependency
|
111
111
|
name: devise
|
112
112
|
requirement: !ruby/object:Gem::Requirement
|
@@ -259,6 +259,7 @@ files:
|
|
259
259
|
- app/views/kaui/account_emails/show.html.erb
|
260
260
|
- app/views/kaui/account_tags/_account_tags_table.html.erb
|
261
261
|
- app/views/kaui/account_tags/edit.html.erb
|
262
|
+
- app/views/kaui/account_tags/show.html.erb
|
262
263
|
- app/views/kaui/account_timelines/index.html.erb
|
263
264
|
- app/views/kaui/account_timelines/show.html.erb
|
264
265
|
- app/views/kaui/accounts/index.html.erb
|
@@ -437,7 +438,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
437
438
|
version: '0'
|
438
439
|
segments:
|
439
440
|
- 0
|
440
|
-
hash:
|
441
|
+
hash: -2233739606759617333
|
441
442
|
requirements: []
|
442
443
|
rubyforge_project:
|
443
444
|
rubygems_version: 1.8.25
|