Bug 9041 - Hourly fines does not work in koha 3.8.6
Summary: Hourly fines does not work in koha 3.8.6
Status: RESOLVED DUPLICATE of bug 8882
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: 3.8
Hardware: All All
: P1 - high critical
Assignee: Bugs List
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-08 22:48 UTC by Humberto Blanco
Modified: 2012-11-14 13:17 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Humberto Blanco 2012-11-08 22:48:29 UTC
Hi, 
i have the following circ rule for a material
Patron category:            all
Item type:                  computer
Current checkouts allowed:  1
Loan period:                2
Unit:                 	    hours
Hard due date:              None defined
Fine amount:                2000
Fine charging interval:     1
Fine grace period (day):    0
Suspension in days (day):   0
Renewals allowed (count):   0
Holds allowed (count):      0
Rental discount (%):        0

when i checkout this material type i recibe an alert saying "Please confirm checkout" and i have to put manually the due date; an then checkout the item.

if i checkout the item with no due date automatically the due date  is for the same day but at 0 hours (then the user is blocked), or if i apply the patch and modify circulation.pl then the due date is 23:59 of today. But never work when the due date is lower than 10 hours.

I really appreciate your help.
Comment 1 Humberto Blanco 2012-11-13 17:34:11 UTC
Review the source code i found that in Koha::Calendar.pm,  in the sub addDate when  evaluate   $self->is_holiday($dt)  the results for $dt appears bad, then in the Circulation.pm returns INVALID_DATE and needs manually checkout.
For my biblio, i assume that all loans not in holidays then i put this in Koha::Calendar.pm
if ( $days_mode eq 'Datedue' ){ 
  my $dt = $base_date + $add_duration;

  if($unit ne 'hours'){  # Added for me
     while ( $self->is_holiday($dt) ) {
	$dt->add_duration($day_dur);
	if ( $unit eq 'hours' ) {
	   $dt->set_hour($return_by_hour);    # Staffs specific
	}
     }
  } # End added for me

  return $dt; 
}
Comment 2 Kyle M Hall (khall) 2012-11-14 13:17:06 UTC

*** This bug has been marked as a duplicate of bug 8882 ***