@@ -, +, @@ ~ The error "Can't use string ("branchcode") as a HASH ref while "strict refs" in use at /kohadevbox/koha/Koha/DiscreteCalendar.pm line 79" is no longer here a) Calendar on the left b) Holidays list on the right a) Working day : white b) Unique holiday: red c) Holiday repeating weekly: yellow d) Holiday repeating yearly: orange e) Floating holiday: green f) Need validation: blue --- C4/Circulation.pm | 10 +++++----- C4/HoldsQueue.pm | 4 ++-- Koha/Charges/Fees.pm | 2 +- Koha/Checkouts.pm | 2 +- Koha/DiscreteCalendar.pm | 4 ++-- Koha/Hold.pm | 2 +- installer/data/mysql/updatedatabase.pl | 2 +- misc/cronjobs/fines.pl | 2 +- misc/cronjobs/holds/holds_reminder.pl | 2 +- misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl | 2 +- 10 files changed, 16 insertions(+), 16 deletions(-) --- a/C4/Circulation.pm +++ a/C4/Circulation.pm @@ -1344,7 +1344,7 @@ sub checkHighHolds { branchcode => $branchcode, } ); - my $calendar = Koha::DiscreteCalendar->new( branchcode => $branchcode, days_mode => $daysmode ); + my $calendar = Koha::DiscreteCalendar->new({ branchcode => $branchcode, days_mode => $daysmode }); my $orig_due = C4::Circulation::CalcDateDue( $issuedate, $itype, $branchcode, $patron->unblessed ); @@ -2477,10 +2477,10 @@ sub _calculate_new_debar_dt { my $new_debar_dt; # Use the calendar or not to calculate the debarment date if ( C4::Context->preference('SuspensionsCalendar') eq 'noSuspensionsWhenClosed' ) { - my $calendar = Koha::DiscreteCalendar->new( + my $calendar = Koha::DiscreteCalendar->new({ branchcode => $branchcode, days_mode => 'Calendar' - ); + }); $new_debar_dt = $calendar->addDuration( $return_date, $suspension_days ); } else { @@ -3593,7 +3593,7 @@ sub CalcDateDue { else { # days $dur = DateTime::Duration->new( days => $loanlength->{$length_key}); } - my $calendar = Koha::DiscreteCalendar->new( branchcode => $branch, days_mode => $daysmode ); + my $calendar = Koha::DiscreteCalendar->new({ branchcode => $branch, days_mode => $daysmode }); $datedue = $calendar->addDuration( $datedue, $dur, $loanlength->{lengthunit} ); if ($loanlength->{lengthunit} eq 'days') { $datedue->set_hour(23); @@ -3632,7 +3632,7 @@ sub CalcDateDue { } } if ( $daysmode ne 'Days' ) { - my $calendar = Koha::DiscreteCalendar->new( branchcode => $branch, days_mode => $daysmode ); + my $calendar = Koha::DiscreteCalendar->new({ branchcode => $branch, days_mode => $daysmode }); if ( $calendar->is_holiday($datedue) ) { # Don't return on a closed day $datedue = $calendar->prev_open_days( $datedue )->set(hour => 23, minute => 59); --- a/C4/HoldsQueue.pm +++ a/C4/HoldsQueue.pm @@ -78,8 +78,8 @@ sub TransportCostMatrix { disable_transfer => $disabled }; - if ( !$ignore_holds_queue_skip_closed && C4::Context->preference("HoldsQueueSkipClosed") ) { - $calendars->{$from} ||= Koha::DiscreteCalendar->new( branchcode => $from ); + if ( !my $ignore_holds_queue_skip_closed && C4::Context->preference("HoldsQueueSkipClosed") ) { + my $calendars->{$from} ||= Koha::DiscreteCalendar->new({ branchcode => $from }); $transport_cost_matrix{$to}{$from}{disable_transfer} ||= $calendars->{$from}->is_holiday( $today ); } --- a/Koha/Charges/Fees.pm +++ a/Koha/Charges/Fees.pm @@ -109,7 +109,7 @@ sub accumulate_rentalcharge { return 0 unless $rentalcharge_increment && $rentalcharge_increment > 0; my $duration; - my $calendar = Koha::DiscreteCalendar->new( branchcode => $self->library->id ); + my $calendar = Koha::DiscreteCalendar->new({ branchcode => $self->library->id }); if ( $units eq 'hours' ) { if ( $itemtype->rentalcharge_hourly_calendar ) { --- a/Koha/Checkouts.pm +++ a/Koha/Checkouts.pm @@ -55,7 +55,7 @@ sub calculate_dropbox_date { branchcode => $branchcode, } ); - my $calendar = Koha::DiscreteCalendar->new( branchcode => $branchcode, days_mode => $daysmode ); + my $calendar = Koha::DiscreteCalendar->new({ branchcode => $branchcode, days_mode => $daysmode }); my $today = dt_from_string; my $dropbox_date = $calendar->addDuration( $today, -1 ); my $dateInfo = $calendar->get_date_info($dropbox_date); --- a/Koha/DiscreteCalendar.pm +++ a/Koha/DiscreteCalendar.pm @@ -277,7 +277,7 @@ sub get_date_info { my $maxDate = $calendar->get_max_date(); -Returns the furthest date available in the databse of current branch. +Returns the furthest date available in the database of current branch. =cut @@ -303,7 +303,7 @@ sub get_max_date { my $minDate = $calendar->get_min_date(); -Returns the oldest date available in the databse of current branch. +Returns the oldest date available in the database of current branch. =cut --- a/Koha/Hold.pm +++ a/Koha/Hold.pm @@ -217,7 +217,7 @@ sub set_waiting { branchcode => $self->branchcode, } ); - my $calendar = Koha::DiscreteCalendar->new( branchcode => $self->branchcode, days_mode => $daysmode ); + my $calendar = Koha::DiscreteCalendar->new({ branchcode => $self->branchcode, days_mode => $daysmode }); $new_expiration_date = $calendar->days_forward( dt_from_string(), $max_pickup_delay ); } --- a/installer/data/mysql/updatedatabase.pl +++ a/installer/data/mysql/updatedatabase.pl @@ -14371,7 +14371,7 @@ if( CheckVersion( $DBversion ) ) { my $expirationdate = dt_from_string($hold->{waitingdate}); if ( C4::Context->preference("ExcludeHolidaysFromMaxPickUpDelay") ) { - my $calendar = Koha::DiscreteCalendar->new( branchcode => $hold->{branchcode}, days_mode => C4::Context->preference('useDaysMode') ); + my $calendar = Koha::DiscreteCalendar->new({ branchcode => $hold->{branchcode}, days_mode => C4::Context->preference('useDaysMode') }); $expirationdate = $calendar->days_forward( $expirationdate, $max_pickup_delay ); } else { $expirationdate->add( days => $max_pickup_delay ); --- a/misc/cronjobs/fines.pl +++ a/misc/cronjobs/fines.pl @@ -203,7 +203,7 @@ EOM sub set_holiday { my ( $branch, $dt ) = @_; - my $calendar = Koha::DiscreteCalendar->new( branchcode => $branch ); + my $calendar = Koha::DiscreteCalendar->new({ branchcode => $branch }); return $calendar->is_holiday($dt); } --- a/misc/cronjobs/holds/holds_reminder.pl +++ a/misc/cronjobs/holds/holds_reminder.pl @@ -244,7 +244,7 @@ foreach my $branchcode (@branchcodes) { #BEGIN BRANCH LOOP # If respecting calendar get the correct waiting since date my $waiting_date; if( $use_calendar ){ - my $calendar = Koha::DiscreteCalendar->new( branchcode => $branchcode, days_mode => 'Calendar' ); + my $calendar = Koha::DiscreteCalendar->new({ branchcode => $branchcode, days_mode => 'Calendar' }); my $duration = DateTime::Duration->new( days => -$days ); $waiting_date = $calendar->addDays($date_to_run,$duration); #Add negative of days } else { --- a/misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl +++ a/misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl @@ -335,7 +335,7 @@ sub GetWaitingHolds { } ); - my $calendar = Koha::DiscreteCalendar->new( branchcode => $issue->{'site'}, days_mode => $daysmode ); + my $calendar = Koha::DiscreteCalendar->new({ branchcode => $issue->{'site'}, days_mode => $daysmode }); my $waiting_date = dt_from_string( $issue->{waitingdate}, 'sql' ); my $pickup_date = $waiting_date->clone->add( days => $pickupdelay ); --