Lines 129-134
use C4::Biblio; # AddBiblio TransformKohaToMarc
Link Here
|
129 |
use C4::Budgets; |
129 |
use C4::Budgets; |
130 |
use C4::Items; |
130 |
use C4::Items; |
131 |
use C4::Output; |
131 |
use C4::Output; |
|
|
132 |
use C4::Barcodes; |
132 |
|
133 |
|
133 |
### "-------------------- addorder.pl ----------" |
134 |
### "-------------------- addorder.pl ----------" |
134 |
|
135 |
|
Lines 303-309
if ( $orderinfo->{quantity} ne '0' ) {
Link Here
|
303 |
push @{$itemhash{$itemid[$i]}->{'indicator'}},$indicator[$i]; |
304 |
push @{$itemhash{$itemid[$i]}->{'indicator'}},$indicator[$i]; |
304 |
} |
305 |
} |
305 |
foreach my $item (keys %itemhash){ |
306 |
foreach my $item (keys %itemhash){ |
306 |
|
|
|
307 |
my $xml = TransformHtmlToXml( $itemhash{$item}->{'tags'}, |
307 |
my $xml = TransformHtmlToXml( $itemhash{$item}->{'tags'}, |
308 |
$itemhash{$item}->{'subfields'}, |
308 |
$itemhash{$item}->{'subfields'}, |
309 |
$itemhash{$item}->{'field_values'}, |
309 |
$itemhash{$item}->{'field_values'}, |
Lines 311-316
if ( $orderinfo->{quantity} ne '0' ) {
Link Here
|
311 |
$itemhash{$item}->{'ind_tag'}, |
311 |
$itemhash{$item}->{'ind_tag'}, |
312 |
'ITEM'); |
312 |
'ITEM'); |
313 |
my $record=MARC::Record::new_from_xml($xml, 'UTF-8'); |
313 |
my $record=MARC::Record::new_from_xml($xml, 'UTF-8'); |
|
|
314 |
my ($barcodefield,$barcodesubfield) = GetMarcFromKohaField('items.barcode'); |
315 |
my $barcode = $record->subfield($barcodefield,$barcodesubfield); |
316 |
my $aBpref = C4::Context->preference('autoBarcode'); |
317 |
if( $barcode eq '' && $aBpref ne 'OFF'){ |
318 |
my $barcodeobj = C4::Barcodes->new; |
319 |
$barcode = $barcodeobj->next_value(); |
320 |
$record->field($barcodefield)->delete_subfield( code => $barcodesubfield); |
321 |
$record->field($barcodefield)->add_subfields($barcodesubfield => $barcode); |
322 |
} |
314 |
my ($biblionumber,$bibitemnum,$itemnumber) = AddItemFromMarc($record,$$orderinfo{biblionumber}); |
323 |
my ($biblionumber,$bibitemnum,$itemnumber) = AddItemFromMarc($record,$$orderinfo{biblionumber}); |
315 |
$order->add_item($itemnumber); |
324 |
$order->add_item($itemnumber); |
316 |
} |
325 |
} |