kaui 3.0.9 → 4.0.0
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/assets/images/kaui/account/authorize.svg +4 -0
- data/app/assets/images/kaui/account/credit.svg +4 -0
- data/app/assets/images/kaui/account/down-arrow.svg +3 -0
- data/app/assets/images/kaui/account/edit.svg +4 -0
- data/app/assets/images/kaui/account/pay-all.svg +5 -0
- data/app/assets/images/kaui/account/plus.svg +3 -0
- data/app/assets/images/kaui/account/purchase.svg +5 -0
- data/app/assets/images/kaui/account/refresh.svg +5 -0
- data/app/assets/images/kaui/arrow.svg +3 -0
- data/app/assets/images/kaui/card.svg +5 -0
- data/app/assets/images/kaui/copy.svg +12 -0
- data/app/assets/images/kaui/dashboard/aviate.svg +6 -0
- data/app/assets/images/kaui/dashboard/custom-field.svg +5 -0
- data/app/assets/images/kaui/dashboard/kaui-doc-img.png +0 -0
- data/app/assets/images/kaui/dashboard/plugins.svg +7 -0
- data/app/assets/images/kaui/dashboard/tags.svg +4 -0
- data/app/assets/images/kaui/dashboard/users.svg +6 -0
- data/app/assets/images/kaui/delete.svg +6 -0
- data/app/assets/images/kaui/dots.svg +5 -0
- data/app/assets/images/kaui/download-csv.svg +5 -0
- data/app/assets/images/kaui/download.svg +4 -0
- data/app/assets/images/kaui/eye-off.svg +9 -0
- data/app/assets/images/kaui/eye.svg +7 -0
- data/app/assets/images/kaui/file-upload.svg +34 -0
- data/app/assets/images/kaui/generate.svg +5 -0
- data/app/assets/images/kaui/header/account.svg +4 -0
- data/app/assets/images/kaui/header/cog_icon.svg +4 -0
- data/app/assets/images/kaui/header/invoice.svg +5 -0
- data/app/assets/images/kaui/header/payment.svg +5 -0
- data/app/assets/images/kaui/header/search_icon.svg +4 -0
- data/app/assets/images/kaui/header/subscription.svg +6 -0
- data/app/assets/images/kaui/logout.svg +4 -0
- data/app/assets/images/kaui/modal/close.svg +3 -0
- data/app/assets/images/kaui/modal/plus.svg +3 -0
- data/app/assets/images/kaui/modal/red-close.svg +10 -0
- data/app/assets/images/kaui/modal/search.svg +4 -0
- data/app/assets/images/kaui/payment/payment.svg +4 -0
- data/app/assets/images/kaui/payment/refund.svg +4 -0
- data/app/assets/images/kaui/plus.svg +3 -0
- data/app/assets/images/kaui/search.svg +4 -0
- data/app/assets/images/kaui/setting/account.svg +10 -0
- data/app/assets/images/kaui/setting/analytics.svg +7 -0
- data/app/assets/images/kaui/setting/custom-field.svg +5 -0
- data/app/assets/images/kaui/setting/e-notifications.svg +6 -0
- data/app/assets/images/kaui/setting/plugins.svg +7 -0
- data/app/assets/images/kaui/setting/plus.svg +3 -0
- data/app/assets/images/kaui/setting/reset.svg +4 -0
- data/app/assets/images/kaui/setting/tag-definitions.svg +5 -0
- data/app/assets/images/kaui/setting/tags.svg +4 -0
- data/app/assets/images/kaui/setting/tenants.svg +6 -0
- data/app/assets/images/kaui/setting/users.svg +6 -0
- data/app/assets/images/kaui/setting.svg +4 -0
- data/app/assets/images/kaui/sidebar/account.svg +4 -0
- data/app/assets/images/kaui/sidebar/audit.svg +5 -0
- data/app/assets/images/kaui/sidebar/custom-fields.svg +5 -0
- data/app/assets/images/kaui/sidebar/invoices.svg +5 -0
- data/app/assets/images/kaui/sidebar/payments.svg +5 -0
- data/app/assets/images/kaui/sidebar/queues.svg +5 -0
- data/app/assets/images/kaui/sidebar/subscriptions.svg +6 -0
- data/app/assets/images/kaui/sidebar/tags.svg +5 -0
- data/app/assets/images/kaui/sidebar/timeline.svg +5 -0
- data/app/assets/images/kaui/sign_in_background.svg +57 -0
- data/app/assets/images/kaui/sort-down.svg +3 -0
- data/app/assets/images/kaui/sort-up.svg +3 -0
- data/app/assets/images/kaui/subscription/add-on.svg +7 -0
- data/app/assets/images/kaui/subscription/cancel.svg +6 -0
- data/app/assets/images/kaui/subscription/change.svg +6 -0
- data/app/assets/images/kaui/subscription/date.svg +6 -0
- data/app/assets/images/kaui/subscription/pause.svg +4 -0
- data/app/assets/images/kaui/timeline/authorize.svg +5 -0
- data/app/assets/images/kaui/timeline/capture.svg +5 -0
- data/app/assets/images/kaui/timeline/chargeback.svg +3 -0
- data/app/assets/images/kaui/timeline/credit.svg +6 -0
- data/app/assets/images/kaui/timeline/invoice.svg +5 -0
- data/app/assets/images/kaui/timeline/purchase.svg +5 -0
- data/app/assets/images/kaui/timeline/refund.svg +4 -0
- data/app/assets/images/kaui/timeline/void.svg +4 -0
- data/app/assets/images/kaui/view-doc.svg +6 -0
- data/app/assets/images/kaui/warning.png +0 -0
- data/app/assets/javascripts/application.js +2 -2
- data/app/assets/javascripts/kaui/kaui_override.js +232 -0
- data/app/assets/javascripts/kaui/multi_functions_bar_utils.js +125 -24
- data/app/assets/stylesheets/application.css +13 -1
- data/app/assets/stylesheets/kaui/account.css +2028 -14
- data/app/assets/stylesheets/kaui/account_timeline.css +183 -0
- data/app/assets/stylesheets/kaui/admin_allowed_users.css +260 -0
- data/app/assets/stylesheets/kaui/audit.css +26 -16
- data/app/assets/stylesheets/kaui/audit_logs.css +443 -0
- data/app/assets/stylesheets/kaui/auth_pages.css +72 -0
- data/app/assets/stylesheets/kaui/breadcrumb.css +38 -0
- data/app/assets/stylesheets/kaui/chargebacks.css +118 -0
- data/app/assets/stylesheets/kaui/clock.css +103 -0
- data/app/assets/stylesheets/kaui/common.css +1744 -401
- data/app/assets/stylesheets/kaui/custom_fields.css +546 -0
- data/app/assets/stylesheets/kaui/dashboard.css +26 -0
- data/app/assets/stylesheets/kaui/datatable.css +114 -56
- data/app/assets/stylesheets/kaui/header.css +221 -114
- data/app/assets/stylesheets/kaui/home.css +89 -62
- data/app/assets/stylesheets/kaui/invoice.css +1061 -27
- data/app/assets/stylesheets/kaui/kaui.css +217 -145
- data/app/assets/stylesheets/kaui/overdue.css +5 -3
- data/app/assets/stylesheets/kaui/payment.css +1102 -13
- data/app/assets/stylesheets/kaui/queues.css +269 -0
- data/app/assets/stylesheets/kaui/refunds.css +185 -0
- data/app/assets/stylesheets/kaui/role_definitions.css +111 -0
- data/app/assets/stylesheets/kaui/sidebar.css +122 -0
- data/app/assets/stylesheets/kaui/subscription.css +677 -0
- data/app/assets/stylesheets/kaui/tag_definitions.css +524 -0
- data/app/assets/stylesheets/kaui/tags.css +592 -121
- data/app/assets/stylesheets/kaui/tenants.css +1478 -0
- data/app/assets/stylesheets/kaui/tooltip.css +9 -5
- data/app/assets/stylesheets/kaui/wallets.css +121 -0
- data/app/controllers/kaui/accounts_controller.rb +3 -2
- data/app/controllers/kaui/admin_tenants_controller.rb +33 -0
- data/app/controllers/kaui/custom_fields_controller.rb +1 -1
- data/app/controllers/kaui/engine_controller.rb +1 -2
- data/app/controllers/kaui/engine_controller_util.rb +5 -7
- data/app/controllers/kaui/home_controller.rb +24 -17
- data/app/controllers/kaui/invoices_controller.rb +4 -15
- data/app/controllers/kaui/payments_controller.rb +1 -1
- data/app/controllers/kaui/sessions_controller.rb +1 -0
- data/app/controllers/kaui/tag_definitions_controller.rb +1 -0
- data/app/helpers/kaui/account_helper.rb +13 -0
- data/app/helpers/kaui/plugin_helper.rb +27 -0
- data/app/views/kaui/account_custom_fields/index.html.erb +95 -29
- data/app/views/kaui/account_emails/_account_emails_table.html.erb +13 -3
- data/app/views/kaui/account_emails/_form.html.erb +23 -6
- data/app/views/kaui/account_emails/new.html.erb +12 -6
- data/app/views/kaui/account_tags/_form_bar.html.erb +10 -1
- data/app/views/kaui/account_tags/index.html.erb +103 -24
- data/app/views/kaui/account_timelines/_multi_functions_bar.html.erb +302 -69
- data/app/views/kaui/account_timelines/show.html.erb +360 -254
- data/app/views/kaui/accounts/_account_details.html.erb +165 -0
- data/app/views/kaui/accounts/_account_filterbar.html.erb +70 -80
- data/app/views/kaui/accounts/_add_parent.html.erb +26 -0
- data/app/views/kaui/accounts/_billing_details.html.erb +196 -0
- data/app/views/kaui/accounts/_close_account_modal.html.erb +62 -40
- data/app/views/kaui/accounts/_form_account.html.erb +157 -0
- data/app/views/kaui/accounts/_functions_bar.html.erb +606 -0
- data/app/views/kaui/accounts/_link_parent_modal.html.erb +1 -1
- data/app/views/kaui/accounts/_link_parent_to_modal.html.erb +62 -0
- data/app/views/kaui/accounts/_multi_functions_bar.html.erb +67 -28
- data/app/views/kaui/accounts/_payment_gateways.html.erb +43 -0
- data/app/views/kaui/accounts/_personal_details.html.erb +67 -0
- data/app/views/kaui/accounts/edit.html.erb +15 -9
- data/app/views/kaui/accounts/index.html.erb +77 -27
- data/app/views/kaui/accounts/new.html.erb +14 -8
- data/app/views/kaui/accounts/show.html.erb +17 -11
- data/app/views/kaui/admin/index.html.erb +44 -19
- data/app/views/kaui/admin_allowed_users/_form.html.erb +123 -31
- data/app/views/kaui/admin_allowed_users/edit.html.erb +15 -9
- data/app/views/kaui/admin_allowed_users/index.html.erb +150 -30
- data/app/views/kaui/admin_allowed_users/new.html.erb +14 -8
- data/app/views/kaui/admin_allowed_users/show.html.erb +137 -32
- data/app/views/kaui/admin_tenants/_add_allowed_user_modal.html.erb +42 -15
- data/app/views/kaui/admin_tenants/_clock.html.erb +72 -0
- data/app/views/kaui/admin_tenants/_form.html.erb +32 -20
- data/app/views/kaui/admin_tenants/_form_catalog_translation.erb +21 -8
- data/app/views/kaui/admin_tenants/_form_invoice_template.erb +25 -9
- data/app/views/kaui/admin_tenants/_form_invoice_translation.erb +36 -20
- data/app/views/kaui/admin_tenants/_form_plugin_config.erb +16 -20
- data/app/views/kaui/admin_tenants/_show_catalog.erb +13 -6
- data/app/views/kaui/admin_tenants/_show_catalog_simple.erb +95 -46
- data/app/views/kaui/admin_tenants/_show_catalog_xml.erb +62 -37
- data/app/views/kaui/admin_tenants/_show_overdue.erb +91 -75
- data/app/views/kaui/admin_tenants/_tenant_details.html.erb +106 -17
- data/app/views/kaui/admin_tenants/_tenants_table.html.erb +67 -6
- data/app/views/kaui/admin_tenants/_useful_links.html.erb +21 -16
- data/app/views/kaui/admin_tenants/index.html.erb +35 -11
- data/app/views/kaui/admin_tenants/index.js.erb +3 -0
- data/app/views/kaui/admin_tenants/new.html.erb +19 -13
- data/app/views/kaui/admin_tenants/new_catalog.html.erb +230 -98
- data/app/views/kaui/admin_tenants/new_overdue_config.html.erb +152 -80
- data/app/views/kaui/admin_tenants/new_plan_currency.html.erb +44 -30
- data/app/views/kaui/admin_tenants/show.html.erb +211 -78
- data/app/views/kaui/admin_tenants/show.js.erb +3 -0
- data/app/views/kaui/audit_logs/_multi_functions_bar.html.erb +298 -101
- data/app/views/kaui/audit_logs/index.html.erb +137 -38
- data/app/views/kaui/bundle_tags/_form_bar.html.erb +11 -4
- data/app/views/kaui/bundles/_bundle_details.html.erb +24 -12
- data/app/views/kaui/bundles/index.html.erb +79 -104
- data/app/views/kaui/bundles/pause_resume.html.erb +73 -38
- data/app/views/kaui/chargebacks/_form.html.erb +35 -18
- data/app/views/kaui/chargebacks/new.html.erb +16 -9
- data/app/views/kaui/charges/_form.html.erb +54 -42
- data/app/views/kaui/charges/new.html.erb +15 -8
- data/app/views/kaui/components/breadcrumb/_breadcrumb.html.erb +146 -0
- data/app/views/kaui/components/button/_button.html.erb +16 -0
- data/app/views/kaui/components/dashboard/_card.html.erb +15 -0
- data/app/views/kaui/components/dashboard/_setting.html.erb +15 -0
- data/app/views/kaui/components/form_input/_form_input.html.erb +4 -0
- data/app/views/kaui/components/form_password/_form_password.html.erb +6 -0
- data/app/views/kaui/components/logo/_logo.html.erb +1 -0
- data/app/views/kaui/components/menu_dropdown/_menu_dropdown.html.erb +59 -0
- data/app/views/kaui/components/search_input/_search_input.html.erb +81 -0
- data/app/views/kaui/credits/_form.html.erb +42 -25
- data/app/views/kaui/credits/new.html.erb +15 -8
- data/app/views/kaui/custom_fields/_form.html.erb +37 -25
- data/app/views/kaui/custom_fields/_list_bar.html.erb +11 -10
- data/app/views/kaui/custom_fields/index.html.erb +121 -27
- data/app/views/kaui/custom_fields/new.html.erb +19 -8
- data/app/views/kaui/errors/500.html.erb +1 -1
- data/app/views/kaui/home/index.html.erb +77 -30
- data/app/views/kaui/invoice_items/_edit_form.html.erb +30 -14
- data/app/views/kaui/invoice_items/edit.html.erb +15 -7
- data/app/views/kaui/invoice_tags/_form_bar.html.erb +13 -3
- data/app/views/kaui/invoices/_invoice_filterbar.html.erb +53 -69
- data/app/views/kaui/invoices/_invoice_table.html.erb +77 -92
- data/app/views/kaui/invoices/_multi_functions_bar.html.erb +351 -140
- data/app/views/kaui/invoices/index.html.erb +89 -27
- data/app/views/kaui/invoices/show.html.erb +392 -80
- data/app/views/kaui/layouts/kaui_account_sidebar.html.erb +42 -0
- data/app/views/kaui/layouts/kaui_application.html.erb +29 -15
- data/app/views/kaui/layouts/kaui_flash.html.erb +82 -31
- data/app/views/kaui/layouts/kaui_navbar.html.erb +109 -82
- data/app/views/kaui/layouts/kaui_setting_sidebar.html.erb +36 -0
- data/app/views/kaui/payment_methods/_form.html.erb +32 -11
- data/app/views/kaui/payment_methods/_new_creditcard_payment_method.html.erb +35 -34
- data/app/views/kaui/payment_methods/_payment_methods_details_table.html.erb +27 -29
- data/app/views/kaui/payment_methods/_payment_methods_table.html.erb +116 -38
- data/app/views/kaui/payment_methods/_plugin_properties.html.erb +19 -9
- data/app/views/kaui/payment_methods/new.html.erb +14 -8
- data/app/views/kaui/payments/_form.html.erb +30 -13
- data/app/views/kaui/payments/_multi_functions_bar.html.erb +351 -141
- data/app/views/kaui/payments/_payment_filterbar.html.erb +63 -79
- data/app/views/kaui/payments/_payment_invoice_table.html.erb +105 -0
- data/app/views/kaui/payments/_payment_table.html.erb +4 -67
- data/app/views/kaui/payments/index.html.erb +90 -26
- data/app/views/kaui/payments/new.html.erb +15 -8
- data/app/views/kaui/payments/show.html.erb +222 -28
- data/app/views/kaui/queues/index.html.erb +329 -111
- data/app/views/kaui/refunds/_form.html.erb +68 -45
- data/app/views/kaui/refunds/new.html.erb +15 -8
- data/app/views/kaui/role_definitions/_form.html.erb +104 -17
- data/app/views/kaui/role_definitions/new.html.erb +15 -8
- data/app/views/kaui/sessions/_form.html.erb +9 -19
- data/app/views/kaui/sessions/new.html.erb +10 -9
- data/app/views/kaui/subscriptions/_cancel_by_date_modal.html.erb +65 -35
- data/app/views/kaui/subscriptions/_edit_form.html.erb +66 -35
- data/app/views/kaui/subscriptions/_form.html.erb +63 -32
- data/app/views/kaui/subscriptions/_subscriptions_table.html.erb +215 -57
- data/app/views/kaui/subscriptions/edit.html.erb +19 -8
- data/app/views/kaui/subscriptions/edit_bcd.erb +46 -16
- data/app/views/kaui/subscriptions/new.html.erb +22 -15
- data/app/views/kaui/tag_definitions/_form.html.erb +51 -30
- data/app/views/kaui/tag_definitions/index.html.erb +151 -40
- data/app/views/kaui/tag_definitions/new.html.erb +15 -8
- data/app/views/kaui/tags/index.html.erb +136 -47
- data/app/views/kaui/tenants/_form.html.erb +8 -5
- data/app/views/kaui/tenants/index.html.erb +15 -9
- data/app/views/kaui/transactions/_control_plugin_names.html.erb +18 -10
- data/app/views/kaui/transactions/_form.html.erb +86 -25
- data/app/views/kaui/transactions/new.html.erb +15 -9
- data/config/routes.rb +1 -0
- data/lib/kaui/engine.rb +11 -0
- data/lib/kaui/version.rb +1 -1
- data/lib/kaui.rb +0 -1
- metadata +120 -2
|
@@ -1,30 +1,44 @@
|
|
|
1
|
-
<div class="
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
<%= render :
|
|
5
|
-
<
|
|
6
|
-
<
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
<
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
<div class="kaui-container invoice-index">
|
|
2
|
+
<%= render "kaui/components/breadcrumb/breadcrumb" %>
|
|
3
|
+
<div class="d-flex " style="gap: 4rem;">
|
|
4
|
+
<%= render :template => 'kaui/layouts/kaui_account_sidebar' %>
|
|
5
|
+
<div class="invoices" style="max-width: <%= request.path.include?('/accounts/') ? '67.5rem' : '80rem' %>;">
|
|
6
|
+
<div class="d-flex flex-column ">
|
|
7
|
+
<div class="invoices-header mb-4">
|
|
8
|
+
<div class="d-flex align-items-center">
|
|
9
|
+
<h2>Invoices</h2>
|
|
10
|
+
</div>
|
|
11
|
+
<span>
|
|
12
|
+
<%= render :partial => 'multi_functions_bar' %>
|
|
13
|
+
</span>
|
|
14
|
+
</div>
|
|
15
|
+
<div id="search-labels-container" class="ml-2">
|
|
16
|
+
<!-- Dynamic search labels will be added here -->
|
|
17
|
+
</div>
|
|
18
|
+
<table id="invoices-table" class="invoices-table">
|
|
19
|
+
<thead class="table-header">
|
|
20
|
+
<tr>
|
|
21
|
+
<% Kaui.account_invoices_columns.call[0].each_with_index do |title, index| %>
|
|
22
|
+
<th class="sortable-header" data-column="<%= index %>">
|
|
23
|
+
<div class="header-content">
|
|
24
|
+
<span class="header-text"><%= title %></span>
|
|
25
|
+
<div class="sort-icons">
|
|
26
|
+
<%= image_tag "kaui/sort-up.svg", class: "sort-icon sort-asc" %>
|
|
27
|
+
<%= image_tag "kaui/sort-down.svg", class: "sort-icon sort-desc" %>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
</th>
|
|
31
|
+
<% end %>
|
|
32
|
+
</tr>
|
|
33
|
+
</thead>
|
|
34
|
+
<tbody class="table-body">
|
|
35
|
+
</tbody>
|
|
36
|
+
</table>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
19
39
|
</div>
|
|
20
40
|
</div>
|
|
21
41
|
|
|
22
|
-
<style>
|
|
23
|
-
#invoices-table td, #invoices-table tr {
|
|
24
|
-
white-space: nowrap;
|
|
25
|
-
}
|
|
26
|
-
</style>
|
|
27
|
-
|
|
28
42
|
<%= javascript_tag do %>
|
|
29
43
|
$(document).ready(function() {
|
|
30
44
|
var stateKey = 'DataTables_invoices-table';
|
|
@@ -50,12 +64,13 @@ $(document).ready(function() {
|
|
|
50
64
|
"dom": "<'row'r>t<'row'<'col-md-6'i><'col-md-6'p>>",
|
|
51
65
|
"pagingType": <% if @max_nb_records.nil? -%>"simple"<% else -%>"full_numbers"<% end -%>,
|
|
52
66
|
"language": {
|
|
53
|
-
"info": <% if @max_nb_records.nil? -%>"Showing _START_ to _END_ of <%= number_with_delimiter(Kaui::EngineControllerUtil::SIMPLE_PAGINATION_THRESHOLD) -%>+ entries"<% else -%>"Showing _START_ to _END_ of _TOTAL_ entries"<% end
|
|
67
|
+
"info": <% if @max_nb_records.nil? -%>"Showing _START_ to _END_ of <%= number_with_delimiter(Kaui::EngineControllerUtil::SIMPLE_PAGINATION_THRESHOLD) -%>+ entries"<% else -%>"Showing _START_ to _END_ of _TOTAL_ entries"<% end -%>,
|
|
68
|
+
"infoFiltered": ""
|
|
54
69
|
},
|
|
55
70
|
"pageLength": <%= @limit %>,
|
|
56
71
|
"displayStart": <%= @offset %>,
|
|
57
72
|
<% if @search_query.blank? %>
|
|
58
|
-
"ordering":
|
|
73
|
+
"ordering": true,
|
|
59
74
|
<% elsif !@ordering.blank? %>
|
|
60
75
|
"order": [[ 0, "<%= @ordering %>" ]],
|
|
61
76
|
<% end %>
|
|
@@ -81,14 +96,61 @@ $(document).ready(function() {
|
|
|
81
96
|
}
|
|
82
97
|
});
|
|
83
98
|
|
|
99
|
+
// Custom sorting functionality
|
|
100
|
+
var currentSortColumn = -1;
|
|
101
|
+
var currentSortDirection = 'asc';
|
|
102
|
+
|
|
103
|
+
// Handle custom header clicks
|
|
104
|
+
$('.sortable-header').on('click', function() {
|
|
105
|
+
var columnIndex = parseInt($(this).data('column'));
|
|
106
|
+
var newDirection = 'asc';
|
|
107
|
+
|
|
108
|
+
// If clicking the same column, toggle direction
|
|
109
|
+
if (currentSortColumn === columnIndex) {
|
|
110
|
+
newDirection = currentSortDirection === 'asc' ? 'desc' : 'asc';
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
currentSortColumn = columnIndex;
|
|
114
|
+
currentSortDirection = newDirection;
|
|
115
|
+
|
|
116
|
+
// Update visual indicators
|
|
117
|
+
updateSortIndicators(columnIndex, newDirection);
|
|
118
|
+
|
|
119
|
+
// Apply DataTable sorting
|
|
120
|
+
table.order([columnIndex, newDirection]).draw();
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
// Function to update sort indicators
|
|
124
|
+
function updateSortIndicators(columnIndex, direction) {
|
|
125
|
+
// Reset all headers
|
|
126
|
+
$('.sortable-header').removeClass('sort-asc-active sort-desc-active');
|
|
127
|
+
$('.sort-icon').removeClass('active');
|
|
128
|
+
|
|
129
|
+
// Set active state for current column
|
|
130
|
+
var $header = $('.sortable-header[data-column="' + columnIndex + '"]');
|
|
131
|
+
$header.addClass(direction + '-active');
|
|
132
|
+
$header.find('.sort-' + direction).addClass('active');
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// Initialize sort indicators based on current state
|
|
136
|
+
<% if !@ordering.blank? %>
|
|
137
|
+
var initialColumn = 0;
|
|
138
|
+
var initialDirection = "<%= @ordering %>";
|
|
139
|
+
updateSortIndicators(initialColumn, initialDirection);
|
|
140
|
+
<% end %>
|
|
141
|
+
|
|
84
142
|
// Add an action whenever the page changes
|
|
85
143
|
table.on('page.dt', function() {
|
|
86
|
-
debugger;
|
|
87
144
|
populateSearchLabelsFromUrl();
|
|
88
145
|
});
|
|
89
146
|
|
|
90
147
|
<!-- When we don't know the total number of pages, we need to hide the legend and next button manually -->
|
|
91
148
|
$('#invoices-table').on('draw.dt', function() {
|
|
149
|
+
$("td.dataTables_empty").each(function() {
|
|
150
|
+
var text = $(this).text().trim();
|
|
151
|
+
$(this).html('<p class="max-text-container">' + text + '</p>');
|
|
152
|
+
});
|
|
153
|
+
|
|
92
154
|
<% if @max_nb_records.nil? %>
|
|
93
155
|
var noMoreData = table.column(0)
|
|
94
156
|
.data()
|
|
@@ -1,103 +1,391 @@
|
|
|
1
|
-
<div class="
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
<
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
<% dry_run = @invoice.invoice_number.blank? %>
|
|
14
|
-
<% if dry_run %>
|
|
15
|
-
<div class="alert alert-warning">
|
|
16
|
-
This is a dry-run invoice.
|
|
17
|
-
<% if can? :trigger, Kaui::Invoice %>
|
|
18
|
-
To persist it, <%= link_to 'trigger an invoice run', kaui_engine.trigger_invoice_path(:account_id => @invoice.account_id, :target_date => @invoice.target_date), :method => :post %>.
|
|
19
|
-
<% end %>
|
|
1
|
+
<div class="kaui-container invoice-show">
|
|
2
|
+
|
|
3
|
+
<%= render "kaui/components/breadcrumb/breadcrumb" %>
|
|
4
|
+
<div class="invoice">
|
|
5
|
+
<div class="d-flex flex-column ">
|
|
6
|
+
<div class="invoice-header mb-4">
|
|
7
|
+
<div class="d-flex align-items-center">
|
|
8
|
+
<h2>
|
|
9
|
+
Invoice
|
|
10
|
+
<%= @invoice.invoice_number %>
|
|
11
|
+
|
|
12
|
+
</h2>
|
|
20
13
|
</div>
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
14
|
+
<% dry_run = @invoice.invoice_number.blank? %>
|
|
15
|
+
<% if dry_run %>
|
|
16
|
+
<div class="alert alert-warning">
|
|
17
|
+
This is a dry-run invoice.
|
|
18
|
+
<% if can? :trigger, Kaui::Invoice %>
|
|
19
|
+
To persist it, <%= link_to 'trigger an invoice run', kaui_engine.trigger_invoice_path(:account_id => @invoice.account_id, :target_date => @invoice.target_date), :method => :post %>.
|
|
20
|
+
<% end %>
|
|
21
|
+
</div>
|
|
22
|
+
<% elsif @invoice.status == 'DRAFT' %>
|
|
23
|
+
<div class="alert alert-warning">
|
|
24
|
+
This is a DRAFT invoice.
|
|
25
|
+
<%= link_to 'Commit it', kaui_engine.commit_invoice_path(:id => @invoice.invoice_id), :method => :post %>.
|
|
26
|
+
</div>
|
|
27
|
+
<% elsif @invoice.status == 'VOID' %>
|
|
28
|
+
<div class="alert alert-danger">
|
|
29
|
+
This invoice has been voided.
|
|
30
|
+
</div>
|
|
31
|
+
<% end %>
|
|
32
|
+
<% unless @invoice_tags.find { |t| t.tag_definition_name == 'WRITTEN_OFF' }.nil? %>
|
|
33
|
+
<div class="alert alert-danger">
|
|
34
|
+
This invoice has been written off.
|
|
35
|
+
</div>
|
|
36
|
+
<% end %>
|
|
37
|
+
<span>
|
|
38
|
+
|
|
39
|
+
<% 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))))
|
|
40
|
+
if !(@available_invoice_tags ||= nil).blank? || !(@custom_fields ||= nil).blank? || display_payment_options %>
|
|
41
|
+
<div class="tag-bar">
|
|
42
|
+
<% if !@invoice.invoice_number.blank? %>
|
|
43
|
+
<%= Kaui.customer_invoice_link.call(@invoice, self) %>
|
|
44
|
+
<%= Kaui.additional_invoice_links.call(@invoice, self) %>
|
|
45
|
+
<% end %>
|
|
46
|
+
<% unless @available_invoice_tags.blank? %>
|
|
47
|
+
<div class="tag-select position-relative" onclick="void(0)">
|
|
48
|
+
<%= render "kaui/components/button/button", {
|
|
49
|
+
label: "Tag As",
|
|
50
|
+
trailing_icon: "kaui/account/down-arrow.svg",
|
|
51
|
+
variant: "outline-secondary d-inline-flex align-items-center gap-1",
|
|
52
|
+
type: "button",
|
|
53
|
+
html_class: "kaui-button custom-hover",
|
|
54
|
+
} %>
|
|
55
|
+
|
|
56
|
+
<div class="tag-select-box tag-as-select-box">
|
|
57
|
+
<strong>Tag As:</strong>
|
|
58
|
+
<%= render :partial => 'kaui/invoice_tags/form_bar',
|
|
59
|
+
:locals => {:account_id => @account.account_id,
|
|
60
|
+
:invoice_id => @invoice.invoice_id,
|
|
61
|
+
:tag_names => @invoice_tags.map { |tag| tag.tag_definition_name },
|
|
62
|
+
:available_tags => @available_invoice_tags} %>
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
<% end %>
|
|
66
|
+
<% if can?(:void, Kaui::Invoice) && @invoice.status != 'VOID' && @invoice_tags.find { |t| t.tag_definition_name == 'WRITTEN_OFF' }.nil? # The backend will do more comprehensive checks %>
|
|
67
|
+
<div class="tag-select position-relative" onclick="void(0)">
|
|
68
|
+
<%= render "kaui/components/button/button", {
|
|
69
|
+
label: "Void",
|
|
70
|
+
icon: "kaui/delete.svg",
|
|
71
|
+
variant: "outline-secondary d-inline-flex align-items-center gap-1",
|
|
72
|
+
type: "button",
|
|
73
|
+
html_class: "kaui-button custom-hover",
|
|
74
|
+
} %>
|
|
75
|
+
|
|
76
|
+
<div class="tag-select-box tag-as-select-box">
|
|
77
|
+
<%= form_tag void_invoice_path(:id => @invoice.invoice_id), :method => :delete do %>
|
|
78
|
+
<%= label_tag :comment, 'Comment', :class => 'col-sm-2 control-label' %>
|
|
79
|
+
<%= text_area_tag :comment, nil, :rows => 3, :class => 'form-control' %>
|
|
80
|
+
|
|
81
|
+
<div class="d-flex align-items-right justify-content-end">
|
|
82
|
+
<%= render "kaui/components/button/button", {
|
|
83
|
+
label: "Void",
|
|
84
|
+
variant: "outline-secondary d-inline-flex align-items-center gap-1",
|
|
85
|
+
type: "submit",
|
|
86
|
+
html_class: "kaui-dropdown custom-hover",
|
|
87
|
+
} %>
|
|
88
|
+
</div>
|
|
89
|
+
<% end %>
|
|
90
|
+
</div>
|
|
91
|
+
</div>
|
|
92
|
+
<% end %>
|
|
93
|
+
<% if can?(:credit, Kaui::Account) && @invoice.status == 'DRAFT' %>
|
|
94
|
+
<%= link_to kaui_engine.new_account_credit_path(@invoice.account_id, :currency => @invoice.currency, :invoice_id => @invoice.invoice_id) do %>
|
|
95
|
+
<%= render "kaui/components/button/button", {
|
|
96
|
+
label: "Add credit",
|
|
97
|
+
icon: "kaui/payment/payment.svg",
|
|
98
|
+
variant: "outline-secondary d-inline-flex align-items-center gap-1",
|
|
99
|
+
type: "button",
|
|
100
|
+
html_class: "kaui-dropdown custom-hover",
|
|
101
|
+
} %>
|
|
102
|
+
<% end %>
|
|
103
|
+
<% end %>
|
|
104
|
+
<% if can?(:charge, Kaui::Account) && @invoice.status == 'DRAFT' %>
|
|
105
|
+
<%= link_to kaui_engine.new_account_charge_path(@invoice.account_id, :currency => @invoice.currency, :invoice_id => @invoice.invoice_id) do %>
|
|
106
|
+
<%= render "kaui/components/button/button", {
|
|
107
|
+
label: "Create charge",
|
|
108
|
+
icon: "kaui/payment/payment.svg",
|
|
109
|
+
variant: "outline-secondary d-inline-flex align-items-center gap-1",
|
|
110
|
+
type: "button",
|
|
111
|
+
html_class: "kaui-dropdown custom-hover",
|
|
112
|
+
} %>
|
|
113
|
+
<% end %>
|
|
114
|
+
<% end %>
|
|
115
|
+
<% if @invoice.balance > 0 && can?(:trigger, Kaui::Payment) %>
|
|
116
|
+
<%= link_to kaui_engine.new_account_payment_path(@invoice.account_id, :invoice_id => @invoice.invoice_id) do %>
|
|
117
|
+
<%= render "kaui/components/button/button", {
|
|
118
|
+
label: "Make payment",
|
|
119
|
+
icon: "kaui/payment/payment.svg",
|
|
120
|
+
variant: "outline-secondary d-inline-flex align-items-center gap-1",
|
|
121
|
+
type: "button",
|
|
122
|
+
html_class: "kaui-dropdown custom-hover",
|
|
123
|
+
} %>
|
|
124
|
+
<% end %>
|
|
125
|
+
<% end %>
|
|
126
|
+
</div>
|
|
127
|
+
<% end %>
|
|
128
|
+
</span>
|
|
129
|
+
</div>
|
|
130
|
+
<div class="row invoice-detail">
|
|
131
|
+
<div class="col-sm-6">
|
|
132
|
+
<div>
|
|
133
|
+
<b>Invoice date</b>
|
|
134
|
+
<p><%= @invoice.invoice_date %></p>
|
|
135
|
+
</div>
|
|
136
|
+
<div>
|
|
137
|
+
<b>Target date</b>
|
|
138
|
+
<p><%= @invoice.target_date %></p>
|
|
139
|
+
</div>
|
|
25
140
|
</div>
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
141
|
+
<div class="col-sm-6">
|
|
142
|
+
<div>
|
|
143
|
+
<b>Account Id</b>
|
|
144
|
+
<p>
|
|
145
|
+
<%= @invoice.account_id %>
|
|
146
|
+
<%= render "kaui/components/button/button", {
|
|
147
|
+
label: '',
|
|
148
|
+
icon: "kaui/copy.svg",
|
|
149
|
+
variant: "outline-secondary d-inline-flex align-items-center gap-1",
|
|
150
|
+
type: "button",
|
|
151
|
+
html_class: "dots-menu kaui-button",
|
|
152
|
+
html_options: {
|
|
153
|
+
onclick: "navigator.clipboard.writeText('#{@invoice.account_id}')",
|
|
154
|
+
title: "copy to"
|
|
155
|
+
}
|
|
156
|
+
} %>
|
|
157
|
+
</p>
|
|
158
|
+
</div>
|
|
159
|
+
<div>
|
|
160
|
+
<b>Invoice Id</b>
|
|
161
|
+
<p>
|
|
162
|
+
<%= @invoice.invoice_id %>
|
|
163
|
+
<%= render "kaui/components/button/button", {
|
|
164
|
+
label: '',
|
|
165
|
+
icon: "kaui/copy.svg",
|
|
166
|
+
variant: "outline-secondary d-inline-flex align-items-center gap-1",
|
|
167
|
+
type: "button",
|
|
168
|
+
html_class: "dots-menu kaui-button",
|
|
169
|
+
html_options: {
|
|
170
|
+
onclick: "navigator.clipboard.writeText('#{@invoice.invoice_id}')"
|
|
171
|
+
}
|
|
172
|
+
} %>
|
|
173
|
+
</p>
|
|
174
|
+
</div>
|
|
29
175
|
</div>
|
|
30
|
-
<% end %>
|
|
31
|
-
<% unless @invoice_tags.find { |t| t.tag_definition_name == 'WRITTEN_OFF' }.nil? %>
|
|
32
|
-
<div class="alert alert-danger">
|
|
33
|
-
This invoice has been written off.
|
|
34
176
|
</div>
|
|
35
|
-
<% end %>
|
|
36
|
-
|
|
37
|
-
<div class="row">
|
|
38
|
-
<div class="col-md-3">
|
|
39
|
-
<table class="transparent subtitle">
|
|
40
|
-
<tr>
|
|
41
|
-
<th>Invoice date</th>
|
|
42
|
-
<td><%= @invoice.invoice_date %></td>
|
|
43
|
-
</tr>
|
|
44
|
-
<tr>
|
|
45
|
-
<th>Target date</th>
|
|
46
|
-
<td><%= @invoice.target_date %></td>
|
|
47
|
-
</tr>
|
|
48
|
-
</table>
|
|
49
|
-
</div>
|
|
50
|
-
</div>
|
|
51
|
-
|
|
52
|
-
<%= render :partial => 'kaui/invoices/invoice_table', :locals => {:dry_run => dry_run} %>
|
|
53
177
|
|
|
178
|
+
<%= render :partial => 'kaui/invoices/invoice_table', :locals => {:dry_run => dry_run} %>
|
|
179
|
+
</div>
|
|
54
180
|
</div>
|
|
55
|
-
|
|
56
181
|
</div>
|
|
57
182
|
|
|
58
183
|
<% unless @payments.empty? %>
|
|
59
|
-
<div class="
|
|
60
|
-
|
|
184
|
+
<div class="kaui-container">
|
|
185
|
+
<% @payments.each_with_index do |payment, idx| %>
|
|
186
|
+
<div class="invoice">
|
|
187
|
+
<div class="d-flex flex-column ">
|
|
188
|
+
<div class="invoice-header mb-4">
|
|
189
|
+
<div class="d-flex align-items-center">
|
|
190
|
+
<h2>Payment Details</h2>
|
|
191
|
+
</div>
|
|
192
|
+
<span>
|
|
193
|
+
<% if payment.capturable? || payment.voidable? || (payment.refundable? && (can?(:refund, Kaui::Payment) || can?(:chargeback, Kaui::Payment))) %>
|
|
61
194
|
|
|
62
|
-
<div class="search">
|
|
63
195
|
|
|
64
|
-
|
|
196
|
+
<div class="tag-select-box">
|
|
65
197
|
|
|
66
|
-
|
|
198
|
+
<% if payment.refundable? %>
|
|
199
|
+
<% if payment.refundable? %>
|
|
200
|
+
<% if can? :chargeback, Kaui::Payment %>
|
|
201
|
+
<% if payment.target_invoice_id.present? %>
|
|
202
|
+
<%= link_to kaui_engine.new_account_chargeback_path(payment.account_id, {
|
|
203
|
+
payment_id: payment.payment_id,
|
|
204
|
+
invoice_id: payment.target_invoice_id
|
|
205
|
+
}) do %>
|
|
206
|
+
<%= render "kaui/components/button/button", {
|
|
207
|
+
label: "Chargeback",
|
|
208
|
+
icon: "kaui/account/refresh.svg",
|
|
209
|
+
variant: "outline-secondary d-inline-flex align-items-center gap-1",
|
|
210
|
+
type: "button",
|
|
211
|
+
html_class: "kaui-button custom-hover",
|
|
212
|
+
} %>
|
|
213
|
+
<% end %>
|
|
214
|
+
<% else %>
|
|
215
|
+
<%= link_to kaui_engine.new_account_transaction_path(payment.account_id, {
|
|
216
|
+
payment_id: payment.payment_id,
|
|
217
|
+
payment_method_id: payment.payment_method_id,
|
|
218
|
+
amount: payment.amount_refundable,
|
|
219
|
+
currency: payment.currency,
|
|
220
|
+
transaction_type: "CHARGEBACK"
|
|
221
|
+
}) do %>
|
|
222
|
+
<%= render "kaui/components/button/button", {
|
|
223
|
+
label: "Chargeback",
|
|
224
|
+
icon: "kaui/account/refresh.svg",
|
|
225
|
+
variant: "outline-secondary d-inline-flex align-items-center gap-1",
|
|
226
|
+
type: "button",
|
|
227
|
+
html_class: "kaui-button custom-hover",
|
|
228
|
+
} %>
|
|
229
|
+
<% end %>
|
|
230
|
+
<% end %>
|
|
231
|
+
<% end %>
|
|
232
|
+
<% end %>
|
|
67
233
|
|
|
68
|
-
|
|
234
|
+
<% end %>
|
|
69
235
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
236
|
+
<% if payment.capturable? %>
|
|
237
|
+
<%= link_to kaui_engine.new_account_transaction_path(payment.account_id, {
|
|
238
|
+
payment_id: payment.payment_id,
|
|
239
|
+
payment_method_id: payment.payment_method_id,
|
|
240
|
+
amount: payment.amount_capturable,
|
|
241
|
+
currency: payment.currency,
|
|
242
|
+
transaction_type: "CAPTURE"
|
|
243
|
+
}) do %>
|
|
244
|
+
<%= render "kaui/components/button/button", {
|
|
245
|
+
label: "Capture",
|
|
246
|
+
icon: "kaui/card.svg",
|
|
247
|
+
variant: "outline-secondary d-inline-flex align-items-center gap-1",
|
|
248
|
+
type: "button",
|
|
249
|
+
html_class: "kaui-button custom-hover",
|
|
250
|
+
} %>
|
|
251
|
+
<% end %>
|
|
252
|
+
<% end %>
|
|
84
253
|
|
|
85
|
-
<%= render :partial => 'kaui/payments/payment_table',
|
|
86
|
-
:locals => {:payment => payment,
|
|
87
|
-
:account => @account,
|
|
88
|
-
:payment_method => @payment_methods[payment.payment_id],
|
|
89
|
-
:custom_fields => @payment_custom_fields[payment.payment_id] || []} %>
|
|
90
254
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
255
|
+
<% if payment.voidable? %>
|
|
256
|
+
<%= link_to kaui_engine.new_account_transaction_path(payment.account_id, {
|
|
257
|
+
payment_id: payment.payment_id,
|
|
258
|
+
payment_method_id: payment.payment_method_id,
|
|
259
|
+
transaction_type: "VOID"
|
|
260
|
+
}) do %>
|
|
261
|
+
<%= render "kaui/components/button/button", {
|
|
262
|
+
label: "Void",
|
|
263
|
+
icon: "kaui/delete.svg",
|
|
264
|
+
variant: "outline-secondary d-inline-flex align-items-center gap-1",
|
|
265
|
+
type: "button",
|
|
266
|
+
html_class: "kaui-button custom-hover",
|
|
267
|
+
} %>
|
|
268
|
+
<% end %>
|
|
269
|
+
<% end %>
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
<% if can? :refund, Kaui::Payment %>
|
|
273
|
+
<% if payment.target_invoice_id.present? %>
|
|
274
|
+
<%= link_to kaui_engine.new_account_refund_path(payment.account_id, params: {
|
|
275
|
+
payment_id: payment.payment_id,
|
|
276
|
+
invoice_id: payment.target_invoice_id
|
|
277
|
+
}) do %>
|
|
278
|
+
<%= render "kaui/components/button/button", {
|
|
279
|
+
label: "Refund",
|
|
280
|
+
icon: "kaui/payment/refund.svg",
|
|
281
|
+
variant: "outline-secondary d-inline-flex align-items-center gap-1",
|
|
282
|
+
type: "button",
|
|
283
|
+
html_class: "kaui-dropdown custom-hover",
|
|
284
|
+
} %>
|
|
285
|
+
<% end %>
|
|
286
|
+
<% else %>
|
|
287
|
+
<%= link_to kaui_engine.new_account_transaction_path(payment.account_id,
|
|
288
|
+
payment_id: payment.payment_id,
|
|
289
|
+
payment_method_id: payment.payment_method_id,
|
|
290
|
+
amount: payment.amount_refundable,
|
|
291
|
+
currency: payment.currency,
|
|
292
|
+
transaction_type: 'REFUND') do %>
|
|
293
|
+
<%= render "kaui/components/button/button", {
|
|
294
|
+
label: "Refund",
|
|
295
|
+
icon: "kaui/payment/refund.svg",
|
|
296
|
+
variant: "outline-secondary d-inline-flex align-items-center gap-1",
|
|
297
|
+
type: "button",
|
|
298
|
+
html_class: "kaui-dropdown custom-hover",
|
|
299
|
+
} %>
|
|
300
|
+
<% end %>
|
|
301
|
+
<% end %>
|
|
302
|
+
|
|
303
|
+
<% end %>
|
|
95
304
|
|
|
305
|
+
</div>
|
|
306
|
+
|
|
307
|
+
<% end %>
|
|
308
|
+
</span>
|
|
96
309
|
</div>
|
|
310
|
+
|
|
97
311
|
|
|
98
|
-
|
|
312
|
+
<div class="row invoice-detail">
|
|
313
|
+
<div class="col-sm-6">
|
|
314
|
+
<div>
|
|
315
|
+
<b>Payment</b>
|
|
316
|
+
<p class="payment-link"><%= link_to payment.payment_number, account_payment_path(@account.account_id, payment.payment_id) %></p>
|
|
317
|
+
</div>
|
|
318
|
+
<div>
|
|
319
|
+
<b>External key</b>
|
|
320
|
+
<p>
|
|
321
|
+
<%= payment.payment_external_key %>
|
|
322
|
+
<%= render "kaui/components/button/button", {
|
|
323
|
+
label: '',
|
|
324
|
+
icon: "kaui/copy.svg",
|
|
325
|
+
variant: "outline-secondary d-inline-flex align-items-center gap-1",
|
|
326
|
+
type: "button",
|
|
327
|
+
html_class: "dots-menu kaui-button",
|
|
328
|
+
html_options: {
|
|
329
|
+
onclick: "navigator.clipboard.writeText('#{payment.payment_external_key}')"
|
|
330
|
+
}
|
|
331
|
+
} %>
|
|
332
|
+
</p>
|
|
333
|
+
</div>
|
|
334
|
+
<div>
|
|
335
|
+
<b>Invoice ID</b>
|
|
336
|
+
<p><%= link_to payment.target_invoice_id, account_invoice_path(@account.account_id, payment.target_invoice_id) %></p>
|
|
337
|
+
</div>
|
|
338
|
+
</div>
|
|
339
|
+
<div class="col-sm-6">
|
|
340
|
+
<div>
|
|
341
|
+
<b>Account Id</b>
|
|
342
|
+
<p>
|
|
343
|
+
<%= payment.account_id %>
|
|
344
|
+
<%= render "kaui/components/button/button", {
|
|
345
|
+
label: '',
|
|
346
|
+
icon: "kaui/copy.svg",
|
|
347
|
+
variant: "outline-secondary d-inline-flex align-items-center gap-1",
|
|
348
|
+
type: "button",
|
|
349
|
+
html_class: "dots-menu kaui-button",
|
|
350
|
+
html_options: {
|
|
351
|
+
onclick: "navigator.clipboard.writeText('#{payment.account_id}')",
|
|
352
|
+
title: "copy to"
|
|
353
|
+
}
|
|
354
|
+
} %>
|
|
355
|
+
</p>
|
|
356
|
+
</div>
|
|
357
|
+
<div>
|
|
358
|
+
<b>Payment method Id</b>
|
|
359
|
+
<p>
|
|
360
|
+
<%= payment.payment_method_id %>
|
|
361
|
+
<%= render "kaui/components/button/button", {
|
|
362
|
+
label: '',
|
|
363
|
+
icon: "kaui/copy.svg",
|
|
364
|
+
variant: "outline-secondary d-inline-flex align-items-center gap-1",
|
|
365
|
+
type: "button",
|
|
366
|
+
html_class: "dots-menu kaui-button",
|
|
367
|
+
html_options: {
|
|
368
|
+
onclick: "navigator.clipboard.writeText('#{payment.payment_method_id}')"
|
|
369
|
+
}
|
|
370
|
+
} %>
|
|
371
|
+
</p>
|
|
372
|
+
</div>
|
|
373
|
+
</div>
|
|
374
|
+
</div>
|
|
375
|
+
|
|
376
|
+
<%= render :partial => 'kaui/payments/payment_invoice_table',
|
|
377
|
+
:locals => {:payment => payment,
|
|
378
|
+
:account => @account,
|
|
379
|
+
:payment_method => @payment_methods[payment.payment_id],
|
|
380
|
+
:custom_fields => @payment_custom_fields[payment.payment_id] || []} %>
|
|
99
381
|
|
|
382
|
+
<% if idx < @payments.size - 1 %>
|
|
383
|
+
<hr class="breathe"/>
|
|
384
|
+
<% end %>
|
|
385
|
+
|
|
386
|
+
</div>
|
|
100
387
|
</div>
|
|
388
|
+
<% end %>
|
|
101
389
|
</div>
|
|
102
390
|
<% end %>
|
|
103
391
|
|
|
@@ -112,7 +400,7 @@
|
|
|
112
400
|
$(document).ready(function() {
|
|
113
401
|
disableLinks();
|
|
114
402
|
|
|
115
|
-
$('#invoice-table').
|
|
403
|
+
var table = $('#invoice-table').DataTable({
|
|
116
404
|
"dom": "t",
|
|
117
405
|
"paging": false,
|
|
118
406
|
"order": [],
|
|
@@ -126,5 +414,29 @@
|
|
|
126
414
|
{ "orderable": false }
|
|
127
415
|
]
|
|
128
416
|
});
|
|
417
|
+
|
|
418
|
+
// Custom sorting behavior with indicators (scoped to this table)
|
|
419
|
+
(function attachSortHandlers() {
|
|
420
|
+
var currentSortColumn = -1;
|
|
421
|
+
var currentSortDirection = 'asc';
|
|
422
|
+
var $table = $('#invoice-table');
|
|
423
|
+
|
|
424
|
+
$table.find('thead .sortable-header').on('click', function() {
|
|
425
|
+
var columnIndex = parseInt($(this).data('column'));
|
|
426
|
+
var newDirection = (currentSortColumn === columnIndex && currentSortDirection === 'asc') ? 'desc' : 'asc';
|
|
427
|
+
currentSortColumn = columnIndex;
|
|
428
|
+
currentSortDirection = newDirection;
|
|
429
|
+
updateSortIndicators($table, columnIndex, newDirection);
|
|
430
|
+
table.order([columnIndex, newDirection]).draw();
|
|
431
|
+
});
|
|
432
|
+
})();
|
|
433
|
+
|
|
434
|
+
function updateSortIndicators($table, columnIndex, direction) {
|
|
435
|
+
$table.find('.sortable-header').removeClass('sort-asc-active sort-desc-active');
|
|
436
|
+
$table.find('.sort-icon').removeClass('active');
|
|
437
|
+
var $header = $table.find('.sortable-header[data-column="' + columnIndex + '"]');
|
|
438
|
+
$header.addClass(direction + '-active');
|
|
439
|
+
$header.find('.sort-' + direction).addClass('active');
|
|
440
|
+
}
|
|
129
441
|
});
|
|
130
442
|
<% end %>
|