Bugzilla – Attachment 18143 Details for
Bug 10120
Fine recalculation on return needs to be a system preference
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 10120 : Tidy up the code so we can see what is going on
PASSED-QA-Bug-10120--Tidy-up-the-code-so-we-can-se.patch (text/plain), 3.42 KB, created by
Katrin Fischer
on 2013-05-15 06:30:04 UTC
(
hide
)
Description:
[PASSED QA] Bug 10120 : Tidy up the code so we can see what is going on
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2013-05-15 06:30:04 UTC
Size:
3.42 KB
patch
obsolete
>From 785896e08edb8c83d68443b827afdf048c48e65b Mon Sep 17 00:00:00 2001 >From: Chris Cormack <chris@bigballofwax.co.nz> >Date: Tue, 30 Apr 2013 08:28:23 +1200 >Subject: [PATCH] [PASSED QA] Bug 10120 : Tidy up the code so we can see what > is going on > >Signed-off-by: David Cook <dcook@prosentient.com.au> >Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> > >Amended test plan used for testing: > >Note: Use a new item for each test as we determine >fines by item number. If you have the same item twice >on the same day on the same account with the same >due date, fine calculation is going to fail. > >1/ Create an overdue item, that should get fines >2/ Return the item from the patron account checkout tab >3/ Check the borrowers record to see if the fine has been added/updated > >Repeat, but for 2/ return the item from the check in page > >Apply patch > >1/ Make sure preference is set to do >Repeat steps 1-3 from above > >2/ Switch the preference to don't >Repeat steps 1-2 >3/ Check the fine hasn't been added/updated > >Again, check for returns from patron account and check in page. >--- > C4/Circulation.pm | 33 ++++++++++++++++++++------------- > 1 file changed, 20 insertions(+), 13 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index e069132..f7cb4de 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -1785,21 +1785,28 @@ sub AddReturn { > } > > if ($borrowernumber) { >- if( C4::Context->preference('CalculateFinesOnReturn') && $issue->{'overdue'}){ >- # we only need to calculate and change the fines if we want to do that on return >- # Should be on for hourly loans >- my ( $amount, $type, $unitcounttotal ) = C4::Overdues::CalcFine( $item, $borrower->{categorycode},$branch, $datedue, $today ); >+ if ( C4::Context->preference('CalculateFinesOnReturn') >+ && $issue->{'overdue'} ) >+ { >+# we only need to calculate and change the fines if we want to do that on return >+# Should be on for hourly loans >+ my ( $amount, $type, $unitcounttotal ) = >+ C4::Overdues::CalcFine( $item, $borrower->{categorycode}, >+ $branch, $datedue, $today ); > $type ||= q{}; >- if ( $amount > 0 && ( C4::Context->preference('finesMode') eq 'production' )) { >- C4::Overdues::UpdateFine( >- $issue->{itemnumber}, >- $issue->{borrowernumber}, >- $amount, $type, output_pref($datedue) >- ); >- } >+ if ( $amount > 0 >+ && ( C4::Context->preference('finesMode') eq 'production' ) >+ ) >+ { >+ C4::Overdues::UpdateFine( $issue->{itemnumber}, >+ $issue->{borrowernumber}, >+ $amount, $type, output_pref($datedue) ); >+ } > } >- MarkIssueReturned($borrowernumber, $item->{'itemnumber'}, $circControlBranch, '', $borrower->{'privacy'}); >- $messages->{'WasReturned'} = 1; # FIXME is the "= 1" right? This could be the borrower hash. >+ MarkIssueReturned( $borrowernumber, $item->{'itemnumber'}, >+ $circControlBranch, '', $borrower->{'privacy'} ); >+ $messages->{'WasReturned'} = >+ 1; # FIXME is the "= 1" right? This could be the borrower hash. > } > > ModItem({ onloan => undef }, $issue->{'biblionumber'}, $item->{'itemnumber'}); >-- >1.7.9.5
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 10120
:
17824
|
17825
|
17885
|
17886
|
17887
|
18143
|
18144
|
18145
|
44078