Skip to content

Commit

Permalink
Merge pull request #2670 from bitzesty/tweak-product-data-in-report
Browse files Browse the repository at this point in the history
Correct keys for product service data for entries report
  • Loading branch information
DaniBitZesty authored Oct 31, 2023
2 parents 71fb974 + dacb82b commit c036b22
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions app/models/reports/data_pickers/form_document_picker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -297,18 +297,14 @@ def product_service
if obj.award_year.year <= 2020
doc("mobility_desc_short")
else
doc("application_category") == "initiative" ? doc("initiative_desc_short") : doc("organisation_desc_short")
end
else
if obj.award_year.year <= 2023
doc("trade_goods_briefly")
else
if doc("trade_goods_and_services_explanations").present?
doc("trade_goods_and_services_explanations").map{ |h| h.dig("desc_short") }
.reject(&:blank?)
.join(", ")
if obj.award_year.year <= 2023
doc("application_category") == "initiative" ? doc("initiative_desc_short") : doc("organisation_desc_short")
else
doc("initiative_desc_short")
end
end
else
obj.award_year.year <= 2023 ? doc("trade_goods_briefly") : doc("trade_description_short")
end

ActionView::Base.full_sanitizer.sanitize(service)
Expand Down

0 comments on commit c036b22

Please sign in to comment.