kaui 4.0.20 → 4.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/controllers/kaui/accounts_controller.rb +2 -2
- data/app/controllers/kaui/engine_controller_util.rb +2 -2
- data/app/controllers/kaui/invoices_controller.rb +2 -0
- data/app/controllers/kaui/payments_controller.rb +2 -0
- data/app/models/kaui/account.rb +3 -1
- data/app/models/kaui/invoice.rb +3 -0
- data/app/models/kaui/payment.rb +3 -0
- data/app/views/kaui/accounts/_functions_bar.html.erb +2 -2
- data/app/views/kaui/accounts/_multi_functions_bar.html.erb +2 -2
- data/app/views/kaui/accounts/index.html.erb +3 -2
- data/app/views/kaui/invoices/_multi_functions_bar.html.erb +2 -2
- data/app/views/kaui/invoices/index.html.erb +4 -2
- data/app/views/kaui/payments/_multi_functions_bar.html.erb +2 -2
- data/app/views/kaui/payments/index.html.erb +5 -3
- data/lib/kaui/version.rb +1 -1
- data/lib/kaui.rb +11 -9
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bedd9b4f949e19f4818536fb8374a3adfeab4b6adbb87d6e6fd146ee2e19c82a
|
|
4
|
+
data.tar.gz: 658d3fb91736468eb634d4ac3f54c1710d30717293b5d3ff8e2633f08c71df8a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3a79003af9a6324459d100f84fd14717e4a432e26c58e201472d7e35a5ee693a6943ecbd6c423c2dffe86cdfd258f23008711f934d254f2babb82fe3e5cbadb2
|
|
7
|
+
data.tar.gz: 6cf9a83025b46de823588ff1783b7dd0c336f8e3ecfdaaf7888af336af706a55f6b033a04a1f736690466f9b09bd36b0239ee8cfd8170754dcd342343f0039e9
|
|
@@ -17,7 +17,7 @@ module Kaui
|
|
|
17
17
|
return
|
|
18
18
|
end
|
|
19
19
|
@search_fields = Kaui::Account::ADVANCED_SEARCH_COLUMNS.map { |attr| [attr, attr.split('_').join(' ').capitalize] }
|
|
20
|
-
@dropdown_default = default_columns(Kaui.account_search_columns.call[2], Kaui::Account::
|
|
20
|
+
@dropdown_default = default_columns(Kaui.account_search_columns.call[2], Kaui::Account::DEFAULT_VISIBLE_COLUMNS)
|
|
21
21
|
@visible_columns = @dropdown_default
|
|
22
22
|
|
|
23
23
|
@ordering = params[:ordering] || (@search_query.blank? ? 'desc' : 'asc')
|
|
@@ -47,7 +47,7 @@ module Kaui
|
|
|
47
47
|
Kaui.account_search_columns.call(account, view_context)[1]
|
|
48
48
|
end
|
|
49
49
|
|
|
50
|
-
paginate searcher, data_extractor, formatter, default_columns(Kaui.account_search_columns.call[2], Kaui::Account::
|
|
50
|
+
paginate searcher, data_extractor, formatter, default_columns(Kaui.account_search_columns.call[2], Kaui::Account::DEFAULT_VISIBLE_COLUMNS)
|
|
51
51
|
end
|
|
52
52
|
|
|
53
53
|
def download
|
|
@@ -203,8 +203,8 @@ module Kaui
|
|
|
203
203
|
render json: response, status: response_status
|
|
204
204
|
end
|
|
205
205
|
|
|
206
|
-
def default_columns(fields,
|
|
207
|
-
fields.map { |field| { data:
|
|
206
|
+
def default_columns(fields, visible_fields)
|
|
207
|
+
fields.each_with_index.map { |field, index| { data: index, visible: visible_fields.include?(field) } }
|
|
208
208
|
end
|
|
209
209
|
end
|
|
210
210
|
end
|
|
@@ -10,6 +10,8 @@ module Kaui
|
|
|
10
10
|
@offset = params[:offset] || 0
|
|
11
11
|
@limit = params[:limit] || 50
|
|
12
12
|
@search_fields = Kaui::Invoice::ADVANCED_SEARCH_COLUMNS.map { |attr| [attr, attr.split('_').join(' ').capitalize] }
|
|
13
|
+
@dropdown_default = default_columns(Kaui.account_invoices_columns.call[3], Kaui::Invoice::DEFAULT_VISIBLE_COLUMNS)
|
|
14
|
+
@visible_columns = @dropdown_default
|
|
13
15
|
|
|
14
16
|
@max_nb_records = @search_query.blank? ? Kaui::Invoice.list_or_search(nil, 0, 0, options_for_klient).pagination_max_nb_records : 0
|
|
15
17
|
end
|
|
@@ -11,6 +11,8 @@ module Kaui
|
|
|
11
11
|
@offset = params[:offset] || 0
|
|
12
12
|
@limit = params[:limit] || 50
|
|
13
13
|
@search_fields = Kaui::Payment::ADVANCED_SEARCH_COLUMNS.map { |attr| [attr, attr.split('_').join(' ').capitalize] }
|
|
14
|
+
@dropdown_default = default_columns(Kaui.account_payments_columns.call[3], Kaui::Payment::DEFAULT_VISIBLE_COLUMNS)
|
|
15
|
+
@visible_columns = @dropdown_default
|
|
14
16
|
|
|
15
17
|
@max_nb_records = @search_query.blank? ? Kaui::Payment.list_or_search(nil, 0, 0, options_for_klient).pagination_max_nb_records : 0
|
|
16
18
|
end
|
data/app/models/kaui/account.rb
CHANGED
|
@@ -4,7 +4,9 @@ module Kaui
|
|
|
4
4
|
class Account < KillBillClient::Model::Account
|
|
5
5
|
attr_accessor :phone, :bill_cycle_day_local
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
# Columns shown by default on the Accounts list screen (demo-friendly defaults); the rest remain
|
|
8
|
+
# available but hidden until the user opts in via "Edit Columns".
|
|
9
|
+
DEFAULT_VISIBLE_COLUMNS = %w[name account_id external_key currency time_zone locale account_balance account_cba].freeze
|
|
8
10
|
REMAPPING_FIELDS = {
|
|
9
11
|
'is_payment_delegated_to_parent' => 'pay_via_parent',
|
|
10
12
|
'account_balance' => 'balance',
|
data/app/models/kaui/invoice.rb
CHANGED
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
module Kaui
|
|
4
4
|
class Invoice < KillBillClient::Model::Invoice
|
|
5
5
|
TABLE_IGNORE_COLUMNS = %w[amount balance credit_adj refund_adj items is_parent_invoice parent_invoice_id parent_account_id audit_logs bundle_keys].freeze
|
|
6
|
+
# Columns shown by default on the Invoices list screen (demo-friendly defaults); the rest remain
|
|
7
|
+
# available but hidden until the user opts in via "Edit Columns".
|
|
8
|
+
DEFAULT_VISIBLE_COLUMNS = %w[invoice_number invoice_id status invoice_date target_date currency account_id].freeze
|
|
6
9
|
ADVANCED_SEARCH_COLUMNS = %w[id account_id invoice_date target_date currency status balance].freeze
|
|
7
10
|
ADVANCED_SEARCH_NAME_CHANGES = [%w[ac_id account_id]].freeze
|
|
8
11
|
|
data/app/models/kaui/payment.rb
CHANGED
|
@@ -7,6 +7,9 @@ module Kaui
|
|
|
7
7
|
attr_accessor :payment_date, :target_invoice_id
|
|
8
8
|
|
|
9
9
|
TRANSACTION_STATUSES = %w[SUCCESS PENDING PAYMENT_FAILURE PLUGIN_FAILURE UNKNOWN].freeze
|
|
10
|
+
# Columns shown by default on the Payments list screen (demo-friendly defaults); the rest remain
|
|
11
|
+
# available but hidden until the user opts in via "Edit Columns".
|
|
12
|
+
DEFAULT_VISIBLE_COLUMNS = %w[payment_date payment_number status account_id currency purchased_amount refunded_amount credited_amount].freeze
|
|
10
13
|
REMAPPING_FIELDS = {
|
|
11
14
|
'auth_amount' => 'auth',
|
|
12
15
|
'captured_amount' => 'capture',
|
|
@@ -378,7 +378,7 @@ $(document).ready(function() {
|
|
|
378
378
|
updateDropdownOrder();
|
|
379
379
|
|
|
380
380
|
function updateDropdownOrder() {
|
|
381
|
-
var state = JSON.parse(localStorage.getItem('DataTables_accounts-
|
|
381
|
+
var state = JSON.parse(localStorage.getItem('DataTables_accounts-table-v2_' + window.location.pathname));
|
|
382
382
|
if (state === null) {
|
|
383
383
|
// On initial load, ensure the existing checkboxes work
|
|
384
384
|
setupColumnToggleEvents();
|
|
@@ -393,7 +393,7 @@ $(document).ready(function() {
|
|
|
393
393
|
|
|
394
394
|
if (columnOrder !== undefined) {
|
|
395
395
|
$list.empty();
|
|
396
|
-
var state = JSON.parse(localStorage.getItem('DataTables_accounts-
|
|
396
|
+
var state = JSON.parse(localStorage.getItem('DataTables_accounts-table-v2_' + window.location.pathname));
|
|
397
397
|
if (state !== null) {
|
|
398
398
|
var colsOrder = state.ColReorder;
|
|
399
399
|
}
|
|
@@ -319,7 +319,7 @@ $(document).ready(function() {
|
|
|
319
319
|
updateDropdownOrder();
|
|
320
320
|
|
|
321
321
|
function updateDropdownOrder() {
|
|
322
|
-
var state = JSON.parse(localStorage.getItem('DataTables_accounts-
|
|
322
|
+
var state = JSON.parse(localStorage.getItem('DataTables_accounts-table-v2_' + window.location.pathname));
|
|
323
323
|
if (state === null) {
|
|
324
324
|
return;
|
|
325
325
|
}
|
|
@@ -332,7 +332,7 @@ $(document).ready(function() {
|
|
|
332
332
|
|
|
333
333
|
if (columnOrder !== undefined) {
|
|
334
334
|
$list.empty();
|
|
335
|
-
var state = JSON.parse(localStorage.getItem('DataTables_accounts-
|
|
335
|
+
var state = JSON.parse(localStorage.getItem('DataTables_accounts-table-v2_' + window.location.pathname));
|
|
336
336
|
if (state !== null) {
|
|
337
337
|
var colsOrder = state.ColReorder;
|
|
338
338
|
}
|
|
@@ -79,11 +79,12 @@ $(document).ready(function() {
|
|
|
79
79
|
"enable": false
|
|
80
80
|
},
|
|
81
81
|
"stateSave": true,
|
|
82
|
+
"stateDuration": -1,
|
|
82
83
|
"stateSaveCallback": function(settings, data) {
|
|
83
|
-
localStorage.setItem('DataTables_accounts-
|
|
84
|
+
localStorage.setItem('DataTables_accounts-table-v2_' + window.location.pathname, JSON.stringify(data));
|
|
84
85
|
},
|
|
85
86
|
"stateLoadCallback": function(settings) {
|
|
86
|
-
return JSON.parse(localStorage.getItem('DataTables_accounts-
|
|
87
|
+
return JSON.parse(localStorage.getItem('DataTables_accounts-table-v2_' + window.location.pathname));
|
|
87
88
|
},
|
|
88
89
|
"scrollX": true,
|
|
89
90
|
"dom": "<'row'r>t<'row'<'col-md-6'i><'col-md-6'p>>",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
<% Kaui.account_invoices_columns.call[0].each_with_index do |title, index| %>
|
|
53
53
|
<li class="list-group-item-manual" data-id="<%= index %>">
|
|
54
54
|
<label class="label-group-item-manual">
|
|
55
|
-
<input type="checkbox" class="column-toggle" draggable="true" data-column="<%= index %>" checked
|
|
55
|
+
<input type="checkbox" class="column-toggle" draggable="true" data-column="<%= index %>" <%= 'checked' if @dropdown_default[index][:visible] %>>
|
|
56
56
|
<%= title %>
|
|
57
57
|
<span class="icon-drag" aria-hidden="true"></span>
|
|
58
58
|
</label>
|
|
@@ -337,7 +337,7 @@ $(document).ready(function() {
|
|
|
337
337
|
updateDropdownOrder();
|
|
338
338
|
|
|
339
339
|
function loadState() {
|
|
340
|
-
var state = JSON.parse(localStorage.getItem('DataTables_invoices-table'));
|
|
340
|
+
var state = JSON.parse(localStorage.getItem('DataTables_invoices-table-v2'));
|
|
341
341
|
return state || { columns: [], columnOrder: [] };
|
|
342
342
|
}
|
|
343
343
|
|
|
@@ -50,7 +50,7 @@ $(document).ready(function() {
|
|
|
50
50
|
}
|
|
51
51
|
});
|
|
52
52
|
|
|
53
|
-
var stateKey = 'DataTables_invoices-table';
|
|
53
|
+
var stateKey = 'DataTables_invoices-table-v2';
|
|
54
54
|
var state = JSON.parse(localStorage.getItem(stateKey));
|
|
55
55
|
if (state) {
|
|
56
56
|
state.start = <%= @offset %>;
|
|
@@ -63,6 +63,7 @@ $(document).ready(function() {
|
|
|
63
63
|
"enable": false
|
|
64
64
|
},
|
|
65
65
|
"stateSave": true,
|
|
66
|
+
"stateDuration": -1,
|
|
66
67
|
"stateSaveCallback": function(settings, data) {
|
|
67
68
|
localStorage.setItem(stateKey, JSON.stringify(data));
|
|
68
69
|
},
|
|
@@ -99,7 +100,8 @@ $(document).ready(function() {
|
|
|
99
100
|
});
|
|
100
101
|
return reorderedData;
|
|
101
102
|
}
|
|
102
|
-
}
|
|
103
|
+
},
|
|
104
|
+
"columns": <%= raw @visible_columns.to_json %>
|
|
103
105
|
});
|
|
104
106
|
|
|
105
107
|
// If the page loaded with advanced search params in the URL (e.g. restored from
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
<% Kaui.account_payments_columns.call()[0].each_with_index do |title, index| %>
|
|
53
53
|
<li class="list-group-item-manual" data-id="<%= index %>">
|
|
54
54
|
<label class="label-group-item-manual">
|
|
55
|
-
<input type="checkbox" class="column-toggle" draggable="true" data-column="<%= index %>" checked
|
|
55
|
+
<input type="checkbox" class="column-toggle" draggable="true" data-column="<%= index %>" <%= 'checked' if @dropdown_default[index][:visible] %>>
|
|
56
56
|
<%= title %>
|
|
57
57
|
<span class="icon-drag" aria-hidden="true"></span>
|
|
58
58
|
</label>
|
|
@@ -338,7 +338,7 @@ $(document).ready(function() {
|
|
|
338
338
|
updateDropdownOrder();
|
|
339
339
|
|
|
340
340
|
function loadState() {
|
|
341
|
-
var state = JSON.parse(localStorage.getItem('DataTables_payments-table'));
|
|
341
|
+
var state = JSON.parse(localStorage.getItem('DataTables_payments-table-v2'));
|
|
342
342
|
return state || { columns: [], columnOrder: [] };
|
|
343
343
|
}
|
|
344
344
|
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
|
|
42
42
|
<%= javascript_tag do %>
|
|
43
43
|
$(document).ready(function() {
|
|
44
|
-
var stateKey = 'DataTables_payments-table';
|
|
44
|
+
var stateKey = 'DataTables_payments-table-v2';
|
|
45
45
|
var state = JSON.parse(localStorage.getItem(stateKey));
|
|
46
46
|
if (state) {
|
|
47
47
|
state.start = <%= @offset %>;
|
|
@@ -54,11 +54,12 @@ $(document).ready(function() {
|
|
|
54
54
|
"enable": false
|
|
55
55
|
},
|
|
56
56
|
"stateSave": true,
|
|
57
|
+
"stateDuration": -1,
|
|
57
58
|
"stateSaveCallback": function(settings, data) {
|
|
58
|
-
localStorage.setItem(
|
|
59
|
+
localStorage.setItem(stateKey, JSON.stringify(data));
|
|
59
60
|
},
|
|
60
61
|
"stateLoadCallback": function(settings) {
|
|
61
|
-
return JSON.parse(localStorage.getItem(
|
|
62
|
+
return JSON.parse(localStorage.getItem(stateKey));
|
|
62
63
|
},
|
|
63
64
|
"scrollX": true,
|
|
64
65
|
<% if @account.account_id.blank? %>
|
|
@@ -115,6 +116,7 @@ $(document).ready(function() {
|
|
|
115
116
|
"processing": true,
|
|
116
117
|
"serverSide": true,
|
|
117
118
|
"search": {"search": "<%= @search_query %>"},
|
|
119
|
+
"columns": <%= raw @visible_columns.to_json %>
|
|
118
120
|
});
|
|
119
121
|
|
|
120
122
|
// If the page loaded with advanced search params in the URL (e.g. restored from
|
data/lib/kaui/version.rb
CHANGED
data/lib/kaui.rb
CHANGED
|
@@ -66,6 +66,8 @@ module Kaui
|
|
|
66
66
|
# Add additional fields if needed
|
|
67
67
|
fields = original_fields.dup
|
|
68
68
|
fields -= %w[audit_logs first_name_length]
|
|
69
|
+
# Demo-friendly default column order (see Kaui::Account::DEFAULT_VISIBLE_COLUMNS for the ones shown by default)
|
|
70
|
+
fields = Kaui::Account::DEFAULT_VISIBLE_COLUMNS + (fields - Kaui::Account::DEFAULT_VISIBLE_COLUMNS)
|
|
69
71
|
headers = fields.dup
|
|
70
72
|
Kaui::Account::REMAPPING_FIELDS.each do |k, v|
|
|
71
73
|
headers[fields.index(k)] = v
|
|
@@ -115,8 +117,8 @@ module Kaui
|
|
|
115
117
|
fields = KillBillClient::Model::InvoiceAttributes.instance_variable_get(:@json_attributes)
|
|
116
118
|
# Change the order if needed
|
|
117
119
|
fields -= Kaui::Invoice::TABLE_IGNORE_COLUMNS
|
|
118
|
-
|
|
119
|
-
fields
|
|
120
|
+
# Demo-friendly default column order (see Kaui::Invoice::DEFAULT_VISIBLE_COLUMNS for the ones shown by default)
|
|
121
|
+
fields = Kaui::Invoice::DEFAULT_VISIBLE_COLUMNS + (fields - Kaui::Invoice::DEFAULT_VISIBLE_COLUMNS)
|
|
120
122
|
|
|
121
123
|
headers = fields.map { |attr| attr.split('_').join(' ').capitalize }
|
|
122
124
|
# Add additional headers if needed
|
|
@@ -146,16 +148,16 @@ module Kaui
|
|
|
146
148
|
|
|
147
149
|
raw_data = fields.map { |attr| invoice&.send(attr.downcase) }
|
|
148
150
|
|
|
149
|
-
[headers, values, raw_data]
|
|
151
|
+
[headers, values, raw_data, fields]
|
|
150
152
|
end
|
|
151
153
|
|
|
152
154
|
self.account_payments_columns = lambda do |account = nil, payment = nil, view_context = nil|
|
|
153
155
|
fields = KillBillClient::Model::PaymentAttributes.instance_variable_get(:@json_attributes)
|
|
154
156
|
# Change the order if needed
|
|
155
|
-
fields = %w[payment_date] + fields
|
|
156
|
-
fields -= %w[
|
|
157
|
-
|
|
158
|
-
fields
|
|
157
|
+
fields = %w[payment_date status] + fields
|
|
158
|
+
fields -= %w[transactions audit_logs]
|
|
159
|
+
# Demo-friendly default column order (see Kaui::Payment::DEFAULT_VISIBLE_COLUMNS for the ones shown by default)
|
|
160
|
+
fields = Kaui::Payment::DEFAULT_VISIBLE_COLUMNS + (fields - Kaui::Payment::DEFAULT_VISIBLE_COLUMNS)
|
|
159
161
|
|
|
160
162
|
headers = fields.dup
|
|
161
163
|
Kaui::Payment::REMAPPING_FIELDS.each do |k, v|
|
|
@@ -163,7 +165,7 @@ module Kaui
|
|
|
163
165
|
end
|
|
164
166
|
headers.map! { |attr| attr.split('_').join(' ').capitalize }
|
|
165
167
|
|
|
166
|
-
return [headers, []] if payment.nil?
|
|
168
|
+
return [headers, [], [], fields] if payment.nil?
|
|
167
169
|
|
|
168
170
|
values = fields.map do |attr|
|
|
169
171
|
case attr
|
|
@@ -190,7 +192,7 @@ module Kaui
|
|
|
190
192
|
end
|
|
191
193
|
|
|
192
194
|
# Add additional values if needed
|
|
193
|
-
[headers, values, raw_data]
|
|
195
|
+
[headers, values, raw_data, fields]
|
|
194
196
|
end
|
|
195
197
|
|
|
196
198
|
self.account_audit_logs_columns = lambda do
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: kaui
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.0.
|
|
4
|
+
version: 4.0.21
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kill Bill core team
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-07-
|
|
11
|
+
date: 2026-07-22 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: actionpack
|