|
Line 0
Link Here
|
| 0 |
- |
1 |
use Modern::Perl; |
|
|
2 |
|
| 3 |
return { |
| 4 |
bug_number => "29457", |
| 5 |
description => "Check manager_id in cancelled account lines", |
| 6 |
up => sub { |
| 7 |
my ($args) = @_; |
| 8 |
my ($dbh, $out) = @$args{qw(dbh out)}; |
| 9 |
my ( $count_empty ) = $dbh->selectrow_array( |
| 10 |
q{SELECT COUNT(*) FROM accountlines WHERE credit_type_code = 'CANCELLATION' AND manager_id IS NULL} |
| 11 |
); |
| 12 |
my ( $count_bad ) = $dbh->selectrow_array( |
| 13 |
q{SELECT COUNT(*) FROM accountlines WHERE credit_type_code = 'CANCELLATION' AND manager_id IS NOT NULL} |
| 14 |
); |
| 15 |
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; |
| 16 |
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; |
| 17 |
say $out "Your data did not contain missing or incorrect manager_id's in cancelled account lines" unless $count_empty or $count_bad; |
| 18 |
}, |
| 19 |
} |