Bugzilla – Attachment 55599 Details for
Bug 17135
Fine for the previous overdue may get overwritten by the next one
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17135: [QA Follow-up] Changes as to reporting
Bug-17135-QA-Follow-up-Changes-as-to-reporting.patch (text/plain), 3.55 KB, created by
Marcel de Rooy
on 2016-09-16 06:51:57 UTC
(
hide
)
Description:
Bug 17135: [QA Follow-up] Changes as to reporting
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2016-09-16 06:51:57 UTC
Size:
3.55 KB
patch
obsolete
>From 9726bba3c990cacf6526a54cc72fc86c4eec2290 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 9 Sep 2016 10:53:48 +0200 >Subject: [PATCH] Bug 17135: [QA Follow-up] Changes as to reporting >Content-Type: text/plain; charset=utf-8 > >We should at least report some grand totals when fixing fine records. >This patch also includes some cosmetic whitespace swapping. >Turned one last into an if statement. > >Added a copyright statement too. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > .../fix_unclosed_nonaccruing_fines_bug17135.pl | 31 +++++++++++++------- > 1 file changed, 20 insertions(+), 11 deletions(-) > >diff --git a/installer/data/mysql/fix_unclosed_nonaccruing_fines_bug17135.pl b/installer/data/mysql/fix_unclosed_nonaccruing_fines_bug17135.pl >index b44d6f2..b7f1efd 100755 >--- a/installer/data/mysql/fix_unclosed_nonaccruing_fines_bug17135.pl >+++ b/installer/data/mysql/fix_unclosed_nonaccruing_fines_bug17135.pl >@@ -1,5 +1,7 @@ > #!/usr/bin/perl > >+# Copyright 2016 Jacek Ablewicz >+# > # This file is part of Koha. > # > # Koha is free software; you can redistribute it and/or modify it >@@ -97,10 +99,9 @@ sub Bug_17135_fix { > ## which does not require any correction > next if ($fine->{description} =~ /$due_qr/); > >- { >+ if( !$old_date_pattern ) { > ## for extracting old due date from fine description > ## not used for fixing anything, logging/debug purposes only >- last if $old_date_pattern; > $old_date_pattern = $due; > $old_date_pattern =~ s/[A-Za-z]/\[A-Za-z\]/g; > $old_date_pattern =~ s/[0-9]/\\d/g; >@@ -174,15 +175,12 @@ sub Bug_17135_fix { > }; > } > >- if ($verbose) { >- Warn("Fine records with mismatched old vs current due dates: $different_dates_cnt"); >- Warn("Non-accruing accountlines FU records (item not due): ".$not_due_not_accruning_cnt); >- Warn("Non-accruing accountlines FU records (item due): ".$due_not_accruning_cnt); >+ if( $verbose ) { >+ Warn( "Fine records with mismatched old vs current due dates: $different_dates_cnt" ); >+ Warn( "Non-accruing accountlines FU records (item not due): ".$not_due_not_accruning_cnt ); >+ Warn( "Non-accruing accountlines FU records (item due): ".$due_not_accruning_cnt ); > } > >- if (@$forfixing > 0) { >- Warn("Dry run (test only mode), skipping ".scalar(@$forfixing)." database changes.") unless ($confirm); >- } > my $updated_cnt = 0; > my $update_sql = "UPDATE accountlines SET accounttype = 'F' WHERE accounttype = 'FU' AND accountlines_id = ? LIMIT 1"; > for my $fine (@$forfixing) { >@@ -197,8 +195,19 @@ sub Bug_17135_fix { > $updated_cnt += $rows_affected; > logaction("FINES", "FU", $fine->{borrowernumber}, $logentry) if ($log); > } >- if (@$forfixing > 0 && $confirm && $mode eq 'production') { >- Warn("Database update done, $updated_cnt".((@$forfixing == $updated_cnt)? "": "/".scalar(@$forfixing))." fine records closed successfully."); >+ >+ # Regardless of verbose, we report at least a number here >+ if( @$forfixing > 0 ) { >+ if( $confirm && $mode eq 'production') { >+ Warn( "Database update done, $updated_cnt". >+ ( @$forfixing == $updated_cnt? "": ( "/". @$forfixing )). >+ " fine records closed successfully." ); >+ } else { >+ Warn( "Dry run (test only mode), skipping ". @$forfixing. >+ " fine records." ); >+ } >+ } else { >+ Warn( "No fine records needed to be fixed" ); > } > } > >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 17135
:
54972
|
55074
|
55075
|
55077
|
55080
|
55081
|
55082
|
55413
|
55414
|
55595
|
55596
|
55597
|
55598
| 55599 |
55671