Lines 770-782
sub BatchCommitItems {
Link Here
|
770 |
my $duplicate_barcode = exists( $item->{'barcode'} ) && Koha::Items->find({ barcode => $item->{'barcode'} }); |
770 |
my $duplicate_barcode = exists( $item->{'barcode'} ) && Koha::Items->find({ barcode => $item->{'barcode'} }); |
771 |
my $duplicate_itemnumber = exists( $item->{'itemnumber'} ); |
771 |
my $duplicate_itemnumber = exists( $item->{'itemnumber'} ); |
772 |
|
772 |
|
773 |
my $updsth = $dbh->prepare("UPDATE import_items SET status = ?, itemnumber = ? WHERE import_items_id = ?"); |
773 |
my $updsth = $dbh->prepare("UPDATE import_items SET status = ?, itemnumber = ?, import_error = ? WHERE import_items_id = ?"); |
774 |
if ( $action eq "replace" && $duplicate_itemnumber ) { |
774 |
if ( $action eq "replace" && $duplicate_itemnumber ) { |
775 |
# Duplicate itemnumbers have precedence, that way we can update barcodes by overlaying |
775 |
# Duplicate itemnumbers have precedence, that way we can update barcodes by overlaying |
776 |
ModItemFromMarc( $item_marc, $biblionumber, $item->{itemnumber} ); |
776 |
ModItemFromMarc( $item_marc, $biblionumber, $item->{itemnumber} ); |
777 |
$updsth->bind_param( 1, 'imported' ); |
777 |
$updsth->bind_param( 1, 'imported' ); |
778 |
$updsth->bind_param( 2, $item->{itemnumber} ); |
778 |
$updsth->bind_param( 2, $item->{itemnumber} ); |
779 |
$updsth->bind_param( 3, $row->{'import_items_id'} ); |
779 |
$updsth->bind_param( 3, undef ); |
|
|
780 |
$updsth->bind_param( 4, $row->{'import_items_id'} ); |
780 |
$updsth->execute(); |
781 |
$updsth->execute(); |
781 |
$updsth->finish(); |
782 |
$updsth->finish(); |
782 |
$num_items_replaced++; |
783 |
$num_items_replaced++; |
Lines 785-798
sub BatchCommitItems {
Link Here
|
785 |
ModItemFromMarc( $item_marc, $biblionumber, $itemnumber ); |
786 |
ModItemFromMarc( $item_marc, $biblionumber, $itemnumber ); |
786 |
$updsth->bind_param( 1, 'imported' ); |
787 |
$updsth->bind_param( 1, 'imported' ); |
787 |
$updsth->bind_param( 2, $item->{itemnumber} ); |
788 |
$updsth->bind_param( 2, $item->{itemnumber} ); |
788 |
$updsth->bind_param( 3, $row->{'import_items_id'} ); |
789 |
$updsth->bind_param( 3, undef ); |
|
|
790 |
$updsth->bind_param( 4, $row->{'import_items_id'} ); |
789 |
$updsth->execute(); |
791 |
$updsth->execute(); |
790 |
$updsth->finish(); |
792 |
$updsth->finish(); |
791 |
$num_items_replaced++; |
793 |
$num_items_replaced++; |
792 |
} elsif ($duplicate_barcode) { |
794 |
} elsif ($duplicate_barcode) { |
793 |
$updsth->bind_param( 1, 'error' ); |
795 |
$updsth->bind_param( 1, 'error' ); |
794 |
$updsth->bind_param( 2, 'duplicate item barcode' ); |
796 |
$updsth->bind_param( 2, undef ); |
795 |
$updsth->bind_param( 3, $row->{'import_items_id'} ); |
797 |
$updsth->bind_param( 3, 'duplicate item barcode' ); |
|
|
798 |
$updsth->bind_param( 4, $row->{'import_items_id'} ); |
796 |
$updsth->execute(); |
799 |
$updsth->execute(); |
797 |
$num_items_errored++; |
800 |
$num_items_errored++; |
798 |
} else { |
801 |
} else { |
Lines 804-810
sub BatchCommitItems {
Link Here
|
804 |
if( $itemnumber ) { |
807 |
if( $itemnumber ) { |
805 |
$updsth->bind_param( 1, 'imported' ); |
808 |
$updsth->bind_param( 1, 'imported' ); |
806 |
$updsth->bind_param( 2, $itemnumber ); |
809 |
$updsth->bind_param( 2, $itemnumber ); |
807 |
$updsth->bind_param( 3, $row->{'import_items_id'} ); |
810 |
$updsth->bind_param( 3, undef ); |
|
|
811 |
$updsth->bind_param( 4, $row->{'import_items_id'} ); |
808 |
$updsth->execute(); |
812 |
$updsth->execute(); |
809 |
$updsth->finish(); |
813 |
$updsth->finish(); |
810 |
$num_items_added++; |
814 |
$num_items_added++; |
811 |
- |
|
|