Bugzilla – Attachment 12811 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), 6.06 KB, created by
Kyle M Hall (khall)
on 2012-10-15 12:43:29 UTC
(
hide
)
Description:
Bug 8769 - Allow SIP2 return backdating
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2012-10-15 12:43:29 UTC
Size:
6.06 KB
patch
obsolete
>From b32da52e82b19d8230e87f997140ef93dfcb6595 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Mon, 15 Oct 2012 08:15:13 -0400 >Subject: [PATCH] Bug 8769 - Allow SIP2 return backdating >Content-Type: text/plain; charset="utf-8" > >Patch based on code by Scott Kushner <skushner@mplmain.mtpl.org> >--- > C4/Circulation.pm | 6 +++++- > C4/ImportBatch.pm | 32 ++++++++++++++++++++++++++++++++ > C4/SIP/ILS/Transaction/Checkin.pm | 9 ++++----- > etc/SIPconfig.xml | 10 +++++----- > 4 files changed, 46 insertions(+), 11 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 7485de5..e14be2f 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -1678,7 +1678,7 @@ patron who last borrowed the book. > =cut > > sub AddReturn { >- my ( $barcode, $branch, $exemptfine, $dropbox ) = @_; >+ my ( $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'}; >@@ -1764,6 +1764,7 @@ sub AddReturn { > } > > if ($borrowernumber) { >+<<<<<<< HEAD > if($issue->{'overdue'}){ > my ( $amount, $type, $unitcounttotal ) = C4::Overdues::CalcFine( $item, $borrower->{categorycode},$branch, $datedue, $today ); > $type ||= q{}; >@@ -1776,6 +1777,9 @@ sub AddReturn { > } > } > MarkIssueReturned($borrowernumber, $item->{'itemnumber'}, $circControlBranch, '', $borrower->{'privacy'}); >+======= >+ MarkIssueReturned($borrowernumber, $item->{'itemnumber'}, $circControlBranch, $return_date, $borrower->{'privacy'}); >+>>>>>>> Bug 8769 - Allow SIP2 return backdating > $messages->{'WasReturned'} = 1; # FIXME is the "= 1" right? This could be the borrower hash. > } > >diff --git a/C4/ImportBatch.pm b/C4/ImportBatch.pm >index 15f1acb..62000de 100644 >--- a/C4/ImportBatch.pm >+++ b/C4/ImportBatch.pm >@@ -76,6 +76,7 @@ BEGIN { > SetImportRecordStatus > GetImportRecordMatches > SetImportRecordMatches >+ GetImportProfileLoop > ); > } > >@@ -1344,7 +1345,38 @@ sub SetImportRecordMatches { > $sth->execute($import_record_id, $match->{'record_id'}, $match->{'score'}); > } > } >+#added sub GetImportProfileLoop > >+sub GetImportProfileLoop { >+ my $dbh = C4::Context->dbh; >+ >+ my $results = $dbh->selectall_arrayref( " >+ SELECT >+ import_profiles.profile_id, description, matcher_id, template_id, overlay_action, nomatch_action, parse_items, item_action, COUNT( marcxml ) AS added_items, ip_actions.tag, ip_actions.subfield >+ FROM import_profiles >+ LEFT JOIN import_profile_added_items AS ip_items ON ( import_profiles.profile_id = ip_items.profile_id ) >+ LEFT JOIN import_profile_subfield_actions AS ip_actions ON ( import_profiles.profile_id = ip_actions.profile_id ) >+ GROUP BY import_profiles.profile_id, ip_actions.tag, ip_actions.subfield >+ ", { Slice => {} } ); >+ return [] unless ( @$results ); >+ >+ my @profiles; >+ my $current_profile; >+ >+ foreach my $result ( @$results ) { >+ if ( $current_profile && $current_profile->{'profile_id'} == $result->{'profile_id'} ) { >+ push @{ $current_profile->{'modified_subfields'} }, { tag => $result->{'tag'}, subfield => $result->{'subfield'} } >+ } else { >+ push @profiles, $result; >+ $current_profile = $result; >+ $current_profile->{'modified_subfields'} = $result->{'tag'} ? [ { tag => $result->{'tag'}, subfield => $result->{'subfield'} } ] : []; >+ } >+ delete $result->{'tag'}; >+ delete $result->{'subfield'}; >+ } >+ >+ return \@profiles; >+} > > # internal functions > >diff --git a/C4/SIP/ILS/Transaction/Checkin.pm b/C4/SIP/ILS/Transaction/Checkin.pm >index 47bd85d..2029a0b 100644 >--- a/C4/SIP/ILS/Transaction/Checkin.pm >+++ b/C4/SIP/ILS/Transaction/Checkin.pm >@@ -46,13 +46,12 @@ sub new { > > sub do_checkin { > my $self = shift; >- my $branch = shift; >- if (!$branch) { >- $branch = 'SIP2'; >- } >+ my $branch = shift || 'SIP2'; >+ my $return_date = shift; >+ > my $barcode = $self->{item}->id; > $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 > >diff --git a/etc/SIPconfig.xml b/etc/SIPconfig.xml >index f229b9a..6611f3e 100644 >--- a/etc/SIPconfig.xml >+++ b/etc/SIPconfig.xml >@@ -36,9 +36,9 @@ > </listeners> > > <accounts> >- <login id="term1" password="term1" delimiter="|" error-detect="enabled" institution="CPL" /> >- <login id="koha" password="koha" delimiter="|" error-detect="enabled" institution="kohalibrary" /> >- <login id="koha2" password="koha" institution="kohalibrary2" /> >+ <login id="sipuser" password="sipchkacs" delimiter="|" error-detect="enabled" institution="MID" /> >+ <login id="sipuser3" password="sipuser3" delimiter="|" error-detect="enabled" institution="mid" /> >+ <login id="sipuser2" password="sipuser2" institution="MID" /> > <login id="lpl-sc" password="1234" institution="LPL" /> > <login id="lpl-sc-beacock" password="xyzzy" > delimiter="|" error-detect="enabled" institution="LPL" /> >@@ -52,13 +52,13 @@ in our case "ILS". > --> > > <institutions> >- <institution id="MAIN" implementation="ILS" parms=""> >+ <institution id="MID" implementation="ILS" parms=""> > <policy checkin="true" renewal="true" checkout="true" > status_update="false" offline="false" > timeout="100" > retries="5" /> > </institution> >- <institution id="CPL" implementation="ILS" parms=""> >+ <institution id="mid" implementation="ILS" parms=""> > <policy checkin="true" renewal="true" checkout="true" > status_update="false" offline="false" > timeout="25" >-- >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