@@ -, +, @@ rentals fees by time period --- Koha/Charges/Fees.pm | 4 ++-- admin/itemtypes.pl | 6 ++++++ .../prog/en/modules/admin/itemtypes.tt | 18 ++++++++++++++++++ 3 files changed, 26 insertions(+), 2 deletions(-) --- a/Koha/Charges/Fees.pm +++ a/Koha/Charges/Fees.pm @@ -112,7 +112,7 @@ sub accumulate_rentalcharge { my $calendar = Koha::Calendar->new( branchcode => $self->library->id ); if ( $units eq 'hours' ) { - if ( C4::Context->preference('finesCalendar') eq 'noFinesWhenClosed' ) { + if ( $itemtype->rentalcharge_hourly_calendar && C4::Context->preference('finesCalendar') eq 'noFinesWhenClosed' ) { $duration = $calendar->hours_between( $self->from_date->truncate( to => 'minute' ), $self->to_date->truncate( to => 'minute' ) @@ -124,7 +124,7 @@ sub accumulate_rentalcharge { } } else { - if ( C4::Context->preference('finesCalendar') eq 'noFinesWhenClosed' ) { + if ( $itemtype->rentalcharge_daily_calendar && C4::Context->preference('finesCalendar') eq 'noFinesWhenClosed' ) { $duration = $calendar->days_between( $self->from_date, $self->to_date ); } --- a/admin/itemtypes.pl +++ a/admin/itemtypes.pl @@ -105,6 +105,8 @@ if ( $op eq 'add_form' ) { my $checkinmsgtype = $input->param('checkinmsgtype'); my $hideinopac = $input->param('hideinopac') // 0; my $searchcategory = $input->param('searchcategory'); + my $rentalcharge_daily_calendar = $input->param('rentalcharge_daily_calendar') // 0; + my $rentalcharge_hourly_calendar = $input->param('rentalcharge_hourly_calendar') // 0; if ( $itemtype and $is_a_modif ) { # it's a modification $itemtype->description($description); @@ -121,6 +123,8 @@ if ( $op eq 'add_form' ) { $itemtype->sip_media_type($sip_media_type); $itemtype->hideinopac($hideinopac); $itemtype->searchcategory($searchcategory); + $itemtype->rentalcharge_daily_calendar($rentalcharge_daily_calendar); + $itemtype->rentalcharge_hourly_calendar($rentalcharge_hourly_calendar); eval { $itemtype->store; @@ -150,6 +154,8 @@ if ( $op eq 'add_form' ) { sip_media_type => $sip_media_type, hideinopac => $hideinopac, searchcategory => $searchcategory, + rentalcharge_daily_calendar => $rentalcharge_daily_calendar, + rentalcharge_hourly_calendar => $rentalcharge_hourly_calendar, } ); eval { --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt @@ -241,11 +241,29 @@ Item types administration This fee is charged at checkout/renewal time for each day between the checkout/renewal date and due date for loans specified in days. +
  • + + [% IF itemtype.rentalcharge_daily_calendar %] + + [% ELSE %] + + [% END %] + If checked, daily charge will be calculated based on the value of the system preference finesCalendar. If not checked, the fee will be calculated based on the number of days until due, directly. +
  • This fee is charged at checkout/renewal time for each hour between the checkout/renewal date and due date for loans specified in hours.
  • +
  • + + [% IF itemtype.rentalcharge_hourly_calendar %] + + [% ELSE %] + + [% END %] + If checked, hourly charge will be calculated based on the value of the system preference finesCalendar. If not checked, the fee will be calculated based on the number of hours until due, directly. +
  • --