Bugzilla – Attachment 95720 Details for
Bug 24075
Backdating a return to the exact due date and time results in the fine not being refunded
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24075: Alternative 2
Bug-24075-Alternative-2.patch (text/plain), 2.43 KB, created by
Martin Renvoize (ashimema)
on 2019-11-22 12:31:41 UTC
(
hide
)
Description:
Bug 24075: Alternative 2
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-11-22 12:31:41 UTC
Size:
2.43 KB
patch
obsolete
>From bed46a44ff4c3a0a9306df250262af8087623109 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 22 Nov 2019 12:31:09 +0000 >Subject: [PATCH] Bug 24075: Alternative 2 > >--- > C4/Circulation.pm | 6 ++---- > C4/Overdues.pm | 4 ++++ > 2 files changed, 6 insertions(+), 4 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index ad617c846e..74011cafc3 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -1953,17 +1953,15 @@ sub AddReturn { > > # case of a return of document (deal with issues and holdingbranch) > if ($doreturn) { >- my $is_overdue; > die "The item is not issed and cannot be returned" unless $issue; # Just in case... > $patron or warn "AddReturn without current borrower"; >- $is_overdue = $issue->is_overdue( $return_date ); > > if ($patron) { > eval { > MarkIssueReturned( $borrowernumber, $item->itemnumber, $return_date, $patron->privacy ); > }; > unless ( $@ ) { >- if ( C4::Context->preference('CalculateFinesOnReturn') && $is_overdue && !$item->itemlost ) { >+ if ( C4::Context->preference('CalculateFinesOnReturn') && !$item->itemlost ) { > _CalculateAndUpdateFine( { issue => $issue, item => $item_unblessed, borrower => $patron_unblessed, return_date => $return_date } ); > } > } else { >@@ -2890,7 +2888,7 @@ sub AddRenewal { > my $schema = Koha::Database->schema; > $schema->txn_do(sub{ > >- if ( C4::Context->preference('CalculateFinesOnReturn') && $issue->is_overdue ) { >+ if ( C4::Context->preference('CalculateFinesOnReturn') ) { > _CalculateAndUpdateFine( { issue => $issue, item => $item_unblessed, borrower => $patron_unblessed } ); > } > _FixOverduesOnReturn( $borrowernumber, $itemnumber, undef, 'RENEWED' ); >diff --git a/C4/Overdues.pm b/C4/Overdues.pm >index 78e16230bb..1726d29cc4 100644 >--- a/C4/Overdues.pm >+++ b/C4/Overdues.pm >@@ -232,6 +232,10 @@ or "Final Notice". But CalcFine never defined any value. > > sub CalcFine { > my ( $item, $bortype, $branchcode, $due_dt, $end_date ) = @_; >+ >+ # Skip calculations if item is not overdue >+ return ( 0, 0, 0 ) unless (DateTime->compare( $due_dt, $end_date ) == -1); >+ > my $start_date = $due_dt->clone(); > # get issuingrules (fines part will be used) > my $itemtype = $item->{itemtype} || $item->{itype}; >-- >2.20.1
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 24075
:
95625
|
95626
|
95654
|
95655
|
95656
|
95706
|
95707
|
95719
|
95720
|
95723
|
95724
|
95727
|
95728