From 684cea430969edddf852eab4c1456a0398dc7c2f 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 --- 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 5337bf0bdf..4b02a26b3d 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -2123,7 +2123,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 4c8ce2484e..0026405f99 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 2348916152..be254eaeb0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tmpl @@ -289,7 +289,7 @@ if (alreadyreserved > "0"){   - Due + Due In transit from , -- 2.39.5