|
Lines 238-244
elsif ($op eq 'add') {
Link Here
|
| 238 |
my $fine = $input->param('fine'); |
238 |
my $fine = $input->param('fine'); |
| 239 |
my $finedays = $input->param('finedays'); |
239 |
my $finedays = $input->param('finedays'); |
| 240 |
my $maxsuspensiondays = $input->param('maxsuspensiondays'); |
240 |
my $maxsuspensiondays = $input->param('maxsuspensiondays'); |
| 241 |
$maxsuspensiondays = undef if $maxsuspensiondays eq q||; |
241 |
$maxsuspensiondays = '' if $maxsuspensiondays eq q||; |
| 242 |
my $firstremind = $input->param('firstremind'); |
242 |
my $firstremind = $input->param('firstremind'); |
| 243 |
my $chargeperiod = $input->param('chargeperiod'); |
243 |
my $chargeperiod = $input->param('chargeperiod'); |
| 244 |
my $chargeperiod_charge_at = $input->param('chargeperiod_charge_at'); |
244 |
my $chargeperiod_charge_at = $input->param('chargeperiod_charge_at'); |
|
Lines 247-266
elsif ($op eq 'add') {
Link Here
|
| 247 |
my $renewalsallowed = $input->param('renewalsallowed'); |
247 |
my $renewalsallowed = $input->param('renewalsallowed'); |
| 248 |
my $renewalperiod = $input->param('renewalperiod'); |
248 |
my $renewalperiod = $input->param('renewalperiod'); |
| 249 |
my $norenewalbefore = $input->param('norenewalbefore'); |
249 |
my $norenewalbefore = $input->param('norenewalbefore'); |
| 250 |
$norenewalbefore = undef if $norenewalbefore =~ /^\s*$/; |
250 |
$norenewalbefore = '' if $norenewalbefore =~ /^\s*$/; |
| 251 |
my $auto_renew = $input->param('auto_renew') eq 'yes' ? 1 : 0; |
251 |
my $auto_renew = $input->param('auto_renew') eq 'yes' ? 1 : 0; |
| 252 |
my $no_auto_renewal_after = $input->param('no_auto_renewal_after'); |
252 |
my $no_auto_renewal_after = $input->param('no_auto_renewal_after'); |
| 253 |
$no_auto_renewal_after = undef if $no_auto_renewal_after =~ /^\s*$/; |
253 |
$no_auto_renewal_after = '' if $no_auto_renewal_after =~ /^\s*$/; |
| 254 |
my $no_auto_renewal_after_hard_limit = $input->param('no_auto_renewal_after_hard_limit') || undef; |
254 |
my $no_auto_renewal_after_hard_limit = $input->param('no_auto_renewal_after_hard_limit') || ''; |
| 255 |
$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 ); |
255 |
$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 ); |
| 256 |
$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 ); |
256 |
$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 ); |
| 257 |
my $reservesallowed = $input->param('reservesallowed'); |
257 |
my $reservesallowed = $input->param('reservesallowed'); |
| 258 |
my $holds_per_record = $input->param('holds_per_record'); |
258 |
my $holds_per_record = $input->param('holds_per_record'); |
| 259 |
my $onshelfholds = $input->param('onshelfholds') || 0; |
259 |
my $onshelfholds = $input->param('onshelfholds') || 0; |
| 260 |
$maxissueqty =~ s/\s//g; |
260 |
$maxissueqty =~ s/\s//g; |
| 261 |
$maxissueqty = undef if $maxissueqty !~ /^\d+/; |
261 |
$maxissueqty = '' if $maxissueqty !~ /^\d+/; |
| 262 |
$maxonsiteissueqty =~ s/\s//g; |
262 |
$maxonsiteissueqty =~ s/\s//g; |
| 263 |
$maxonsiteissueqty = undef if $maxonsiteissueqty !~ /^\d+/; |
263 |
$maxonsiteissueqty = '' if $maxonsiteissueqty !~ /^\d+/; |
| 264 |
my $issuelength = $input->param('issuelength'); |
264 |
my $issuelength = $input->param('issuelength'); |
| 265 |
$issuelength = $issuelength eq q{} ? undef : $issuelength; |
265 |
$issuelength = $issuelength eq q{} ? undef : $issuelength; |
| 266 |
my $lengthunit = $input->param('lengthunit'); |
266 |
my $lengthunit = $input->param('lengthunit'); |
|
Lines 271-277
elsif ($op eq 'add') {
Link Here
|
| 271 |
my $rentaldiscount = $input->param('rentaldiscount'); |
271 |
my $rentaldiscount = $input->param('rentaldiscount'); |
| 272 |
my $opacitemholds = $input->param('opacitemholds') || 0; |
272 |
my $opacitemholds = $input->param('opacitemholds') || 0; |
| 273 |
my $article_requests = $input->param('article_requests') || 'no'; |
273 |
my $article_requests = $input->param('article_requests') || 'no'; |
| 274 |
my $overduefinescap = $input->param('overduefinescap') || undef; |
274 |
my $overduefinescap = $input->param('overduefinescap') || ''; |
| 275 |
my $cap_fine_to_replacement_price = $input->param('cap_fine_to_replacement_price') eq 'on'; |
275 |
my $cap_fine_to_replacement_price = $input->param('cap_fine_to_replacement_price') eq 'on'; |
| 276 |
warn "Adding $br, $bor, $itemtype, $fine, $maxissueqty, $maxonsiteissueqty, $cap_fine_to_replacement_price"; |
276 |
warn "Adding $br, $bor, $itemtype, $fine, $maxissueqty, $maxonsiteissueqty, $cap_fine_to_replacement_price"; |
| 277 |
|
277 |
|
|
Lines 300-305
elsif ($op eq 'add') {
Link Here
|
| 300 |
overduefinescap => $overduefinescap, |
300 |
overduefinescap => $overduefinescap, |
| 301 |
cap_fine_to_replacement_price => $cap_fine_to_replacement_price, |
301 |
cap_fine_to_replacement_price => $cap_fine_to_replacement_price, |
| 302 |
article_requests => $article_requests, |
302 |
article_requests => $article_requests, |
|
|
303 |
maxissueqty => $maxissueqty, |
| 304 |
maxonsiteissueqty => $maxonsiteissueqty, |
| 303 |
}; |
305 |
}; |
| 304 |
|
306 |
|
| 305 |
Koha::CirculationRules->set_rules( |
307 |
Koha::CirculationRules->set_rules( |
|
Lines 308-315
elsif ($op eq 'add') {
Link Here
|
| 308 |
itemtype => $itemtype eq '*' ? undef : $itemtype, |
310 |
itemtype => $itemtype eq '*' ? undef : $itemtype, |
| 309 |
branchcode => $br eq '*' ? undef : $br, |
311 |
branchcode => $br eq '*' ? undef : $br, |
| 310 |
rules => { |
312 |
rules => { |
| 311 |
maxissueqty => $maxissueqty, |
|
|
| 312 |
maxonsiteissueqty => $maxonsiteissueqty, |
| 313 |
%$params, |
313 |
%$params, |
| 314 |
} |
314 |
} |
| 315 |
} |
315 |
} |