diff --git a/app/models/stats/stats_report.rb b/app/models/stats/stats_report.rb index 6ce13ce613..141226d76a 100644 --- a/app/models/stats/stats_report.rb +++ b/app/models/stats/stats_report.rb @@ -29,6 +29,7 @@ def updatable? Report.new(name: :agfs_management_information_statistics, date_required: true), Report.new(name: :lgfs_management_information_statistics, date_required: true), Report.new(name: :provisional_assessment), + Report.new(name: :provisional_assessment_new), Report.new(name: :rejections_refusals), Report.new(name: :submitted_claims), Report.new(name: :reports_access_details, hidden: true, updatable: false)].freeze diff --git a/app/services/reports/provisional_assessments_new.rb b/app/services/reports/provisional_assessments_new.rb index d857863a84..5abff119e9 100644 --- a/app/services/reports/provisional_assessments_new.rb +++ b/app/services/reports/provisional_assessments_new.rb @@ -21,7 +21,7 @@ class ProvisionalAssessmentsNew } ].freeze - def self.call = new.call + def self.call(...) = new(...).call def call Claim::BaseClaim.includes(INCLUDES) @@ -31,12 +31,20 @@ def call private - def format_row(claim) - total = claim.total_including_vat - assessed = claim.amount_assessed + def format_row(claim) = summary_fields(claim) + extended_fields(claim) + + def summary_fields(claim) + [ + claim.provider.name, + claim.total_including_vat, + claim.amount_assessed, + claim.total_including_vat - claim.amount_assessed + ] + end + + def extended_fields(claim) [ - claim.provider.name, total, assessed, total - assessed, - claim.type.gsub(/Claim::/, ''), + claim.type.gsub('Claim::', ''), claim.case_type.name, claim.earliest_representation_order_date, claim.case_workers.last.name, diff --git a/app/services/stats/simple_report_generator.rb b/app/services/stats/simple_report_generator.rb index c261c4e3d1..5b58fb7d6a 100644 --- a/app/services/stats/simple_report_generator.rb +++ b/app/services/stats/simple_report_generator.rb @@ -21,7 +21,8 @@ def report_klass @report_klass ||= { provisional_assessment: Reports::ProvisionalAssessments, rejections_refusals: Reports::RejectionsRefusals, - submitted_claims: Reports::SubmittedClaims + submitted_claims: Reports::SubmittedClaims, + provisional_assessment_new: Reports::ProvisionalAssessmentsNew }[@report.to_sym] end end diff --git a/config/locales/en/views/management_information.yml b/config/locales/en/views/management_information.yml index fd9f8dba11..8b6aa3a9f3 100644 --- a/config/locales/en/views/management_information.yml +++ b/config/locales/en/views/management_information.yml @@ -56,6 +56,7 @@ en: management_information_v2_html: | Management information beta provisional_assessment_html: Provisional assessment + provisional_assessment_new_html: Provisional assessment (New) rejections_refusals_html: 'Rejections/Refusals' submitted_claims_html: Submitted claims reports_access_details_html: Reports access details