Lines 135-160
if ($AcqCreateItem eq 'receiving') {
Link Here
|
135 |
if($item->{holdingbranch}) { |
135 |
if($item->{holdingbranch}) { |
136 |
$item->{holdingbranchname} = GetBranchName($item->{holdingbranch}); |
136 |
$item->{holdingbranchname} = GetBranchName($item->{holdingbranch}); |
137 |
} |
137 |
} |
138 |
if(my $code = GetAuthValCode("items.notforloan", $fw)) { |
138 |
my $av; |
139 |
my $av = Koha::AuthorisedValues->search({ category => $code, authorised_value => $item->{notforloan} }); |
139 |
$av = Koha::AuthorisedValues->search_by_koha_field({frameworkcode => $fw, kohafield => 'items.notforloan', authorised_value => $item->{notforloan} }); |
140 |
$item->{notforloan} = $av->count ? $av->next->lib : ''; |
140 |
$item->{notforloan} = $av->count ? $av->next->lib : ''; |
141 |
} |
141 |
|
142 |
if(my $code = GetAuthValCode("items.restricted", $fw)) { |
142 |
$av = Koha::AuthorisedValues->search_by_koha_field({frameworkcode => $fw, kohafield => 'items.restricted', authorised_value => $item->{restricted} }); |
143 |
my $av = Koha::AuthorisedValues->search({ category => $code, authorised_value => $item->{restricted} }); |
143 |
$item->{restricted} = $av->count ? $av->next->lib : ''; |
144 |
$item->{restricted} = $av->count ? $av->next->lib : ''; |
144 |
|
145 |
} |
145 |
$av = Koha::AuthorisedValues->search_by_koha_field({frameworkcode => $fw, kohafield => 'items.location', authorised_value => $item->{location} }); |
146 |
if(my $code = GetAuthValCode("items.location", $fw)) { |
146 |
$item->{location} = $av->count ? $av->next->lib : ''; |
147 |
my $av = Koha::AuthorisedValues->search({ category => $code, authorised_value => $item->{location} }); |
147 |
|
148 |
$item->{location} = $av->count ? $av->next->lib : ''; |
148 |
$av = Koha::AuthorisedValues->search_by_koha_field({frameworkcode => $fw, kohafield => 'items.collection', authorised_value => $item->{collection} }); |
149 |
} |
149 |
$item->{collection} = $av->count ? $av->next->lib : ''; |
150 |
if(my $code = GetAuthValCode("items.ccode", $fw)) { |
150 |
|
151 |
my $av = Koha::AuthorisedValues->search({ category => $code, authorised_value => $item->{collection} }); |
151 |
$av = Koha::AuthorisedValues->search_by_koha_field({frameworkcode => $fw, kohafield => 'items.materials', authorised_value => $item->{materials} }); |
152 |
$item->{collection} = $av->count ? $av->next->lib : ''; |
152 |
$item->{materials} = $av->count ? $av->next->lib : ''; |
153 |
} |
153 |
|
154 |
if(my $code = GetAuthValCode("items.materials", $fw)) { |
|
|
155 |
my $av = Koha::AuthorisedValues->search({ category => $code, authorised_value => $item->{materials} }); |
156 |
$item->{materials} = $av->count ? $av->next->lib : ''; |
157 |
} |
158 |
my $itemtype = getitemtypeinfo($item->{itype}); |
154 |
my $itemtype = getitemtypeinfo($item->{itype}); |
159 |
$item->{itemtype} = $itemtype->{description}; |
155 |
$item->{itemtype} = $itemtype->{description}; |
160 |
push @items, $item; |
156 |
push @items, $item; |