From f4eb618d1908c1962e568be363b5cd067b35d865 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Fri, 26 Nov 2021 07:53:44 +0000 Subject: [PATCH] Bug 29457: (QA follow-up) Report about checked manager_id's Content-Type: text/plain; charset=utf-8 We print the number of missing or incorrect manager_id's now. Signed-off-by: Marcel de Rooy --- .../data/mysql/atomicupdate/bug_29457.pl | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 installer/data/mysql/atomicupdate/bug_29457.pl diff --git a/installer/data/mysql/atomicupdate/bug_29457.pl b/installer/data/mysql/atomicupdate/bug_29457.pl new file mode 100755 index 0000000000..23e9d13016 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_29457.pl @@ -0,0 +1,19 @@ +use Modern::Perl; + +return { + bug_number => "29457", + description => "Check manager_id in cancelled account lines", + up => sub { + my ($args) = @_; + my ($dbh, $out) = @$args{qw(dbh out)}; + my ( $count_empty ) = $dbh->selectrow_array( + q{SELECT COUNT(*) FROM accountlines WHERE credit_type_code = 'CANCELLATION' AND manager_id IS NULL} + ); + my ( $count_bad ) = $dbh->selectrow_array( + q{SELECT COUNT(*) FROM accountlines WHERE credit_type_code = 'CANCELLATION' AND manager_id IS NOT NULL} + ); + say $out "Note: We counted $count_empty cancellations in accountlines with a missing manager_id. We regret that, but it can't hurt. This release/upgrade fixed the bug causing it." if $count_empty; + say $out "Warning: We counted $count_bad cancellations in accountlines with an incorrect manager_id. This does not really hurt, but if you want to clear or even correct the data, please go to the following URL: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29457#c31" if $count_bad; + say $out "Your data did not contain missing or incorrect manager_id's in cancelled account lines" unless $count_empty or $count_bad; + }, +} -- 2.20.1