Bug 9573: Lost items report - Add a new itemlost_on column
[koha.git] / admin / itemtypes.pl
index 756910d..cc790df 100755 (executable)
@@ -72,6 +72,8 @@ if ( $op eq 'add_form' ) {
     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;
@@ -90,6 +92,8 @@ if ( $op eq 'add_form' ) {
     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);
@@ -108,17 +112,19 @@ if ( $op eq 'add_form' ) {
         }
     } 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; };
@@ -139,13 +145,13 @@ if ( $op eq 'add_form' ) {
     $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' ) {