--- a/misc/export_records.pl +++ a/misc/export_records.pl @@ -32,7 +32,7 @@ use Koha::CsvProfiles; use Koha::Exporter::Record; use Koha::DateUtils qw( dt_from_string output_pref ); -my ( $output_format, $timestamp, $dont_export_items, $csv_profile_id, $deleted_barcodes, $clean, $filename, $record_type, $id_list_file, $starting_authid, $ending_authid, $authtype, $starting_biblionumber, $ending_biblionumber, $itemtype, $starting_callnumber, $ending_callnumber, $start_accession, $end_accession, $help ); +my ( $output_format, $timestamp, $dont_export_items, $csv_profile_id, $deleted_barcodes, $clean, $filename, $record_type, $id_list_file, $starting_authid, $ending_authid, $authtype, $starting_biblionumber, $ending_biblionumber, $itemtype, $starting_callnumber, $ending_callnumber, $start_accession, $end_accession, $homebranch, $holdingbranch, $help ); GetOptions( 'format=s' => \$output_format, 'date=s' => \$timestamp, @@ -53,6 +53,8 @@ GetOptions( 'ending_callnumber=s' => \$ending_callnumber, 'start_accession=s' => \$start_accession, 'end_accession=s' => \$end_accession, + 'homebranch=s' => \$homebranch, + 'holdingbranch=s' => \$holdingbranch, 'h|help|?' => \$help ) || pod2usage(1); @@ -150,7 +152,15 @@ if ( $record_type eq 'bibs' ) { : ( 'me.itemtype' => $itemtype ) : () ), - + ( $homebranch + ? ( "items.homebranch" => $homebranch ) + : () + ), + ( $holdingbranch + ? ( "items.holdingbranch" => $holdingbranch ) + : () + ), + }; my $biblioitems = Koha::Biblioitems->search( $conditions, { join => 'items' } ); while ( my $biblioitem = $biblioitems->next ) { @@ -310,6 +320,14 @@ Print a brief help message. --end_accession=DATE Export biblio with an item accessionned after DATE +=item B<--homebranch> + + --homebranch=BRANCHCODE Export biblio owned by a specific library given by BRANCHCODE + +=item B<--holdingbranch> + + --holdingbranch=BRANCHCODE Export biblio hold by a specific library given by BRANCHCODE + =back =head1 AUTHOR