# You should have received a copy of the GNU General Public License
# along with Koha; if not, see <http://www.gnu.org/licenses>.
-use strict;
-use warnings;
+use Modern::Perl;
use CGI qw ( -utf8 );
use C4::Context;
use C4::Output;
use C4::Auth;
use C4::Koha;
use C4::Debug;
-use C4::Branch;
use Koha::DateUtils;
use Koha::Database;
use Koha::IssuingRule;
my $finedays = $input->param('finedays');
my $maxsuspensiondays = $input->param('maxsuspensiondays');
$maxsuspensiondays = undef if $maxsuspensiondays eq q||;
+ my $suspension_chargeperiod = $input->param('suspension_chargeperiod') || 1;
my $firstremind = $input->param('firstremind');
my $chargeperiod = $input->param('chargeperiod');
my $chargeperiod_charge_at = $input->param('chargeperiod_charge_at');
my $norenewalbefore = $input->param('norenewalbefore');
$norenewalbefore = undef if $norenewalbefore =~ /^\s*$/;
my $auto_renew = $input->param('auto_renew') eq 'yes' ? 1 : 0;
+ my $no_auto_renewal_after = $input->param('no_auto_renewal_after');
+ $no_auto_renewal_after = undef if $no_auto_renewal_after =~ /^\s*$/;
+ my $no_auto_renewal_after_hard_limit = $input->param('no_auto_renewal_after_hard_limit') || undef;
+ $no_auto_renewal_after_hard_limit = eval { dt_from_string( $input->param('no_auto_renewal_after_hard_limit') ) } if ( $no_auto_renewal_after_hard_limit );
+ $no_auto_renewal_after_hard_limit = output_pref( { dt => $no_auto_renewal_after_hard_limit, dateonly => 1, dateformat => 'iso' } ) if ( $no_auto_renewal_after_hard_limit );
my $reservesallowed = $input->param('reservesallowed');
my $holds_per_record = $input->param('holds_per_record');
my $onshelfholds = $input->param('onshelfholds') || 0;
my $hardduedatecompare = $input->param('hardduedatecompare');
my $rentaldiscount = $input->param('rentaldiscount');
my $opacitemholds = $input->param('opacitemholds') || 0;
+ my $article_requests = $input->param('article_requests') || 'no';
my $overduefinescap = $input->param('overduefinescap') || undef;
my $cap_fine_to_replacement_price = $input->param('cap_fine_to_replacement_price') eq 'on';
$debug and warn "Adding $br, $bor, $itemtype, $fine, $maxissueqty, $maxonsiteissueqty, $cap_fine_to_replacement_price";
fine => $fine,
finedays => $finedays,
maxsuspensiondays => $maxsuspensiondays,
+ suspension_chargeperiod => $suspension_chargeperiod,
firstremind => $firstremind,
chargeperiod => $chargeperiod,
chargeperiod_charge_at => $chargeperiod_charge_at,
renewalperiod => $renewalperiod,
norenewalbefore => $norenewalbefore,
auto_renew => $auto_renew,
+ no_auto_renewal_after => $no_auto_renewal_after,
+ no_auto_renewal_after_hard_limit => $no_auto_renewal_after_hard_limit,
reservesallowed => $reservesallowed,
holds_per_record => $holds_per_record,
issuelength => $issuelength,
opacitemholds => $opacitemholds,
overduefinescap => $overduefinescap,
cap_fine_to_replacement_price => $cap_fine_to_replacement_price,
+ article_requests => $article_requests,
};
my $issuingrule = Koha::IssuingRules->find({categorycode => $bor, itemtype => $itemtype, branchcode => $br});
maxonsiteissueqty = ?
WHERE categorycode = ?
|);
- $sth_search->execute($branch);
+ $sth_search->execute($categorycode);
my $res = $sth_search->fetchrow_hashref();
if ($res->{total}) {
$sth_update->execute($maxissueqty, $maxonsiteissueqty, $categorycode);
my $patron_categories = Koha::Patron::Categories->search({}, { order_by => ['description'] });
my @row_loop;
-my @itemtypes = @{ GetItemTypes( style => 'array' ) };
-@itemtypes = sort { lc $a->{translated_description} cmp lc $b->{translated_description} } @itemtypes;
+my $itemtypes = Koha::ItemTypes->search_with_localization;
my $sth2 = $dbh->prepare("
SELECT issuingrules.*,
} else {
$row->{'hardduedate'} = 0;
}
+ if ($row->{no_auto_renewal_after_hard_limit}) {
+ my $dt = eval { dt_from_string( $row->{no_auto_renewal_after_hard_limit} ) };
+ $row->{no_auto_renewal_after_hard_limit} = eval { output_pref( { dt => $dt, dateonly => 1 } ) } if $dt;
+ }
+
push @row_loop, $row;
}
$template->param(
patron_categories => $patron_categories,
- itemtypeloop => \@itemtypes,
+ itemtypeloop => $itemtypes,
rules => \@sorted_row_loop,
humanbranch => ($branch ne '*' ? $branch : ''),
current_branch => $branch,