Bug 20598: (QA follow-up) Tiny fixes
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Fri, 16 Nov 2018 09:37:55 +0000 (10:37 +0100)
committer“Lucas Gass” <lucas@bywatersolutions.com>
Tue, 4 Dec 2018 18:51:54 +0000 (18:51 +0000)
[1] Correct POD for _FixOverduesOnReturn
Is called by AddReturn, AddRenewal and LostItem.
Also tested in Circulation.t btw

[2] $dbh is not used in _FixOverduesOnReturn
[3] Moving all parameters to the first line.
[4] Variable $uquery is not used too.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 867f88076eb47c434c3edf6f7903238b5a465cdb)

C4/Circulation.pm

index b340162..1a29ce6 100644 (file)
@@ -2298,22 +2298,20 @@ C<$itm> itemnumber
 C<$exemptfine> BOOL -- remove overdue charge associated with this issue. 
 C<$dropboxmode> BOOL -- remove lastincrement on overdue charge associated with this issue.
 
-Internal function, called only by AddReturn
+Internal function
 
 =cut
 
 sub _FixOverduesOnReturn {
-    my ($borrowernumber, $item);
-    unless ($borrowernumber = shift) {
+    my ($borrowernumber, $item, $exemptfine, $dropbox ) = @_;
+    unless( $borrowernumber ) {
         warn "_FixOverduesOnReturn() not supplied valid borrowernumber";
         return;
     }
-    unless ($item = shift) {
+    unless( $item ) {
         warn "_FixOverduesOnReturn() not supplied valid itemnumber";
         return;
     }
-    my ($exemptfine, $dropbox) = @_;
-    my $dbh = C4::Context->dbh;
 
     # check for overdue fine
     my $accountline = Koha::Account::Lines->search(
@@ -2328,7 +2326,6 @@ sub _FixOverduesOnReturn {
     )->next();
     return 0 unless $accountline;    # no warning, there's just nothing to fix
 
-    my $uquery;
     if ($exemptfine) {
         my $amountoutstanding = $accountline->amountoutstanding;