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.
Files changed (259) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/kaui/account/authorize.svg +4 -0
  3. data/app/assets/images/kaui/account/credit.svg +4 -0
  4. data/app/assets/images/kaui/account/down-arrow.svg +3 -0
  5. data/app/assets/images/kaui/account/edit.svg +4 -0
  6. data/app/assets/images/kaui/account/pay-all.svg +5 -0
  7. data/app/assets/images/kaui/account/plus.svg +3 -0
  8. data/app/assets/images/kaui/account/purchase.svg +5 -0
  9. data/app/assets/images/kaui/account/refresh.svg +5 -0
  10. data/app/assets/images/kaui/arrow.svg +3 -0
  11. data/app/assets/images/kaui/card.svg +5 -0
  12. data/app/assets/images/kaui/copy.svg +12 -0
  13. data/app/assets/images/kaui/dashboard/aviate.svg +6 -0
  14. data/app/assets/images/kaui/dashboard/custom-field.svg +5 -0
  15. data/app/assets/images/kaui/dashboard/kaui-doc-img.png +0 -0
  16. data/app/assets/images/kaui/dashboard/plugins.svg +7 -0
  17. data/app/assets/images/kaui/dashboard/tags.svg +4 -0
  18. data/app/assets/images/kaui/dashboard/users.svg +6 -0
  19. data/app/assets/images/kaui/delete.svg +6 -0
  20. data/app/assets/images/kaui/dots.svg +5 -0
  21. data/app/assets/images/kaui/download-csv.svg +5 -0
  22. data/app/assets/images/kaui/download.svg +4 -0
  23. data/app/assets/images/kaui/eye-off.svg +9 -0
  24. data/app/assets/images/kaui/eye.svg +7 -0
  25. data/app/assets/images/kaui/file-upload.svg +34 -0
  26. data/app/assets/images/kaui/generate.svg +5 -0
  27. data/app/assets/images/kaui/header/account.svg +4 -0
  28. data/app/assets/images/kaui/header/cog_icon.svg +4 -0
  29. data/app/assets/images/kaui/header/invoice.svg +5 -0
  30. data/app/assets/images/kaui/header/payment.svg +5 -0
  31. data/app/assets/images/kaui/header/search_icon.svg +4 -0
  32. data/app/assets/images/kaui/header/subscription.svg +6 -0
  33. data/app/assets/images/kaui/logout.svg +4 -0
  34. data/app/assets/images/kaui/modal/close.svg +3 -0
  35. data/app/assets/images/kaui/modal/plus.svg +3 -0
  36. data/app/assets/images/kaui/modal/red-close.svg +10 -0
  37. data/app/assets/images/kaui/modal/search.svg +4 -0
  38. data/app/assets/images/kaui/payment/payment.svg +4 -0
  39. data/app/assets/images/kaui/payment/refund.svg +4 -0
  40. data/app/assets/images/kaui/plus.svg +3 -0
  41. data/app/assets/images/kaui/search.svg +4 -0
  42. data/app/assets/images/kaui/setting/account.svg +10 -0
  43. data/app/assets/images/kaui/setting/analytics.svg +7 -0
  44. data/app/assets/images/kaui/setting/custom-field.svg +5 -0
  45. data/app/assets/images/kaui/setting/e-notifications.svg +6 -0
  46. data/app/assets/images/kaui/setting/plugins.svg +7 -0
  47. data/app/assets/images/kaui/setting/plus.svg +3 -0
  48. data/app/assets/images/kaui/setting/reset.svg +4 -0
  49. data/app/assets/images/kaui/setting/tag-definitions.svg +5 -0
  50. data/app/assets/images/kaui/setting/tags.svg +4 -0
  51. data/app/assets/images/kaui/setting/tenants.svg +6 -0
  52. data/app/assets/images/kaui/setting/users.svg +6 -0
  53. data/app/assets/images/kaui/setting.svg +4 -0
  54. data/app/assets/images/kaui/sidebar/account.svg +4 -0
  55. data/app/assets/images/kaui/sidebar/audit.svg +5 -0
  56. data/app/assets/images/kaui/sidebar/custom-fields.svg +5 -0
  57. data/app/assets/images/kaui/sidebar/invoices.svg +5 -0
  58. data/app/assets/images/kaui/sidebar/payments.svg +5 -0
  59. data/app/assets/images/kaui/sidebar/queues.svg +5 -0
  60. data/app/assets/images/kaui/sidebar/subscriptions.svg +6 -0
  61. data/app/assets/images/kaui/sidebar/tags.svg +5 -0
  62. data/app/assets/images/kaui/sidebar/timeline.svg +5 -0
  63. data/app/assets/images/kaui/sign_in_background.svg +57 -0
  64. data/app/assets/images/kaui/sort-down.svg +3 -0
  65. data/app/assets/images/kaui/sort-up.svg +3 -0
  66. data/app/assets/images/kaui/subscription/add-on.svg +7 -0
  67. data/app/assets/images/kaui/subscription/cancel.svg +6 -0
  68. data/app/assets/images/kaui/subscription/change.svg +6 -0
  69. data/app/assets/images/kaui/subscription/date.svg +6 -0
  70. data/app/assets/images/kaui/subscription/pause.svg +4 -0
  71. data/app/assets/images/kaui/timeline/authorize.svg +5 -0
  72. data/app/assets/images/kaui/timeline/capture.svg +5 -0
  73. data/app/assets/images/kaui/timeline/chargeback.svg +3 -0
  74. data/app/assets/images/kaui/timeline/credit.svg +6 -0
  75. data/app/assets/images/kaui/timeline/invoice.svg +5 -0
  76. data/app/assets/images/kaui/timeline/purchase.svg +5 -0
  77. data/app/assets/images/kaui/timeline/refund.svg +4 -0
  78. data/app/assets/images/kaui/timeline/void.svg +4 -0
  79. data/app/assets/images/kaui/view-doc.svg +6 -0
  80. data/app/assets/images/kaui/warning.png +0 -0
  81. data/app/assets/javascripts/application.js +2 -2
  82. data/app/assets/javascripts/kaui/kaui_override.js +232 -0
  83. data/app/assets/javascripts/kaui/multi_functions_bar_utils.js +125 -24
  84. data/app/assets/stylesheets/application.css +13 -1
  85. data/app/assets/stylesheets/kaui/account.css +2028 -14
  86. data/app/assets/stylesheets/kaui/account_timeline.css +183 -0
  87. data/app/assets/stylesheets/kaui/admin_allowed_users.css +260 -0
  88. data/app/assets/stylesheets/kaui/audit.css +26 -16
  89. data/app/assets/stylesheets/kaui/audit_logs.css +443 -0
  90. data/app/assets/stylesheets/kaui/auth_pages.css +72 -0
  91. data/app/assets/stylesheets/kaui/breadcrumb.css +38 -0
  92. data/app/assets/stylesheets/kaui/chargebacks.css +118 -0
  93. data/app/assets/stylesheets/kaui/clock.css +103 -0
  94. data/app/assets/stylesheets/kaui/common.css +1744 -401
  95. data/app/assets/stylesheets/kaui/custom_fields.css +546 -0
  96. data/app/assets/stylesheets/kaui/dashboard.css +26 -0
  97. data/app/assets/stylesheets/kaui/datatable.css +114 -56
  98. data/app/assets/stylesheets/kaui/header.css +221 -114
  99. data/app/assets/stylesheets/kaui/home.css +89 -62
  100. data/app/assets/stylesheets/kaui/invoice.css +1061 -27
  101. data/app/assets/stylesheets/kaui/kaui.css +217 -145
  102. data/app/assets/stylesheets/kaui/overdue.css +5 -3
  103. data/app/assets/stylesheets/kaui/payment.css +1102 -13
  104. data/app/assets/stylesheets/kaui/queues.css +269 -0
  105. data/app/assets/stylesheets/kaui/refunds.css +185 -0
  106. data/app/assets/stylesheets/kaui/role_definitions.css +111 -0
  107. data/app/assets/stylesheets/kaui/sidebar.css +122 -0
  108. data/app/assets/stylesheets/kaui/subscription.css +677 -0
  109. data/app/assets/stylesheets/kaui/tag_definitions.css +524 -0
  110. data/app/assets/stylesheets/kaui/tags.css +592 -121
  111. data/app/assets/stylesheets/kaui/tenants.css +1478 -0
  112. data/app/assets/stylesheets/kaui/tooltip.css +9 -5
  113. data/app/assets/stylesheets/kaui/wallets.css +121 -0
  114. data/app/controllers/kaui/accounts_controller.rb +3 -2
  115. data/app/controllers/kaui/admin_tenants_controller.rb +33 -0
  116. data/app/controllers/kaui/custom_fields_controller.rb +1 -1
  117. data/app/controllers/kaui/engine_controller.rb +1 -2
  118. data/app/controllers/kaui/engine_controller_util.rb +5 -7
  119. data/app/controllers/kaui/home_controller.rb +24 -17
  120. data/app/controllers/kaui/invoices_controller.rb +4 -15
  121. data/app/controllers/kaui/payments_controller.rb +1 -1
  122. data/app/controllers/kaui/sessions_controller.rb +1 -0
  123. data/app/controllers/kaui/tag_definitions_controller.rb +1 -0
  124. data/app/helpers/kaui/account_helper.rb +13 -0
  125. data/app/helpers/kaui/plugin_helper.rb +27 -0
  126. data/app/views/kaui/account_custom_fields/index.html.erb +95 -29
  127. data/app/views/kaui/account_emails/_account_emails_table.html.erb +13 -3
  128. data/app/views/kaui/account_emails/_form.html.erb +23 -6
  129. data/app/views/kaui/account_emails/new.html.erb +12 -6
  130. data/app/views/kaui/account_tags/_form_bar.html.erb +10 -1
  131. data/app/views/kaui/account_tags/index.html.erb +103 -24
  132. data/app/views/kaui/account_timelines/_multi_functions_bar.html.erb +302 -69
  133. data/app/views/kaui/account_timelines/show.html.erb +360 -254
  134. data/app/views/kaui/accounts/_account_details.html.erb +165 -0
  135. data/app/views/kaui/accounts/_account_filterbar.html.erb +70 -80
  136. data/app/views/kaui/accounts/_add_parent.html.erb +26 -0
  137. data/app/views/kaui/accounts/_billing_details.html.erb +196 -0
  138. data/app/views/kaui/accounts/_close_account_modal.html.erb +62 -40
  139. data/app/views/kaui/accounts/_form_account.html.erb +157 -0
  140. data/app/views/kaui/accounts/_functions_bar.html.erb +606 -0
  141. data/app/views/kaui/accounts/_link_parent_modal.html.erb +1 -1
  142. data/app/views/kaui/accounts/_link_parent_to_modal.html.erb +62 -0
  143. data/app/views/kaui/accounts/_multi_functions_bar.html.erb +67 -28
  144. data/app/views/kaui/accounts/_payment_gateways.html.erb +43 -0
  145. data/app/views/kaui/accounts/_personal_details.html.erb +67 -0
  146. data/app/views/kaui/accounts/edit.html.erb +15 -9
  147. data/app/views/kaui/accounts/index.html.erb +77 -27
  148. data/app/views/kaui/accounts/new.html.erb +14 -8
  149. data/app/views/kaui/accounts/show.html.erb +17 -11
  150. data/app/views/kaui/admin/index.html.erb +44 -19
  151. data/app/views/kaui/admin_allowed_users/_form.html.erb +123 -31
  152. data/app/views/kaui/admin_allowed_users/edit.html.erb +15 -9
  153. data/app/views/kaui/admin_allowed_users/index.html.erb +150 -30
  154. data/app/views/kaui/admin_allowed_users/new.html.erb +14 -8
  155. data/app/views/kaui/admin_allowed_users/show.html.erb +137 -32
  156. data/app/views/kaui/admin_tenants/_add_allowed_user_modal.html.erb +42 -15
  157. data/app/views/kaui/admin_tenants/_clock.html.erb +72 -0
  158. data/app/views/kaui/admin_tenants/_form.html.erb +32 -20
  159. data/app/views/kaui/admin_tenants/_form_catalog_translation.erb +21 -8
  160. data/app/views/kaui/admin_tenants/_form_invoice_template.erb +25 -9
  161. data/app/views/kaui/admin_tenants/_form_invoice_translation.erb +36 -20
  162. data/app/views/kaui/admin_tenants/_form_plugin_config.erb +16 -20
  163. data/app/views/kaui/admin_tenants/_show_catalog.erb +13 -6
  164. data/app/views/kaui/admin_tenants/_show_catalog_simple.erb +95 -46
  165. data/app/views/kaui/admin_tenants/_show_catalog_xml.erb +62 -37
  166. data/app/views/kaui/admin_tenants/_show_overdue.erb +91 -75
  167. data/app/views/kaui/admin_tenants/_tenant_details.html.erb +106 -17
  168. data/app/views/kaui/admin_tenants/_tenants_table.html.erb +67 -6
  169. data/app/views/kaui/admin_tenants/_useful_links.html.erb +21 -16
  170. data/app/views/kaui/admin_tenants/index.html.erb +35 -11
  171. data/app/views/kaui/admin_tenants/index.js.erb +3 -0
  172. data/app/views/kaui/admin_tenants/new.html.erb +19 -13
  173. data/app/views/kaui/admin_tenants/new_catalog.html.erb +230 -98
  174. data/app/views/kaui/admin_tenants/new_overdue_config.html.erb +152 -80
  175. data/app/views/kaui/admin_tenants/new_plan_currency.html.erb +44 -30
  176. data/app/views/kaui/admin_tenants/show.html.erb +211 -78
  177. data/app/views/kaui/admin_tenants/show.js.erb +3 -0
  178. data/app/views/kaui/audit_logs/_multi_functions_bar.html.erb +298 -101
  179. data/app/views/kaui/audit_logs/index.html.erb +137 -38
  180. data/app/views/kaui/bundle_tags/_form_bar.html.erb +11 -4
  181. data/app/views/kaui/bundles/_bundle_details.html.erb +24 -12
  182. data/app/views/kaui/bundles/index.html.erb +79 -104
  183. data/app/views/kaui/bundles/pause_resume.html.erb +73 -38
  184. data/app/views/kaui/chargebacks/_form.html.erb +35 -18
  185. data/app/views/kaui/chargebacks/new.html.erb +16 -9
  186. data/app/views/kaui/charges/_form.html.erb +54 -42
  187. data/app/views/kaui/charges/new.html.erb +15 -8
  188. data/app/views/kaui/components/breadcrumb/_breadcrumb.html.erb +146 -0
  189. data/app/views/kaui/components/button/_button.html.erb +16 -0
  190. data/app/views/kaui/components/dashboard/_card.html.erb +15 -0
  191. data/app/views/kaui/components/dashboard/_setting.html.erb +15 -0
  192. data/app/views/kaui/components/form_input/_form_input.html.erb +4 -0
  193. data/app/views/kaui/components/form_password/_form_password.html.erb +6 -0
  194. data/app/views/kaui/components/logo/_logo.html.erb +1 -0
  195. data/app/views/kaui/components/menu_dropdown/_menu_dropdown.html.erb +59 -0
  196. data/app/views/kaui/components/search_input/_search_input.html.erb +81 -0
  197. data/app/views/kaui/credits/_form.html.erb +42 -25
  198. data/app/views/kaui/credits/new.html.erb +15 -8
  199. data/app/views/kaui/custom_fields/_form.html.erb +37 -25
  200. data/app/views/kaui/custom_fields/_list_bar.html.erb +11 -10
  201. data/app/views/kaui/custom_fields/index.html.erb +121 -27
  202. data/app/views/kaui/custom_fields/new.html.erb +19 -8
  203. data/app/views/kaui/errors/500.html.erb +1 -1
  204. data/app/views/kaui/home/index.html.erb +77 -30
  205. data/app/views/kaui/invoice_items/_edit_form.html.erb +30 -14
  206. data/app/views/kaui/invoice_items/edit.html.erb +15 -7
  207. data/app/views/kaui/invoice_tags/_form_bar.html.erb +13 -3
  208. data/app/views/kaui/invoices/_invoice_filterbar.html.erb +53 -69
  209. data/app/views/kaui/invoices/_invoice_table.html.erb +77 -92
  210. data/app/views/kaui/invoices/_multi_functions_bar.html.erb +351 -140
  211. data/app/views/kaui/invoices/index.html.erb +89 -27
  212. data/app/views/kaui/invoices/show.html.erb +392 -80
  213. data/app/views/kaui/layouts/kaui_account_sidebar.html.erb +42 -0
  214. data/app/views/kaui/layouts/kaui_application.html.erb +29 -15
  215. data/app/views/kaui/layouts/kaui_flash.html.erb +82 -31
  216. data/app/views/kaui/layouts/kaui_navbar.html.erb +109 -82
  217. data/app/views/kaui/layouts/kaui_setting_sidebar.html.erb +36 -0
  218. data/app/views/kaui/payment_methods/_form.html.erb +32 -11
  219. data/app/views/kaui/payment_methods/_new_creditcard_payment_method.html.erb +35 -34
  220. data/app/views/kaui/payment_methods/_payment_methods_details_table.html.erb +27 -29
  221. data/app/views/kaui/payment_methods/_payment_methods_table.html.erb +116 -38
  222. data/app/views/kaui/payment_methods/_plugin_properties.html.erb +19 -9
  223. data/app/views/kaui/payment_methods/new.html.erb +14 -8
  224. data/app/views/kaui/payments/_form.html.erb +30 -13
  225. data/app/views/kaui/payments/_multi_functions_bar.html.erb +351 -141
  226. data/app/views/kaui/payments/_payment_filterbar.html.erb +63 -79
  227. data/app/views/kaui/payments/_payment_invoice_table.html.erb +105 -0
  228. data/app/views/kaui/payments/_payment_table.html.erb +4 -67
  229. data/app/views/kaui/payments/index.html.erb +90 -26
  230. data/app/views/kaui/payments/new.html.erb +15 -8
  231. data/app/views/kaui/payments/show.html.erb +222 -28
  232. data/app/views/kaui/queues/index.html.erb +329 -111
  233. data/app/views/kaui/refunds/_form.html.erb +68 -45
  234. data/app/views/kaui/refunds/new.html.erb +15 -8
  235. data/app/views/kaui/role_definitions/_form.html.erb +104 -17
  236. data/app/views/kaui/role_definitions/new.html.erb +15 -8
  237. data/app/views/kaui/sessions/_form.html.erb +9 -19
  238. data/app/views/kaui/sessions/new.html.erb +10 -9
  239. data/app/views/kaui/subscriptions/_cancel_by_date_modal.html.erb +65 -35
  240. data/app/views/kaui/subscriptions/_edit_form.html.erb +66 -35
  241. data/app/views/kaui/subscriptions/_form.html.erb +63 -32
  242. data/app/views/kaui/subscriptions/_subscriptions_table.html.erb +215 -57
  243. data/app/views/kaui/subscriptions/edit.html.erb +19 -8
  244. data/app/views/kaui/subscriptions/edit_bcd.erb +46 -16
  245. data/app/views/kaui/subscriptions/new.html.erb +22 -15
  246. data/app/views/kaui/tag_definitions/_form.html.erb +51 -30
  247. data/app/views/kaui/tag_definitions/index.html.erb +151 -40
  248. data/app/views/kaui/tag_definitions/new.html.erb +15 -8
  249. data/app/views/kaui/tags/index.html.erb +136 -47
  250. data/app/views/kaui/tenants/_form.html.erb +8 -5
  251. data/app/views/kaui/tenants/index.html.erb +15 -9
  252. data/app/views/kaui/transactions/_control_plugin_names.html.erb +18 -10
  253. data/app/views/kaui/transactions/_form.html.erb +86 -25
  254. data/app/views/kaui/transactions/new.html.erb +15 -9
  255. data/config/routes.rb +1 -0
  256. data/lib/kaui/engine.rb +11 -0
  257. data/lib/kaui/version.rb +1 -1
  258. data/lib/kaui.rb +0 -1
  259. metadata +120 -2
@@ -1,203 +1,292 @@
1
- <div class="search">
2
-
3
- <div class="column-block">
4
-
5
- <h1>Account timeline</h1>
6
-
7
- <form class="form-horizontal">
8
- <div class="form-group">
9
- <label for="bundles" class="col-sm-2 control-label">Filter by bundle</label>
10
-
11
- <div class="col-sm-10">
12
- <%= select_tag 'bundles', options_for_select([''] + @bundle_names.values.sort, @selected_bundle || 'all'), :class => 'form-control' %>
1
+ <div class="kaui-container kaui-account-timelines-show">
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="account-timeline">
6
+ <div class="d-flex flex-column ">
7
+ <div class="account-timeline-header mb-4">
8
+ <div class="d-flex align-items-center">
9
+ <h2>Account Timeline</h2>
10
+ </div>
11
+ <span>
12
+ <%= render :partial => 'multi_functions_bar' %>
13
+ </span>
13
14
  </div>
14
- </div>
15
- <div class="form-group">
16
- <label for="events" class="col-sm-2 control-label">Filter by event type</label>
17
-
18
- <div class="col-sm-10 ">
19
- <%= select_tag 'event_types', options_for_select('<option value="all">ALL</option><option value="invoice">INVOICE</option><option value="payment">PAYMENT</option><option value="entitlement">ENTITLEMENTS</option>'.html_safe), :class => 'form-control' %>
20
- </div>
21
- </div>
22
- </form>
23
15
 
24
- <%= render :partial => 'multi_functions_bar' %>
25
-
26
- <hr/>
27
-
28
- <table id="timeline-table" class="table table-condensed mobile-data">
29
- <thead>
30
- <tr>
31
- <th>Effective Date</th>
32
- <th>Bundle</th>
33
- <th>Event Type</th>
34
- <th>Details</th>
35
- <th>Reason Code / Comments</th>
36
- </tr>
37
- </thead>
38
- <tbody>
39
- <% if @account.present? %>
40
- <% @invoices.each do |invoice_stub| %>
41
- <% if invoice_stub.bundle_keys.present? %>
42
- <% bundles = invoice_stub.bundle_keys.split(',').map { |bundle_key| @bundle_names[bundle_key] }.join(',') %>
43
- <% end %>
44
- <% if invoice_stub.invoice_id.present? && @invoices_by_id.has_key?(invoice_stub.invoice_id) %>
45
- <% invoice = @invoices_by_id[invoice_stub.invoice_id] %>
46
- <% else %>
47
- <% invoice = invoice_stub %>
48
- <% end %>
49
- <tr title="<%= bundles %>" data-event_type="INVOICE">
50
- <td>
51
- <% if invoice.target_date.present? %>
52
- <%= invoice.target_date %>
53
- <% else %>
54
- [unknown]
55
- <% end %>
56
- </td>
57
- <td>
58
- <% if invoice_stub.bundle_keys.present? %>
59
- <ul>
60
- <% invoice_stub.bundle_keys.split(',').each do |bundle_key| %>
61
- <li><%= truncate_uuid(@bundle_names[bundle_key]) %></li>
16
+ <form class="form-horizontal d-flex gap-2 mb-4 pb-3 border-bottom mx-0">
17
+ <div class="form-group p-0 w-100">
18
+ <label for="search" class="control-label">Search</label>
19
+ <div class="input-group">
20
+ <input type="text" id="search" class="form-control m-0" placeholder="Search">
21
+ </div>
22
+ </div>
23
+ <div class="form-group p-0 w-100 max-width-148">
24
+ <label for="bundles" class="control-label">Filter by bundle</label>
25
+ <div class="d-flex">
26
+ <%= select_tag 'bundles', options_for_select(['All'] + @bundle_names.values.sort, @selected_bundle || 'all'), :class => 'form-control' %>
27
+ </div>
28
+ </div>
29
+ <div class="form-group p-0 w-100 max-width-148">
30
+ <label for="payment_filter" class="control-label">Payment</label>
31
+ <div class="d-flex">
32
+ <%= select_tag 'payment_filter', options_for_select('<option value="all">ALL</option><option value="authorize">AUTHORIZE</option><option value="purchase">PURCHASE</option><option value="capture">CAPTURE</option><option value="credit">CREDIT</option><option value="refund">REFUND</option><option value="void">VOID</option><option value="chargeback">CHARGEBACK</option>'.html_safe), :class => 'form-control' %>
33
+ </div>
34
+ </div>
35
+ <div class="form-group p-0 w-100 max-width-148">
36
+ <label for="subscription_filter" class="control-label">Subscription</label>
37
+ <div class="d-flex">
38
+ <%= select_tag 'subscription_filter', options_for_select('<option value="all">ALL</option><option value="start_entitlement">START_ENTITLEMENT</option><option value="pause_entitlement">PAUSE_ENTITLEMENT</option><option value="resume_entitlement">RESUME_ENTITLEMENT</option><option value="stop_entitlement">STOP_ENTITLEMENT</option><option value="phase">PHASE</option><option value="change">CHANGE</option>'.html_safe), :class => 'form-control' %>
39
+ </div>
40
+ </div>
41
+ <div class="form-group p-0 w-100 max-width-148">
42
+ <label for="billing_filter" class="control-label">Billing</label>
43
+ <div class="d-flex">
44
+ <%= select_tag 'billing_filter', options_for_select('<option value="all">ALL</option><option value="invoice">INVOICE</option><option value="start_billing">START_BILLING</option><option value="pause_billing">PAUSE_BILLING</option><option value="resume_billing">RESUME_BILLING</option><option value="stop_billing">STOP_BILLING</option>'.html_safe), :class => 'form-control' %>
45
+ </div>
46
+ </div>
47
+ <div class="form-group p-0 d-flex align-self-end justify-content-end w-100">
48
+ <button type="button" id="clear-all-filters" class="dots-menu link-button">Clear Filters</button>
49
+ </div>
50
+ </form>
51
+
52
+ <div>
53
+ <% if @account.present? %>
54
+ <% @invoices.each do |invoice_stub| %>
55
+ <% if invoice_stub.bundle_keys.present? %>
56
+ <% bundles = invoice_stub.bundle_keys.split(',').map { |bundle_key| @bundle_names[bundle_key] }.join(',') %>
57
+ <% end %>
58
+ <% if invoice_stub.invoice_id.present? && @invoices_by_id.has_key?(invoice_stub.invoice_id) %>
59
+ <% invoice = @invoices_by_id[invoice_stub.invoice_id] %>
60
+ <% else %>
61
+ <% invoice = invoice_stub %>
62
+ <% end %>
63
+ <div title="<%= bundles %>" data-event-type="INVOICE">
64
+ <div class="datetime-container">
65
+ <% if invoice.target_date.present? %>
66
+ <%= invoice.target_date %>
67
+ <% else %>
68
+ [unknown]
69
+ <% end %>
70
+ </div>
71
+ <div class="account-timeline-card d-flex gap-3">
72
+ <span class="icon-container">
73
+ <%= image_tag("kaui/timeline/invoice.svg", width: 20, height: 20) %>
74
+ </span>
75
+
76
+ <div class="d-flex justify-content-start flex-column gap-3 w-100 row">
77
+ <h3>INVOICE</h3>
78
+ <div class="w-100">
79
+ <div class="row account-timeline-card-detail">
80
+ <div class="col-sm-4">
81
+ <div class="mb-3">
82
+ <b>Amount</b>
83
+ <p>
84
+ <%= humanized_money_with_symbol invoice.amount_to_money %>(<%= @account.currency %>)<span class="hide" title="<%= invoice.invoice_number %>"></span>
85
+ </p>
86
+ </div>
87
+ <div>
88
+ <b>Refund Adjustment</b>
89
+ <p>
90
+ <%= humanized_money_with_symbol invoice.refund_adjustment_to_money %>(<%= @account.currency %>)
91
+ </p>
92
+ </div>
93
+ <% if invoice_stub.audit_logs.present? %>
94
+ <div class="mt-3">
95
+ <b>Reason Code / Comments</b>
96
+ <p>
97
+ <% invoice_stub.audit_logs.each do |entry| %>
98
+ <%= Kaui::AuditLog.description(entry) %>
99
+ <% end %>
100
+ </p>
101
+ </div>
102
+ <% end %>
103
+ </div>
104
+ <div class="col-sm-4">
105
+ <div class="mb-3">
106
+ <b>Balance</b>
107
+ <p>
108
+ <%= humanized_money_with_symbol invoice.balance_to_money %>(<%= @account.currency %>)
109
+ </p>
110
+ </div>
111
+ <div>
112
+ <b>Invoice number</b>
113
+ <p><%= link_to invoice.invoice_number, account_invoice_path(invoice.account_id, invoice.invoice_id) %></p>
114
+ </div>
115
+ </div>
116
+ <div class="col-sm-4">
117
+ <div class="mb-3">
118
+ <b>Credit Adjustment</b>
119
+ <p>
120
+ <%= humanized_money_with_symbol invoice.credit_adjustment_to_money %>(<%= @account.currency %>)
121
+ </p>
122
+ </div>
123
+ <% if invoice_stub.bundle_keys.present? %>
124
+ <div>
125
+ <b>Bundle</b>
126
+ <p>
127
+ <% invoice_stub.bundle_keys.split(',').each do |bundle_key| %>
128
+ <%= truncate_uuid(@bundle_names[bundle_key]) %>
129
+ <% end %>
130
+ </p>
131
+ </div>
62
132
  <% end %>
63
- </ul>
64
- <% end %>
65
- </td>
66
- <td>INVOICE</td>
67
- <td>
68
- <ul>
69
- <li><span class="hide" title="<%= invoice.invoice_number %>"></span>
70
- <%= 'Amount:' %> <%= humanized_money_with_symbol invoice.amount_to_money %>
71
- (<%= @account.currency %>)
72
- </li>
73
- <li><%= 'Balance:' %> <%= humanized_money_with_symbol invoice.balance_to_money %>
74
- (<%= @account.currency %>)
75
- </li>
76
- </li>
77
- <% if invoice.credit_adj.present? && invoice.credit_adj > 0 %>
78
- <li><%= 'Credit adjustment:' %> <%= humanized_money_with_symbol invoice.credit_adjustment_to_money %>
79
- (<%= @account.currency %>)
80
- </li>
81
- <% end %>
82
- <% if invoice.refund_adj.present? && invoice.refund_adj < 0 %>
83
- <li><%= 'Refund adjustment:' %> <%= humanized_money_with_symbol invoice.refund_adjustment_to_money %>
84
- (<%= @account.currency %>)
85
- </li>
86
- <% end %>
87
- <li><%= 'Invoice #' %>&nbsp;<%= link_to invoice.invoice_number, account_invoice_path(invoice.account_id, invoice.invoice_id) %></li>
88
- </ul>
89
- </td>
90
- <td>
91
- <% if invoice_stub.audit_logs.present? %>
92
- <ul>
93
- <% invoice_stub.audit_logs.each do |entry| %>
94
- <li><%= Kaui::AuditLog.description(entry) %></li>
95
- <% end %>
96
- </ul>
97
- <% end %>
98
- </td>
99
- </tr>
133
+
134
+ </div>
135
+ </div>
136
+ </div>
137
+ </div>
138
+ </div>
139
+ </div>
100
140
  <% end %>
141
+
101
142
  <% @payments.each do |payment| %>
102
- <% if payment.target_invoice_id.present? %>
103
- <% bundles = @bundle_names_by_invoice_id[payment.target_invoice_id].to_a.join(',') %>
104
- <% invoice = @invoices_by_id[payment.target_invoice_id] %>
105
- <% else %>
106
- <% bundles = nil %>
107
- <% invoice = nil %>
108
- <% end %>
109
- <% payment.transactions.each do |transaction| %>
110
- <tr title="<%= bundles %>" data-event_type="PAYMENT">
111
- <td>
112
- <% if transaction.effective_date.present? %>
113
- <%= format_date(transaction.effective_date, @account.time_zone).html_safe %>
114
- <% else %>
115
- [unknown]
116
- <% end %>
117
- </td>
118
- <td>
119
- <% if @bundle_keys_by_invoice_id[payment.target_invoice_id].present? %>
120
- <ul>
121
- <% @bundle_keys_by_invoice_id[payment.target_invoice_id].each do |bundle_key| %>
122
- <li><%= truncate_uuid(@bundle_names[bundle_key]) %></li>
123
- <% end %>
124
- </ul>
125
- <% end %>
126
- </td>
127
- <td><%= transaction.transaction_type %></td>
128
- <td>
129
- <ul>
130
- <li>
143
+ <% if payment.target_invoice_id.present? %>
144
+ <% bundles = @bundle_names_by_invoice_id[payment.target_invoice_id].to_a.join(',') %>
145
+ <% invoice = @invoices_by_id[payment.target_invoice_id] %>
146
+ <% else %>
147
+ <% bundles = nil %>
148
+ <% invoice = nil %>
149
+ <% end %>
150
+ <% payment.transactions.each do |transaction| %>
151
+ <div title="<%= bundles %>" data-event-type="<%= transaction.transaction_type %>">
152
+ <div class="datetime-container">
153
+ <% if transaction.effective_date.present? %>
154
+ <%= format_date(transaction.effective_date, @account.time_zone).html_safe %>
155
+ <% else %>
156
+ [unknown]
157
+ <% end %>
158
+ </div>
159
+ <div class="account-timeline-card d-flex gap-3">
160
+ <span class="icon-container">
161
+ <%= image_tag("kaui/timeline/#{transaction.transaction_type.downcase}.svg", width: 20, height: 20) %>
162
+ </span>
163
+
164
+ <div class="d-flex justify-content-start flex-column gap-3 w-100 row">
165
+ <h3><%= transaction.transaction_type %></h3>
166
+ <div class="w-100">
167
+ <div class="row account-timeline-card-detail">
168
+ <div class="col-sm-4">
131
169
  <% unless transaction.transaction_type == 'VOID' %>
132
- <%= 'Amount:' %>&nbsp;<%= humanized_money_with_symbol Kaui::Transaction.amount_to_money(transaction) %>
133
- (<%= transaction.currency %>)
170
+ <div class="mb-3">
171
+ <b>Amount</b>
172
+ <p>
173
+ <%= humanized_money_with_symbol Kaui::Transaction.amount_to_money(transaction) %>(<%= transaction.currency %>)
174
+ </p>
175
+ </div>
134
176
  <% end %>
135
- </li>
136
- <li>
137
- <%= colored_transaction_status(transaction.status) %>
138
- </li>
139
- <li><%= 'Payment #' %>&nbsp;<%= link_to payment.payment_number, account_payment_path(payment.account_id, payment.payment_id) %></li>
140
- <% unless invoice.nil? %>
141
- <li><%= 'Invoice #' %>&nbsp;<%= link_to invoice.invoice_number, account_invoice_path(invoice.account_id, invoice.invoice_id) %></li>
142
- <% end %>
143
- </ul>
144
- </td>
145
- <td>
146
- <% if transaction.audit_logs.present? %>
147
- <ul>
148
- <% transaction.audit_logs
149
- .map { |entry| Kaui::AuditLog.description(entry) }
150
- .chunk { |x| x }
151
- .map(&:first)
152
- .each do |entry| %>
153
- <li><%= entry %></li>
154
- <% end %>
155
- </ul>
156
- <% end %>
157
- </td>
158
- </tr>
159
- <% end %>
160
- <% end %>
161
- <% @bundles.each do |bundle| %>
162
- <% bundle.subscriptions.each do |sub| %>
163
- <% sub.events.each do |event| %>
164
- <!-- SKIP SERVICE_STATE_CHANGE -->
165
- <% next if event.event_type == 'SERVICE_STATE_CHANGE' %>
166
- <tr title="<%= @bundle_names[bundle.external_key] %>" data-event_type="<%= event.event_type %>">
167
- <td>
168
- <% if event.effective_date.present? %>
169
- <%= format_date(event.effective_date, @account.time_zone).html_safe %>
170
- <% else %>
171
- [unknown]
177
+ <div>
178
+ <b>Payment Number</b>
179
+ <p><%= link_to payment.payment_number, account_payment_path(payment.account_id, payment.payment_id) %></p>
180
+ </div>
181
+ </div>
182
+ <div class="col-sm-4">
183
+ <div class="mb-3">
184
+ <b>Status</b>
185
+ <p class="transaction-status"><%= colored_transaction_status(transaction.status) %></p>
186
+ </div>
187
+ <% unless invoice.nil? %>
188
+ <div>
189
+ <b>Invoice Number</b>
190
+ <p><%= link_to invoice.invoice_number, account_invoice_path(invoice.account_id, invoice.invoice_id) %></p>
191
+ </div>
192
+ <% end %>
193
+ </div>
194
+ <div class="col-sm-4">
195
+ <% if @bundle_keys_by_invoice_id[payment.target_invoice_id].present? %>
196
+ <div class="mb-3">
197
+ <b>Bundle</b>
198
+ <p>
199
+ <% @bundle_keys_by_invoice_id[payment.target_invoice_id].each do |bundle_key| %>
200
+ <%= truncate_uuid(@bundle_names[bundle_key]) %>
201
+ <% end %>
202
+ </p>
203
+ </div>
172
204
  <% end %>
173
- </td>
174
- <td>
175
- <ul>
176
- <li><%= truncate_uuid(@bundle_names[bundle.external_key]) %></li>
177
- </ul>
178
- </td>
179
- <td><%= event.event_type %></td>
180
- <td>
181
- <ul>
182
- <li><span class="hide" title="<%= sub.product_category %>"></span><%= event.phase %></li>
183
- </ul>
184
- </td>
185
- <td>
186
- <% if event.audit_logs.present? %>
187
- <ul>
188
- <% event.audit_logs.each do |entry| %>
189
- <li><%= Kaui::AuditLog.description(entry) %></li>
205
+ <% if transaction.audit_logs.present? %>
206
+ <div>
207
+ <b>Reason Code / Comments</b>
208
+ <p>
209
+ <% transaction.audit_logs
210
+ .map { |entry| Kaui::AuditLog.description(entry) }
211
+ .chunk { |x| x }
212
+ .map(&:first)
213
+ .each do |entry| %>
214
+ <%= entry %>
190
215
  <% end %>
191
- </ul>
216
+ </p>
217
+ </div>
192
218
  <% end %>
193
- </td>
194
- </tr>
195
- <% end %>
219
+ </div>
220
+ </div>
221
+ </div>
222
+ </div>
223
+ </div>
224
+ </div>
225
+ <% end %>
226
+ <% end %>
227
+
228
+ <% @bundles.each do |bundle| %>
229
+ <% bundle.subscriptions.each do |sub| %>
230
+ <% sub.events.each do |event| %>
231
+ <% next if event.event_type == 'SERVICE_STATE_CHANGE' %>
232
+ <div title="<%= @bundle_names[bundle.external_key] %>" data-event-type="<%= event.event_type %>">
233
+ <div class="datetime-container">
234
+ <% if event.effective_date.present? %>
235
+ <%= format_date(event.effective_date, @account.time_zone).html_safe %>
236
+ <% else %>
237
+ [unknown]
238
+ <% end %>
239
+ </div>
240
+ <div class="account-timeline-card d-flex gap-3">
241
+ <span class="icon-container">
242
+ <%= image_tag("kaui/timeline/invoice.svg", width: 20, height: 20) %>
243
+ </span>
244
+
245
+ <div class="d-flex justify-content-start flex-column gap-3 w-100 row">
246
+ <h3><%= event.event_type %></h3>
247
+ <div class="w-100">
248
+ <div class="row account-timeline-card-detail">
249
+ <div class="col-sm-4">
250
+ <div>
251
+ <b>Details</b>
252
+ <p>
253
+ <%= event.phase %><span class="hide" title="<%= sub.product_category %>"></span>
254
+ </p>
255
+ </div>
256
+
257
+ </div>
258
+ <div class="col-sm-4">
259
+ <div>
260
+ <b>Bundle</b>
261
+ <p>
262
+ <%= truncate_uuid(@bundle_names[bundle.external_key]) %>
263
+ </p>
264
+ </div>
265
+ </div>
266
+ <div class="col-sm-4">
267
+ <div>
268
+ <b>Reason Code / Comments</b>
269
+ <p>
270
+ <% if event.audit_logs.present? %>
271
+ <% event.audit_logs.each do |entry| %>
272
+ <%= Kaui::AuditLog.description(entry) %>
273
+ <% end %>
274
+ <% end %>
275
+ </p>
276
+ </div>
277
+ </div>
278
+ </div>
279
+ </div>
280
+ </div>
281
+ </div>
282
+ </div>
196
283
  <% end %>
284
+ <% end %>
197
285
  <% end %>
198
- <% end %>
199
- </tbody>
200
- </table>
286
+ <% end %>
287
+ </div>
288
+ </div>
289
+ </div>
201
290
  </div>
202
291
  </div>
203
292
 
@@ -208,7 +297,7 @@
208
297
  });
209
298
  }
210
299
 
211
- eventsOrder = ["START_ENTITLEMENT", "START_BILLING", "PAUSE_ENTITLEMENT", "PAUSE_BILLING", "RESUME_ENTITLEMENT",
300
+ var eventsOrder = ["START_ENTITLEMENT", "START_BILLING", "PAUSE_ENTITLEMENT", "PAUSE_BILLING", "RESUME_ENTITLEMENT",
212
301
  "RESUME_BILLING", "PHASE", "CHANGE", "STOP_ENTITLEMENT", "STOP_BILLING", "INVOICE", "AUTHORIZE", "PURCHASE", "CAPTURE",
213
302
  "CREDIT", "REFUND", "VOID", "CHARGEBACK"];
214
303
 
@@ -227,7 +316,7 @@
227
316
  function extractTitleAttributeFromText(txt) {
228
317
  // Ugly - better way of doing this?
229
318
  var matches = txt.match(/title="\w+"/g);
230
- if (matches == null || matches.size == 0) {
319
+ if (matches == null || matches.length == 0) {
231
320
  return null;
232
321
  }
233
322
  return matches[0].split('=')[1];
@@ -263,75 +352,92 @@
263
352
  });
264
353
  }
265
354
 
266
- function filterEachNode(rows) {
267
- var bundle = $("#bundles").val();
268
- var event_to_filter = $('#event_types').val().toUpperCase();
269
-
270
- for (i = 0; i < rows.length; i++)
271
- {
272
- tr = $(rows[i]);
273
-
274
- //filter bundles
275
- if (bundle == "" || tr.attr("title").split(",").indexOf(bundle) >= 0) {
276
- //first level filtering, so can remove hide
277
- tr.removeClass("hide");
355
+ function filterTimeline() {
356
+ var selectedBundle = $("#bundles").val();
357
+ var selectedPayment = $('#payment_filter').val().toUpperCase();
358
+ var selectedSubscription = $('#subscription_filter').val().toUpperCase();
359
+ var selectedBilling = $('#billing_filter').val().toUpperCase();
360
+ var searchQuery = $('#search').val().toLowerCase();
361
+
362
+ // Show all cards initially
363
+ $('.account-timeline-card').parent().show();
364
+
365
+ // Apply all filters to each card
366
+ $('.account-timeline-card').parent().each(function() {
367
+ var $card = $(this);
368
+ var eventType = $card.data('event-type');
369
+ var bundleTitle = $card.attr('title');
370
+ var cardText = $card.text().toLowerCase();
371
+
372
+ var shouldShow = true;
373
+
374
+ if (selectedBundle && selectedBundle !== '' && selectedBundle !== 'All') {
375
+ if (!bundleTitle || bundleTitle.indexOf(selectedBundle) === -1) {
376
+ shouldShow = false;
377
+ }
278
378
  }
279
- else {
280
- //remove tr's not under this filter mode
281
- tr.addClass("hide");
379
+
380
+ // Filter by payment events if not "ALL"
381
+ if (selectedPayment !== "ALL" && shouldShow) {
382
+ if (!eventType || eventType !== selectedPayment) {
383
+ shouldShow = false;
384
+ }
282
385
  }
283
-
284
- //filter events
285
- if ("ALL" != event_to_filter)
286
- filterEvents(tr, event_to_filter);
287
-
288
- //add more filters here
289
- //do not unhide any rows
386
+
387
+ // Filter by subscription events if not "ALL"
388
+ if (selectedSubscription !== "ALL" && shouldShow) {
389
+ if (!eventType || eventType !== selectedSubscription) {
390
+ shouldShow = false;
391
+ }
290
392
  }
291
- }
292
-
293
- function filterEvents(tr, event_to_filter) {
294
- tr_event_type = tr.data().event_type;
295
-
296
- core_events = ["INVOICE", "PAYMENT"]; //events which are not entitlements
297
-
298
- //is tr event not an event in question
299
- tr_event_does_not_match_filter = ("ENTITLEMENT" != event_to_filter &&
300
- tr_event_type != event_to_filter);
301
-
302
- //tr event is not an entitlement
303
- tr_event_is_not_entitlement = ("ENTITLEMENT" == event_to_filter &&
304
- core_events.indexOf(tr_event_type) >= 0);
305
-
306
- if ( tr_event_does_not_match_filter || tr_event_is_not_entitlement )
307
- {
308
- //add hide to all who dont deserve the filter
309
- tr.addClass("hide");
393
+
394
+ // Filter by billing events if not "ALL"
395
+ if (selectedBilling !== "ALL" && shouldShow) {
396
+ if (!eventType || eventType !== selectedBilling) {
397
+ shouldShow = false;
398
+ }
310
399
  }
400
+
401
+ // Apply search filter if query exists
402
+ if (searchQuery && shouldShow) {
403
+ if (cardText.indexOf(searchQuery) === -1) {
404
+ shouldShow = false;
405
+ }
406
+ }
407
+
408
+ // Show or hide the card based on all filters
409
+ if (shouldShow) {
410
+ $card.show();
411
+ } else {
412
+ $card.hide();
413
+ }
414
+ });
311
415
  }
312
416
 
313
- function filterTable()
314
- {
315
- var dataTable = initTable();
316
- var all_nodes = dataTable.fnGetNodes();
317
-
318
- filterEachNode(all_nodes);
319
-
320
- //my rows are filtered, draw table
321
- dataTable.fnDraw();
322
- }
323
-
324
-
325
417
  $(document).ready(function() {
326
- disableLinks();
327
- // When going through the pages of the table, disable links as needed
328
- $('#timeline-table').bind('draw', function (e) {
329
- disableLinks();
330
- });
331
-
332
- initTable();
333
-
334
- $("#bundles, #event_types").change(filterTable);
335
- filterTable();
418
+ disableLinks();
419
+
420
+ // Initialize filters with debounce for search
421
+ var searchTimeout;
422
+ $("#bundles, #payment_filter, #subscription_filter, #billing_filter").on('change', filterTimeline);
423
+ $('#search').on('keyup', function() {
424
+ clearTimeout(searchTimeout);
425
+ searchTimeout = setTimeout(filterTimeline, 300);
426
+ });
427
+
428
+
429
+
430
+ // Clear all filters button
431
+ $('#clear-all-filters').click(function() {
432
+ $('#search').val('');
433
+ $('#bundles').val('All');
434
+ $('#payment_filter').val('all');
435
+ $('#subscription_filter').val('all');
436
+ $('#billing_filter').val('all');
437
+ filterTimeline();
438
+ });
439
+
440
+ // Apply initial filters if any are selected
441
+ filterTimeline();
336
442
  });
337
- <% end %>
443
+ <% end %>