bug 3049: display correct due date of renewed loans

The intranet item display provided by moredetail.pl
would display the original due date of the item, and
would thus be incorrect if the item had been renewed
and got a different due date.

The incorrect date was coming from items.onloan,
which AddIssue() sets to the due date.  This patch
fixes the bug in two ways:

[1] AddRenewal() now updates items.onloan with the
    correct due date.
[2] Two templates were updated to display the
    due date from (indirectly) issues.date_due
    instead of items.onloan, thus making it less
    likely that the wrong value will be displayed.

This patch does *not* update items.onloan to reflect
the correct due date.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Signed-off-by: Henri-Damien LAURENT <henridamien.laurent@biblibre.com>
This commit is contained in:
Galen Charlton 2009-04-08 14:46:01 -05:00 committed by Henri-Damien LAURENT
parent 00ba07b595
commit 2d048e474e
4 changed files with 7 additions and 7 deletions

View File

@ -2007,7 +2007,7 @@ sub AddRenewal {
# Update the renewal count on the item, and tell zebra to reindex
$renews = $biblio->{'renewals'} + 1;
ModItem({ renewals => $renews }, $biblio->{'biblionumber'}, $itemnumber);
ModItem({ renewals => $renews, onloan => $datedue->output('iso') }, $biblio->{'biblionumber'}, $itemnumber);
# Charge a new rental fee, if applicable?
my ( $charge, $type ) = GetIssuingCharges( $itemnumber, $borrowernumber );

View File

@ -109,11 +109,11 @@ foreach my $item (@items){
}
$item->{'homebranchname'} = GetBranchName($item->{'homebranch'});
$item->{'holdingbranchname'} = GetBranchName($item->{'holdingbranch'});
if ($item->{'onloan'} eq ''){
$item->{'issue'}= 0;
} else {
$item->{'onloan'} = format_date($item->{'onloan'});
if ($item->{'datedue'}) {
$item->{'datedue'} = format_date($item->{'datedue'});
$item->{'issue'}= 1;
} else {
$item->{'issue'}= 0;
}
}
$template->param(count => $data->{'count'},

View File

@ -62,7 +62,7 @@
<ol class="bibliodetails">
<li><span class="label">Current Location:</span> <!-- TMPL_VAR NAME="holdingbranchname" -->&nbsp;</li>
<li><span class="label">Checkout Status:</span> <!-- TMPL_IF NAME="issue" -->Checked out to <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->"><!-- TMPL_VAR NAME="cardnumber" --></a>, Due back on <!-- TMPL_VAR NAME="onloan" --><!-- TMPL_ELSE -->Not Checked out <!-- /TMPL_IF --></li>
<li><span class="label">Checkout Status:</span> <!-- TMPL_IF NAME="issue" -->Checked out to <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->"><!-- TMPL_VAR NAME="cardnumber" --></a>, Due back on <!-- TMPL_VAR NAME="datedue" --><!-- TMPL_ELSE -->Not Checked out <!-- /TMPL_IF --></li>
<li><span class="label">Lost Status:</span>
<!-- TMPL_IF NAME="CAN_user_circulate" -->
<form action="updateitem.pl" method="post">

View File

@ -248,7 +248,7 @@ if (alreadyreserved > "0"){
<td><!-- TMPL_IF NAME="copynumber" --><!-- TMPL_VAR NAME="copynumber" --><!-- TMPL_ELSE -->&nbsp;<!-- /TMPL_IF --></td>
<td>
<!-- TMPL_IF Name="onloan" -->
<span class="checkedout">Due <!-- TMPL_VAR NAME="onloan" --></span>
<span class="checkedout">Due <!-- TMPL_VAR NAME="date_due" --></span>
<!-- TMPL_ELSE -->
<!-- TMPL_IF Name="transfertwhen" -->
In transit from <!-- TMPL_VAR NAME="transfertfrom" -->,