my $itemtype = Koha::ItemTypes->find($itemtype_code);
my $description = $input->param('description');
my $rentalcharge = $input->param('rentalcharge');
+ my $defaultreplacecost = $input->param('defaultreplacecost');
+ my $processfee = $input->param('processfee');
my $image = $input->param('image') || q||;
my $notforloan = $input->param('notforloan') ? 1 : 0;
if ( $itemtype and $is_a_modif ) { # it's a modification
$itemtype->description($description);
$itemtype->rentalcharge($rentalcharge);
+ $itemtype->defaultreplacecost($defaultreplacecost);
+ $itemtype->processfee($processfee);
$itemtype->notforloan($notforloan);
$itemtype->imageurl($imageurl);
$itemtype->summary($summary);
}
} elsif ( not $itemtype and not $is_a_modif ) {
my $itemtype = Koha::ItemType->new(
- { itemtype => $itemtype_code,
- description => $description,
- rentalcharge => $rentalcharge,
- notforloan => $notforloan,
- imageurl => $imageurl,
- summary => $summary,
- checkinmsg => $checkinmsg,
- checkinmsgtype => $checkinmsgtype,
- sip_media_type => $sip_media_type,
- hideinopac => $hideinopac,
- searchcategory => $searchcategory,
+ { itemtype => $itemtype_code,
+ description => $description,
+ rentalcharge => $rentalcharge,
+ defaultreplacecost => $defaultreplacecost,
+ processfee => $processfee,
+ notforloan => $notforloan,
+ imageurl => $imageurl,
+ summary => $summary,
+ checkinmsg => $checkinmsg,
+ checkinmsgtype => $checkinmsgtype,
+ sip_media_type => $sip_media_type,
+ hideinopac => $hideinopac,
+ searchcategory => $searchcategory,
}
);
eval { $itemtype->store; };
$op = 'list';
} elsif ( $op eq 'delete_confirm' ) {
- my $ItemType = Koha::ItemTypes->find($itemtype_code);
- my $overalltotal = $ItemType->can_be_deleted();
- if ($overalltotal == 0) {
+ my $itemtype = Koha::ItemTypes->find($itemtype_code);
+ my $can_be_deleted = $itemtype->can_be_deleted();
+ if ($can_be_deleted == 0) {
push @messages, { type => 'error', code => 'cannot_be_deleted'};
$op = 'list';
} else {
- $template->param( itemtype => $ItemType, );
+ $template->param( itemtype => $itemtype, );
}
} elsif ( $op eq 'delete_confirmed' ) {