kaui 0.16.2 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/app/assets/javascripts/application.js +1 -1
- data/app/assets/javascripts/kaui/kaui.js +78 -1
- data/app/assets/stylesheets/bootstrap_and_overrides.css.less +5 -0
- data/app/assets/stylesheets/kaui/account.less +20 -0
- data/app/assets/stylesheets/kaui/audit.less +38 -0
- data/app/assets/stylesheets/kaui/common.less +103 -0
- data/app/assets/stylesheets/kaui/datatable.less +19 -0
- data/app/assets/stylesheets/kaui/kaui.less +3 -1
- data/app/assets/stylesheets/kaui/subscription.less +15 -0
- data/app/assets/stylesheets/kaui/tags.less +30 -1
- data/app/controllers/kaui/account_custom_fields_controller.rb +24 -0
- data/app/controllers/kaui/account_tags_controller.rb +21 -0
- data/app/controllers/kaui/accounts_controller.rb +43 -16
- data/app/controllers/kaui/admin_tenants_controller.rb +152 -11
- data/app/controllers/kaui/audit_logs_controller.rb +93 -0
- data/app/controllers/kaui/bundles_controller.rb +15 -3
- data/app/controllers/kaui/custom_fields_controller.rb +2 -0
- data/app/controllers/kaui/engine_controller_util.rb +14 -0
- data/app/controllers/kaui/invoice_items_controller.rb +17 -0
- data/app/controllers/kaui/invoices_controller.rb +22 -5
- data/app/controllers/kaui/payment_methods_controller.rb +10 -9
- data/app/controllers/kaui/subscriptions_controller.rb +54 -7
- data/app/controllers/kaui/tag_definitions_controller.rb +1 -0
- data/app/helpers/kaui/account_helper.rb +28 -0
- data/app/helpers/kaui/object_helper.rb +4 -0
- data/app/helpers/kaui/permissions_helper.rb +15 -0
- data/app/helpers/kaui/plugin_helper.rb +58 -0
- data/app/helpers/kaui/subscription_helper.rb +9 -7
- data/app/models/kaui/admin_tenant.rb +20 -6
- data/app/models/kaui/catalog.rb +4 -4
- data/app/models/kaui/tag.rb +1 -1
- data/app/models/kaui/tag_definition.rb +1 -1
- data/app/views/kaui/account_custom_fields/index.html.erb +35 -0
- data/app/views/kaui/account_tags/index.html.erb +35 -0
- data/app/views/kaui/accounts/_account_info.html.erb +5 -0
- data/app/views/kaui/accounts/_billing_info.html.erb +1 -1
- data/app/views/kaui/accounts/_close_account_modal.html.erb +98 -0
- data/app/views/kaui/accounts/index.html.erb +0 -7
- data/app/views/kaui/accounts/show.html.erb +4 -0
- data/app/views/kaui/admin_tenants/_add_allowed_user_modal.html.erb +64 -0
- data/app/views/kaui/admin_tenants/_form_plugin_config.erb +257 -151
- data/app/views/kaui/admin_tenants/_show_catalog_simple.erb +133 -48
- data/app/views/kaui/admin_tenants/_show_catalog_xml.erb +3 -2
- data/app/views/kaui/admin_tenants/show.html.erb +6 -1
- data/app/views/kaui/audit_logs/_show_history_modal.html.erb +177 -0
- data/app/views/kaui/audit_logs/index.html.erb +52 -0
- data/app/views/kaui/bundle_tags/_form_bar.html.erb +4 -2
- data/app/views/kaui/bundles/index.html.erb +21 -14
- data/app/views/kaui/chargebacks/_form.html.erb +1 -9
- data/app/views/kaui/charges/_form.html.erb +2 -10
- data/app/views/kaui/credits/_form.html.erb +1 -9
- data/app/views/kaui/custom_fields/_form.html.erb +1 -1
- data/app/views/kaui/custom_fields/_list_bar.html.erb +1 -1
- data/app/views/kaui/invoices/_invoice_table.html.erb +30 -2
- data/app/views/kaui/layouts/kaui_account_navbar.html.erb +7 -0
- data/app/views/kaui/layouts/kaui_flash.html.erb +13 -2
- data/app/views/kaui/payment_methods/_new_creditcard_payment_method.html.erb +11 -11
- data/app/views/kaui/payment_methods/_plugin_properties.html.erb +1 -1
- data/app/views/kaui/payments/_form.html.erb +1 -9
- data/app/views/kaui/refunds/_form.html.erb +4 -6
- data/app/views/kaui/subscriptions/_cancel_by_date_modal.html.erb +62 -0
- data/app/views/kaui/subscriptions/_form.html.erb +7 -13
- data/app/views/kaui/subscriptions/_subscriptions_table.html.erb +50 -11
- data/app/views/kaui/subscriptions/new.html.erb +3 -1
- data/app/views/kaui/tag_definitions/_form.html.erb +139 -0
- data/app/views/kaui/tags/index.html.erb +1 -1
- data/app/views/kaui/transactions/_control_plugin_names.html.erb +1 -1
- data/config/routes.rb +18 -2
- data/db/migrate/20130812155313_devise_create_kaui_users.rb +9 -7
- data/db/migrate/20150109214021_create_kaui_tenants.rb +8 -6
- data/db/migrate/20150112232813_create_kaui_allowed_users.rb +15 -11
- data/lib/kaui/engine.rb +1 -0
- data/lib/kaui/version.rb +1 -1
- data/test/dummy/config/database.yml +6 -1
- data/test/fixtures/SpyCarAdvanced.xml +824 -0
- data/test/functional/kaui/account_children_controller_test.rb +1 -1
- data/test/functional/kaui/account_custom_fields_controller_test.rb +29 -0
- data/test/functional/kaui/account_tags_controller_test.rb +19 -0
- data/test/functional/kaui/accounts_controller_test.rb +23 -6
- data/test/functional/kaui/admin_controller_test.rb +2 -2
- data/test/functional/kaui/admin_tenants_controller_test.rb +76 -5
- data/test/functional/kaui/audit_logs_controller_test.rb +71 -0
- data/test/functional/kaui/bundles_controller_test.rb +2 -1
- data/test/functional/kaui/payments_controller_test.rb +1 -1
- data/test/functional/kaui/subscriptions_controller_test.rb +1 -2
- data/test/functional/kaui/tag_definitions_controller_test.rb +2 -1
- data/test/killbill_test_helper.rb +5 -2
- data/test/unit/kaui/admin_tenant_test.rb +100 -0
- data/test/unit/kaui/money_helper_test.rb +1 -1
- metadata +58 -13
- data/app/assets/javascripts/kaui/validation.js +0 -21
- data/test/dummy/log/test.log +0 -0
@@ -17,13 +17,14 @@
|
|
17
17
|
</tr>
|
18
18
|
</thead>
|
19
19
|
<tbody>
|
20
|
-
<% @
|
20
|
+
<% @catalog_versions.each do |catalog| %>
|
21
21
|
<tr>
|
22
22
|
<td><%= catalog[:version] %></td>
|
23
23
|
<td><%= catalog[:version_date] %></td>
|
24
24
|
<td>
|
25
25
|
<%= form_tag(kaui_engine.admin_tenant_display_catalog_xml_path, :id => "submit_form_xml_#{catalog[:version]}", :method => 'post', :multipart => true, :class => "hide") do %>
|
26
|
-
<%= hidden_field_tag(:
|
26
|
+
<%= hidden_field_tag(:effective_date, catalog[:version_date]) %>
|
27
|
+
<%= hidden_field_tag(:id, @tenant.id) %>
|
27
28
|
<%= submit_tag 'submit' %>
|
28
29
|
<% end %>
|
29
30
|
<a class='btn btn-xs' href="javascript:void(0);" onclick="submit_xml(<%= catalog[:version] %>);">view xml</a>
|
@@ -9,7 +9,10 @@
|
|
9
9
|
|
10
10
|
<div class="column-block">
|
11
11
|
|
12
|
-
<h1>Allowed Users
|
12
|
+
<h1>Allowed Users
|
13
|
+
<%= link_to '<i class="fa fa-plus-square"></i>'.html_safe,
|
14
|
+
'#addAllowedUserModal',
|
15
|
+
:class => 'btn btn-xs', data: {toggle: 'modal'} %></h1>
|
13
16
|
<table id="allowed-users-for-tenant-table" class="table table-condensed">
|
14
17
|
<thead>
|
15
18
|
<tr>
|
@@ -78,6 +81,8 @@
|
|
78
81
|
</div>
|
79
82
|
</div>
|
80
83
|
|
84
|
+
<%= render :partial => 'add_allowed_user_modal' %>
|
85
|
+
|
81
86
|
<%= javascript_tag do %>
|
82
87
|
|
83
88
|
|
@@ -0,0 +1,177 @@
|
|
1
|
+
<div class="modal fade" id="showHistoryModal" tabindex="-1" role="dialog">
|
2
|
+
<div class="modal-dialog modal-lg" role="document">
|
3
|
+
<div class="modal-content column-block">
|
4
|
+
<div>
|
5
|
+
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
6
|
+
<h1 class="modal-title">History</h1>
|
7
|
+
</div>
|
8
|
+
<div class="modal-body">
|
9
|
+
<input type="hidden" id="objectId" />
|
10
|
+
<input type="hidden" id="objectType" />
|
11
|
+
<input type="hidden" id="changeDate" />
|
12
|
+
<input type="hidden" id="changeType" />
|
13
|
+
<div class="alert alert-info" role="alert">Loading data from server</div>
|
14
|
+
<div id="templatesPlaceHolder" style="display: flex;">
|
15
|
+
<div id="templateFieldsPlaceHolder"></div>
|
16
|
+
<div id="templatePlaceHolder"></div>
|
17
|
+
</div>
|
18
|
+
</div>
|
19
|
+
</div><!-- /.modal-content -->
|
20
|
+
</div><!-- /.modal-dialog -->
|
21
|
+
</div><!-- /.modal -->
|
22
|
+
|
23
|
+
<script id="history_template" type="text/template" >
|
24
|
+
{{#auditLogs}}
|
25
|
+
<div class="panel panel-{{selected}}" id="{{panelId}}">
|
26
|
+
<div class="panel-heading">{{#changeType}}{{changeType}} - {{changeDate}}{{/changeType}} </div>
|
27
|
+
<ul class="list-group">
|
28
|
+
{{#history}}
|
29
|
+
<li class="list-group-item {{class}}">
|
30
|
+
<span {{#longValue}}title="{{.}}"{{/longValue}} >{{value}}</span>
|
31
|
+
</li>
|
32
|
+
{{/history}}
|
33
|
+
</ul>
|
34
|
+
</div>
|
35
|
+
{{/auditLogs}}
|
36
|
+
</script>
|
37
|
+
|
38
|
+
<%= javascript_tag do %>
|
39
|
+
$(document).ready(function() {
|
40
|
+
|
41
|
+
const IGNORABLE_FIELDS = ['id','createdDate','updatedDate','recordId','accountRecordId','tenantRecordId','historyTableName','tableName']
|
42
|
+
function renderHistory(auditLogsWithHistory) {
|
43
|
+
var auditLogs = [];
|
44
|
+
var changeDateSelected = $("#changeDate").val();
|
45
|
+
var changeTypeSelected = $("#changeType").val();
|
46
|
+
var activePanel = "history0";
|
47
|
+
var fieldNamePanel = {
|
48
|
+
selected: false,
|
49
|
+
changeType: null,
|
50
|
+
changeDate: null,
|
51
|
+
panelId: "fields",
|
52
|
+
history: []
|
53
|
+
};
|
54
|
+
|
55
|
+
for (var i = 0 ; i < auditLogsWithHistory.length; i++) {
|
56
|
+
var isActivePanel = auditLogsWithHistory[i].changeDate == changeDateSelected && auditLogsWithHistory[i].changeType == changeTypeSelected;
|
57
|
+
var auditLog = {
|
58
|
+
selected: isActivePanel ? 'primary' : 'default',
|
59
|
+
changeType: auditLogsWithHistory[i].changeType,
|
60
|
+
changeDate: auditLogsWithHistory[i].changeDate,
|
61
|
+
panelId: "history" + i,
|
62
|
+
history: []
|
63
|
+
};
|
64
|
+
|
65
|
+
var currentHistory = auditLogsWithHistory[i].history;
|
66
|
+
var previousHistory = (i == 0 ? null : auditLogsWithHistory[i - 1].history);
|
67
|
+
for (var field in currentHistory) {
|
68
|
+
if (IGNORABLE_FIELDS.indexOf(field) == -1) {
|
69
|
+
var previousValue = previousHistory == null || previousHistory[field] == undefined ? null : previousHistory[field];
|
70
|
+
auditLog.history.push({
|
71
|
+
class: diffClass(previousValue, currentHistory[field], previousHistory == null),
|
72
|
+
value: getValue(currentHistory[field]),
|
73
|
+
longValue: !isBlank(currentHistory[field]) && currentHistory[field].length > 40 ? currentHistory[field] : null
|
74
|
+
});
|
75
|
+
|
76
|
+
// only use the first history object to set the fields title
|
77
|
+
if (i == 0) {
|
78
|
+
fieldNamePanel.history.push({
|
79
|
+
class: 'disabled',
|
80
|
+
value: field.replace(/([a-zA-Z])(?=[A-Z])/g, '$1 ').toLowerCase(),
|
81
|
+
longValue: null
|
82
|
+
});
|
83
|
+
}
|
84
|
+
}
|
85
|
+
}
|
86
|
+
|
87
|
+
auditLogs.push(auditLog);
|
88
|
+
if (isActivePanel) {
|
89
|
+
activePanel = auditLog.panelId;
|
90
|
+
}
|
91
|
+
}
|
92
|
+
|
93
|
+
var template = $("#history_template").html();
|
94
|
+
var markup = Mustache.render(template, { auditLogs: auditLogs });
|
95
|
+
var headerMarkup = Mustache.render(template, { auditLogs: fieldNamePanel });
|
96
|
+
$("#showHistoryModal").find(".alert").hide();
|
97
|
+
$("#templateFieldsPlaceHolder").html(headerMarkup);
|
98
|
+
$("#templatePlaceHolder").html(markup);
|
99
|
+
|
100
|
+
moveToActivePanel(activePanel);
|
101
|
+
}
|
102
|
+
|
103
|
+
function getValue(value) {
|
104
|
+
if (isBlank(value)) {
|
105
|
+
return value;
|
106
|
+
}
|
107
|
+
|
108
|
+
return value.length > 40 ? value.substring(0,40) + "..." : value
|
109
|
+
}
|
110
|
+
|
111
|
+
function moveToActivePanel(activePanel) {
|
112
|
+
var leftPos = $('#templatePlaceHolder').scrollLeft();
|
113
|
+
var panelLeftPosition = $('#' + activePanel).position().left;
|
114
|
+
$("#templatePlaceHolder").animate({
|
115
|
+
scrollLeft: leftPos + panelLeftPosition - 270
|
116
|
+
}, 800);
|
117
|
+
}
|
118
|
+
|
119
|
+
function diffClass(previousValue, currentValue, isTheBeginningOfTime) {
|
120
|
+
var updated = 'list-group-item-success';
|
121
|
+
var deleted = 'list-group-item-danger';
|
122
|
+
var noChange = '';
|
123
|
+
|
124
|
+
if ( isTheBeginningOfTime ) {
|
125
|
+
return isNullOrUndefined(currentValue) ? noChange : updated;
|
126
|
+
} else if (isBlank(previousValue) && !isBlank(currentValue)) {
|
127
|
+
return updated;
|
128
|
+
} else if (!isBlank(previousValue) && isBlank(currentValue)) {
|
129
|
+
return deleted;
|
130
|
+
} else if (previousValue != currentValue) {
|
131
|
+
return updated;
|
132
|
+
} else {
|
133
|
+
return noChange;
|
134
|
+
}
|
135
|
+
}
|
136
|
+
|
137
|
+
function loadHistory(url) {
|
138
|
+
var object_id = $("#objectId").val();
|
139
|
+
var object_type = $("#objectType").val();
|
140
|
+
|
141
|
+
$.ajax({
|
142
|
+
url: '<%= audit_logs_history_path(@account.account_id) %>',
|
143
|
+
type: "GET",
|
144
|
+
dataType: "json",
|
145
|
+
data: {
|
146
|
+
"object_id": object_id,
|
147
|
+
"object_type": object_type
|
148
|
+
},
|
149
|
+
success: function(data) {
|
150
|
+
if (data.error == null && data.audits != null) {
|
151
|
+
renderHistory(data.audits);
|
152
|
+
} else {
|
153
|
+
$('#showHistoryModal').modal('hide')
|
154
|
+
ajaxAlert(data.error);
|
155
|
+
}
|
156
|
+
}
|
157
|
+
});
|
158
|
+
}
|
159
|
+
|
160
|
+
$('#showHistoryModal').on('show.bs.modal', function (e) {
|
161
|
+
$("#objectId").val(e.relatedTarget.dataset['objectId']);
|
162
|
+
$("#objectType").val(e.relatedTarget.dataset['objectType']);
|
163
|
+
$("#changeDate").val(e.relatedTarget.dataset['changeDate']);
|
164
|
+
$("#changeType").val(e.relatedTarget.dataset['changeType']);
|
165
|
+
$("#templatePlaceHolder").html('');
|
166
|
+
$("#templateFieldsPlaceHolder").html('');
|
167
|
+
$("#showHistoryModal").find(".alert").show();
|
168
|
+
$("#showHistoryModal").find(".modal-title").html((e.relatedTarget.dataset['objectType']).toLowerCase().replace('_',' ') + " History [" + e.relatedTarget.dataset['objectId'] + "]");
|
169
|
+
ajaxCloseAlert();
|
170
|
+
});
|
171
|
+
|
172
|
+
$('#showHistoryModal').on('shown.bs.modal', function (e) {
|
173
|
+
loadHistory();
|
174
|
+
});
|
175
|
+
|
176
|
+
});
|
177
|
+
<% end %>
|
@@ -0,0 +1,52 @@
|
|
1
|
+
<div class="search">
|
2
|
+
|
3
|
+
<div class="column-block">
|
4
|
+
|
5
|
+
<h1>Audit logs</h1>
|
6
|
+
<input type="hidden" id="audit-logs" value="<%= @audit_logs_json %>">
|
7
|
+
<table id="audit-logs-table" class="table table-condensed table-colored-rows mobile-data">
|
8
|
+
<thead>
|
9
|
+
<tr>
|
10
|
+
<th>Created date</th>
|
11
|
+
<th>Object id</th>
|
12
|
+
<th>Object type</th>
|
13
|
+
<th>Change type</th>
|
14
|
+
<th>Username</th>
|
15
|
+
<th>Reason</th>
|
16
|
+
<th>Comment</th>
|
17
|
+
<th>User token</th>
|
18
|
+
</tr>
|
19
|
+
</thead>
|
20
|
+
<tbody>
|
21
|
+
<tr>
|
22
|
+
<td colspan="1" class="dataTables_empty">Loading data from server</td>
|
23
|
+
</tr>
|
24
|
+
</tbody>
|
25
|
+
</table>
|
26
|
+
|
27
|
+
</div>
|
28
|
+
|
29
|
+
<%= render :partial => 'show_history_modal' %>
|
30
|
+
|
31
|
+
</div>
|
32
|
+
|
33
|
+
|
34
|
+
<%= javascript_tag do %>
|
35
|
+
$(document).ready(function() {
|
36
|
+
var auditLogs = JSON.parse($("#audit-logs").val());
|
37
|
+
$('#audit-logs-table').DataTable({
|
38
|
+
dom: "<'row'<'col-md-6'l><'col-md-6'f>r>t<'row'<'col-md-6'i><'col-md-6'p>>",
|
39
|
+
data: auditLogs,
|
40
|
+
order: [[ 0, 'desc' ]],
|
41
|
+
createdRow: function( row, data, dataIndex ) {
|
42
|
+
if ( data[3] == "INSERT" ) {
|
43
|
+
$(row).addClass( 'insert' );
|
44
|
+
} else if ( data[3] == "UPDATE" ) {
|
45
|
+
$(row).addClass( 'update' );
|
46
|
+
} else if ( data[3] == "DELETE" ) {
|
47
|
+
$(row).addClass( 'delete' );
|
48
|
+
}
|
49
|
+
}
|
50
|
+
});
|
51
|
+
});
|
52
|
+
<% end %>
|
@@ -1,6 +1,8 @@
|
|
1
1
|
<% can_change_tags = can?(:add, Kaui::Tag) || can?(:delete, Kaui::Tag) %>
|
2
|
-
<%= form_tag
|
3
|
-
|
2
|
+
<%= form_tag update_tags_path do %>
|
3
|
+
<% params.each_key do |key| %>
|
4
|
+
<%= hidden_field_tag key, params[key] %>
|
5
|
+
<% end %>
|
4
6
|
|
5
7
|
<% available_tags.each do |tag| %>
|
6
8
|
<%= check_box_tag "tag_#{tag.id}", tag.name, tag_names.include?(tag.name), :disabled => !can_change_tags, :readonly => !can_change_tags %>
|
@@ -29,31 +29,38 @@
|
|
29
29
|
<div class="info-wrapper">
|
30
30
|
|
31
31
|
<div class="tag-bar">
|
32
|
+
<% unless @available_tags.empty? %>
|
33
|
+
<div class="tag-select" onclick="void(0)">
|
34
|
+
<span><i class="fa fa-tag"></i><i class="fa fa-caret-down"></i></span>
|
32
35
|
|
33
|
-
|
34
|
-
|
36
|
+
<div class="tag-select-box">
|
37
|
+
<strong>Tag as:</strong>
|
35
38
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
39
|
+
<%= render :partial => 'kaui/bundle_tags/form_bar',
|
40
|
+
:locals => {:params => { :bundle_id => bundle.bundle_id},
|
41
|
+
:tag_names => (@tags_per_bundle[bundle.bundle_id] || []).map { |tag| tag.tag_definition_name },
|
42
|
+
:available_tags => @available_tags,
|
43
|
+
:update_tags_path => update_bundle_tags_path
|
44
|
+
} %>
|
45
|
+
</div>
|
43
46
|
</div>
|
44
|
-
|
45
|
-
|
47
|
+
<% end %>
|
46
48
|
<%= render :partial => 'kaui/custom_fields/list_bar',
|
47
49
|
:locals => {:custom_fields => @custom_fields_per_bundle[bundle.bundle_id] || []} %>
|
48
50
|
|
49
|
-
<% if !is_subscription_cancelled?(@
|
51
|
+
<% if !is_subscription_cancelled?(@subscription[bundle.bundle_id]) &&
|
50
52
|
(can?(:create, Kaui::Subscription) || can?(:transfer, Kaui::Subscription) || can?(:pause_resume, Kaui::Subscription)) %>
|
51
53
|
<div class="tag-select" onclick="void(0)">
|
52
54
|
<span><i class="fa fa-gift"></i><i class="fa fa-caret-down"></i></span>
|
53
55
|
|
54
56
|
<div class="tag-select-box">
|
55
|
-
<% if can?(:create, Kaui::Subscription) && @
|
56
|
-
<%= link_to
|
57
|
+
<% if can?(:create, Kaui::Subscription) && @subscription[bundle.bundle_id].present? %>
|
58
|
+
<%= link_to "<i class='fa fa-plus'></i> #{@subscription[bundle.bundle_id].product_category == 'BASE' ? 'Add add-on' : 'Add standalone subscription'}".html_safe,
|
59
|
+
kaui_engine.new_subscription_path(:params => {
|
60
|
+
:account_id => bundle.account_id,
|
61
|
+
:bundle_id => bundle.bundle_id,
|
62
|
+
:base_product_name => @subscription[bundle.bundle_id].product_name,
|
63
|
+
:product_category => @subscription[bundle.bundle_id].product_category == 'BASE' ? 'ADD_ON' : 'STANDALONE'}) %>
|
57
64
|
<% end %>
|
58
65
|
<% if can? :transfer, Kaui::Subscription %>
|
59
66
|
<%= link_to '<i class="fa fa-random"></i> Transfer Ownership'.html_safe, kaui_engine.transfer_bundle_path(bundle.bundle_id) %>
|
@@ -5,7 +5,7 @@
|
|
5
5
|
<div class="form-group">
|
6
6
|
<%= f.label :amount, 'Amount', :class => 'col-sm-2 control-label' %>
|
7
7
|
<div class="col-sm-10">
|
8
|
-
<%= f.
|
8
|
+
<%= f.number_field :amount, :id => 'chargeback_amount', :class => 'form-control' %>
|
9
9
|
<p class="help-block">Currency: <%= @chargeback.currency %></p>
|
10
10
|
</div>
|
11
11
|
</div>
|
@@ -36,11 +36,3 @@
|
|
36
36
|
</div>
|
37
37
|
</div>
|
38
38
|
<% end %>
|
39
|
-
|
40
|
-
<%= javascript_tag do %>
|
41
|
-
$(document).ready(function() {
|
42
|
-
$("#chargeback_amount").keydown(function(event) {
|
43
|
-
preventNonNumericValues(event);
|
44
|
-
});
|
45
|
-
});
|
46
|
-
<% end %>
|
@@ -15,7 +15,7 @@
|
|
15
15
|
<div class="form-group">
|
16
16
|
<%= f.label :amount, 'Amount', :class => 'col-sm-2 control-label' %>
|
17
17
|
<div class="col-sm-10">
|
18
|
-
<%= f.
|
18
|
+
<%= f.number_field :amount, :id => 'charge_amount', :class => 'form-control' %>
|
19
19
|
<% if @invoice.present? %>
|
20
20
|
<p class="help-block">Currency: <%= @invoice.currency %></p>
|
21
21
|
<% end %>
|
@@ -49,12 +49,4 @@
|
|
49
49
|
<%= submit_tag 'Save', :class => 'btn btn-default' %>
|
50
50
|
</div>
|
51
51
|
</div>
|
52
|
-
<% end %>
|
53
|
-
|
54
|
-
<%= javascript_tag do %>
|
55
|
-
$(document).ready(function() {
|
56
|
-
$("#charge_amount").keydown(function(event) {
|
57
|
-
preventNonNumericValues(event);
|
58
|
-
});
|
59
|
-
});
|
60
|
-
<% end %>
|
52
|
+
<% end %>
|
@@ -35,12 +35,4 @@
|
|
35
35
|
<%= submit_tag 'Save', :class => 'btn btn-default' %>
|
36
36
|
</div>
|
37
37
|
</div>
|
38
|
-
<% end %>
|
39
|
-
|
40
|
-
<%= javascript_tag do %>
|
41
|
-
$(document).ready(function() {
|
42
|
-
$("#credit_amount").keydown(function(event) {
|
43
|
-
preventNonNumericValues(event);
|
44
|
-
});
|
45
|
-
});
|
46
|
-
<% end %>
|
38
|
+
<% end %>
|
@@ -8,7 +8,7 @@
|
|
8
8
|
<div class="form-group">
|
9
9
|
<%= f.label :object_type, 'Object type', :class => 'col-sm-2 control-label' %>
|
10
10
|
<div class="col-sm-10">
|
11
|
-
<%= f.select :object_type, [:ACCOUNT, :BUNDLE, :SUBSCRIPTION, :INVOICE, :PAYMENT], {:selected => :account}, :class => 'form-control' %>
|
11
|
+
<%= f.select :object_type, [:ACCOUNT, :BUNDLE, :SUBSCRIPTION, :INVOICE, :INVOICE_ITEM, :PAYMENT], {:selected => :account}, :class => 'form-control' %>
|
12
12
|
</div>
|
13
13
|
</div>
|
14
14
|
<div class="form-group">
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<div class="info-wrapper">
|
2
2
|
|
3
3
|
<% display_payment_options = (!dry_run && ((can?(:credit, Kaui::Account) && @invoice.status == 'DRAFT') || (can?(:charge, Kaui::Account) && @invoice.status == 'DRAFT') || (@invoice.balance > 0 && can?(:trigger, Kaui::Payment))))
|
4
|
-
if (
|
4
|
+
if !(@custom_fields ||= nil).blank? || display_payment_options %>
|
5
5
|
<div class="tag-bar">
|
6
6
|
<!--<div class="tag-select">-->
|
7
7
|
<!--<span><i class="fa fa-tag"></i><i class="fa fa-caret-down"></i></span>-->
|
@@ -41,6 +41,9 @@
|
|
41
41
|
<table id="invoice-table" class="table table-condensed mobile-data">
|
42
42
|
<thead>
|
43
43
|
<tr>
|
44
|
+
<% unless (@available_invoice_item_tags ||= nil).blank? && (@custom_fields_per_invoice_item ||= nil).blank? %>
|
45
|
+
<th></th>
|
46
|
+
<% end %>
|
44
47
|
<th>Description</th>
|
45
48
|
<th>Start date</th>
|
46
49
|
<th>End date</th>
|
@@ -53,6 +56,32 @@
|
|
53
56
|
<tbody>
|
54
57
|
<% @invoice.items.each do |item| %>
|
55
58
|
<tr id=<%= "invoice_item_#{item.invoice_item_id}_#{item.linked_invoice_item_id}" %>>
|
59
|
+
<% unless @available_invoice_item_tags.blank? && @custom_fields_per_invoice_item.blank? %>
|
60
|
+
<td class="inline-row-tag-bar">
|
61
|
+
<div class="tag-bar tag-bar-no-border">
|
62
|
+
<% unless @available_invoice_item_tags.blank? %>
|
63
|
+
<div class="tag-select" onclick="void(0)">
|
64
|
+
<span><i class="fa fa-tag"></i><i class="fa fa-caret-down"></i></span>
|
65
|
+
|
66
|
+
<div class="tag-select-box">
|
67
|
+
<strong>Tag as:</strong>
|
68
|
+
|
69
|
+
<%= render :partial => 'kaui/bundle_tags/form_bar',
|
70
|
+
:locals => {:params => { :invoice_id => item.invoice_id, :account_id => item.account_id},
|
71
|
+
:tag_names => (@tags_per_invoice_item[item.invoice_item_id] || []).map { |tag| tag.tag_definition_name },
|
72
|
+
:available_tags => @available_invoice_item_tags,
|
73
|
+
:update_tags_path => update_invoice_items_tags_path(item.invoice_item_id)
|
74
|
+
} %>
|
75
|
+
</div>
|
76
|
+
</div>
|
77
|
+
<% end %>
|
78
|
+
|
79
|
+
<%= render :partial => 'kaui/custom_fields/list_bar',
|
80
|
+
:locals => {:custom_fields => @custom_fields_per_invoice_item[item.invoice_item_id] || []} %>
|
81
|
+
</div>
|
82
|
+
|
83
|
+
</td>
|
84
|
+
<% end %>
|
56
85
|
<td onClick="hightlightLinkedItems('<%= item.invoice_item_id %>', '<%= item.linked_invoice_item_id %>'); return false;"><%= item.description %></td>
|
57
86
|
<td onClick="hightlightLinkedItems('<%= item.invoice_item_id %>', '<%= item.linked_invoice_item_id %>'); return false;"><%= item.start_date.html_safe if item.start_date %></td>
|
58
87
|
<td onClick="hightlightLinkedItems('<%= item.invoice_item_id %>', '<%= item.linked_invoice_item_id %>'); return false;"><%= item.end_date.html_safe if item.end_date %></td>
|
@@ -74,7 +103,6 @@
|
|
74
103
|
<% end %>
|
75
104
|
</tbody>
|
76
105
|
</table>
|
77
|
-
|
78
106
|
<table class="invoice-totals">
|
79
107
|
<tr>
|
80
108
|
<th></th>
|
@@ -8,9 +8,16 @@
|
|
8
8
|
<%= link_to 'Invoices', kaui_engine.account_invoices_path(params[:account_id]), :class => (params[:controller].ends_with?('invoices') ? 'current' : 'non-current') %>
|
9
9
|
<%= link_to 'Payments', kaui_engine.account_payments_path(params[:account_id]), :class => (params[:controller].ends_with?('payments') ? 'current' : 'non-current') %>
|
10
10
|
<%= link_to 'Timeline', kaui_engine.account_timeline_path(params[:account_id]), :class => (params[:controller].ends_with?('timelines') ? 'current' : 'non-current') %>
|
11
|
+
<%= link_to 'Tags', kaui_engine.account_tags_path(params[:account_id]), :class => (params[:controller].ends_with?('tags') ? 'current' : 'non-current') %>
|
12
|
+
<%= link_to 'Custom Fields', kaui_engine.account_custom_fields_path(params[:account_id]), :class => (params[:controller].ends_with?('custom_fields') ? 'current' : 'non-current') %>
|
11
13
|
|
12
14
|
<% if current_user.root? %>
|
13
15
|
<%= link_to 'Queues', kaui_engine.account_queues_path(params[:account_id]), :class => (params[:controller].ends_with?('queues') ? 'current' : 'non-current') %>
|
16
|
+
<%= link_to 'Audit', kaui_engine.account_audit_logs_path(params[:account_id]), :class => (params[:controller].ends_with?('logs') ? 'current' : 'non-current') %>
|
17
|
+
<% end %>
|
18
|
+
|
19
|
+
<% if account_closed? %>
|
20
|
+
<span class="label label-danger">CLOSED</span>
|
14
21
|
<% end %>
|
15
22
|
</div>
|
16
23
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<%- # :alert used by devise -%>
|
2
2
|
<% [:error, :alert].each do |key| %>
|
3
3
|
<% if flash[key] %>
|
4
|
-
<div class="row">
|
4
|
+
<div class="row server-alert">
|
5
5
|
<div class="col-md-12">
|
6
6
|
<div class="alert alert-danger"><%= flash[key] %></div>
|
7
7
|
</div>
|
@@ -9,9 +9,20 @@
|
|
9
9
|
<% end %>
|
10
10
|
<% end %>
|
11
11
|
<% if flash[:notice] %>
|
12
|
-
<div class="row">
|
12
|
+
<div class="row server-alert">
|
13
13
|
<div class="col-md-12">
|
14
14
|
<div class="alert alert-info"><%= flash[:notice] %></div>
|
15
15
|
</div>
|
16
16
|
</div>
|
17
17
|
<% end %>
|
18
|
+
<!--This is for ajax calls that need to notify for error, to trigger this alert use ajaxAlert(message)-->
|
19
|
+
<div id="ajaxAlert" class="row" style="display: none">
|
20
|
+
<div class="col-md-12">
|
21
|
+
<div class="alert alert-danger">
|
22
|
+
<button type="button" class="close" aria-label="Close">
|
23
|
+
<span aria-hidden="true">×</span>
|
24
|
+
</button>
|
25
|
+
<span id="ajaxErrorMessage"></span>
|
26
|
+
</div>
|
27
|
+
</div>
|
28
|
+
</div>
|
@@ -1,66 +1,66 @@
|
|
1
1
|
<div class="form-group">
|
2
2
|
<%= label_tag :card_type, 'Card type', :class => 'col-sm-3 control-label' %>
|
3
3
|
<div class="col-sm-9">
|
4
|
-
<%= text_field_tag :card_type, @card_type, :class => 'form-control' %>
|
4
|
+
<%= text_field_tag :card_type, @card_type ||= nil, :class => 'form-control' %>
|
5
5
|
</div>
|
6
6
|
</div>
|
7
7
|
<div class="form-group">
|
8
8
|
<%= label_tag :card_holder_name, 'Card holder name', :class => 'col-sm-3 control-label' %>
|
9
9
|
<div class="col-sm-9">
|
10
|
-
<%= text_field_tag :card_holder_name, @card_holder_name, :class => 'form-control' %>
|
10
|
+
<%= text_field_tag :card_holder_name, @card_holder_name ||= nil, :class => 'form-control' %>
|
11
11
|
</div>
|
12
12
|
</div>
|
13
13
|
<div class="form-group">
|
14
14
|
<%= label_tag :expiration_month, 'Expiration month', :class => 'col-sm-3 control-label' %>
|
15
15
|
<div class="col-sm-9">
|
16
|
-
<%= text_field_tag :expiration_month, @expiration_month, :class => 'form-control' %>
|
16
|
+
<%= text_field_tag :expiration_month, @expiration_month ||= nil, :class => 'form-control' %>
|
17
17
|
</div>
|
18
18
|
</div>
|
19
19
|
<div class="form-group">
|
20
20
|
<%= label_tag :expiration_year, 'Expiration year', :class => 'col-sm-3 control-label' %>
|
21
21
|
<div class="col-sm-9">
|
22
|
-
<%= text_field_tag :expiration_year, @expiration_year, :class => 'form-control' %>
|
22
|
+
<%= text_field_tag :expiration_year, @expiration_year ||= nil, :class => 'form-control' %>
|
23
23
|
</div>
|
24
24
|
</div>
|
25
25
|
<div class="form-group">
|
26
26
|
<%= label_tag :credit_card_number, 'Credit card number', :class => 'col-sm-3 control-label' %>
|
27
27
|
<div class="col-sm-9">
|
28
|
-
<%= text_field_tag :credit_card_number, @credit_card_number, :class => 'form-control' %>
|
28
|
+
<%= text_field_tag :credit_card_number, @credit_card_number ||= nil, :class => 'form-control' %>
|
29
29
|
</div>
|
30
30
|
</div>
|
31
31
|
<div class="form-group">
|
32
32
|
<%= label_tag :address1, 'Address 1', :class => 'col-sm-3 control-label' %>
|
33
33
|
<div class="col-sm-9">
|
34
|
-
<%= text_field_tag :address1, @address1, :class => 'form-control' %>
|
34
|
+
<%= text_field_tag :address1, @address1 ||= nil, :class => 'form-control' %>
|
35
35
|
</div>
|
36
36
|
</div>
|
37
37
|
<div class="form-group">
|
38
38
|
<%= label_tag :address2, 'Address 2', :class => 'col-sm-3 control-label' %>
|
39
39
|
<div class="col-sm-9">
|
40
|
-
<%= text_field_tag :address2, @address2, :class => 'form-control' %>
|
40
|
+
<%= text_field_tag :address2, @address2 ||= nil, :class => 'form-control' %>
|
41
41
|
</div>
|
42
42
|
</div>
|
43
43
|
<div class="form-group">
|
44
44
|
<%= label_tag :city, 'City', :class => 'col-sm-3 control-label' %>
|
45
45
|
<div class="col-sm-9">
|
46
|
-
<%= text_field_tag :city, @city, :class => 'form-control' %>
|
46
|
+
<%= text_field_tag :city, @city ||= nil, :class => 'form-control' %>
|
47
47
|
</div>
|
48
48
|
</div>
|
49
49
|
<div class="form-group">
|
50
50
|
<%= label_tag :postal_code, 'ZIP code', :class => 'col-sm-3 control-label' %>
|
51
51
|
<div class="col-sm-9">
|
52
|
-
<%= text_field_tag :postal_code, @postal_code, :class => 'form-control' %>
|
52
|
+
<%= text_field_tag :postal_code, @postal_code ||= nil, :class => 'form-control' %>
|
53
53
|
</div>
|
54
54
|
</div>
|
55
55
|
<div class="form-group">
|
56
56
|
<%= label_tag :state, 'State', :class => 'col-sm-3 control-label' %>
|
57
57
|
<div class="col-sm-9">
|
58
|
-
<%= text_field_tag :state, @state, :class => 'form-control' %>
|
58
|
+
<%= text_field_tag :state, @state ||= nil, :class => 'form-control' %>
|
59
59
|
</div>
|
60
60
|
</div>
|
61
61
|
<div class="form-group">
|
62
62
|
<%= label_tag :country, 'Country', :class => 'col-sm-3 control-label' %>
|
63
63
|
<div class="col-sm-9">
|
64
|
-
<%= text_field_tag :country, @country, :class => 'form-control' %>
|
64
|
+
<%= text_field_tag :country, @country ||= nil, :class => 'form-control' %>
|
65
65
|
</div>
|
66
66
|
</div>
|
@@ -9,7 +9,7 @@
|
|
9
9
|
</tr>
|
10
10
|
</thead>
|
11
11
|
<tbody>
|
12
|
-
<% (@plugin_properties
|
12
|
+
<% (@plugin_properties ||= [{}]).each_with_index do |plugin_properties, index| %>
|
13
13
|
<%= fields :plugin_properties do |property| %>
|
14
14
|
<%= property.fields_for "#{index}", plugin_properties do |key_value| %>
|
15
15
|
<tr id="plugin_property_<%= index %>" >
|
@@ -16,7 +16,7 @@
|
|
16
16
|
<div class="form-group">
|
17
17
|
<%= f.label :purchased_amount, 'Amount', :class => 'col-sm-3 control-label' %>
|
18
18
|
<div class="col-sm-9">
|
19
|
-
<%= f.
|
19
|
+
<%= f.number_field :purchased_amount, :id => 'payment_amount', :class => 'form-control' %>
|
20
20
|
<p class="help-block">Currency: <%= @invoice.present? ? @invoice.currency : @account.currency %></p>
|
21
21
|
</div>
|
22
22
|
</div>
|
@@ -45,11 +45,3 @@
|
|
45
45
|
</div>
|
46
46
|
</div>
|
47
47
|
<% end %>
|
48
|
-
|
49
|
-
<%= javascript_tag do %>
|
50
|
-
$(document).ready(function() {
|
51
|
-
$("#payment_amount").keydown(function(event) {
|
52
|
-
preventNonNumericValues(event);
|
53
|
-
});
|
54
|
-
});
|
55
|
-
<% end %>
|