Added in setting item properties for price, shelving_location, circ modifier and... user/stompro/lp2008904-item-attributes
authorJosh Stompro <stomproj+gitlab2020@gsuite.larl.org>
Fri, 24 Feb 2023 20:04:08 +0000 (20:04 +0000)
committerJosh Stompro <stomproj@larl.org>
Tue, 14 Mar 2023 20:40:15 +0000 (15:40 -0500)
Signed-off-by: Josh Stompro <stomproj@larl.org>
lib/NCIP/ILS/Evergreen.pm

index e0f3cc4..c3325fe 100644 (file)
@@ -2228,10 +2228,16 @@ sub create_fuller_copy {
 
         # create the copy
         if ($acn) {
-            $item = Fieldmapper::asset::copy->new();
+                        $item = Fieldmapper::asset::copy->new();
             $item->barcode($item_info->{barcode});
             $item->call_number($acn->id());
+            if ($self->{config}->{items}->{circ_as_type}) {
+                $item->circ_as_type($self->{config}->{items}->{circ_as_type});
+            }
             $item->circ_lib($self->{session}->{work_ou}->id);
+            if ($self->{config}->{items}->{circ_modifier}) {
+                $item->circ_modifier($self->{config}->{items}->{circ_modifier});
+            }
             $item->circulate('t');
             if ($self->{config}->{items}->{use_force_holds}) {
                 $item->holdable('f');
@@ -2239,10 +2245,17 @@ sub create_fuller_copy {
                 $item->holdable('t');
             }
             $item->opac_visible('f');
+            if ($self->{config}->{items}->{item_price}) {
+                $item->price($self->{config}->{items}->{item_price});
+            }
             $item->deleted('f');
             $item->fine_level(OILS_PRECAT_COPY_FINE_LEVEL);
             $item->loan_duration(OILS_PRECAT_COPY_LOAN_DURATION);
-            $item->location(1);
+            if ($self->{config}->{items}->{shelving_location}) {
+                $item->location($self->{config}->{items}->{shelving_location}->{sid});
+            } else {
+                $item->location(1);
+            }
             $item->status(0);
             $item->editor($self->{session}->{user}->id);
             $item->creator($self->{session}->{user}->id);