Bugzilla – Attachment 8879 Details for
Bug 7849
Instant Fine Calculation at Checkin
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Add instant checkin to Circulation
0002-updateing-whitespace-changes.patch (text/plain), 2.49 KB, created by
Elliott Davis
on 2012-04-04 16:51:33 UTC
(
hide
)
Description:
Add instant checkin to Circulation
Filename:
MIME Type:
Creator:
Elliott Davis
Created:
2012-04-04 16:51:33 UTC
Size:
2.49 KB
patch
obsolete
>From 55d69d4ee7363db3884094adad8f5e588819dd4b Mon Sep 17 00:00:00 2001 >From: Elliott Davis <tdavis@uttyler.edu> >Date: Thu, 29 Mar 2012 20:05:10 +0000 >Subject: [PATCH 2/2] updateing whitespace changes > >--- > C4/Circulation.pm | 25 ++++++++++++++++++++----- > 1 files changed, 20 insertions(+), 5 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 9c43f36..89d002e 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -36,6 +36,7 @@ use C4::Message; > use C4::Debug; > use C4::Branch; # GetBranches > use C4::Log; # logaction >+use C4::Overdues qw(CalcFine UpdateFine); > > use Data::Dumper; > use Koha::DateUtils; >@@ -1595,20 +1596,34 @@ sub AddReturn { > > # case of a return of document (deal with issues and holdingbranch) > if ($doreturn) { >+ my $today = DateTime->now( time_zone => C4::Context->tz() ); >+ my $datedue = $issue->{date_due}; > $borrower or warn "AddReturn without current borrower"; >- my $circControlBranch; >+ my $circControlBranch; > if ($dropbox) { > # define circControlBranch only if dropbox mode is set > # don't allow dropbox mode to create an invalid entry in issues (issuedate > today) > # FIXME: check issuedate > returndate, factoring in holidays > #$circControlBranch = _GetCircControlBranch($item,$borrower) unless ( $item->{'issuedate'} eq C4::Dates->today('iso') );; > $circControlBranch = _GetCircControlBranch($item,$borrower); >+ $today->add(days => -1 ); >+ $issue->{'overdue'} = DateTime->compare($issue->{'date_due'}, $today ) == -1 ? 1 : 0; > } >- > if ($borrowernumber) { >- MarkIssueReturned($borrowernumber, $item->{'itemnumber'}, $circControlBranch, '', $borrower->{'privacy'}); >- $messages->{'WasReturned'} = 1; # FIXME is the "= 1" right? This could be the borrower hash. >- } >+ if($issue->{'overdue'}){ >+ my ( $amount, $type, $daycounttotal ) = C4::Overdues::CalcFine( $item, $borrower->{categorycode},$branch, $datedue, $today ); >+ my $type ||= q{}; >+ if ( $amount > 0 ) { >+ 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. >+ } > > ModItem({ onloan => undef }, $issue->{'biblionumber'}, $item->{'itemnumber'}); > } >-- >1.7.2.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 7849
:
8703
|
8781
|
8879
|
8907
|
9012
|
9231
|
9284