kaui 0.6.6 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +2 -0
- data/Gemfile.lock +51 -37
- data/README.md +5 -0
- data/Rakefile +1 -1
- data/app/controllers/kaui/account_emails_controller.rb +26 -44
- data/app/controllers/kaui/account_tags_controller.rb +26 -38
- data/app/controllers/kaui/account_timelines_controller.rb +47 -50
- data/app/controllers/kaui/accounts_controller.rb +68 -148
- data/app/controllers/kaui/bundle_tags_controller.rb +32 -21
- data/app/controllers/kaui/bundles_controller.rb +44 -69
- data/app/controllers/kaui/chargebacks_controller.rb +31 -61
- data/app/controllers/kaui/charges_controller.rb +19 -21
- data/app/controllers/kaui/credits_controller.rb +22 -36
- data/app/controllers/kaui/custom_fields_controller.rb +15 -13
- data/app/controllers/kaui/engine_controller.rb +8 -10
- data/app/controllers/kaui/invoice_items_controller.rb +24 -41
- data/app/controllers/kaui/invoices_controller.rb +36 -46
- data/app/controllers/kaui/payment_methods_controller.rb +84 -28
- data/app/controllers/kaui/payments_controller.rb +64 -26
- data/app/controllers/kaui/refunds_controller.rb +27 -107
- data/app/controllers/kaui/subscriptions_controller.rb +88 -132
- data/app/controllers/kaui/tag_definitions_controller.rb +32 -79
- data/app/controllers/kaui/tags_controller.rb +16 -14
- data/app/controllers/kaui/transactions_controller.rb +25 -0
- data/app/helpers/kaui/money_helper.rb +8 -0
- data/app/helpers/kaui/subscription_helper.rb +115 -0
- data/app/helpers/kaui/uuid_helper.rb +9 -0
- data/app/models/kaui/ability.rb +2 -2
- data/app/models/kaui/account.rb +25 -42
- data/app/models/kaui/account_email.rb +11 -48
- data/app/models/kaui/account_timeline.rb +1 -5
- data/app/models/kaui/audit_log.rb +1 -15
- data/app/models/kaui/base.rb +1 -126
- data/app/models/kaui/bundle.rb +47 -14
- data/app/models/kaui/catalog.rb +2 -0
- data/app/models/kaui/chargeback.rb +24 -36
- data/app/models/kaui/credit.rb +5 -20
- data/app/models/kaui/custom_field.rb +9 -5
- data/app/models/kaui/invoice.rb +9 -53
- data/app/models/kaui/invoice_item.rb +8 -18
- data/app/models/kaui/invoice_payment.rb +24 -0
- data/app/models/kaui/payment.rb +14 -32
- data/app/models/kaui/payment_method.rb +36 -0
- data/app/models/kaui/rails_methods.rb +7 -9
- data/app/models/kaui/refund.rb +5 -20
- data/app/models/kaui/subscription.rb +7 -27
- data/app/models/kaui/tag.rb +10 -6
- data/app/models/kaui/tag_definition.rb +26 -34
- data/app/models/kaui/transaction.rb +30 -0
- data/app/models/kaui/user.rb +2 -0
- data/app/views/kaui/account_emails/_form.html.erb +8 -28
- data/app/views/kaui/account_emails/show.html.erb +10 -10
- data/app/views/kaui/account_tags/_account_tags_table.html.erb +20 -18
- data/app/views/kaui/account_tags/_form.html.erb +42 -0
- data/app/views/kaui/account_tags/edit.html.erb +1 -41
- data/app/views/kaui/account_tags/show.html.erb +6 -3
- data/app/views/kaui/account_timelines/show.html.erb +273 -302
- data/app/views/kaui/accounts/_form.html.erb +116 -0
- data/app/views/kaui/accounts/index.html.erb +13 -11
- data/app/views/kaui/accounts/new.html.erb +5 -0
- data/app/views/kaui/accounts/show.html.erb +101 -99
- data/app/views/kaui/bundle_tags/_bundle_tags_table.html.erb +29 -9
- data/app/views/kaui/bundle_tags/_form.html.erb +41 -0
- data/app/views/kaui/bundle_tags/edit.html.erb +2 -34
- data/app/views/kaui/bundle_tags/show.html.erb +6 -0
- data/app/views/kaui/bundles/index.html.erb +9 -9
- data/app/views/kaui/bundles/show.html.erb +17 -15
- data/app/views/kaui/bundles/transfer.html.erb +25 -24
- data/app/views/kaui/chargebacks/_form.html.erb +44 -0
- data/app/views/kaui/chargebacks/new.html.erb +3 -115
- data/app/views/kaui/charges/_form.html.erb +73 -0
- data/app/views/kaui/charges/new.html.erb +2 -91
- data/app/views/kaui/credits/_form.html.erb +73 -0
- data/app/views/kaui/credits/new.html.erb +2 -85
- data/app/views/kaui/invoice_items/edit.html.erb +77 -78
- data/app/views/kaui/invoices/show.html.erb +3 -10
- data/app/views/kaui/layouts/kaui_application.html.erb +0 -2
- data/app/views/kaui/payment_methods/_form.html.erb +30 -0
- data/app/views/kaui/payment_methods/_new_creditcard_payment_method.html.erb +19 -18
- data/app/views/kaui/payment_methods/_payment_methods_table.html.erb +8 -5
- data/app/views/kaui/payment_methods/index.html.erb +10 -10
- data/app/views/kaui/payment_methods/new.html.erb +2 -20
- data/app/views/kaui/payment_methods/show.html.erb +2 -1
- data/app/views/kaui/payments/_payments_table.html.erb +30 -22
- data/app/views/kaui/payments/index.html.erb +1 -1
- data/app/views/kaui/payments/new.html.erb +5 -5
- data/app/views/kaui/payments/show.html.erb +3 -0
- data/app/views/kaui/refunds/new.html.erb +96 -104
- data/app/views/kaui/subscriptions/_form.html.erb +36 -0
- data/app/views/kaui/subscriptions/_subscriptions_table.html.erb +39 -44
- data/app/views/kaui/subscriptions/edit.html.erb +24 -35
- data/app/views/kaui/subscriptions/index.html.erb +13 -12
- data/app/views/kaui/subscriptions/new.html.erb +6 -43
- data/app/views/kaui/subscriptions/show.html.erb +32 -25
- data/app/views/kaui/tag_definitions/_form.html.erb +10 -37
- data/app/views/kaui/tag_definitions/index.html.erb +3 -5
- data/app/views/kaui/tag_definitions/show.html.erb +1 -2
- data/app/views/kaui/transactions/_form.html.erb +77 -0
- data/app/views/kaui/transactions/new.html.erb +3 -0
- data/config/initializers/kilbill-client-init.rb +1 -1
- data/config/routes.rb +4 -15
- data/kaui.gemspec +8 -6
- data/lib/kaui/engine.rb +4 -1
- data/lib/kaui/version.rb +1 -1
- data/lib/kaui.rb +2 -2
- data/test/functional/kaui/account_emails_controller_test.rb +28 -0
- data/test/functional/kaui/account_tags_controller_test.rb +29 -0
- data/test/functional/kaui/account_timelines_controller_test.rb +21 -0
- data/test/functional/kaui/accounts_controller_test.rb +56 -50
- data/test/functional/kaui/bundle_tags_controller_test.rb +29 -0
- data/test/functional/kaui/bundles_controller_test.rb +58 -13
- data/test/functional/kaui/chargebacks_controller_test.rb +16 -5
- data/test/functional/kaui/charges_controller_test.rb +39 -0
- data/test/functional/kaui/credits_controller_test.rb +35 -0
- data/test/functional/kaui/custom_fields_controller_test.rb +21 -0
- data/test/functional/kaui/functional_test_helper.rb +61 -0
- data/test/functional/kaui/invoice_items_controller_test.rb +24 -10
- data/test/functional/kaui/invoices_controller_test.rb +41 -13
- data/test/functional/kaui/payment_methods_controller_test.rb +49 -0
- data/test/functional/kaui/payments_controller_test.rb +32 -5
- data/test/functional/kaui/refunds_controller_test.rb +40 -5
- data/test/functional/kaui/subscriptions_controller_test.rb +82 -0
- data/test/functional/kaui/tag_definitions_controller_test.rb +27 -53
- data/test/functional/kaui/tags_controller_test.rb +21 -0
- data/test/functional/kaui/transactions_controller_test.rb +32 -0
- data/test/integration/kaui/integration_test_helper.rb +31 -0
- data/test/integration/kaui/navigation_test.rb +43 -0
- data/test/killbill_test_helper.rb +143 -0
- data/test/test_helper.rb +10 -227
- data/test/unit/kaui/account_email_test.rb +19 -0
- data/test/unit/kaui/account_test.rb +7 -35
- data/test/unit/kaui/base_test.rb +5 -46
- data/test/unit/kaui/date_helper_test.rb +6 -5
- data/test/unit/kaui/invoice_item_test.rb +5 -17
- data/test/unit/kaui/invoice_payment_test.rb +42 -0
- data/test/unit/kaui/invoice_test.rb +15 -15
- data/test/unit/kaui/money_helper_test.rb +10 -0
- data/test/unit/kaui/payment_test.rb +42 -0
- data/test/unit/kaui/tag_definition_test.rb +5 -28
- data/test/unit/kaui/uuid_helper_test.rb +10 -0
- metadata +134 -159
- data/app/controllers/kaui/analytics_controller.rb +0 -28
- data/app/helpers/kaui/killbill_helper.rb +0 -611
- data/app/models/kaui/analytics.rb +0 -19
- data/app/models/kaui/analytics_sanity.rb +0 -7
- data/app/models/kaui/business_account.rb +0 -12
- data/app/models/kaui/business_field.rb +0 -6
- data/app/models/kaui/business_invoice.rb +0 -31
- data/app/models/kaui/business_invoice_item.rb +0 -17
- data/app/models/kaui/business_invoice_payment.rb +0 -25
- data/app/models/kaui/business_overdue_status.rb +0 -8
- data/app/models/kaui/business_snapshot.rb +0 -9
- data/app/models/kaui/business_subscription_transition.rb +0 -53
- data/app/models/kaui/business_tag.rb +0 -5
- data/app/models/kaui/charge.rb +0 -14
- data/app/models/kaui/entitlement.rb +0 -2
- data/app/models/kaui/event.rb +0 -13
- data/app/models/kaui/external_payment.rb +0 -15
- data/app/models/kaui/overdue_state.rb +0 -10
- data/app/models/kaui/payment_attempt.rb +0 -27
- data/app/models/kaui/product.rb +0 -24
- data/app/models/kaui/time_series_data.rb +0 -8
- data/app/views/kaui/analytics/account_snapshot.html.erb +0 -211
- data/app/views/kaui/analytics/index.html.erb +0 -17
- data/app/views/kaui/chargebacks/index.html.erb +0 -14
- data/app/views/kaui/chargebacks/show.html.erb +0 -19
- data/app/views/kaui/credits/index.html.erb +0 -14
- data/app/views/kaui/credits/show.html.erb +0 -19
- data/app/views/kaui/invoice_items/index.html.erb +0 -20
- data/app/views/kaui/invoice_items/show.html.erb +0 -31
- data/app/views/kaui/refunds/_refunds_table.html.erb +0 -31
- data/app/views/kaui/refunds/index.html.erb +0 -43
- data/app/views/kaui/refunds/show.html.erb +0 -33
- data/app/views/kaui/tag_definitions/edit.html.erb +0 -3
- data/test/dummy/test/fixtures/accounts.yml +0 -32
- data/test/dummy/test/fixtures/bill_cycle_days.yml +0 -3
- data/test/dummy/test/fixtures/bundles.yml +0 -4
- data/test/dummy/test/fixtures/invoice_items.yml +0 -13
- data/test/dummy/test/fixtures/invoices.yml +0 -11
- data/test/dummy/test/fixtures/overdue_states.yml +0 -8
- data/test/dummy/test/fixtures/payment_methods.yml +0 -5
- data/test/dummy/test/fixtures/plugin_info_properties.yml +0 -59
- data/test/dummy/test/fixtures/plugin_infos.yml +0 -2
- data/test/dummy/test/fixtures/refunds.yml +0 -9
- data/test/dummy/test/fixtures/tag_definitions.yml +0 -20
- data/test/functional/kaui/account_timeline_controller_test.rb +0 -9
- data/test/functional/kaui/extpayments_controller_test.rb +0 -9
- data/test/functional/kaui/home_controller_test.rb +0 -11
- data/test/integration/navigation_test.rb +0 -10
- data/test/kaui_test.rb +0 -7
- data/test/unit/helpers/kaui/account_timeline_helper_test.rb +0 -6
- data/test/unit/helpers/kaui/bundles_helper_test.rb +0 -6
- data/test/unit/helpers/kaui/chargebacks_helper_test.rb +0 -6
- data/test/unit/helpers/kaui/extpayments_helper_test.rb +0 -6
- data/test/unit/helpers/kaui/home_helper_test.rb +0 -6
- data/test/unit/helpers/kaui/invoices_helper_test.rb +0 -6
- data/test/unit/helpers/kaui/payments_helper_test.rb +0 -6
- data/test/unit/helpers/kaui/refunds_helper_test.rb +0 -6
- data/test/unit/kaui/overdue_state_test.rb +0 -18
- data/test/unit/kaui/refund_test.rb +0 -20
- data/test/unit/model_test.rb +0 -151
@@ -0,0 +1,116 @@
|
|
1
|
+
<%= form_for @account, :html => {:class => 'form-horizontal'} do |f| %>
|
2
|
+
<fieldset>
|
3
|
+
<div class="control-group">
|
4
|
+
<%= f.label :name, 'Name *', :class => 'control-label' %>
|
5
|
+
<div class="controls">
|
6
|
+
<%= f.text_field :name, :class => 'input-small', :required => true %>
|
7
|
+
</div>
|
8
|
+
</div>
|
9
|
+
<div class="control-group">
|
10
|
+
<%= f.label :first_name_length, 'First name length', :class => 'control-label' %>
|
11
|
+
<div class="controls">
|
12
|
+
<%= f.text_field :first_name_length, :class => 'input-small' %>
|
13
|
+
</div>
|
14
|
+
</div>
|
15
|
+
<div class="control-group">
|
16
|
+
<%= f.label :external_key, 'External key *', :class => 'control-label' %>
|
17
|
+
<div class="controls">
|
18
|
+
<%= f.text_field :external_key, :class => 'input-small', :required => true %>
|
19
|
+
</div>
|
20
|
+
</div>
|
21
|
+
<div class="control-group">
|
22
|
+
<%= f.label :email, 'Email *', :class => 'control-label' %>
|
23
|
+
<div class="controls">
|
24
|
+
<%= f.text_field :email, :class => 'input-small', :required => true %>
|
25
|
+
</div>
|
26
|
+
</div>
|
27
|
+
<div class="control-group">
|
28
|
+
<%= f.label :bill_cycle_day_local, 'Bill cycle day', :class => 'control-label' %>
|
29
|
+
<div class="controls">
|
30
|
+
<%= f.text_field :bill_cycle_day_local, :class => 'input-small' %>
|
31
|
+
</div>
|
32
|
+
</div>
|
33
|
+
<div class="control-group">
|
34
|
+
<%= f.label :currency, 'Currency', :class => 'control-label' %>
|
35
|
+
<div class="controls">
|
36
|
+
<%= f.select :currency, currencies, {}, :class => 'input-small' %>
|
37
|
+
</div>
|
38
|
+
</div>
|
39
|
+
<div class="control-group">
|
40
|
+
<%= f.label :time_zone, 'Timezone', :class => 'control-label' %>
|
41
|
+
<div class="controls">
|
42
|
+
<%= f.collection_select :time_zone, ActiveSupport::TimeZone.all, :formatted_offset, :to_s, :class => 'input-large' %>
|
43
|
+
</div>
|
44
|
+
</div>
|
45
|
+
<div class="control-group">
|
46
|
+
<%= f.label :address1, 'Address line 1', :class => 'control-label' %>
|
47
|
+
<div class="controls">
|
48
|
+
<%= f.text_field :address1, :class => 'input-small' %>
|
49
|
+
</div>
|
50
|
+
</div>
|
51
|
+
<div class="control-group">
|
52
|
+
<%= f.label :address2, 'Address line 2', :class => 'control-label' %>
|
53
|
+
<div class="controls">
|
54
|
+
<%= f.text_field :address2, :class => 'input-small' %>
|
55
|
+
</div>
|
56
|
+
</div>
|
57
|
+
<div class="control-group">
|
58
|
+
<%= f.label :postal_code, 'Zip code', :class => 'control-label' %>
|
59
|
+
<div class="controls">
|
60
|
+
<%= f.text_field :postal_code, :class => 'input-small' %>
|
61
|
+
</div>
|
62
|
+
</div>
|
63
|
+
<div class="control-group">
|
64
|
+
<%= f.label :company, 'Company', :class => 'control-label' %>
|
65
|
+
<div class="controls">
|
66
|
+
<%= f.text_field :company, :class => 'input-small' %>
|
67
|
+
</div>
|
68
|
+
</div>
|
69
|
+
<div class="control-group">
|
70
|
+
<%= f.label :city, 'City', :class => 'control-label' %>
|
71
|
+
<div class="controls">
|
72
|
+
<%= f.text_field :city, :class => 'input-small' %>
|
73
|
+
</div>
|
74
|
+
</div>
|
75
|
+
<div class="control-group">
|
76
|
+
<%= f.label :state, 'State', :class => 'control-label' %>
|
77
|
+
<div class="controls">
|
78
|
+
<%= f.text_field :state, :class => 'input-small' %>
|
79
|
+
</div>
|
80
|
+
</div>
|
81
|
+
<div class="control-group">
|
82
|
+
<%= f.label :country, 'Country', :class => 'control-label' %>
|
83
|
+
<div class="controls">
|
84
|
+
<%= f.country_select :country, {priority: %w(US CA), prompt: 'Please select a country'}, :class => 'input-large' %>
|
85
|
+
</div>
|
86
|
+
</div>
|
87
|
+
<div class="control-group">
|
88
|
+
<%= f.label :locale, 'Locale', :class => 'control-label' %>
|
89
|
+
<div class="controls">
|
90
|
+
<%= f.text_field :locale, :class => 'input-small' %>
|
91
|
+
</div>
|
92
|
+
</div>
|
93
|
+
<div class="control-group">
|
94
|
+
<%= f.label :phone, 'Phone', :class => 'control-label' %>
|
95
|
+
<div class="controls">
|
96
|
+
<%= f.text_field :phone, :class => 'input-small' %>
|
97
|
+
</div>
|
98
|
+
</div>
|
99
|
+
<div class="control-group">
|
100
|
+
<%= f.label :is_migrated, 'Migrated?', :class => 'control-label' %>
|
101
|
+
<div class="controls">
|
102
|
+
<%= f.check_box :is_migrated, :class => 'input-small' %>
|
103
|
+
</div>
|
104
|
+
</div>
|
105
|
+
<div class="control-group">
|
106
|
+
<%= f.label :is_notified_for_invoices, 'Notified for invoices?', :class => 'control-label' %>
|
107
|
+
<div class="controls">
|
108
|
+
<%= f.check_box :is_notified_for_invoices, :class => 'input-small' %>
|
109
|
+
</div>
|
110
|
+
</div>
|
111
|
+
|
112
|
+
<div class="form-actions">
|
113
|
+
<%= button_tag 'Create account', :class => 'btn btn-primary' %>
|
114
|
+
</div>
|
115
|
+
</fieldset>
|
116
|
+
<% end %>
|
@@ -1,21 +1,23 @@
|
|
1
1
|
<table id="accounts-table" class="table table-condensed">
|
2
2
|
<thead>
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
3
|
+
<tr>
|
4
|
+
<th>Account ID</th>
|
5
|
+
<th>Name</th>
|
6
|
+
<th>External key</th>
|
7
|
+
<th>Currency</th>
|
8
|
+
<th>City</th>
|
9
|
+
<th>Country</th>
|
10
|
+
</tr>
|
11
11
|
</thead>
|
12
12
|
<tbody>
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
<tr>
|
14
|
+
<td colspan="1" class="dataTables_empty">Loading data from server</td>
|
15
|
+
</tr>
|
16
16
|
</tbody>
|
17
17
|
</table>
|
18
18
|
|
19
|
+
<h3><%= link_to 'Create new account', new_account_path %></h3>
|
20
|
+
|
19
21
|
<%= javascript_tag do %>
|
20
22
|
$(document).ready(function() {
|
21
23
|
$('#accounts-table').dataTable({
|
@@ -1,106 +1,108 @@
|
|
1
|
-
|
2
|
-
<
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
<!-- Payment, Credit then Charge. Same ordering as in the billing timeline -->
|
52
|
-
<%= link_to 'Payment',
|
53
|
-
kaui_engine.pay_all_invoices_account_path(@account.account_id),
|
54
|
-
:method => :post,
|
55
|
-
:class => "btn btn-mini #{"disabled" if !@account.balance.nil? and @account.balance <= 0}" %>
|
56
|
-
</nobr>
|
57
|
-
<% if can? :credit, Kaui::Account %>
|
58
|
-
<nobr>
|
59
|
-
<%= link_to 'Credit',
|
60
|
-
kaui_engine.new_credit_path(:params => { :account_id => @account.account_id }),
|
61
|
-
:class => "btn btn-mini" %>
|
62
|
-
</nobr>
|
63
|
-
<% end %>
|
64
|
-
<% if can? :charge, Kaui::Account %>
|
65
|
-
<nobr>
|
66
|
-
<%= link_to 'Charge',
|
67
|
-
kaui_engine.new_charge_path(:params => { :account_id => @account.account_id }),
|
68
|
-
:class => "btn btn-mini" %>
|
69
|
-
</nobr>
|
70
|
-
<% end %>
|
71
|
-
</dd>
|
72
|
-
<dt>Account credit:</dt>
|
73
|
-
<% if @account.cba.nil? %>
|
74
|
-
<dd>unknown
|
75
|
-
<% elsif @account.cba >= 0 %>
|
76
|
-
<dd><span class="label label-success" ><%= humanized_money_with_symbol @account.cba_to_money %> (<%= @account.currency %>)</span>
|
77
|
-
<% else %>
|
78
|
-
<dd><span class="label label-important" ><%= humanized_money_with_symbol @account.cba_to_money %> (<%= @account.currency %>)</span>
|
79
|
-
<% end %>
|
80
|
-
</dd>
|
81
|
-
<dt>Notified for inv?</dt>
|
82
|
-
<dd><%= @account.is_notified_for_invoices %> <%= link_to "Toggle", kaui_engine.toggle_email_notifications_account_path(@account.account_id, :is_notified => !@account.is_notified_for_invoices), :method => :post, :class => 'btn btn-mini' %></dd>
|
83
|
-
<%= render :partial => "kaui/tags/tags_table",
|
84
|
-
:locals => { :tags => @tags, :tags_url_or_path => kaui_engine.edit_account_tags_path(:params => { :account_id => @account.account_id }), :tags_show_path => kaui_engine.account_tags_path(:account_id => @account.account_id) } %>
|
85
|
-
<%= render :partial => "kaui/account_emails/account_emails_table",
|
86
|
-
:locals => { :account_emails => @account_emails, :account_id => @account.account_id } %>
|
87
|
-
<dt>New base subscription:</dt>
|
88
|
-
<dd><%= link_to "Create", kaui_engine.new_subscription_path(:params => { :account_id => @account.account_id, :product_category => "BASE" }), :class => "btn btn-mini" %></dd>
|
89
|
-
</dl>
|
90
|
-
<h2><%= link_to "Billing timeline", kaui_engine.account_timeline_path(@account.account_id) %></h2>
|
91
|
-
<% if @payment_methods.present? %>
|
92
|
-
<%= render :partial => "kaui/payment_methods/payment_methods_table", :locals => { :account_id => @account.account_id, :payment_methods => @payment_methods } %>
|
1
|
+
<dl class="dl-horizontal">
|
2
|
+
<dt>Id:</dt>
|
3
|
+
<dd><%= @account.account_id %> </dd>
|
4
|
+
<dt>Name:</dt>
|
5
|
+
<dd><%= @account.name %> </dd>
|
6
|
+
<dt>Email:</dt>
|
7
|
+
<dd><%= @account.email %> </dd>
|
8
|
+
<dt>Bill cycle day:</dt>
|
9
|
+
<% if @account.bill_cycle_day_local %>
|
10
|
+
<dd><%= @account.bill_cycle_day_local %> (user timezone)</dd>
|
11
|
+
<% else %>
|
12
|
+
<dd><%= t :unknown_bcd %></dd>
|
13
|
+
<% end %>
|
14
|
+
<dt>Currency:</dt>
|
15
|
+
<dd><%= @account.currency %> </dd>
|
16
|
+
<dt>Timezone:</dt>
|
17
|
+
<dd><%= @account.time_zone %> </dd>
|
18
|
+
<dt>Address 1:</dt>
|
19
|
+
<dd><%= @account.address1 %> </dd>
|
20
|
+
<dt>Address 2:</dt>
|
21
|
+
<dd><%= @account.address2 %> </dd>
|
22
|
+
<dt>Company:</dt>
|
23
|
+
<dd><%= @account.company %> </dd>
|
24
|
+
<dt>State:</dt>
|
25
|
+
<dd><%= @account.state %> </dd>
|
26
|
+
<dt>Country:</dt>
|
27
|
+
<dd><%= @account.country %> </dd>
|
28
|
+
<dt>Phone:</dt>
|
29
|
+
<dd><%= @account.phone %> </dd>
|
30
|
+
<dt>External key:</dt>
|
31
|
+
<dd><%= @account.external_key %> </dd>
|
32
|
+
<dt>Overdue status:</dt>
|
33
|
+
<% if @overdue_state.nil? %>
|
34
|
+
<dd>unknown</dd>
|
35
|
+
<% elsif @overdue_state.clear_state %>
|
36
|
+
<dd><span class='label label-success'>Good</span>
|
37
|
+
<dd>
|
38
|
+
<% else %>
|
39
|
+
<dd><span class='label label-important'><%= @overdue_state.name %></span>
|
40
|
+
<dd>
|
41
|
+
<% end %>
|
42
|
+
<dt>Account balance:</dt>
|
43
|
+
<% if @account.account_balance.nil? %>
|
44
|
+
<dd>unknown</dd>
|
45
|
+
<% elsif @account.account_balance <= 0 %>
|
46
|
+
<dd><span class="label label-success"><%= humanized_money_with_symbol @account.balance_to_money %>
|
47
|
+
(<%= @account.currency %>)</span>
|
48
|
+
<% else %>
|
49
|
+
<dd><span class="label label-important"><%= humanized_money_with_symbol @account.balance_to_money %>
|
50
|
+
(<%= @account.currency %>)</span>
|
93
51
|
<% end %>
|
94
|
-
|
95
|
-
|
52
|
+
|
53
|
+
<nobr>
|
54
|
+
<!-- Payment, Credit then Charge. Same ordering as in the billing timeline -->
|
55
|
+
<%= link_to 'Payment',
|
56
|
+
kaui_engine.pay_all_invoices_account_path(@account.account_id),
|
57
|
+
:method => :post,
|
58
|
+
:class => "btn btn-mini #{"disabled" if !@account.account_balance.nil? and @account.account_balance <= 0}" %>
|
59
|
+
</nobr>
|
60
|
+
<% if can? :credit, Kaui::Account %>
|
61
|
+
<nobr>
|
62
|
+
<%= link_to 'Credit',
|
63
|
+
kaui_engine.new_credit_path(:params => {:account_id => @account.account_id}),
|
64
|
+
:class => "btn btn-mini" %>
|
65
|
+
</nobr>
|
66
|
+
<% end %>
|
67
|
+
<% if can? :charge, Kaui::Account %>
|
68
|
+
<nobr>
|
69
|
+
<%= link_to 'Charge',
|
70
|
+
kaui_engine.new_charge_path(:params => {:account_id => @account.account_id}),
|
71
|
+
:class => "btn btn-mini" %>
|
72
|
+
</nobr>
|
73
|
+
<% end %>
|
74
|
+
</dd>
|
75
|
+
<dt>Account credit:</dt>
|
76
|
+
<% if @account.account_cba.nil? %>
|
77
|
+
<dd>unknown
|
78
|
+
<% elsif @account.account_cba >= 0 %>
|
79
|
+
<dd><span class="label label-success"><%= humanized_money_with_symbol @account.cba_to_money %>
|
80
|
+
(<%= @account.currency %>)</span>
|
81
|
+
<% else %>
|
82
|
+
<dd><span class="label label-important"><%= humanized_money_with_symbol @account.cba_to_money %>
|
83
|
+
(<%= @account.currency %>)</span>
|
84
|
+
<% end %>
|
85
|
+
</dd>
|
86
|
+
<dt>Notified for inv?</dt>
|
87
|
+
<dd><%= @account.is_notified_for_invoices %> <%= link_to "Toggle", kaui_engine.toggle_email_notifications_account_path(@account.account_id, :is_notified => !@account.is_notified_for_invoices), :method => :post, :class => 'btn btn-mini' %></dd>
|
88
|
+
<%= render :partial => "kaui/tags/tags_table",
|
89
|
+
:locals => {:tags => @tags, :tags_url_or_path => kaui_engine.edit_account_tags_path(:params => {:account_id => @account.account_id}), :tags_show_path => kaui_engine.account_tags_path(:account_id => @account.account_id)} %>
|
90
|
+
<%= render :partial => "kaui/account_emails/account_emails_table",
|
91
|
+
:locals => {:account_emails => @account_emails, :account_id => @account.account_id} %>
|
92
|
+
<dt>New base subscription:</dt>
|
93
|
+
<dd><%= link_to "Create", kaui_engine.new_subscription_path(:params => {:account_id => @account.account_id, :product_category => "BASE"}), :class => "btn btn-mini" %></dd>
|
94
|
+
</dl>
|
95
|
+
<h2><%= link_to "Billing timeline", kaui_engine.account_timeline_path(@account.account_id) %></h2>
|
96
|
+
<% if @payment_methods.present? %>
|
97
|
+
<%= render :partial => "kaui/payment_methods/payment_methods_table", :locals => {:account_id => @account.account_id, :payment_methods => @payment_methods} %>
|
98
|
+
<% end %>
|
99
|
+
<%= link_to "Add payment method", kaui_engine.new_payment_method_path(:account_id => @account.account_id), :class => "btn btn-mini" %>
|
100
|
+
<% @bundles.each do |bundle| %>
|
96
101
|
<% subs = @subscriptions_by_bundle_id[bundle.bundle_id] %>
|
97
102
|
<% if subs.present? %>
|
98
|
-
|
99
|
-
|
103
|
+
<h2>Bundle <%= link_to Kaui.bundle_key_display_string.call(bundle.external_key), Kaui.bundle_home_path.call(bundle.bundle_id) if bundle.external_key.present? %></h2>
|
104
|
+
<%= render :partial => "kaui/subscriptions/subscriptions_table", :locals => {:subscriptions => subs, :account => @account} %>
|
100
105
|
<% end %>
|
101
|
-
<% end %>
|
102
|
-
<% else %>
|
103
|
-
<p>Account not found</p>
|
104
106
|
<% end %>
|
105
107
|
|
106
108
|
<%= javascript_tag do %>
|
@@ -1,11 +1,31 @@
|
|
1
|
-
<
|
2
|
-
<
|
1
|
+
<div class="page-header">
|
2
|
+
<h3>Tags for <%= (link_to @bundle.external_key, bundle_path(@bundle.bundle_id)) if @bundle.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>
|
3
15
|
<% if @tags.present? %>
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
16
|
+
<% @tags.each do |tag| %>
|
17
|
+
<% tag.audit_logs.each do |log| %>
|
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.time_zone).html_safe if log.change_date.present? %></td>
|
21
|
+
<td><span
|
22
|
+
<% if log.change_type != 'INSERT' %>class='alert-error'
|
23
|
+
<% else %>class='alert-success' <% end %>><%= log.change_type %></span></td>
|
24
|
+
<td><%= log.changed_by %></td>
|
25
|
+
<td><%= log.reason_code %> <%= log.comments %></td>
|
26
|
+
</tr>
|
27
|
+
<% end %>
|
28
|
+
<% end %>
|
8
29
|
<% end %>
|
9
|
-
|
10
|
-
|
11
|
-
</dd>
|
30
|
+
</tbody>
|
31
|
+
</table>
|
@@ -0,0 +1,41 @@
|
|
1
|
+
<%= form_tag update_bundle_tags_path, :class => 'form-horizontal' do %>
|
2
|
+
<%= hidden_field_tag :bundle_id, @bundle.bundle_id %>
|
3
|
+
<fieldset>
|
4
|
+
<div class="control-group">
|
5
|
+
<label class="control-label">Bundle name</label>
|
6
|
+
|
7
|
+
<div class="controls">
|
8
|
+
<label class="checkbox">
|
9
|
+
<%= link_to @bundle.external_key, Kaui.bundle_home_path.call(@bundle.bundle_id) %><br/>
|
10
|
+
</label>
|
11
|
+
</div>
|
12
|
+
</div>
|
13
|
+
<div class="control-group">
|
14
|
+
<%= label_tag :name, 'Tag', :class => 'control-label' %>
|
15
|
+
<div class="controls">
|
16
|
+
<% @available_tags.each do |tag| %>
|
17
|
+
<label class="checkbox">
|
18
|
+
<%= check_box_tag "tag_#{tag.id}", tag.name, @tag_names.include?(tag.name) %>
|
19
|
+
<span href="#" class="tag-description" rel="tooltip" title="<%= tag.description %>"><%= tag.name %></span>
|
20
|
+
</label>
|
21
|
+
<% end %>
|
22
|
+
</div>
|
23
|
+
</div>
|
24
|
+
|
25
|
+
<div class='control-group'>
|
26
|
+
<%= label_tag :comment, 'Comment', :class => "control-label" %>
|
27
|
+
<div class="controls">
|
28
|
+
<%= text_area_tag :comment, '', :rows => 3, :class => 'input-xlarge' %>
|
29
|
+
</div>
|
30
|
+
</div>
|
31
|
+
|
32
|
+
<div class="form-actions">
|
33
|
+
<%= button_tag 'Update', :class => 'btn btn-primary' %>
|
34
|
+
</div>
|
35
|
+
</fieldset>
|
36
|
+
<% end %>
|
37
|
+
<%= javascript_tag do %>
|
38
|
+
$(function() {
|
39
|
+
$(".tag-description").tooltip();
|
40
|
+
});
|
41
|
+
<% end %>
|
@@ -1,37 +1,5 @@
|
|
1
|
-
<div class=
|
1
|
+
<div class='page-header'>
|
2
2
|
<h1>Add/Remove Tags</h1>
|
3
3
|
</div>
|
4
|
-
<%= form_tag update_bundle_tags_path, :class => "form-horizontal" do %>
|
5
|
-
<%= hidden_field_tag :bundle_id, @bundle.bundle_id %>
|
6
|
-
<fieldset>
|
7
|
-
<div class="control-group">
|
8
|
-
<label class="control-label">Bundle name</label>
|
9
|
-
<div class="controls">
|
10
|
-
<label class="checkbox">
|
11
|
-
<%= link_to @bundle.external_key, Kaui.bundle_home_path.call(@bundle.bundle_id) %><br/>
|
12
|
-
</label>
|
13
|
-
</div>
|
14
|
-
</div>
|
15
|
-
<div class="control-group">
|
16
|
-
<%= label_tag :name, "Tag", :class => "control-label" %>
|
17
|
-
<div class="controls">
|
18
|
-
<% @available_tags.each do |tag| %>
|
19
|
-
<label class="checkbox">
|
20
|
-
<%= check_box_tag "tags[]", tag.name, @tags.include?(tag.name) %>
|
21
|
-
<span href="#" class="tag-description" rel="tooltip" title="<%= tag.description %>"><%= tag.name %></span>
|
22
|
-
</label>
|
23
|
-
<% end %>
|
24
|
-
</div>
|
25
|
-
</div>
|
26
4
|
|
27
|
-
|
28
|
-
<%= button_tag "Update", :class =>"btn btn-primary" %>
|
29
|
-
<%= link_to 'Back', :back, :class => 'btn' %>
|
30
|
-
</div>
|
31
|
-
</fieldset>
|
32
|
-
<% end %>
|
33
|
-
<%= javascript_tag do %>
|
34
|
-
$(function() {
|
35
|
-
$(".tag-description").tooltip();
|
36
|
-
});
|
37
|
-
<% end %>
|
5
|
+
<%= render 'form' %>
|
@@ -0,0 +1,6 @@
|
|
1
|
+
<%= render 'bundle_tags_table' %>
|
2
|
+
|
3
|
+
<% if can? :add, Kaui::Tag or can? :remove, Kaui::Tag %>
|
4
|
+
<%= link_to 'Add/Remove Tags', kaui_engine.edit_bundle_tags_path(:bundle_id => @bundle.bundle_id), :class => 'btn' %>
|
5
|
+
<% end %>
|
6
|
+
<%= link_to 'Go to bundle', kaui_engine.bundle_path(:id => @bundle.bundle_id), :class => 'btn' %>
|
@@ -1,16 +1,16 @@
|
|
1
1
|
<table id="bundles-table" class="table table-condensed">
|
2
2
|
<thead>
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
3
|
+
<tr>
|
4
|
+
<th>Bundle ID</th>
|
5
|
+
<th>Account ID</th>
|
6
|
+
<th>External key</th>
|
7
|
+
<th>Subscriptions</th>
|
8
|
+
</tr>
|
9
9
|
</thead>
|
10
10
|
<tbody>
|
11
|
-
|
12
|
-
|
13
|
-
|
11
|
+
<tr>
|
12
|
+
<td colspan="1" class="dataTables_empty">Loading data from server</td>
|
13
|
+
</tr>
|
14
14
|
</tbody>
|
15
15
|
</table>
|
16
16
|
|
@@ -1,16 +1,18 @@
|
|
1
|
-
|
2
|
-
<
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
<%= link_to
|
11
|
-
|
12
|
-
|
1
|
+
<dl class="dl-horizontal">
|
2
|
+
<dt>Id:</dt>
|
3
|
+
<dd><%= @bundle.bundle_id %> </dd>
|
4
|
+
<dt>Account:</dt>
|
5
|
+
<dd><%= @account.name %> </dd>
|
6
|
+
<dd><%= link_to @account.email, Kaui.account_home_path.call(@account.external_key) %> </dd>
|
7
|
+
<dt>Bundle key:</dt>
|
8
|
+
<dd>
|
9
|
+
<%= @bundle.external_key %>
|
10
|
+
<%= link_to 'Transfer Ownership', kaui_engine.transfer_bundle_path(@bundle.bundle_id), :class => 'btn btn-mini' %>
|
11
|
+
</dd>
|
12
|
+
<%= render :partial => 'kaui/tags/tags_table',
|
13
|
+
:locals => {:tags => @tags, :tags_url_or_path => kaui_engine.edit_bundle_tags_path(:params => {:bundle_id => @bundle.bundle_id}), :tags_show_path => kaui_engine.bundle_tags_path(:bundle_id => @bundle.bundle_id)} %>
|
14
|
+
<% if @bundle.subscriptions.present? %>
|
15
|
+
<%= render :partial => 'kaui/subscriptions/subscriptions_table', :locals => {:subscriptions => @bundle.subscriptions, :account => @account} %>
|
13
16
|
<% end %>
|
14
|
-
|
15
|
-
|
16
|
-
<% end %>
|
17
|
+
</dl>
|
18
|
+
<%= link_to 'Go to account', kaui_engine.account_path(:id => @account.account_id), :class => 'btn' %>
|
@@ -1,29 +1,30 @@
|
|
1
1
|
<h3>Transfer <%= link_to Kaui.bundle_key_display_string.call(@bundle.external_key), Kaui.bundle_home_path.call(@bundle.bundle_id) if @bundle.external_key.present? %> </h3>
|
2
|
-
<%= form_tag do_transfer_bundle_path(@bundle.bundle_id), :class =>
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
2
|
+
<%= form_tag do_transfer_bundle_path(@bundle.bundle_id), :class => 'form-horizontal', :method => :put do %>
|
3
|
+
<div class="control-group">
|
4
|
+
<%= label_tag :current_owner, 'Current account', :class => 'control-label' %>
|
5
|
+
<div class="controls">
|
6
|
+
<label class="checkbox">
|
7
|
+
<%= link_to @account.name, Kaui.account_home_path.call(@account.external_key) %><br/>
|
8
|
+
<%= link_to @account.email, Kaui.account_home_path.call(@account.external_key) %><br/>
|
9
|
+
<%= link_to @account.external_key, Kaui.account_home_path.call(@account.external_key) %>
|
10
|
+
</label>
|
11
|
+
</div>
|
11
12
|
</div>
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
<div class="control-group">
|
14
|
+
<label class="control-label" for="new_account_key">New Account</label>
|
15
|
+
|
16
|
+
<div class="controls">
|
17
|
+
<%= text_field_tag :new_account_key, nil, :class => 'input-xlarge' %>
|
18
|
+
</div>
|
17
19
|
</div>
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
20
|
+
<div class="control-group">
|
21
|
+
<%= label_tag :comment, 'Comment', :class => 'control-label' %>
|
22
|
+
<div class="controls">
|
23
|
+
<%= text_area_tag :comment, '', :rows => 3, :class => 'input-xlarge' %>
|
24
|
+
</div>
|
25
|
+
</div>
|
26
|
+
<div class="form-actions">
|
27
|
+
<%= submit_tag 'Change', :class => 'btn btn-primary' %>
|
28
|
+
<%= link_to 'Back', :back, :class => 'btn' %>
|
23
29
|
</div>
|
24
|
-
</div>
|
25
|
-
<div class="form-actions">
|
26
|
-
<%= submit_tag "Change", :class => 'btn btn-primary' %>
|
27
|
-
<%= link_to 'Back', :back, :class => 'btn' %>
|
28
|
-
</div>
|
29
30
|
<% end %>
|