spree_cm_commissioner 2.15.6 → 2.16.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/Gemfile.lock +1 -1
- data/app/controllers/spree/admin/taxon_sections_controller.rb +202 -0
- data/app/controllers/spree/admin/taxons_controller_decorator.rb +2 -0
- data/app/controllers/spree/api/v2/platform/homepage_section_relatable_options_controller.rb +15 -16
- data/app/controllers/spree/api/v2/storefront/homepage_sections_controller.rb +3 -0
- data/app/helpers/spree_cm_commissioner/admin/taxon_setting_defaults_helper.rb +13 -0
- data/app/models/concerns/spree_cm_commissioner/line_item_seat_selection.rb +2 -1
- data/app/models/concerns/spree_cm_commissioner/order_pricing_channel.rb +19 -0
- data/app/{services → models}/spree_cm_commissioner/channel_pricing/calculator.rb +10 -3
- data/app/models/spree_cm_commissioner/oauth_application_decorator.rb +1 -1
- data/app/models/spree_cm_commissioner/order_decorator.rb +1 -1
- data/app/models/spree_cm_commissioner/pricing_channel.rb +32 -0
- data/app/models/spree_cm_commissioner/taxon_decorator.rb +2 -1
- data/app/models/spree_cm_commissioner/taxon_vendor.rb +1 -1
- data/app/overrides/spree/admin/oauth_applications/_form/pricing_channel_field.html.erb.deface +1 -1
- data/app/overrides/spree/admin/taxons/_form/advanced_settings.html.erb.deface +64 -0
- data/app/overrides/spree/admin/taxons/_form/check_in_and_operator.html.erb.deface +33 -0
- data/app/overrides/spree/admin/taxons/_form/live_stock.html.erb.deface +30 -0
- data/app/queries/spree_cm_commissioner/settlement_summary_query.rb +2 -2
- data/app/services/spree_cm_commissioner/agencies/onboard.rb +76 -0
- data/app/services/spree_cm_commissioner/channel_pricing/{find_or_create_policy.rb → find_or_create_buy_policy.rb} +1 -1
- data/app/services/spree_cm_commissioner/channel_pricing/list_trip_prices.rb +49 -0
- data/app/services/spree_cm_commissioner/channel_pricing/preview_rule.rb +88 -0
- data/app/services/spree_cm_commissioner/channel_pricing/price_trip_results.rb +1 -1
- data/app/services/spree_cm_commissioner/channel_pricing/resolve.rb +1 -1
- data/app/services/spree_cm_commissioner/seats/assign_guest.rb +124 -0
- data/app/services/spree_cm_commissioner/seats/auto_assign.rb +13 -11
- data/app/services/spree_cm_commissioner/settlements/generate_entries_batch.rb +1 -1
- data/app/views/spree/admin/shared/_taxon_tabs.html.erb +8 -24
- data/app/views/spree/admin/taxon_sections/_add_modal.html.erb +38 -0
- data/app/views/spree/admin/taxon_sections/_columns.html.erb +12 -0
- data/app/views/spree/admin/taxon_sections/_delete_link.html.erb +10 -0
- data/app/views/spree/admin/taxon_sections/_hotel_picker.html.erb +26 -0
- data/app/views/spree/admin/taxon_sections/_hotels_table.html.erb +81 -0
- data/app/views/spree/admin/taxon_sections/_new_section_modal.html.erb +36 -0
- data/app/views/spree/admin/taxon_sections/_product_picker.html.erb +27 -0
- data/app/views/spree/admin/taxon_sections/_products_table.html.erb +80 -0
- data/app/views/spree/admin/taxon_sections/_section.html.erb +78 -0
- data/app/views/spree/admin/taxon_sections/index.html.erb +103 -0
- data/config/locales/en.yml +59 -0
- data/config/locales/km.yml +59 -0
- data/config/routes.rb +16 -7
- data/lib/spree_cm_commissioner/version.rb +1 -1
- metadata +25 -25
- data/app/controllers/spree/admin/classifications_controller.rb +0 -49
- data/app/controllers/spree/admin/taxon_childrens_controller.rb +0 -20
- data/app/controllers/spree/admin/taxon_vendors_controller.rb +0 -35
- data/app/models/concerns/spree_cm_commissioner/order_pricing_channel_resolver.rb +0 -67
- data/app/overrides/spree/admin/taxons/_form/background_color_and_foreground_color.html.erb.deface +0 -35
- data/app/overrides/spree/admin/taxons/_form/check_in_flows.html.erb.deface +0 -36
- data/app/overrides/spree/admin/taxons/_form/custom_redirect_url.html.erb.deface +0 -8
- data/app/overrides/spree/admin/taxons/_form/enforce_waiting_room_session.html.erb.deface +0 -10
- data/app/overrides/spree/admin/taxons/_form/hide_video_banner.html.erb.deface +0 -9
- data/app/overrides/spree/admin/taxons/_form/live_stock_window_form_date.html.erb.deface +0 -41
- data/app/overrides/spree/admin/taxons/_form/preview_checkbox.html.erb.deface +0 -11
- data/app/overrides/spree/admin/taxons/_form/show_badge_status.html.erb.deface +0 -13
- data/app/views/spree/admin/classifications/edit.html.erb +0 -58
- data/app/views/spree/admin/classifications/index.html.erb +0 -24
- data/app/views/spree/admin/classifications/new.html.erb +0 -47
- data/app/views/spree/admin/shared/_products.html.erb +0 -71
- data/app/views/spree/admin/taxon_childrens/index.html.erb +0 -34
- data/app/views/spree/admin/taxon_vendors/_form.html.erb +0 -10
- data/app/views/spree/admin/taxon_vendors/edit.html.erb +0 -24
- data/app/views/spree/admin/taxon_vendors/index.html.erb +0 -55
- data/app/views/spree/admin/taxon_vendors/new.html.erb +0 -28
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
module SpreeCmCommissioner
|
|
2
|
+
module Agencies
|
|
3
|
+
# Creates an agency with its login account, wholesale buy price list and fee agreement in one
|
|
4
|
+
# transaction, so a failed later step never leaves a half-configured agency behind. The account
|
|
5
|
+
# password is generated here, never accepted from the client, and returned once for display.
|
|
6
|
+
class Onboard
|
|
7
|
+
prepend ::Spree::ServiceModule::Base
|
|
8
|
+
|
|
9
|
+
# base58 drops look-alike characters (0/O, I/l) so it can be read off screen; 20 chars ≈ 117 bits.
|
|
10
|
+
PASSWORD_LENGTH = 20
|
|
11
|
+
|
|
12
|
+
# Vendor staff only ever manage the wholesale buy list of a vendor-contracted agency.
|
|
13
|
+
PRICE_LIST_DEFAULTS = {
|
|
14
|
+
channel_type: :channel_vendor_agency,
|
|
15
|
+
platform: :web_dashboard,
|
|
16
|
+
list_type: :buy,
|
|
17
|
+
managed_by: :managed_by_vendor
|
|
18
|
+
}.freeze
|
|
19
|
+
|
|
20
|
+
def self.generate_password
|
|
21
|
+
SecureRandom.base58(PASSWORD_LENGTH)
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# rubocop:disable Metrics/ParameterLists
|
|
25
|
+
def call(agency_params:, user_params:, price_list_params:, agreement_params:, agency_category:, vendor:, service_type:)
|
|
26
|
+
password = self.class.generate_password
|
|
27
|
+
result = nil
|
|
28
|
+
|
|
29
|
+
ApplicationRecord.transaction do
|
|
30
|
+
result = run_steps(agency_params, user_params, price_list_params, agreement_params, agency_category, vendor, service_type, password)
|
|
31
|
+
# The nested services' own transactions join this one, so their Rollbacks are swallowed; roll back here.
|
|
32
|
+
raise ActiveRecord::Rollback if result.failure?
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
result
|
|
36
|
+
end
|
|
37
|
+
# rubocop:enable Metrics/ParameterLists
|
|
38
|
+
|
|
39
|
+
private
|
|
40
|
+
|
|
41
|
+
# rubocop:disable Metrics/ParameterLists
|
|
42
|
+
def run_steps(agency_params, user_params, price_list_params, agreement_params, agency_category, vendor, service_type, password)
|
|
43
|
+
agency = SpreeCmCommissioner::Agency.new(agency_params.to_h.merge(vendor: vendor, agency_category: agency_category))
|
|
44
|
+
return failure(:agency, agency.errors.full_messages.to_sentence) unless agency.save
|
|
45
|
+
|
|
46
|
+
user_result = SpreeCmCommissioner::AgencyUsers::Create.call(
|
|
47
|
+
email: user_params[:email],
|
|
48
|
+
first_name: user_params[:first_name],
|
|
49
|
+
last_name: user_params[:last_name],
|
|
50
|
+
password: password,
|
|
51
|
+
role_ids: Array(user_params[:role_ids]),
|
|
52
|
+
agency: agency,
|
|
53
|
+
vendor: vendor,
|
|
54
|
+
service_type: service_type
|
|
55
|
+
)
|
|
56
|
+
return failure(:account, user_result.error.to_s) if user_result.failure?
|
|
57
|
+
|
|
58
|
+
# Both bases are NOT NULL columns but optional selects in the form, so a blank would raise instead of failing the step.
|
|
59
|
+
price_list_attrs = price_list_params.to_h.symbolize_keys.compact_blank
|
|
60
|
+
.reverse_merge(margin_basis: :base_price, default_settlement_basis: :original_price)
|
|
61
|
+
.merge(PRICE_LIST_DEFAULTS)
|
|
62
|
+
price_list_result = SpreeCmCommissioner::ChannelPricing::Create.call(params: price_list_attrs, agency: agency, vendor: vendor)
|
|
63
|
+
return failure(:price_list, price_list_result.error.to_s) if price_list_result.failure?
|
|
64
|
+
|
|
65
|
+
price_list = price_list_result.value[:channel_price_policy]
|
|
66
|
+
agreement_result = SpreeCmCommissioner::DistributionAgreements::Create.call(
|
|
67
|
+
params: agreement_params.to_h.symbolize_keys, vendor: vendor, channel_price_policy: price_list, partner: agency
|
|
68
|
+
)
|
|
69
|
+
return failure(:agreement, agreement_result.error.to_s) if agreement_result.failure?
|
|
70
|
+
|
|
71
|
+
success(agency: agency, user: user_result.value[:user], password: password, price_list: price_list)
|
|
72
|
+
end
|
|
73
|
+
# rubocop:enable Metrics/ParameterLists
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
end
|
|
@@ -4,7 +4,7 @@ module SpreeCmCommissioner
|
|
|
4
4
|
# channel the vendor hasn't priced yet. Prefers the active policy, then the latest draft (kept as
|
|
5
5
|
# draft: it's the vendor's to activate); otherwise creates an active one with no default margin,
|
|
6
6
|
# so the new rules are the only thing it changes.
|
|
7
|
-
class
|
|
7
|
+
class FindOrCreateBuyPolicy
|
|
8
8
|
prepend ::Spree::ServiceModule::Base
|
|
9
9
|
|
|
10
10
|
def call(vendor:, channel_type:, platform:, currency:)
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
module SpreeCmCommissioner
|
|
2
|
+
module ChannelPricing
|
|
3
|
+
# What each of the vendor's active buy price lists charges for one trip's seat types, and which rule
|
|
4
|
+
# set it, for the trip's Channel Prices tab. Prices with the same Calculator as checkout, but loads
|
|
5
|
+
# only the rules on this trip, its seat types and its route (one query for every list).
|
|
6
|
+
#
|
|
7
|
+
# ListTripPrices.call(trip: trip).value
|
|
8
|
+
# # => { variants: [variant], rows: [{ policy: policy, cells: { variant.id => { base: 10, price: 11.5, level: 'Spree::Product' } } }] }
|
|
9
|
+
#
|
|
10
|
+
# level is the matching rule's scopable_type, or :default when the list's default margin applies.
|
|
11
|
+
# A cell is nil when the seat type has no price in the list's currency.
|
|
12
|
+
class ListTripPrices
|
|
13
|
+
prepend ::Spree::ServiceModule::Base
|
|
14
|
+
|
|
15
|
+
AGENCY_CHANNELS = %i[channel_vendor_agency channel_platform_agency].freeze
|
|
16
|
+
|
|
17
|
+
def call(trip:)
|
|
18
|
+
variants = trip.product.variants.includes(:prices).to_a
|
|
19
|
+
policies = ChannelPricePolicy.where(vendor_id: trip.vendor_id, list_type: :buy, status: :active)
|
|
20
|
+
.includes(:agency).order(:channel_type, :name).to_a
|
|
21
|
+
rules = rules_for(policies, trip, variants).group_by(&:channel_price_policy_id)
|
|
22
|
+
|
|
23
|
+
rows = policies.map do |policy|
|
|
24
|
+
calculator = Calculator.new(policy, rules: rules.fetch(policy.id, []))
|
|
25
|
+
{ policy: policy, cells: variants.to_h { |variant| [variant.id, cell(calculator, variant, trip)] } }
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
success(variants: variants, rows: rows)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
private
|
|
32
|
+
|
|
33
|
+
def rules_for(policies, trip, variants)
|
|
34
|
+
scopables = { 'Spree::Variant' => variants.map(&:id), 'Spree::Product' => [trip.product_id], 'SpreeCmCommissioner::Route' => [trip.route_id] }
|
|
35
|
+
condition = scopables.map { |type, ids| ChannelPriceRule.where(scopable_type: type, scopable_id: ids) }.reduce(:or)
|
|
36
|
+
|
|
37
|
+
ChannelPriceRule.where(channel_price_policy_id: policies.map(&:id)).merge(condition)
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def cell(calculator, variant, trip)
|
|
41
|
+
base = variant.prices.find { |price| price.currency == calculator.currency }&.amount
|
|
42
|
+
return nil if base.nil?
|
|
43
|
+
|
|
44
|
+
scopes = { variant_id: variant.id, product_id: trip.product_id, route_id: trip.route_id }
|
|
45
|
+
{ base: base, price: calculator.price_for(base, **scopes), level: calculator.rule_for(**scopes)&.scopable_type || :default }
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
module SpreeCmCommissioner
|
|
2
|
+
module ChannelPricing
|
|
3
|
+
# What a price rule will do before it is saved, for the rule form: an example ticket's price under it, and
|
|
4
|
+
# where it ranks among the policy's existing rules. Calculator applies the most specific rule
|
|
5
|
+
# (ChannelPriceRule::SCOPABLE_TYPES order), so rules on the target's route/trip lose to it, and rules on
|
|
6
|
+
# its own trips/ticket types keep winning over it.
|
|
7
|
+
#
|
|
8
|
+
# PreviewRule.call(channel_price_policy: policy, target: trip.product, base_amount: 10,
|
|
9
|
+
# attributes: { margin_type: 'percentage', margin_value: '15' }).value
|
|
10
|
+
# # => { price: 11.5, levels: [{ type: 'Spree::Variant', state: :none, count: 0 },
|
|
11
|
+
# # { type: 'Spree::Product', state: :applies, price: 11.5 },
|
|
12
|
+
# # { type: 'SpreeCmCommissioner::Route', state: :overridden, record: route, price: 11.0 },
|
|
13
|
+
# # { type: :default, state: :overridden, price: 10.5 }] }
|
|
14
|
+
class PreviewRule
|
|
15
|
+
prepend ::Spree::ServiceModule::Base
|
|
16
|
+
|
|
17
|
+
# Transit levels only: event (Spree::Taxon) rules price event tickets, which have no route or trip.
|
|
18
|
+
LEVELS = %w[Spree::Variant Spree::Product SpreeCmCommissioner::Route].freeze
|
|
19
|
+
|
|
20
|
+
def call(channel_price_policy:, target:, attributes:, base_amount:)
|
|
21
|
+
@policy = channel_price_policy
|
|
22
|
+
@base = base_amount.to_d
|
|
23
|
+
target_index = LEVELS.index(target.class.base_class.name)
|
|
24
|
+
return failure(nil, 'Unsupported rule target') if target_index.nil?
|
|
25
|
+
|
|
26
|
+
price = rule_price(attributes.to_h.symbolize_keys)
|
|
27
|
+
parents = parents_of(target)
|
|
28
|
+
levels = LEVELS.each_with_index.map do |type, index|
|
|
29
|
+
if index < target_index
|
|
30
|
+
more_specific_level(type, target)
|
|
31
|
+
elsif index == target_index
|
|
32
|
+
{ type: type, state: :applies, price: price }
|
|
33
|
+
else
|
|
34
|
+
less_specific_level(type, parents[type])
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
levels << { type: :default, state: :overridden, price: default_price }
|
|
38
|
+
|
|
39
|
+
success(price: price, levels: levels)
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
private
|
|
43
|
+
|
|
44
|
+
def rules
|
|
45
|
+
@policy.channel_price_rules
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def parents_of(target)
|
|
49
|
+
case target
|
|
50
|
+
when Spree::Variant then { 'Spree::Product' => target.product, 'SpreeCmCommissioner::Route' => target.product&.trip&.route }
|
|
51
|
+
when Spree::Product then { 'SpreeCmCommissioner::Route' => target.trip&.route }
|
|
52
|
+
else {}
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Rules on the target's own trips or ticket types: they stay more specific than the new rule.
|
|
57
|
+
def more_specific_level(type, target)
|
|
58
|
+
product_ids = target.is_a?(Spree::Product) ? [target.id] : SpreeCmCommissioner::Trip.where(route_id: target.id).pluck(:product_id)
|
|
59
|
+
scopable_ids = type == 'Spree::Product' ? product_ids : Spree::Variant.where(product_id: product_ids, is_master: false).pluck(:id)
|
|
60
|
+
count = rules.where(scopable_type: type, scopable_id: scopable_ids).count
|
|
61
|
+
|
|
62
|
+
{ type: type, state: count.positive? ? :keeps_own : :none, count: count }
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
def less_specific_level(type, record)
|
|
66
|
+
rule = record && rules.find_by(scopable: record)
|
|
67
|
+
return { type: type, state: :none, record: record } if rule.nil?
|
|
68
|
+
|
|
69
|
+
{ type: type, state: :overridden, record: record, price: rule_price(rule.attributes.symbolize_keys) }
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
def rule_price(attrs)
|
|
73
|
+
return round(attrs[:amount].to_d) if attrs[:margin_type].to_s == 'fixed_price'
|
|
74
|
+
|
|
75
|
+
round(Calculator.apply_margin(@base, attrs[:margin_type], attrs[:margin_value], attrs[:margin_fixed_value]))
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
def default_price
|
|
79
|
+
round(Calculator.apply_margin(@base, @policy.default_margin_type, @policy.default_margin_value, @policy.default_margin_fixed_value))
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# Same rounding and floor as Calculator#price_for, so the preview matches checkout.
|
|
83
|
+
def round(amount)
|
|
84
|
+
[amount.to_d, 0].max.round(::Money::Currency.new(@policy.currency).exponent)
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
end
|
|
@@ -14,7 +14,7 @@ module SpreeCmCommissioner
|
|
|
14
14
|
prepend ::Spree::ServiceModule::Base
|
|
15
15
|
|
|
16
16
|
def call(query_results:, pricing_channel:, oauth_application: nil)
|
|
17
|
-
mapping = SpreeCmCommissioner::
|
|
17
|
+
mapping = SpreeCmCommissioner::PricingChannel::SOURCES[pricing_channel]
|
|
18
18
|
return success(query_results) if mapping.nil? || mapping[:channel_type].to_s.include?('agency')
|
|
19
19
|
|
|
20
20
|
trips = Array(query_results).flat_map(&:trips).select { |trip| trip.price.present? }
|
|
@@ -8,7 +8,7 @@ module SpreeCmCommissioner
|
|
|
8
8
|
#
|
|
9
9
|
# == What it does
|
|
10
10
|
# 1. Reads `pricing_channel` from the order and maps it to a ChannelPricePolicy `channel_type` + `platform`
|
|
11
|
-
# (
|
|
11
|
+
# (PricingChannel::SOURCES), e.g. 'platform_app' → :channel_platform, :app.
|
|
12
12
|
# 2. For non-agency channels (direct / platform):
|
|
13
13
|
# - Finds the buy policy by vendor + platform + channel_type.
|
|
14
14
|
# - Applies buy policy pricing (default margin or a scoped cm_channel_price_rules rule) to each line item.
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
module SpreeCmCommissioner
|
|
2
|
+
module Seats
|
|
3
|
+
# Gives a paid guest who has no seat yet the seat an organizer picked: the manual fix for a party
|
|
4
|
+
# Seats::AutoAssign left `unseated`, or a guest of a seat-selection ticket who ended up without one.
|
|
5
|
+
# Moving a guest who already has a seat is Seats::SwapSeats' job, not this one.
|
|
6
|
+
#
|
|
7
|
+
# Stock is untouched: the ticket's unit was already taken at checkout, only the seat was missing.
|
|
8
|
+
#
|
|
9
|
+
# success(guest: Guest)
|
|
10
|
+
# | failure(nil, :order_not_paid | :seat_assignment_pending | :already_seated | :block_not_found
|
|
11
|
+
# | :not_a_seat | :layout_not_active | :different_variant | :no_inventory | :seat_taken | :busy)
|
|
12
|
+
# | failure({ messages: [...] }, :guest_invalid)
|
|
13
|
+
class AssignGuest
|
|
14
|
+
prepend ::Spree::ServiceModule::Base
|
|
15
|
+
|
|
16
|
+
def call(guest:, block_id:, actor: nil)
|
|
17
|
+
line_item = guest.line_item
|
|
18
|
+
block = SpreeCmCommissioner::Block.find_by(id: block_id)
|
|
19
|
+
|
|
20
|
+
reason = ineligibility_reason(guest, line_item, block)
|
|
21
|
+
return failure(nil, reason) if reason
|
|
22
|
+
|
|
23
|
+
inventory_items = line_item.inventory_items.to_a
|
|
24
|
+
return failure(nil, :no_inventory) if inventory_items.empty?
|
|
25
|
+
|
|
26
|
+
outcome = assign!(guest, line_item, block, inventory_items, actor)
|
|
27
|
+
return failure(nil, outcome) unless outcome == :ok
|
|
28
|
+
|
|
29
|
+
CmAppLogger.log(
|
|
30
|
+
label: "#{self.class.name}#call success",
|
|
31
|
+
data: { guest_id: guest.id, block_id: block.id, line_item_id: line_item.id, actor_id: actor&.id }
|
|
32
|
+
)
|
|
33
|
+
success(guest: guest.reload)
|
|
34
|
+
rescue ActiveRecord::RecordNotUnique
|
|
35
|
+
# Another writer inserted this seat's first row between our read and insert.
|
|
36
|
+
failure(nil, :seat_taken)
|
|
37
|
+
rescue ActiveRecord::LockWaitTimeout
|
|
38
|
+
# AutoAssign::LOCK_TIMEOUT ran out: an auto-assign run for this ticket type is still going.
|
|
39
|
+
failure(nil, :busy)
|
|
40
|
+
rescue ActiveRecord::RecordInvalid => e
|
|
41
|
+
raise unless e.record.is_a?(SpreeCmCommissioner::Guest)
|
|
42
|
+
|
|
43
|
+
failure({ messages: e.record.errors.full_messages }, :guest_invalid)
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
private
|
|
47
|
+
|
|
48
|
+
# Everything decidable before taking any lock; assign! re-checks what can change under it.
|
|
49
|
+
def ineligibility_reason(guest, line_item, block)
|
|
50
|
+
order = line_item.order
|
|
51
|
+
return :order_not_paid unless order.completed? && !order.canceled?
|
|
52
|
+
return :seat_assignment_pending if line_item.seat_assignment_pending?
|
|
53
|
+
return :already_seated if guest.block_id.present?
|
|
54
|
+
return :block_not_found if block.nil?
|
|
55
|
+
return :not_a_seat unless block.seatable?
|
|
56
|
+
# Same rule as Seats::FreeRunsQuery: an inactive or archived layout's seats are not on sale.
|
|
57
|
+
return :layout_not_active unless block.seat_layout&.active?
|
|
58
|
+
return :different_variant if block.variant_id != line_item.variant_id
|
|
59
|
+
|
|
60
|
+
nil
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def assign!(guest, line_item, block, inventory_items, actor)
|
|
64
|
+
ActiveRecord::Base.transaction do
|
|
65
|
+
# Same lock Seats::AutoAssign holds while seating this ticket type, so the job can never seat
|
|
66
|
+
# this guest (or hand out this seat) between the checks below and the writes.
|
|
67
|
+
AutoAssign.lock_inventory_items!(inventory_items.map(&:id))
|
|
68
|
+
|
|
69
|
+
# Re-checked under the order's row lock, taken in the same order as Seats::AutoAssign (advisory
|
|
70
|
+
# lock, then order). A cancel commits its seat release under this lock, so without the re-check
|
|
71
|
+
# a cancel landing after ineligibility_reason would leave this seat reserved for a canceled
|
|
72
|
+
# order, never to be released.
|
|
73
|
+
order = line_item.order
|
|
74
|
+
order.lock!
|
|
75
|
+
next :order_not_paid unless order.completed? && !order.canceled?
|
|
76
|
+
|
|
77
|
+
# A resume can mark the party pending after ineligibility_reason; seating its guest here would
|
|
78
|
+
# leave the job nobody to seat, so it would never move the party off `pending`.
|
|
79
|
+
next :seat_assignment_pending if line_item.reload.seat_assignment_pending?
|
|
80
|
+
|
|
81
|
+
guest.lock!
|
|
82
|
+
next :already_seated if guest.block_id.present?
|
|
83
|
+
|
|
84
|
+
rows = inventory_items.index_with do |inventory_item|
|
|
85
|
+
SpreeCmCommissioner::ReservedBlock.lock.find_or_initialize_by(block_id: block.id, inventory_item_id: inventory_item.id)
|
|
86
|
+
end
|
|
87
|
+
next :seat_taken if rows.values.any? { |row| row.persisted? && row.unavailable? }
|
|
88
|
+
|
|
89
|
+
rows.each { |inventory_item, row| reserve!(row, inventory_item, guest, actor) }
|
|
90
|
+
|
|
91
|
+
# Guest#assign_seat_number_with_block copies the label into seat_number, and
|
|
92
|
+
# Guest#preload_order_block_ids refreshes the order's list so a later cancel releases it.
|
|
93
|
+
guest.update!(block_id: block.id)
|
|
94
|
+
settle_seat_assignment_status!(line_item)
|
|
95
|
+
|
|
96
|
+
:ok
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# Same attributes Seats::AutoAssign and ReservedBlocks::Reserve write; a `canceled` row left by a
|
|
101
|
+
# previous guest is reused, since (block_id, inventory_item_id) is unique for the row's lifetime.
|
|
102
|
+
def reserve!(row, inventory_item, guest, actor)
|
|
103
|
+
row.update!(
|
|
104
|
+
status: :reserved,
|
|
105
|
+
guest: guest,
|
|
106
|
+
gender: guest.gender || guest.saved_guest&.gender,
|
|
107
|
+
expired_at: nil,
|
|
108
|
+
payment_locked_at: nil,
|
|
109
|
+
inventory_date: inventory_item.inventory_date,
|
|
110
|
+
updated_by: actor
|
|
111
|
+
)
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
# An `unseated` party whose last guest was just seated is no longer waiting on the organizer.
|
|
115
|
+
# update_columns: LineItem validations (purchase limits) must not block a paid order's seat.
|
|
116
|
+
def settle_seat_assignment_status!(line_item)
|
|
117
|
+
return unless line_item.seat_assignment_unseated?
|
|
118
|
+
return if line_item.guests.exists?(block_id: nil)
|
|
119
|
+
|
|
120
|
+
line_item.update_columns(seat_assignment_status: :manual) # rubocop:disable Rails/SkipsModelValidations
|
|
121
|
+
end
|
|
122
|
+
end
|
|
123
|
+
end
|
|
124
|
+
end
|
|
@@ -30,12 +30,24 @@ module SpreeCmCommissioner
|
|
|
30
30
|
|
|
31
31
|
UNSEATED = { status: :unseated, block_ids: [] }.freeze
|
|
32
32
|
|
|
33
|
+
# Sorted so two orders spanning the same items always lock them in the same order. Public because
|
|
34
|
+
# Seats::AssignGuest takes the same lock: a manual seat for a guest this job is about to seat
|
|
35
|
+
# would otherwise leave that guest holding two reserved seats. Must run inside a transaction.
|
|
36
|
+
def self.lock_inventory_items!(inventory_item_ids)
|
|
37
|
+
connection = ActiveRecord::Base.connection
|
|
38
|
+
connection.execute("SET LOCAL lock_timeout = '#{LOCK_TIMEOUT}'")
|
|
39
|
+
|
|
40
|
+
inventory_item_ids.sort.each do |id|
|
|
41
|
+
connection.execute("SELECT pg_advisory_xact_lock(#{Zlib.crc32("spree_cm_commissioner:seat_auto_assign:#{id}")})")
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
33
45
|
def call(order:)
|
|
34
46
|
inventory_item_ids = order.line_items.select(&:auto_assign_seats?).filter_map { |li| li.inventory_items.first&.id }.uniq
|
|
35
47
|
return success([]) if inventory_item_ids.empty?
|
|
36
48
|
|
|
37
49
|
outcomes = ActiveRecord::Base.transaction do
|
|
38
|
-
lock_inventory_items!(inventory_item_ids)
|
|
50
|
+
self.class.lock_inventory_items!(inventory_item_ids)
|
|
39
51
|
|
|
40
52
|
# Taken after the advisory lock so the order row is not held while queueing. The job is
|
|
41
53
|
# enqueued inside the completion transaction, which still holds this row: lock! waits for
|
|
@@ -58,16 +70,6 @@ module SpreeCmCommissioner
|
|
|
58
70
|
|
|
59
71
|
private
|
|
60
72
|
|
|
61
|
-
# Sorted so two orders spanning the same items always lock them in the same order.
|
|
62
|
-
def lock_inventory_items!(inventory_item_ids)
|
|
63
|
-
connection = ActiveRecord::Base.connection
|
|
64
|
-
connection.execute("SET LOCAL lock_timeout = '#{LOCK_TIMEOUT}'")
|
|
65
|
-
|
|
66
|
-
inventory_item_ids.sort.each do |id|
|
|
67
|
-
connection.execute("SELECT pg_advisory_xact_lock(#{Zlib.crc32("spree_cm_commissioner:seat_auto_assign:#{id}")})")
|
|
68
|
-
end
|
|
69
|
-
end
|
|
70
|
-
|
|
71
73
|
def assign_line_item!(order, line_item)
|
|
72
74
|
guests = line_item.guests.where(block_id: nil).order(:id).to_a
|
|
73
75
|
return nil if guests.empty?
|
|
@@ -55,7 +55,7 @@ module SpreeCmCommissioner
|
|
|
55
55
|
# Orders without a known pricing_channel (storefront/tenant orders today) can never be
|
|
56
56
|
# settled, so leave them out instead of retrying them on every run.
|
|
57
57
|
orders = Spree::Order.complete
|
|
58
|
-
.where(pricing_channel: SpreeCmCommissioner::
|
|
58
|
+
.where(pricing_channel: SpreeCmCommissioner::PricingChannel::SOURCES.keys)
|
|
59
59
|
.where.not(id: already_processed)
|
|
60
60
|
return orders if @vendor_id.nil?
|
|
61
61
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
<% content_for(:page_tabs) do %>
|
|
3
2
|
<%= content_tag :li, class: 'nav-item' do %>
|
|
4
3
|
<%= link_to_with_icon 'edit.svg',
|
|
@@ -7,28 +6,13 @@
|
|
|
7
6
|
class: "nav-link #{'active' if current == :details}" %>
|
|
8
7
|
<% end if can?(:manage, Spree::Taxonomy) %>
|
|
9
8
|
|
|
9
|
+
<%# A section's products and hotels are managed on its top-level taxon's Sections tab, not on the section itself. %>
|
|
10
10
|
<%= content_tag :li, class: 'nav-item' do %>
|
|
11
|
-
<%= link_to_with_icon '
|
|
12
|
-
Spree.t(:
|
|
13
|
-
|
|
14
|
-
class: "nav-link #{'active' if current == :
|
|
15
|
-
<% end if can?(:manage,
|
|
16
|
-
|
|
17
|
-
<% if @taxon.depth != 1 %>
|
|
18
|
-
<%= content_tag :li, class: 'nav-item' do %>
|
|
19
|
-
<%= link_to_with_icon 'inbox.svg',
|
|
20
|
-
Spree.t(:products),
|
|
21
|
-
admin_taxonomy_taxon_classifications_url(@taxonomy.id, @taxon.id),
|
|
22
|
-
class: "nav-link #{'active' if current == :products}" %>
|
|
23
|
-
<% end if can?(:manage, Spree::Classification)%>
|
|
24
|
-
<% else %>
|
|
25
|
-
<%= content_tag :li, class: 'nav-item' do %>
|
|
26
|
-
<%= link_to_with_icon 'store.svg',
|
|
27
|
-
Spree.t(:sections),
|
|
28
|
-
admin_taxonomy_taxon_taxon_childrens_url(@taxonomy.id, @taxon.id),
|
|
29
|
-
class: "nav-link #{'active' if current == :sections}" %>
|
|
30
|
-
<% end if can?(:manage, Spree::Taxon)%>
|
|
31
|
-
<% end %>
|
|
11
|
+
<%= link_to_with_icon 'inbox.svg',
|
|
12
|
+
Spree.t(:sections),
|
|
13
|
+
admin_taxonomy_taxon_taxon_sections_url(@taxonomy.id, @taxon.id),
|
|
14
|
+
class: "nav-link #{'active' if current == :sections}" %>
|
|
15
|
+
<% end if can?(:manage, Spree::Taxon) && @taxon.depth == 1 %>
|
|
32
16
|
|
|
33
17
|
<%# user event only show for event %>
|
|
34
18
|
<%= content_tag :li, class: 'nav-item' do %>
|
|
@@ -40,8 +24,8 @@
|
|
|
40
24
|
|
|
41
25
|
<%= content_tag :li, class: 'nav-item' do %>
|
|
42
26
|
<%= link_to_with_icon 'store.svg',
|
|
43
|
-
Spree.t(:
|
|
27
|
+
Spree.t(:pass_designs),
|
|
44
28
|
admin_taxonomy_taxon_guest_card_classes_url(@taxonomy.id, @taxon.id),
|
|
45
29
|
class: "nav-link #{'active' if current == :guest_card_classes}" %>
|
|
46
30
|
<% end if can?(:manage, SpreeCmCommissioner::GuestCardClasses) && @taxon.event? && @taxon.depth == 1 %>
|
|
47
|
-
<% end %>
|
|
31
|
+
<% end %>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<%# :section, :modal_id, :products, :hotels — which forms to offer. A section with one kind only offers that kind, so
|
|
2
|
+
mixing only happens on purpose; an empty (or already mixed) section gets a tab for each.
|
|
3
|
+
The title names what's being added, not the section: a section called "Hotels" made "Add to Hotels" read like a tab. %>
|
|
4
|
+
<% title_key = if products && hotels then 'section_products.add_products_or_hotels' elsif products then 'section_products.add_products' else 'section_hotels.add_hotels' end %>
|
|
5
|
+
<div class="modal fade" id="<%= modal_id %>" tabindex="-1" role="dialog" aria-labelledby="<%= modal_id %>_label" aria-hidden="true">
|
|
6
|
+
<div class="modal-dialog modal-lg" role="document">
|
|
7
|
+
<div class="modal-content">
|
|
8
|
+
<div class="modal-header">
|
|
9
|
+
<div>
|
|
10
|
+
<h5 class="modal-title" id="<%= modal_id %>_label"><%= Spree.t(title_key) %></h5>
|
|
11
|
+
<small class="text-muted"><%= Spree.t('section_products.in_section', section: section.name) %></small>
|
|
12
|
+
</div>
|
|
13
|
+
<button type="button" class="close" data-dismiss="modal" aria-label="<%= Spree.t(:close) %>">
|
|
14
|
+
<span aria-hidden="true">×</span>
|
|
15
|
+
</button>
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
<% if products && hotels %>
|
|
19
|
+
<ul class="nav nav-tabs px-3 pt-3" role="tablist">
|
|
20
|
+
<li class="nav-item">
|
|
21
|
+
<a class="nav-link active" data-toggle="tab" href="#<%= modal_id %>_products" role="tab"><%= Spree.t(:products) %></a>
|
|
22
|
+
</li>
|
|
23
|
+
<li class="nav-item">
|
|
24
|
+
<a class="nav-link" data-toggle="tab" href="#<%= modal_id %>_hotels" role="tab"><%= Spree.t('section_hotels.title') %></a>
|
|
25
|
+
</li>
|
|
26
|
+
</ul>
|
|
27
|
+
<div class="tab-content">
|
|
28
|
+
<div class="tab-pane fade show active" id="<%= modal_id %>_products" role="tabpanel"><%= render 'product_picker', section: section %></div>
|
|
29
|
+
<div class="tab-pane fade" id="<%= modal_id %>_hotels" role="tabpanel"><%= render 'hotel_picker', section: section %></div>
|
|
30
|
+
</div>
|
|
31
|
+
<% elsif products %>
|
|
32
|
+
<%= render 'product_picker', section: section %>
|
|
33
|
+
<% else %>
|
|
34
|
+
<%= render 'hotel_picker', section: section %>
|
|
35
|
+
<% end %>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<%# Shared by the products and hotels tables (table-layout: fixed) so columns line up across every section card:
|
|
2
|
+
grip, thumbnail, name, five data columns, actions. Hotels leave the fifth (Listed) empty. The five data columns
|
|
3
|
+
have no width, so they split what's left after the name's share evenly instead of the name taking all the slack. %>
|
|
4
|
+
<colgroup>
|
|
5
|
+
<col style="width: 44px">
|
|
6
|
+
<col style="width: 64px">
|
|
7
|
+
<col style="width: 30%">
|
|
8
|
+
<% 5.times do %>
|
|
9
|
+
<col>
|
|
10
|
+
<% end %>
|
|
11
|
+
<col style="width: 64px">
|
|
12
|
+
</colgroup>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<%# :url, :title — styled like Spree's link_to_delete, but a plain DELETE link (jquery_ujs submits it as a form) so the
|
|
2
|
+
server redirect reloads the page. link_to_delete adds .delete-resource, which admin.js turns into an AJAX call that
|
|
3
|
+
only removes a <tr> or .removable-dom-element, and our actions answer with a redirect.
|
|
4
|
+
Tooltip on the left: it's the last column, and Spree's default (top) has no room inside .table-responsive, so
|
|
5
|
+
Bootstrap flips it right, off-screen. %>
|
|
6
|
+
<%= link_to_with_icon 'delete.svg', title, url,
|
|
7
|
+
method: :delete,
|
|
8
|
+
no_text: true,
|
|
9
|
+
class: 'btn btn-danger btn-sm',
|
|
10
|
+
data: { confirm: Spree.t(:are_you_sure), placement: 'left' } %>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<%# :section — the hotels form inside the section's Add modal. %>
|
|
2
|
+
<%= form_tag spree.add_hotels_admin_taxonomy_taxon_taxon_section_path(@taxonomy.id, @taxon.id, section.id), method: :post do %>
|
|
3
|
+
<div class="modal-body">
|
|
4
|
+
<%= label_tag "section_#{section.id}_vendor_ids", Spree.t('section_hotels.title') %>
|
|
5
|
+
<%# Accommodation vendors of the event's tenant only (see TaxonSectionsController#event_tenant_id); the app renders a
|
|
6
|
+
section's vendors as hotel cards. Inline width: see _product_picker. %>
|
|
7
|
+
<%= select_tag 'vendor_ids', nil,
|
|
8
|
+
multiple: true,
|
|
9
|
+
id: "section_#{section.id}_vendor_ids",
|
|
10
|
+
class: 'select2autocomplete',
|
|
11
|
+
style: 'width: 100%',
|
|
12
|
+
data: {
|
|
13
|
+
autocomplete_placeholder_value: Spree.t('section_hotels.search_placeholder'),
|
|
14
|
+
autocomplete_url_value: 'homepage_section_relatables_api_v2',
|
|
15
|
+
autocomplete_return_attr_value: :name_with_slug,
|
|
16
|
+
autocomplete_search_query_value: 'name_or_slug_i_cont',
|
|
17
|
+
autocomplete_min_input_value: 2,
|
|
18
|
+
autocomplete_multiple_value: true,
|
|
19
|
+
autocomplete_additional_url_params_value: "model_class=Spree::Vendor&primary_product_type=accommodation&tenant_id=#{event_tenant_id || 0}"
|
|
20
|
+
} %>
|
|
21
|
+
</div>
|
|
22
|
+
<div class="modal-footer">
|
|
23
|
+
<button type="button" class="btn btn-secondary" data-dismiss="modal"><%= Spree.t(:cancel) %></button>
|
|
24
|
+
<%= button_tag Spree.t('section_products.add'), type: 'submit', class: 'btn btn-success' %>
|
|
25
|
+
</div>
|
|
26
|
+
<% end %>
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
<%# :section, :taxon_vendors, :titled — titled only when the section also has products, to tell the two lists apart. %>
|
|
2
|
+
<% reorderable = taxon_vendors.size > 1 && can?(:update, @taxon) %>
|
|
3
|
+
|
|
4
|
+
<% if titled %>
|
|
5
|
+
<h6 class="section-inset pt-3 mb-0 text-muted small text-uppercase border-top"><%= Spree.t('section_hotels.title') %></h6>
|
|
6
|
+
<% end %>
|
|
7
|
+
<div class="table-responsive">
|
|
8
|
+
<table class="table mb-0 section-items-table"
|
|
9
|
+
<%= tag.attributes(data: { section_sortable_link: spree.reorder_hotels_admin_taxonomy_taxon_taxon_section_path(@taxonomy.id, @taxon.id, section.id) }) if reorderable %>>
|
|
10
|
+
<%= render 'columns' %>
|
|
11
|
+
<thead class="text-muted">
|
|
12
|
+
<tr>
|
|
13
|
+
<th scope="col" class="section-handle-col"></th>
|
|
14
|
+
<th scope="col" colspan="2"><%= Spree.t('section_hotels.hotel') %></th>
|
|
15
|
+
<th scope="col" class="text-center"><%= Spree.t(:status) %></th>
|
|
16
|
+
<th scope="col" class="text-center"><%= Spree.t(:price) %></th>
|
|
17
|
+
<th scope="col" class="text-center"><%= Spree.t('section_hotels.stars') %></th>
|
|
18
|
+
<th scope="col" class="text-center"><%= Spree.t('section_hotels.location') %></th>
|
|
19
|
+
<th scope="col"></th>
|
|
20
|
+
<th scope="col"></th>
|
|
21
|
+
</tr>
|
|
22
|
+
</thead>
|
|
23
|
+
<tbody>
|
|
24
|
+
<% taxon_vendors.each do |taxon_vendor| %>
|
|
25
|
+
<% vendor = taxon_vendor.vendor %>
|
|
26
|
+
<tr id="<%= spree_dom_id taxon_vendor %>" data-sortable-id="<%= taxon_vendor.id %>">
|
|
27
|
+
<%# The column is kept even when there's nothing to drag, so rows line up with the section's own grip. %>
|
|
28
|
+
<td class="section-handle-col <%= 'section-item-move-handle' if reorderable %>" title="<%= Spree.t('section_products.drag_hint') if reorderable %>">
|
|
29
|
+
<%= svg_icon(name: 'grip-vertical.svg', width: '18', height: '18') if reorderable %>
|
|
30
|
+
</td>
|
|
31
|
+
<td class="section-thumb">
|
|
32
|
+
<% if vendor.logo&.attachment&.attached? %>
|
|
33
|
+
<%= image_tag main_app.rails_blob_url(vendor.logo.attachment) %>
|
|
34
|
+
<% else %>
|
|
35
|
+
<span class="section-thumb-placeholder d-inline-flex align-items-center justify-content-center text-muted">
|
|
36
|
+
<%= svg_icon(name: 'store.svg', width: '18', height: '18') %>
|
|
37
|
+
</span>
|
|
38
|
+
<% end %>
|
|
39
|
+
</td>
|
|
40
|
+
<td>
|
|
41
|
+
<%= link_to vendor.name, spree.edit_admin_vendor_path(vendor) %>
|
|
42
|
+
<% if vendor.tenant_id != event_tenant_id %>
|
|
43
|
+
<span class="badge badge-warning ml-1" title="<%= Spree.t('section_products.other_tenant_hint') %>"><%= Spree.t('section_products.other_tenant') %></span>
|
|
44
|
+
<% end %>
|
|
45
|
+
<% unless vendor.accommodation? %>
|
|
46
|
+
<span class="badge badge-warning ml-1" title="<%= Spree.t('section_hotels.not_accommodation_hint') %>"><%= Spree.t('section_hotels.not_accommodation') %></span>
|
|
47
|
+
<% end %>
|
|
48
|
+
<br />
|
|
49
|
+
<small class="text-muted"><%= vendor.slug %></small>
|
|
50
|
+
</td>
|
|
51
|
+
<%# The storefront serializes a section's vendors unfiltered, so a pending/blocked hotel still shows in the app. %>
|
|
52
|
+
<td class="text-center">
|
|
53
|
+
<span title="<%= Spree.t('section_hotels.inactive_hint') unless vendor.active? %>">
|
|
54
|
+
<%= active_badge(vendor.active?, label: vendor.state.to_s.humanize) %>
|
|
55
|
+
</span>
|
|
56
|
+
</td>
|
|
57
|
+
<%# min_price/max_price are cached from the hotel's room rates (see VendorDecorator#update_min_max_price). %>
|
|
58
|
+
<td class="text-center">
|
|
59
|
+
<% if vendor.min_price.zero? %>
|
|
60
|
+
-
|
|
61
|
+
<% elsif vendor.max_price > vendor.min_price %>
|
|
62
|
+
<%= vendor.display_min_price %> - <%= vendor.display_max_price %>
|
|
63
|
+
<% else %>
|
|
64
|
+
<%= vendor.display_min_price %>
|
|
65
|
+
<% end %>
|
|
66
|
+
</td>
|
|
67
|
+
<td class="text-center text-nowrap"><%= vendor.star_rating.to_i.positive? ? '★' * vendor.star_rating : '-' %></td>
|
|
68
|
+
<td class="text-center"><%= vendor.default_state&.name || '-' %></td>
|
|
69
|
+
<td></td>
|
|
70
|
+
<td class="actions pr-3">
|
|
71
|
+
<span class="d-flex justify-content-end">
|
|
72
|
+
<%= render 'delete_link',
|
|
73
|
+
url: spree.remove_hotel_admin_taxonomy_taxon_taxon_section_path(@taxonomy.id, @taxon.id, section.id, taxon_vendor.id),
|
|
74
|
+
title: Spree.t('section_hotels.remove') if can?(:update, @taxon) %>
|
|
75
|
+
</span>
|
|
76
|
+
</td>
|
|
77
|
+
</tr>
|
|
78
|
+
<% end %>
|
|
79
|
+
</tbody>
|
|
80
|
+
</table>
|
|
81
|
+
</div>
|