Bugzilla – Attachment 95719 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 1
Bug-24075-Alternative-1.patch (text/plain), 2.67 KB, created by
Martin Renvoize (ashimema)
on 2019-11-22 12:22:34 UTC
(
hide
)
Description:
Bug 24075: Alternative 1
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-11-22 12:22:34 UTC
Size:
2.67 KB
patch
obsolete
>From 0d436c4d41bedbf7b43b498215a99db93426e30c Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 22 Nov 2019 12:21:53 +0000 >Subject: [PATCH] Bug 24075: Alternative 1 > >--- > C4/Circulation.pm | 18 +++++++++++------- > 1 file changed, 11 insertions(+), 7 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index ad617c846e..f8e833e538 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' ); >@@ -4139,9 +4137,15 @@ sub _CalculateAndUpdateFine { > : $issue->branchcode; > > my $date_returned = $return_date ? $return_date : dt_from_string(); >- >- my ( $amount, $unitcounttotal, $unitcount ) = >- C4::Overdues::CalcFine( $item, $borrower->{categorycode}, $control_branchcode, $datedue, $date_returned ); >+ my ( $amount, $unitcounttotal, $unitcount ); >+ if ( $issue->is_overdue($date_returned) ) { >+ ( $amount, $unitcounttotal, $unitcount ) = >+ C4::Overdues::CalcFine( $item, $borrower->{categorycode}, >+ $control_branchcode, $datedue, $date_returned ); >+ } >+ else { >+ ( $amount, $unitcounttotal, $unitcount ) = ( 0, 0, 0 ); >+ } > > if ( C4::Context->preference('finesMode') eq 'production' ) { > if ( $amount > 0 ) { >-- >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