@@ -, +, @@ --- C4/Circulation.pm | 8 ++++---- C4/HoldsQueue.pm | 8 ++++---- C4/Overdues.pm | 6 ++++-- C4/Reserves.pm | 4 ++-- Koha/Hold.pm | 4 ++-- circ/returns.pl | 5 +++-- .../intranet-tmpl/prog/en/modules/tools/tools-home.tt | 5 +++++ misc/cronjobs/fines.pl | 4 ++-- misc/cronjobs/overdue_notices.pl | 18 +++++++----------- misc/cronjobs/staticfines.pl | 4 ++-- misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl | 4 ++-- 11 files changed, 37 insertions(+), 33 deletions(-) --- a/C4/Circulation.pm +++ a/C4/Circulation.pm @@ -43,7 +43,7 @@ use Koha::Account; use Koha::AuthorisedValues; use Koha::Biblioitems; use Koha::DateUtils; -use Koha::Calendar; +use Koha::DiscreteCalendar; use Koha::Checkouts; use Koha::IssuingRules; use Koha::Items; @@ -1213,7 +1213,7 @@ sub checkHighHolds { my $issuedate = DateTime->now( time_zone => C4::Context->tz() ); - my $calendar = Koha::Calendar->new( branchcode => $branch ); + my $calendar = Koha::DiscreteCalendar->new( branchcode => $branch ); my $itype = $item_object->effective_itemtype; my $orig_due = C4::Circulation::CalcDateDue( $issuedate, $itype, $branch, $borrower ); @@ -2153,7 +2153,7 @@ sub MarkIssueReturned { my $query = 'UPDATE issues SET returndate='; my @bind; if ($dropbox_branch) { - my $calendar = Koha::Calendar->new( branchcode => $dropbox_branch ); + my $calendar = Koha::DiscreteCalendar->new( branchcode => $dropbox_branch ); my $dropboxdate = $calendar->addDate( DateTime->now( time_zone => C4::Context->tz), -1 ); $query .= ' ? '; push @bind, $dropboxdate->strftime('%Y-%m-%d %H:%M'); @@ -3478,7 +3478,7 @@ sub CalcDateDue { else { # days $dur = DateTime::Duration->new( days => $loanlength->{$length_key}); } - my $calendar = Koha::Calendar->new( branchcode => $branch ); + my $calendar = Koha::DiscreteCalendar->new( branchcode => $branch ); $datedue = $calendar->addDate( $datedue, $dur, $loanlength->{lengthunit} ); if ($loanlength->{lengthunit} eq 'days') { $datedue->set_hour(23); --- a/C4/HoldsQueue.pm +++ a/C4/HoldsQueue.pm @@ -30,7 +30,7 @@ use C4::Members; use C4::Biblio; use Koha::DateUtils; use Koha::Patrons; - +use Koha::DiscreteCalendar; use List::Util qw(shuffle); use List::MoreUtils qw(any); use Data::Dumper; @@ -77,7 +77,7 @@ sub TransportCostMatrix { }; if ( C4::Context->preference("HoldsQueueSkipClosed") ) { - $calendars->{$from} ||= Koha::Calendar->new( branchcode => $from ); + $calendars->{$from} ||= Koha::DiscreteCalendar->new( branchcode => $from ); $transport_cost_matrix{$to}{$from}{disable_transfer} ||= $calendars->{$from}->is_holiday( $today ); } @@ -206,7 +206,7 @@ sub CreateQueue { $total_requests += scalar(@$hold_requests); $total_available_items += scalar(@$available_items); - my $item_map = MapItemsToHoldRequests($hold_requests, $available_items, $branches_to_use, $transport_cost_matrix); + my $item_map = MapItemsToHoldRequests($hold_requests, $available_items, $branches_to_use, $transport_cost_matrix); $item_map or next; my $item_map_size = scalar(keys %$item_map) or next; @@ -742,7 +742,7 @@ sub load_branches_to_pull_from { my $today = dt_from_string(); if ( C4::Context->preference('HoldsQueueSkipClosed') ) { @branches_to_use = grep { - !Koha::Calendar->new( branchcode => $_ ) + !Koha::DiscreteCalendar->new( branchcode => $_ ) ->is_holiday( $today ) } @branches_to_use; } --- a/C4/Overdues.pm +++ a/C4/Overdues.pm @@ -34,6 +34,8 @@ use C4::Accounts; use C4::Log; # logaction use C4::Debug; use Koha::DateUtils; +use Koha::DiscreteCalendar; +use Koha::Account::Line; use Koha::Account::Lines; use Koha::Account::Offsets; use Koha::IssuingRules; @@ -298,7 +300,7 @@ sub get_chargeable_units { my $charge_duration; if ($unit eq 'hours') { if(C4::Context->preference('finesCalendar') eq 'noFinesWhenClosed') { - my $calendar = Koha::Calendar->new( branchcode => $branchcode ); + my $calendar = Koha::DiscreteCalendar->new( branchcode => $branchcode ); $charge_duration = $calendar->hours_between( $date_due, $date_returned ); } else { $charge_duration = $date_returned->delta_ms( $date_due ); @@ -310,7 +312,7 @@ sub get_chargeable_units { } else { # days if(C4::Context->preference('finesCalendar') eq 'noFinesWhenClosed') { - my $calendar = Koha::Calendar->new( branchcode => $branchcode ); + my $calendar = Koha::DiscreteCalendar->new( branchcode => $branchcode ); $charge_duration = $calendar->days_between( $date_due, $date_returned ); } else { $charge_duration = $date_returned->delta_days( $date_due ); --- a/C4/Reserves.pm +++ a/C4/Reserves.pm @@ -38,7 +38,7 @@ use C4::Log; use Koha::Biblios; use Koha::DateUtils; -use Koha::Calendar; +use Koha::DiscreteCalendar; use Koha::Database; use Koha::Hold; use Koha::Old::Hold; @@ -808,7 +808,7 @@ sub CancelExpiredReserves { my $holds = Koha::Holds->search( $params ); while ( my $hold = $holds->next ) { - my $calendar = Koha::Calendar->new( branchcode => $hold->branchcode ); + my $calendar = Koha::DiscreteCalendar->new( branchcode => $hold->branchcode ); next if !$cancel_on_holidays && $calendar->is_holiday( $today ); --- a/Koha/Hold.pm +++ a/Koha/Hold.pm @@ -25,7 +25,7 @@ use Data::Dumper qw(Dumper); use C4::Context qw(preference); use C4::Log; - +use Koha::DiscreteCalendar; use Koha::DateUtils qw(dt_from_string output_pref); use Koha::Patrons; use Koha::Biblios; @@ -165,7 +165,7 @@ sub set_waiting { my $max_pickup_delay = C4::Context->preference("ReservesMaxPickUpDelay"); my $cancel_on_holidays = C4::Context->preference('ExpireReservesOnHolidays'); - my $calendar = Koha::Calendar->new( branchcode => $self->branchcode ); + my $calendar = Koha::DiscreteCalendar->new( branchcode => $self->branchcode ); my $expirationdate = $today->clone; $expirationdate->add(days => $max_pickup_delay); --- a/circ/returns.pl +++ a/circ/returns.pl @@ -51,7 +51,8 @@ use C4::Koha; # FIXME : is it still useful ? use C4::RotatingCollections; use Koha::AuthorisedValues; use Koha::DateUtils; -use Koha::Calendar; +use Koha::DiscreteCalendar; +use Koha::Checkouts; use Koha::BiblioFrameworks; use Koha::Checkouts; use Koha::Holds; @@ -211,7 +212,7 @@ my $dropboxmode = $query->param('dropboxmode'); my $dotransfer = $query->param('dotransfer'); my $canceltransfer = $query->param('canceltransfer'); my $dest = $query->param('dest'); -my $calendar = Koha::Calendar->new( branchcode => $userenv_branch ); +my $calendar = Koha::DiscreteCalendar->new( branchcode => $userenv_branch ); #dropbox: get last open day (today - 1) my $today = DateTime->now( time_zone => C4::Context->tz()); my $dropboxdate = $calendar->addDate($today, -1); --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt @@ -79,6 +79,11 @@