From 2d048e474eca067481b3de93041e7c3cae85d8ca Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Wed, 8 Apr 2009 14:46:01 -0500 Subject: [PATCH] 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 Signed-off-by: Henri-Damien LAURENT --- C4/Circulation.pm | 2 +- catalogue/moredetail.pl | 8 ++++---- .../prog/en/modules/catalogue/moredetail.tmpl | 2 +- .../intranet-tmpl/prog/en/modules/reserve/request.tmpl | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 2d852bdefa..e490e6f990 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -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 ); diff --git a/catalogue/moredetail.pl b/catalogue/moredetail.pl index b72f126982..6f626616f7 100755 --- a/catalogue/moredetail.pl +++ b/catalogue/moredetail.pl @@ -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'}, diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tmpl index afb3dd3f54..fd7a162583 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tmpl @@ -62,7 +62,7 @@
  1. Current Location:  
  2. -
  3. Checkout Status: Checked out to ">, Due back on Not Checked out
  4. +
  5. Checkout Status: Checked out to ">, Due back on Not Checked out
  6. Lost Status:
    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tmpl index 43970a5056..e18374448c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tmpl @@ -248,7 +248,7 @@ if (alreadyreserved > "0"){   - Due + Due In transit from , -- 2.20.1