Bugzilla – Attachment 100747 Details for
Bug 21443
Add ability to exclude holidays when calculating rentals fees by time period
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21443: Add ability to exclude holidays when calculating rentals fees by time period
Bug-21443-Add-ability-to-exclude-holidays-when-cal.patch (text/plain), 6.18 KB, created by
Kyle M Hall (khall)
on 2020-03-16 12:59:26 UTC
(
hide
)
Description:
Bug 21443: Add ability to exclude holidays when calculating rentals fees by time period
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2020-03-16 12:59:26 UTC
Size:
6.18 KB
patch
obsolete
>From dcaa59df33744b890cac07779c4eebfe4fa5ee62 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Mon, 9 Mar 2020 13:28:16 -0400 >Subject: [PATCH] Bug 21443: Add ability to exclude holidays when calculating > rentals fees by time period > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> > >Signed-off-by: Marti Fuerst <mfuerst@hmcpl.org> >--- > Koha/Charges/Fees.pm | 4 ++-- > admin/itemtypes.pl | 6 ++++++ > .../prog/en/modules/admin/itemtypes.tt | 18 ++++++++++++++++++ > 3 files changed, 26 insertions(+), 2 deletions(-) > >diff --git a/Koha/Charges/Fees.pm b/Koha/Charges/Fees.pm >index 22255d5aba..a3d2a12e39 100644 >--- a/Koha/Charges/Fees.pm >+++ b/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 ); > } >diff --git a/admin/itemtypes.pl b/admin/itemtypes.pl >index 8a341b6e11..7b13dac7b7 100755 >--- a/admin/itemtypes.pl >+++ b/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 { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt >index b6c85294b7..3ba8410352 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt >@@ -241,11 +241,29 @@ Item types administration > <input type="text" id="rentalcharge_daily" name="rentalcharge_daily" size="10" value="[% itemtype.rentalcharge_daily | $Price on_editing => 1 %]" /> > <span class="hint">This fee is charged at checkout/renewal time for each day between the checkout/renewal date and due date for loans specified in days.</span> > </li> >+ <li> >+ <label for="rentalcharge_daily_calendar">Daily rentals use calendar: </label> >+ [% IF itemtype.rentalcharge_daily_calendar %] >+ <input type="checkbox" id="rentalcharge_daily_calendar" name="rentalcharge_daily_calendar" checked="checked" value="1" /> >+ [% ELSE %] >+ <input type="checkbox" id="rentalcharge_daily_calendar" name="rentalcharge_daily_calendar" value="1" /> >+ [% END %] >+ <span class="hint">If checked, daily charge will be calculated based on the value of the system preference <i>finesCalendar</i>. If not checked, the fee will be calculated based on the number of days until due, directly.</span> >+ </li> > <li> > <label for="rentalcharge_hourly">Hourly rental charge: </label> > <input type="text" id="rentalcharge_hourly" name="rentalcharge_hourly" size="10" value="[% itemtype.rentalcharge_hourly | $Price on_editing => 1 %]" /> > <span class="hint">This fee is charged at checkout/renewal time for each hour between the checkout/renewal date and due date for loans specified in hours.</span> > </li> >+ <li> >+ <label for="rentalcharge_hourly_calendar">Hourly rentals use calendar: </label> >+ [% IF itemtype.rentalcharge_hourly_calendar %] >+ <input type="checkbox" id="rentalcharge_hourly_calendar" name="rentalcharge_hourly_calendar" checked="checked" value="1" /> >+ [% ELSE %] >+ <input type="checkbox" id="rentalcharge_hourly_calendar" name="rentalcharge_hourly_calendar" value="1" /> >+ [% END %] >+ <span class="hint">If checked, hourly charge will be calculated based on the value of the system preference <i>finesCalendar</i>. If not checked, the fee will be calculated based on the number of hours until due, directly.</span> >+ </li> > <li> > <label for="defaultreplacecost">Default replacement cost: </label> > <input type="text" id="defaultreplacecost" name="defaultreplacecost" size="10" value="[% itemtype.defaultreplacecost | html %]" /> >-- >2.21.1 (Apple Git-122.3)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 21443
:
100402
|
100403
|
100404
|
100405
|
100744
|
100745
|
100746
|
100747
|
100748
|
101428
|
101429
|
101430
|
101431
|
101458
|
101459
|
101460
|
101461
|
101462
|
101463
|
101464
|
101465
|
101466
|
101467
|
101468
|
101469
|
101631