Bugzilla – Attachment 21942 Details for
Bug 8769
Allow SIP2 return backdating
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8769 - Allow SIP2 return backdating
Bug-8769---Allow-SIP2-return-backdating.patch (text/plain), 3.67 KB, created by
Kyle M Hall (khall)
on 2013-10-10 11:15:46 UTC
(
hide
)
Description:
Bug 8769 - Allow SIP2 return backdating
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2013-10-10 11:15:46 UTC
Size:
3.67 KB
patch
obsolete
>From 494ed345d032e9ec892c93403e4a8a8f39ad5b62 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions> >Date: Fri, 4 Oct 2013 09:53:11 -0400 >Subject: [PATCH] Bug 8769 - Allow SIP2 return backdating > >Currently Koha's SIP server ignores the return date part of an 09 ( aka >CHECKIN ) message. Koha should backdate a return, and remove >fines accordingly. >--- > C4/Circulation.pm | 8 +++++--- > C4/SIP/ILS.pm | 2 +- > C4/SIP/ILS/Transaction/Checkin.pm | 17 ++++++++++++++++- > 3 files changed, 22 insertions(+), 5 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 578f8eb..b9ef839 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -1708,7 +1708,8 @@ patron who last borrowed the book. > =cut > > sub AddReturn { >- my ( $barcode, $branch, $exemptfine, $dropbox ) = @_; >+ my ( $barcode, $branch, $exemptfine, $dropbox, $return_date) = @_; >+warn "AddReturn( $barcode, $branch, $exemptfine, $dropbox, $return_date)"; > > if ($branch and not GetBranchDetail($branch)) { > warn "AddReturn error: branch '$branch' not found. Reverting to " . C4::Context->userenv->{'branch'}; >@@ -1779,7 +1780,8 @@ sub AddReturn { > } > > # case of a return of document (deal with issues and holdingbranch) >- my $today = DateTime->now( time_zone => C4::Context->tz() ); >+ my $today = dt_from_string( $return_date, 'iso' ); >+ > if ($doreturn) { > my $datedue = $issue->{date_due}; > $borrower or warn "AddReturn without current borrower"; >@@ -1819,7 +1821,7 @@ sub AddReturn { > } > > MarkIssueReturned( $borrowernumber, $item->{'itemnumber'}, >- $circControlBranch, '', $borrower->{'privacy'} ); >+ $circControlBranch, $return_date, $borrower->{'privacy'} ); > > # FIXME is the "= 1" right? This could be the borrower hash. > $messages->{'WasReturned'} = 1; >diff --git a/C4/SIP/ILS.pm b/C4/SIP/ILS.pm >index 5d59850..04aa884 100644 >--- a/C4/SIP/ILS.pm >+++ b/C4/SIP/ILS.pm >@@ -181,7 +181,7 @@ sub checkin { > $circ->item($item = new ILS::Item $item_id); > > if ($item) { >- $circ->do_checkin($current_loc); >+ $circ->do_checkin($current_loc, $return_date); > } else { > $circ->alert(1); > $circ->alert_type(99); >diff --git a/C4/SIP/ILS/Transaction/Checkin.pm b/C4/SIP/ILS/Transaction/Checkin.pm >index db1f102..0c84cbc 100644 >--- a/C4/SIP/ILS/Transaction/Checkin.pm >+++ b/C4/SIP/ILS/Transaction/Checkin.pm >@@ -16,6 +16,7 @@ use C4::Circulation; > use C4::Reserves qw( ModReserveAffect ); > use C4::Items qw( ModItemTransfer ); > use C4::Debug; >+use Koha::DateUtils; > > use parent qw(ILS::Transaction); > >@@ -47,12 +48,26 @@ sub new { > sub do_checkin { > my $self = shift; > my $branch = shift; >+ my $return_date = shift; > if (!$branch) { > $branch = 'SIP2'; > } > my $barcode = $self->{item}->id; >+ >+ $return_date = substr( $return_date, 0, 4 ) >+ . '-' >+ . substr( $return_date, 4, 2 ) >+ . '-' >+ . substr( $return_date, 6, 2 ) >+ . q{ } >+ . substr( $return_date, 12, 2 ) >+ . ':' >+ . substr( $return_date, 14, 2 ) >+ . ':' >+ . substr( $return_date, 16, 2 ); >+ > $debug and warn "do_checkin() calling AddReturn($barcode, $branch)"; >- my ($return, $messages, $iteminformation, $borrower) = AddReturn($barcode, $branch); >+ my ($return, $messages, $iteminformation, $borrower) = AddReturn($barcode, $branch, undef, undef, $return_date); > $self->alert(!$return); > # ignoring messages: NotIssued, IsPermanent, WasLost, WasTransfered > >-- >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 8769
:
12193
|
12811
|
12812
|
12813
|
15248
|
19999
|
20000
|
21942
|
23698
|
26753
|
27465
|
27466
|
27467
|
27944
|
27945
|
27946