Bug 5549 : CalcFine was corrupting due date
authorColin Campbell <colin.campbell@ptfs-europe.com>
Tue, 5 Jul 2011 15:44:16 +0000 (16:44 +0100)
committerChris Cormack <chrisc@catalyst.net.nz>
Tue, 20 Mar 2012 00:27:46 +0000 (13:27 +1300)
Clone the passed duedate as the addition of days was
corrupting it in calling context causing new account recs
to be written rather than updating the existing

C4/Overdues.pm

index ae62b1e..7676a87 100644 (file)
@@ -252,7 +252,8 @@ or "Final Notice".  But CalcFine never defined any value.
 =cut
 
 sub CalcFine {
-    my ( $item, $bortype, $branchcode, $start_date, $end_date  ) = @_;
+    my ( $item, $bortype, $branchcode, $due_dt, $end_date  ) = @_;
+    my $start_date = $due_dt->clone();
     my $dbh = C4::Context->dbh;
     my $amount = 0;
     my $charge_duration;