Bug 8365: Followup Force DateTime type for the datedue variable
authorJonathan Druart <jonathan.druart@biblibre.com>
Tue, 19 Mar 2013 13:18:40 +0000 (14:18 +0100)
committerJared Camins-Esakov <jcamins@cpbibliography.com>
Fri, 22 Mar 2013 11:57:02 +0000 (07:57 -0400)
Signed-off-by: Broust <jean-manuel.broust@univ-lyon2.fr>
I tested one more time on a sandbox but I confirm the problem:
the due date doesn't change when you renew more than one time
with syspref renewalperiodbase turned on: "the old due date of
the checkout". The due date should change any time.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Added signed-off line and problem description from bugzilla.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
C4/Circulation.pm

index 185575e..08935e2 100644 (file)
@@ -2525,7 +2525,7 @@ sub AddRenewal {
         my $itemtype = (C4::Context->preference('item-level_itypes')) ? $biblio->{'itype'} : $biblio->{'itemtype'};
 
         $datedue = (C4::Context->preference('RenewalPeriodBase') eq 'date_due') ?
-                                        $issuedata->{date_due} :
+                                        dt_from_string( $issuedata->{date_due} ) :
                                         DateTime->now( time_zone => C4::Context->tz());
         $datedue =  CalcDateDue($datedue, $itemtype, $issuedata->{'branchcode'}, $borrower, 'is a renewal');
     }