Skip to content

Commit 6937d34

Browse files
Fix record count for national reporting uploads with blank lines
We have to include ignored rows in this for national reporting, so that the statistics make sense to users. Jira-Issue: MAV-3401
1 parent 7939a42 commit 6937d34

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

app/components/app_import_statistics_component.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
class AppImportStatisticsComponent < ViewComponent::Base
44
erb_template <<-ERB
5-
<p><strong>Out of <%= pluralize(@import.rows_count, "record") %> found in the file:</strong></p>
5+
<p><strong>Out of <%= pluralize(@import.records_count, "record") %> found in the file:</strong></p>
66
<ul>
77
<li><%= pluralize(@import.new_record_count, "new record") %> imported</li>
88
<li><%= pluralize(@import.exact_duplicate_record_count, "duplicate") %> not imported</li>

app/models/immunisation_import.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,11 @@ def show_cancelled_reviewer?
5757
end
5858

5959
def records_count
60-
vaccination_records.count
60+
if national_reporting?
61+
vaccination_records.count + (ignored_record_count || 0)
62+
else
63+
vaccination_records.count
64+
end
6165
end
6266

6367
private

0 commit comments

Comments
 (0)