Bugzilla – Attachment 3243 Details for
Bug 2975
Offline circ tries to circ on biblio-level "itemtype"
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
proposed bugfix
0001-bug-2975-fix-calculation-of-due-dates-by-offline-cir.patch (text/plain), 4.18 KB, created by
Galen Charlton
on 2011-03-03 19:55:21 UTC
(
hide
)
Description:
proposed bugfix
Filename:
MIME Type:
Creator:
Galen Charlton
Created:
2011-03-03 19:55:21 UTC
Size:
4.18 KB
patch
obsolete
>From 444dc887f68b2ce0756cea74ba89dd41f9f792e2 Mon Sep 17 00:00:00 2001 >From: Galen Charlton <gmcharlt@gmail.com> >Date: Thu, 3 Mar 2011 14:31:36 -0500 >Subject: [PATCH 1/2] bug 2975: fix calculation of due dates by offline circ > >Offline circ no longer tries to calculate the due date >directly, instead relying on the AddIssue and AddRenewal >APIs to do so. This corrects a bug where the due date >would be calculated incorrectly if the item-level_itypes >system preference is turned on. > >This change also has the effect of causing the issue date >for loans uploaded via offline circulation to be set >to the time stamp recorded by the offline circulation client. > >Test plan: > >* Turn on item-level_itypes >* Create an example item whose loan policy per > the item's item type would be different from > the default policy based on the bib-level type. >* Create a test KOC file with a loan of the test > item and the checkout date artificially set > to yesterday. >* Upload the file: > - Before the fix, the due date would be set > to the default due date. Also, the issue date > will be set to the date of the upload. > - After the fix, the due date would be calculated > correctly based on the item's item type. Also, > the issue date will be set to the date recorded > by the offline circulation client. > >Signed-off-by: Galen Charlton <gmcharlt@gmail.com> >--- > offline_circ/process_koc.pl | 15 +++------------ > 1 files changed, 3 insertions(+), 12 deletions(-) > >diff --git a/offline_circ/process_koc.pl b/offline_circ/process_koc.pl >index 5f0d9ff..eca9f86 100755 >--- a/offline_circ/process_koc.pl >+++ b/offline_circ/process_koc.pl >@@ -247,12 +247,6 @@ sub kocIssueItem { > my $item = GetBiblioFromItemNumber( undef, $circ->{ 'barcode' } ); > my $issue = GetItemIssue( $item->{'itemnumber'} ); > >- my $issuingrule = GetIssuingRule( $borrower->{ 'categorycode' }, $item->{ 'itemtype' }, $branchcode ); >- my $issuelength = $issuingrule->{ 'issuelength' }; >- my ( $year, $month, $day ) = split( /-/, $circ->{'date'} ); >- ( $year, $month, $day ) = Add_Delta_Days( $year, $month, $day, $issuelength ); >- my $date_due = sprintf("%04d-%02d-%02d", $year, $month, $day); >- > if ( $issue->{ 'date_due' } ) { ## Item is currently checked out to another person. > #warn "Item Currently Issued."; > my $issue = GetOpenIssue( $item->{'itemnumber'} ); >@@ -260,12 +254,11 @@ sub kocIssueItem { > if ( $issue->{'borrowernumber'} eq $borrower->{'borrowernumber'} ) { ## Issued to this person already, renew it. > #warn "Item issued to this member already, renewing."; > >- my $date_due_object = C4::Dates->new($date_due ,'iso'); > C4::Circulation::AddRenewal( > $issue->{'borrowernumber'}, # borrowernumber > $item->{'itemnumber'}, # itemnumber > undef, # branch >- $date_due_object, # datedue >+ undef, # datedue - let AddRenewal calculate it automatically > $circ->{'date'}, # issuedate > ) unless ($DEBUG); > >@@ -288,8 +281,7 @@ sub kocIssueItem { > my ( $c_y, $c_m, $c_d ) = split( /-/, $circ->{'date'} ); > > if ( Date_to_Days( $i_y, $i_m, $i_d ) < Date_to_Days( $c_y, $c_m, $c_d ) ) { ## Current issue to a different persion is older than this issue, return and issue. >- my $date_due_object = C4::Dates->new($date_due ,'iso'); >- C4::Circulation::AddIssue( $borrower, $circ->{'barcode'}, $date_due_object ) unless ( DEBUG ); >+ C4::Circulation::AddIssue( $borrower, $circ->{'barcode'}, undef, undef, $circ->{'date'} ) unless ( DEBUG ); > push( @output, { issue => 1, > title => $item->{ 'title' }, > biblionumber => $item->{'biblionumber'}, >@@ -309,8 +301,7 @@ sub kocIssueItem { > > } > } else { ## Item is not checked out to anyone at the moment, go ahead and issue it >- my $date_due_object = C4::Dates->new($date_due ,'iso'); >- C4::Circulation::AddIssue( $borrower, $circ->{'barcode'}, $date_due_object ) unless ( DEBUG ); >+ C4::Circulation::AddIssue( $borrower, $circ->{'barcode'}, undef, undef, $circ->{'date'} ) unless ( DEBUG ); > push( @output, { issue => 1, > title => $item->{ 'title' }, > biblionumber => $item->{'biblionumber'}, >-- >1.7.2.3 >
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 2975
: 3243 |
3244