kaui 3.0.2 → 3.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 95dc79de55c417e61d67883ec040660bb28923268cc479b3fa0d027689bd007f
4
- data.tar.gz: 722db58817b35d95ae08be67a131b85b1706868d73d0182bfa267a7007ea5eb2
3
+ metadata.gz: fdb45a75d2f3a57307ffe426a864911262563d623f25cccefd3941de52655e36
4
+ data.tar.gz: f45cbd12e90f63dfb544743381af6c4a2dbeab58fe0671334f02198bdeb97323
5
5
  SHA512:
6
- metadata.gz: '091113972ba008f89462c312ea46f05f0510ed64dff52ecd5522af6eff02f8c61aeaea8cf92d89a405d6a893dfc1ee12f86268f895b3b77107a08722ba185f08'
7
- data.tar.gz: bb5a5b1901b527d519503ca1a406afc86ac44025e51303ba6ab24403515c3ce61f2c2337d863db238418fbada9057243346be53c3e69547160ceaf0337b6c074
6
+ metadata.gz: 065274ae77055af9c3a54b7938f8c8f0d09775b5d7a7b4e953c990790ad7e4af247096b287f308062e53f09b13d16eda146ccd893c762baa3dc7ab644f8a3c01
7
+ data.tar.gz: 15cd32d52a680d624be8bf85f3db439f1afc78ad5d7308054fecf7aad66d130f8a5bd324ec93ba7fd140399be84f4eec6015e1c9a054f55f368f8c4202ecebfb
@@ -0,0 +1,37 @@
1
+ <svg width="138" height="36" viewBox="0 0 138 36" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M8.96891 13.6363L17.1663 16.2316L19.867 20.7179L7.22926 20.294L5.87472 17.7276C4.70442 15.5102 6.6717 12.9089 8.96891 13.6363Z" fill="url(#paint0_linear_5656_117635)"/>
3
+ <path d="M2.73109 18.8862L23.0656 19.4261L31.0472 32.6526C31.9039 34.0722 30.9562 35.9453 29.3786 35.9506L14.6421 36C12.8282 36.0061 11.0908 35.2177 9.83259 33.8178L0.749744 23.712C-0.899153 21.8774 0.354861 18.8231 2.73109 18.8862Z" fill="url(#paint1_linear_5656_117635)"/>
4
+ <path d="M20.5179 0.919922L15.7246 7.75567L23.189 11.3725L24.8913 4.89582L20.5179 0.919922Z" fill="url(#paint2_linear_5656_117635)"/>
5
+ <path d="M27.5141 34.8764L15.4574 13.4093C14.4372 11.5929 14.565 9.35199 15.785 7.66255C16.4888 6.68792 17.8875 6.54241 18.778 7.35118L34.1718 21.3321C36.1567 23.1348 36.5779 26.0884 35.1757 28.371L31.1361 34.9469C30.2983 36.3107 28.2978 36.2717 27.5141 34.8764Z" fill="url(#paint3_linear_5656_117635)"/>
6
+ <path d="M32.0753 11.0799L21.0977 3.84213C19.1972 2.5891 20.3796 -0.360792 22.623 0.0364992L27.8828 0.967948C29.1553 1.19329 30.1995 2.09954 30.5986 3.32489L32.9165 10.4422C33.0801 10.9445 32.5171 11.3713 32.0753 11.0799Z" fill="url(#paint4_linear_5656_117635)"/>
7
+ <path d="M69.3857 29.5787C68.2643 29.5787 67.3552 28.684 67.3552 27.5803V14.5758C67.3552 13.4721 68.2643 12.5774 69.3857 12.5774C70.5072 12.5774 71.4163 13.4721 71.4163 14.5758V27.5803C71.4163 28.684 70.5072 29.5787 69.3857 29.5787ZM69.402 9.77566C68.6439 9.77566 68.0158 9.54218 67.5176 9.07523C67.0411 8.60827 66.8028 8.04581 66.8028 7.38783C66.8028 6.70862 67.0411 6.14616 67.5176 5.70043C68.0158 5.23348 68.6439 5 69.402 5C70.1601 5 70.7773 5.22286 71.2539 5.66859C71.752 6.0931 72.0011 6.63434 72.0011 7.29231C72.0011 7.99274 71.7629 8.58705 71.2863 9.07523C70.8098 9.54218 70.1817 9.77566 69.402 9.77566Z" fill="#293056"/>
8
+ <path d="M77.4776 29.5787C76.3561 29.5787 75.447 28.684 75.447 27.5803V7.9536C75.447 6.84988 76.3561 5.95513 77.4776 5.95513C78.599 5.95513 79.5081 6.84988 79.5081 7.9536V27.5803C79.5081 28.684 78.599 29.5787 77.4776 29.5787Z" fill="#293056"/>
9
+ <path d="M85.5694 29.5787C84.4479 29.5787 83.5388 28.684 83.5388 27.5803V7.9536C83.5388 6.84987 84.4479 5.95513 85.5694 5.95513C86.6908 5.95513 87.6 6.84988 87.6 7.9536V27.5803C87.6 28.684 86.6908 29.5787 85.5694 29.5787Z" fill="#293056"/>
10
+ <path d="M119.786 29.5787C118.664 29.5787 117.755 28.684 117.755 27.5803V14.5758C117.755 13.4721 118.664 12.5774 119.786 12.5774C120.907 12.5774 121.816 13.4721 121.816 14.5758V27.5803C121.816 28.684 120.907 29.5787 119.786 29.5787ZM119.802 9.77566C119.044 9.77566 118.416 9.54218 117.918 9.07523C117.441 8.60827 117.203 8.04581 117.203 7.38783C117.203 6.70862 117.441 6.14616 117.918 5.70043C118.416 5.23348 119.044 5 119.802 5C120.56 5 121.177 5.22286 121.654 5.66859C122.152 6.0931 122.401 6.63434 122.401 7.29231C122.401 7.99274 122.163 8.58705 121.686 9.07523C121.21 9.54218 120.582 9.77566 119.802 9.77566Z" fill="#293056"/>
11
+ <path d="M127.878 29.5787C126.756 29.5787 125.847 28.684 125.847 27.5803V7.9536C125.847 6.84987 126.756 5.95513 127.878 5.95513C128.999 5.95513 129.908 6.84988 129.908 7.9536V27.5803C129.908 28.684 128.999 29.5787 127.878 29.5787Z" fill="#293056"/>
12
+ <path d="M135.969 29.5787C134.848 29.5787 133.939 28.684 133.939 27.5803V7.9536C133.939 6.84987 134.848 5.95513 135.969 5.95513C137.091 5.95513 138 6.84988 138 7.9536V27.5803C138 28.684 137.091 29.5787 135.969 29.5787Z" fill="#293056"/>
13
+ <path d="M59.977 13.0294C60.2978 12.7387 60.7179 12.5774 61.1539 12.5774C62.702 12.5774 63.4773 14.4195 62.3826 15.4968L58.1099 19.7015L63.5453 26.4787C64.552 27.734 63.6435 29.5787 62.0187 29.5787C61.4331 29.5787 60.8787 29.319 60.5094 28.8718L55.0817 22.2982L52.0611 25.0975V27.5803C52.0611 28.684 51.152 29.5787 50.0306 29.5787C48.9091 29.5787 48 28.684 48 27.5803V7.9536C48 6.84987 48.9091 5.95513 50.0306 5.95513C51.152 5.95513 52.0611 6.84988 52.0611 7.9536V20.2027L59.977 13.0294Z" fill="#293056"/>
14
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M106.399 29.8016C104.926 29.8016 103.615 29.4832 102.468 28.8465C101.774 28.4618 101.168 27.9611 100.648 27.3441V27.6762C100.648 28.7269 99.7826 29.5787 98.715 29.5787C97.6474 29.5787 96.7819 28.7269 96.7819 27.6762V7.9536C96.7819 6.84987 97.691 5.95513 98.8125 5.95513C99.9339 5.95513 100.843 6.84988 100.843 7.9536V14.6575C101.337 14.1191 101.9 13.6804 102.532 13.3415C103.702 12.7047 104.991 12.3864 106.399 12.3864C108.11 12.3864 109.615 12.7472 110.915 13.4688C112.236 14.1905 113.276 15.1987 114.034 16.4934C114.813 17.7882 115.203 19.3164 115.203 21.0781C115.203 22.8397 114.813 24.3679 114.034 25.6627C113.276 26.9574 112.236 27.9762 110.915 28.7191C109.615 29.4408 108.11 29.8016 106.399 29.8016ZM108.543 25.7582C107.785 26.1827 106.919 26.395 105.944 26.395C104.969 26.395 104.092 26.1827 103.312 25.7582C102.532 25.3337 101.915 24.7182 101.46 23.9116C101.006 23.1051 100.778 22.1605 100.778 21.0781C100.778 19.9743 101.006 19.0298 101.46 18.2445C101.915 17.4379 102.532 16.8224 103.312 16.3979C104.092 15.9734 104.969 15.7612 105.944 15.7612C106.919 15.7612 107.785 15.9734 108.543 16.3979C109.323 16.8224 109.94 17.4379 110.395 18.2445C110.85 19.0298 111.077 19.9743 111.077 21.0781C111.077 22.1605 110.85 23.1051 110.395 23.9116C109.94 24.7182 109.323 25.3337 108.543 25.7582Z" fill="#293056"/>
15
+ <defs>
16
+ <linearGradient id="paint0_linear_5656_117635" x1="6.3713" y1="14.584" x2="17.3232" y2="20.2038" gradientUnits="userSpaceOnUse">
17
+ <stop stop-color="#004EEB"/>
18
+ <stop offset="1" stop-color="#2970FF"/>
19
+ </linearGradient>
20
+ <linearGradient id="paint1_linear_5656_117635" x1="1.04487" y1="21.155" x2="29.4032" y2="32.4876" gradientUnits="userSpaceOnUse">
21
+ <stop stop-color="#2970FF"/>
22
+ <stop offset="1" stop-color="#7CD4FD"/>
23
+ </linearGradient>
24
+ <linearGradient id="paint2_linear_5656_117635" x1="19.8881" y1="9.67384" x2="23.8884" y2="4.93559" gradientUnits="userSpaceOnUse">
25
+ <stop stop-color="#A6EF67"/>
26
+ <stop offset="1" stop-color="#FDE172"/>
27
+ </linearGradient>
28
+ <linearGradient id="paint3_linear_5656_117635" x1="15.1997" y1="8.83686" x2="29.3077" y2="34.3257" gradientUnits="userSpaceOnUse">
29
+ <stop stop-color="#A6EF67"/>
30
+ <stop offset="1" stop-color="#15B79E"/>
31
+ </linearGradient>
32
+ <linearGradient id="paint4_linear_5656_117635" x1="20.833" y1="1.40851" x2="32.7401" y2="9.43028" gradientUnits="userSpaceOnUse">
33
+ <stop stop-color="#FDE172"/>
34
+ <stop offset="1" stop-color="#EAAA08"/>
35
+ </linearGradient>
36
+ </defs>
37
+ </svg>
@@ -115,10 +115,9 @@ module Kaui
115
115
  end
116
116
 
117
117
  fetch_payment_methods_with_details = fetch_payment_methods.then do |pms|
118
- ops = []
119
- pms.each do |pm|
120
- ops << promise do
121
- Kaui::PaymentMethod.find_by_id(pm.payment_method_id, true, cached_options_for_klient)
118
+ ops = pms.map do |pm|
119
+ promise do
120
+ Kaui::PaymentMethod.find_by_id(pm.payment_method_id, false, true, [], 'NONE', cached_options_for_klient)
122
121
  rescue StandardError => e
123
122
  # Maybe the plugin is not registered or the plugin threw an exception
124
123
  Rails.logger.warn(e)
@@ -182,7 +181,7 @@ module Kaui
182
181
  invoice = nil
183
182
  begin
184
183
  invoice = if dry_run
185
- Kaui::Invoice.trigger_invoice_dry_run(account_id, target_date, false, options_for_klient)
184
+ Kaui::Invoice.trigger_invoice_dry_run(account_id, target_date, false, [], current_user.kb_username, params[:reason], params[:comment], options_for_klient)
186
185
  else
187
186
  Kaui::Invoice.trigger_invoice(account_id, target_date, current_user.kb_username, params[:reason], params[:comment], options_for_klient)
188
187
  end
@@ -209,7 +208,7 @@ module Kaui
209
208
  # Fetched asynchronously, as it takes time. This also helps with enforcing permissions.
210
209
  def next_invoice_date
211
210
  json_response do
212
- next_invoice = Kaui::Invoice.trigger_invoice_dry_run(params.require(:account_id), nil, true, options_for_klient)
211
+ next_invoice = Kaui::Invoice.trigger_invoice_dry_run(params.require(:account_id), nil, true, [], current_user.kb_username, params[:reason], params[:comment], options_for_klient)
213
212
  next_invoice ? next_invoice.target_date.to_json : nil
214
213
  end
215
214
  end
@@ -130,9 +130,23 @@ module Kaui
130
130
  uploaded_catalog = params.require(:catalog)
131
131
  catalog_xml = uploaded_catalog.read
132
132
 
133
- Kaui::AdminTenant.upload_catalog(catalog_xml, options[:username], nil, comment, options)
134
-
135
- redirect_to admin_tenant_path(current_tenant.id), notice: I18n.translate('flashes.notices.catalog_uploaded_successfully')
133
+ validate_response = Kaui::Catalog.validate_catalog(catalog_xml, options[:username], nil, comment, options)
134
+ catalog_validation_errors = begin
135
+ JSON.parse(validate_response.response.body)['catalogValidationErrors']
136
+ rescue StandardError
137
+ nil
138
+ end
139
+ if catalog_validation_errors.blank?
140
+ Kaui::AdminTenant.upload_catalog(catalog_xml, options[:username], nil, comment, options)
141
+ redirect_to admin_tenant_path(current_tenant.id), notice: I18n.translate('flashes.notices.catalog_uploaded_successfully')
142
+ else
143
+ errors = ''
144
+ catalog_validation_errors.each do |validation_error|
145
+ errors += (validation_error['errorDescription'])
146
+ end
147
+ flash[:error] = errors
148
+ redirect_to admin_tenant_new_catalog_path(id: current_tenant.id)
149
+ end
136
150
  end
137
151
 
138
152
  def new_catalog
@@ -441,9 +455,8 @@ module Kaui
441
455
 
442
456
  # convert result to a full hash since dynamic attributes of a class are ignored when converting to json
443
457
  result.each do |data|
444
- plans = []
445
- data[:plans].each do |plan|
446
- plans << plan.instance_variables.each_with_object({}) { |var, hash_plan| hash_plan[var.to_s.delete('@')] = plan.instance_variable_get(var) }
458
+ plans = data[:plans].map do |plan|
459
+ plan.instance_variables.each_with_object({}) { |var, hash_plan| hash_plan[var.to_s.delete('@')] = plan.instance_variable_get(var) }
447
460
  end
448
461
 
449
462
  catalog << { version_date: data[:version_date],
@@ -68,7 +68,7 @@ module Kaui
68
68
  when 'CUSTOM_FIELD'
69
69
  audit_logs_with_history = Kaui::CustomField.new({ custom_field_id: object_id }).audit_logs_with_history(cached_options_for_klient)
70
70
  when 'INVOICE'
71
- invoice = Kaui::Invoice.find_by_id(object_id, 'NONE', cached_options_for_klient)
71
+ invoice = Kaui::Invoice.find_by_id(object_id, false, 'NONE', cached_options_for_klient)
72
72
  audit_logs_with_history = invoice.audit_logs_with_history(cached_options_for_klient)
73
73
  when 'INVOICE_ITEM'
74
74
  invoice_item = Kaui::InvoiceItem.new
@@ -84,10 +84,10 @@ module Kaui
84
84
  payment = Kaui::Payment.find_by_id(object_id, false, false, cached_options_for_klient)
85
85
  audit_logs_with_history = payment.audit_logs_with_history(cached_options_for_klient)
86
86
  when 'PAYMENT_METHOD'
87
- payment_method = Kaui::PaymentMethod.find_by_id(object_id, false, cached_options_for_klient)
87
+ payment_method = Kaui::PaymentMethod.find_by_id(object_id, false, false, [], 'NONE', cached_options_for_klient)
88
88
  audit_logs_with_history = payment_method.audit_logs_with_history(cached_options_for_klient)
89
89
  when 'SUBSCRIPTION'
90
- subscription = Kaui::Subscription.find_by_id(object_id, cached_options_for_klient)
90
+ subscription = Kaui::Subscription.find_by_id(object_id, 'NONE', cached_options_for_klient)
91
91
  audit_logs_with_history = subscription.audit_logs_with_history(cached_options_for_klient)
92
92
  when 'SUBSCRIPTION_EVENT'
93
93
  audit_logs_with_history = Kaui::Subscription.event_audit_logs_with_history(object_id, cached_options_for_klient)
@@ -7,7 +7,7 @@ module Kaui
7
7
  amount = params[:amount]
8
8
 
9
9
  if invoice_id.present?
10
- @invoice = Kaui::Invoice.find_by_id(invoice_id, 'NONE', options_for_klient)
10
+ @invoice = Kaui::Invoice.find_by_id(invoice_id, false, 'NONE', options_for_klient)
11
11
  amount ||= @invoice.balance
12
12
  currency = @invoice.currency
13
13
  else
@@ -7,7 +7,7 @@ module Kaui
7
7
  amount = params[:amount]
8
8
 
9
9
  if invoice_id.present?
10
- @invoice = Kaui::Invoice.find_by_id(invoice_id, 'NONE', options_for_klient)
10
+ @invoice = Kaui::Invoice.find_by_id(invoice_id, false, 'NONE', options_for_klient)
11
11
  amount ||= @invoice.balance
12
12
  currency = @invoice.currency
13
13
  else
@@ -71,7 +71,7 @@ module Kaui
71
71
  end
72
72
  when :SUBSCRIPTION
73
73
  begin
74
- test_uuid = Kaui::Subscription.find_by_id(param_uuid, options_for_klient)
74
+ test_uuid = Kaui::Subscription.find_by_id(param_uuid, 'NONE', options_for_klient)
75
75
  rescue StandardError
76
76
  # Ignore
77
77
  end
@@ -163,7 +163,7 @@ module Kaui
163
163
  end
164
164
  when 'SUBSCRIPTION'
165
165
  begin
166
- test_uuid = Kaui::Subscription.find_by_id(param_uuid, options_for_klient)
166
+ test_uuid = Kaui::Subscription.find_by_id(param_uuid, 'NONE', options_for_klient)
167
167
  rescue StandardError
168
168
  # Ignore
169
169
  ensure
@@ -172,7 +172,7 @@ module Kaui
172
172
  when 'INVOICE'
173
173
  begin
174
174
  cached_options_for_klient = options_for_klient
175
- test_uuid = Kaui::Invoice.find_by_id(param_uuid, 'FULL', cached_options_for_klient)
175
+ test_uuid = Kaui::Invoice.find_by_id(param_uuid, false, 'FULL', cached_options_for_klient)
176
176
  rescue StandardError
177
177
  # Ignore
178
178
  ensure
@@ -55,7 +55,7 @@ module Kaui
55
55
  case search_by
56
56
  when 'ID'
57
57
  begin
58
- invoice = Kaui::Invoice.find_by_id(search_query, 'NONE', options)
58
+ invoice = Kaui::Invoice.find_by_id(search_query, false, 'NONE', options)
59
59
  redirect_to account_invoice_path(invoice.account_id, invoice.invoice_id) and return
60
60
  rescue KillBillClient::API::NotFound => _e
61
61
  search_error("No invoice matches \"#{search_query}\"")
@@ -64,7 +64,7 @@ module Kaui
64
64
  unsupported_search_field('INVOICE', search_by)
65
65
  when 'NUMBER'
66
66
  begin
67
- invoice = Kaui::Invoice.find_by_number(search_query, 'NONE', options)
67
+ invoice = Kaui::Invoice.find_by_number(search_query, false, 'NONE', options)
68
68
  redirect_to account_invoice_path(invoice.account_id, invoice.invoice_id) and return
69
69
  rescue KillBillClient::API::NotFound, KillBillClient::API::BadRequest => _e
70
70
  search_error("No invoice matches \"#{search_query}\"")
@@ -116,14 +116,14 @@ module Kaui
116
116
  def transaction_search(search_query, search_by = nil, _fast = 0, options = {})
117
117
  if search_by.blank? || search_by == 'ID'
118
118
  begin
119
- payment = Kaui::Payment.find_by_transaction_id(search_query, false, true, options)
119
+ payment = Kaui::Payment.find_by_transaction_id(search_query, false, true, [], 'NONE', options)
120
120
  redirect_to account_payment_path(payment.account_id, payment.payment_id) and return
121
121
  rescue KillBillClient::API::NotFound => _e
122
122
  search_error("No transaction matches \"#{search_query}\"")
123
123
  end
124
124
  else
125
125
  begin
126
- payment = Kaui::Payment.find_by_transaction_external_key(search_query, false, true, 'NONE', options)
126
+ payment = Kaui::Payment.find_by_transaction_external_key(search_query, false, true, [], 'NONE', options)
127
127
  redirect_to account_payment_path(payment.account_id, payment.payment_id) and return
128
128
  rescue KillBillClient::API::NotFound => _e
129
129
  search_error("No transaction matches \"#{search_query}\"")
@@ -198,7 +198,7 @@ module Kaui
198
198
  def subscription_search(search_query, search_by = nil, _fast = 0, options = {})
199
199
  if search_by.blank? || search_by == 'ID'
200
200
  begin
201
- subscription = Kaui::Subscription.find_by_id(search_query, options)
201
+ subscription = Kaui::Subscription.find_by_id(search_query, 'NONE', options)
202
202
  redirect_to account_bundles_path(subscription.account_id) and return
203
203
  rescue KillBillClient::API::NotFound => _e
204
204
  search_error("No subscription matches \"#{search_query}\"")
@@ -7,7 +7,7 @@ module Kaui
7
7
  invoice_id = params.require(:invoice_id)
8
8
 
9
9
  # See https://github.com/killbill/killbill/issues/7
10
- invoice = Kaui::Invoice.find_by_id(invoice_id, 'NONE', options_for_klient)
10
+ invoice = Kaui::Invoice.find_by_id(invoice_id, false, 'NONE', options_for_klient)
11
11
  @invoice_item = invoice.items.find { |ii| ii.invoice_item_id == invoice_item_id }
12
12
 
13
13
  return unless @invoice_item.nil?
@@ -67,7 +67,7 @@ module Kaui
67
67
  # Go to the database once
68
68
  cached_options_for_klient = options_for_klient
69
69
 
70
- @invoice = Kaui::Invoice.find_by_id(params.require(:id), 'FULL', cached_options_for_klient)
70
+ @invoice = Kaui::Invoice.find_by_id(params.require(:id), false, 'FULL', cached_options_for_klient)
71
71
  # This will put the TAX items at the bottom
72
72
  precedence = {
73
73
  'EXTERNAL_CHARGE' => 0,
@@ -132,7 +132,7 @@ module Kaui
132
132
 
133
133
  def void_invoice
134
134
  cached_options_for_klient = options_for_klient
135
- invoice = KillBillClient::Model::Invoice.find_by_id(params.require(:id), 'NONE', cached_options_for_klient)
135
+ invoice = KillBillClient::Model::Invoice.find_by_id(params.require(:id), false, 'NONE', cached_options_for_klient)
136
136
  begin
137
137
  invoice.void(current_user.kb_username, params[:reason], params[:comment], cached_options_for_klient)
138
138
  redirect_to account_invoice_path(invoice.account_id, invoice.invoice_id), notice: 'Invoice successfully voided'
@@ -143,12 +143,12 @@ module Kaui
143
143
  end
144
144
 
145
145
  def restful_show
146
- invoice = Kaui::Invoice.find_by_id(params.require(:id), 'NONE', options_for_klient)
146
+ invoice = Kaui::Invoice.find_by_id(params.require(:id), false, 'NONE', options_for_klient)
147
147
  redirect_to account_invoice_path(invoice.account_id, invoice.invoice_id)
148
148
  end
149
149
 
150
150
  def restful_show_by_number
151
- invoice = Kaui::Invoice.find_by_number(params.require(:number), 'NONE', options_for_klient)
151
+ invoice = Kaui::Invoice.find_by_number(params.require(:number), false, 'NONE', options_for_klient)
152
152
  redirect_to account_invoice_path(invoice.account_id, invoice.invoice_id)
153
153
  end
154
154
 
@@ -158,7 +158,7 @@ module Kaui
158
158
 
159
159
  def commit_invoice
160
160
  cached_options_for_klient = options_for_klient
161
- invoice = KillBillClient::Model::Invoice.find_by_id(params.require(:id), 'NONE', cached_options_for_klient)
161
+ invoice = KillBillClient::Model::Invoice.find_by_id(params.require(:id), false, 'NONE', cached_options_for_klient)
162
162
  invoice.commit(current_user.kb_username, params[:reason], params[:comment], cached_options_for_klient)
163
163
  redirect_to account_invoice_path(invoice.account_id, invoice.invoice_id), notice: 'Invoice successfully committed'
164
164
  end
@@ -74,7 +74,7 @@ module Kaui
74
74
  def destroy
75
75
  payment_method_id = params[:id]
76
76
 
77
- payment_method = Kaui::PaymentMethod.find_by_id(payment_method_id, false, options_for_klient)
77
+ payment_method = Kaui::PaymentMethod.find_by_id(payment_method_id, false, false, [], 'NONE', options_for_klient)
78
78
  begin
79
79
  Kaui::PaymentMethod.destroy(payment_method_id, params[:set_auto_pay_off], false, current_user.kb_username, params[:reason], params[:comment], options_for_klient)
80
80
  redirect_to kaui_engine.account_path(payment_method.account_id), notice: "Payment method #{payment_method_id} successfully deleted"
@@ -89,7 +89,7 @@ module Kaui
89
89
  end
90
90
 
91
91
  def restful_show
92
- payment_method = Kaui::PaymentMethod.find_by_id(params.require(:id), false, options_for_klient)
92
+ payment_method = Kaui::PaymentMethod.find_by_id(params.require(:id), false, false, [], 'NONE', options_for_klient)
93
93
  redirect_to kaui_engine.account_path(payment_method.account_id)
94
94
  end
95
95
 
@@ -98,7 +98,7 @@ module Kaui
98
98
  external_key = params.require(:external_key)
99
99
 
100
100
  begin
101
- payment_methods = Kaui::PaymentMethod.find_by_external_key(external_key, false, false, 'NONE', options_for_klient)
101
+ payment_methods = Kaui::PaymentMethod.find_by_external_key(external_key, false, false, [], 'NONE', options_for_klient)
102
102
  rescue KillBillClient::API::NotFound
103
103
  payment_methods = nil
104
104
  end
@@ -78,7 +78,7 @@ module Kaui
78
78
 
79
79
  def new
80
80
  cached_options_for_klient = options_for_klient
81
- fetch_invoice = promise { Kaui::Invoice.find_by_id(params.require(:invoice_id), 'NONE', cached_options_for_klient) }
81
+ fetch_invoice = promise { Kaui::Invoice.find_by_id(params.require(:invoice_id), false, 'NONE', cached_options_for_klient) }
82
82
  fetch_payment_methods = promise { Kaui::PaymentMethod.find_all_by_account_id(params.require(:account_id), false, cached_options_for_klient) }
83
83
 
84
84
  @invoice = wait(fetch_invoice)
@@ -5,8 +5,9 @@ module Kaui
5
5
  def new
6
6
  cached_options_for_klient = options_for_klient
7
7
 
8
- fetch_invoice = promise { Kaui::Invoice.find_by_id(params.require(:invoice_id), 'NONE', cached_options_for_klient) }
8
+ fetch_invoice = promise { Kaui::Invoice.find_by_id(params.require(:invoice_id), false, 'NONE', cached_options_for_klient) }
9
9
  fetch_payment = promise { Kaui::InvoicePayment.find_by_id(params.require(:payment_id), false, false, cached_options_for_klient) }
10
+
10
11
  fetch_bundles = promise { @account.bundles(cached_options_for_klient) }
11
12
 
12
13
  @invoice = wait(fetch_invoice)
@@ -18,7 +19,7 @@ module Kaui
18
19
 
19
20
  # rubocop:disable Lint/FloatComparison
20
21
  def create
21
- invoice = Kaui::Invoice.find_by_id(params.require(:invoice_id), 'NONE', options_for_klient)
22
+ invoice = Kaui::Invoice.find_by_id(params.require(:invoice_id), false, 'NONE', options_for_klient)
22
23
 
23
24
  if params[:adjustment_type] == 'invoiceItemAdjustment'
24
25
  items = []
@@ -72,7 +72,7 @@ module Kaui
72
72
  end
73
73
 
74
74
  def edit
75
- @subscription = Kaui::Subscription.find_by_id(params.require(:id), options_for_klient)
75
+ @subscription = Kaui::Subscription.find_by_id(params.require(:id), 'NONE', options_for_klient)
76
76
  _, plans_details = lookup_bundle_and_plan_details(@subscription)
77
77
  # Use a Set to deal with multiple pricelists
78
78
  @plans = Set.new.merge(plans_details.map(&:plan))
@@ -86,7 +86,7 @@ module Kaui
86
86
 
87
87
  wait_for_completion = params[:wait_for_completion] == '1'
88
88
 
89
- subscription = Kaui::Subscription.find_by_id(params.require(:id), options_for_klient)
89
+ subscription = Kaui::Subscription.find_by_id(params.require(:id), 'NONE', options_for_klient)
90
90
 
91
91
  input = { planName: plan_name }
92
92
 
@@ -124,13 +124,13 @@ module Kaui
124
124
  else
125
125
  nil
126
126
  end
127
- subscription = Kaui::Subscription.find_by_id(params.require(:id), options_for_klient)
127
+ subscription = Kaui::Subscription.find_by_id(params.require(:id), 'NONE', options_for_klient)
128
128
  subscription.cancel(current_user.kb_username, params[:reason], params[:comment], requested_date, entitlement_policy, billing_policy, use_requested_date_for_billing, options_for_klient)
129
129
  redirect_to kaui_engine.account_bundles_path(subscription.account_id), notice: 'Subscription was successfully cancelled'
130
130
  end
131
131
 
132
132
  def reinstate
133
- subscription = Kaui::Subscription.find_by_id(params.require(:id), options_for_klient)
133
+ subscription = Kaui::Subscription.find_by_id(params.require(:id), 'NONE', options_for_klient)
134
134
 
135
135
  subscription.uncancel(current_user.kb_username, params[:reason], params[:comment], options_for_klient)
136
136
 
@@ -138,7 +138,7 @@ module Kaui
138
138
  end
139
139
 
140
140
  def edit_bcd
141
- @subscription = Kaui::Subscription.find_by_id(params.require(:id), options_for_klient)
141
+ @subscription = Kaui::Subscription.find_by_id(params.require(:id), 'NONE', options_for_klient)
142
142
  end
143
143
 
144
144
  def update_bcd
@@ -158,7 +158,7 @@ module Kaui
158
158
  end
159
159
 
160
160
  def restful_show
161
- subscription = Kaui::Subscription.find_by_id(params.require(:id), options_for_klient)
161
+ subscription = Kaui::Subscription.find_by_id(params.require(:id), 'NONE', options_for_klient)
162
162
  redirect_to kaui_engine.account_bundles_path(subscription.account_id)
163
163
  end
164
164
 
@@ -181,7 +181,7 @@ module Kaui
181
181
  external_key = params.require(:external_key)
182
182
 
183
183
  begin
184
- subscription = Kaui::Subscription.find_by_external_key(external_key, options_for_klient)
184
+ subscription = Kaui::Subscription.find_by_external_key(external_key, 'NONE', options_for_klient)
185
185
  rescue KillBillClient::API::NotFound
186
186
  subscription = nil
187
187
  end
@@ -192,7 +192,7 @@ module Kaui
192
192
 
193
193
  def update_tags
194
194
  subscription_id = params.require(:id)
195
- subscription = Kaui::Subscription.find_by_id(subscription_id, options_for_klient)
195
+ subscription = Kaui::Subscription.find_by_id(subscription_id, 'NONE', options_for_klient)
196
196
  tags = []
197
197
  params.each_key do |key|
198
198
  next unless key.include? 'tag'
@@ -3,7 +3,7 @@
3
3
  module Kaui
4
4
  class TransactionsController < Kaui::EngineController
5
5
  def restful_show
6
- payment = Kaui::Payment.find_by_transaction_id(params.require(:id), false, true, options_for_klient)
6
+ payment = Kaui::Payment.find_by_transaction_id(params.require(:id), false, true, [], 'NONE', options_for_klient)
7
7
  redirect_to account_payment_path(payment.account_id, payment.payment_id)
8
8
  end
9
9
 
@@ -18,7 +18,7 @@ module Kaui
18
18
  currency: params[:currency],
19
19
  transaction_type: params[:transaction_type])
20
20
  else
21
- payment = Kaui::Payment.find_by_transaction_id(transaction_id, false, false, options_for_klient)
21
+ payment = Kaui::Payment.find_by_transaction_id(transaction_id, false, false, [], 'NONE', options_for_klient)
22
22
  @transaction = Kaui::Transaction.build_from_raw_transaction(payment.transactions.find { |tx| tx.transaction_id == transaction_id })
23
23
  end
24
24
  end
@@ -6,7 +6,7 @@ module Kaui
6
6
  if search_key.present?
7
7
  find_in_batches_by_search_key(search_key, offset, limit, options)
8
8
  else
9
- find_in_batches(offset, limit, options)
9
+ find_in_batches(offset, limit, 'NONE', options)
10
10
  end
11
11
  end
12
12
  end
@@ -11,12 +11,12 @@ module Kaui
11
11
  end
12
12
 
13
13
  def self.find_safely_by_id(id, options = {})
14
- Kaui::PaymentMethod.find_by_id(id, true, options)
14
+ Kaui::PaymentMethod.find_by_id(id, false, true, [], 'NONE', options)
15
15
  rescue StandardError => e
16
16
  # Maybe the plugin is not registered or the plugin threw an exception
17
17
  Rails.logger.warn(e)
18
18
  begin
19
- Kaui::PaymentMethod.find_by_id(id, false, options)
19
+ Kaui::PaymentMethod.find_by_id(id, false, true, [], 'NONE', options)
20
20
  rescue StandardError
21
21
  nil
22
22
  end
@@ -26,7 +26,7 @@ module Kaui
26
26
  pms = Kaui::PaymentMethod.find_all_by_account_id(account_id, false, options)
27
27
 
28
28
  pms.each_with_index do |pm, i|
29
- pms[i] = Kaui::PaymentMethod.find_by_id(pm.payment_method_id, true, options)
29
+ pms[i] = Kaui::PaymentMethod.find_by_id(pm.payment_method_id, false, true, [], 'NONE', options)
30
30
  rescue StandardError => e
31
31
  # Maybe the plugin is not registered or the plugin threw an exception
32
32
  Rails.logger.warn(e)
@@ -49,7 +49,7 @@ module Kaui
49
49
 
50
50
  # The payment method may have been deleted
51
51
  payment_methods_cache[payment.payment_method_id] ||= begin
52
- Kaui::PaymentMethod.find_by_id(payment.payment_method_id, true, options)
52
+ Kaui::PaymentMethod.find_by_id(payment.payment_method_id, false, true, [], 'NONE', options)
53
53
  rescue StandardError
54
54
  nil
55
55
  end
@@ -3,7 +3,7 @@
3
3
  <div class="row">
4
4
 
5
5
  <div class="col-md-6">
6
- <%= link_to image_tag('kaui/logo.png', :alt => 'Kill Bill Logo'), kaui_engine.home_path %>
6
+ <%= link_to image_tag('kaui/logo.svg', :alt => 'Kill Bill Logo'), kaui_engine.home_path %>
7
7
 
8
8
  <% if user_signed_in? -%>
9
9
  <% if tenant_selected? %>
data/lib/kaui/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Kaui
4
- VERSION = '3.0.2'
4
+ VERSION = '3.0.3'
5
5
  end
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  # desc "Explaining what the task does"
3
4
  # task :kaui do
4
5
  # # Task goes here
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: 3.0.2
4
+ version: 3.0.3
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: 2024-01-30 00:00:00.000000000 Z
11
+ date: 2024-05-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack
@@ -329,7 +329,7 @@ files:
329
329
  - Rakefile
330
330
  - app/assets/config/kaui_manifest.js
331
331
  - app/assets/images/kaui/duck.png
332
- - app/assets/images/kaui/logo.png
332
+ - app/assets/images/kaui/logo.svg
333
333
  - app/assets/images/kaui/search.png
334
334
  - app/assets/images/kaui/search_white.png
335
335
  - app/assets/javascripts/application.js
Binary file