Bug 16493: acq matching on title and author
When you order from a staged file you're getting duplicate warnings that are inaccurate. For example, when you order a file of 50 DVDs for example and they don't have ISBNs they're matching on the books. And then you have to order them one by one. This patch replaces the use of FindDuplicates with Koha's match point system. This means you can select from the same match points defined and used in the batch record importer, or you can opt to skip matching altogether! Test Plan: 1) Import a record with a title, isbn and author. 2) Delete the from the record and stage it again 3) Attempt to add it to a basket via the staged record 4) You should note the gives you the "No records imported" message 5) Apply this patch 6) Create a matcher for ISBN 7) Create a matcher for Author/Title 8) Attempt to add the record to your basket using the ISBN matcher 8) Koha should find no match and import the record to the basket 9) Stage the record again 10) Attempt to add the record to your basket using the Title/Author matcher 11) You should recieve the "No records imported" message. Signed-off-by: Barbara Fondren <bfondren@roundrocktexas.gov> Signed-off-by: Nicole C Engard <nengard@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Mason James <mtj@kohaaloha.com>
This commit is contained in:
parent
7a7a9c7958
commit
04ac2b4500
|
|
@ -31,7 +31,6 @@ use C4::Auth;
|
|||
use C4::Output;
|
||||
use C4::ImportBatch;
|
||||
use C4::Matcher;
|
||||
use C4::Search qw/FindDuplicate/;
|
||||
use C4::Acquisition;
|
||||
use C4::Biblio;
|
||||
use C4::Items;
|
||||
|
|
@ -141,7 +140,7 @@ if ($op eq ""){
|
|||
my @discount = $input->multi_param('discount');
|
||||
my @sort1 = $input->multi_param('sort1');
|
||||
my @sort2 = $input->multi_param('sort2');
|
||||
my $matcher_id = $input->param('matcher_id');
|
||||
my $matcher_id = $input->multi_param('matcher_id');
|
||||
my $active_currency = Koha::Acquisition::Currencies->get_active;
|
||||
for my $biblio (@$biblios){
|
||||
# Check if this import_record_id was selected
|
||||
|
|
@ -160,18 +159,13 @@ if ($op eq ""){
|
|||
# 1st insert the biblio, or find it through matcher
|
||||
unless ( $biblionumber ) {
|
||||
if ($matcher_id) {
|
||||
if ( $matcher_id eq '_TITLE_AUTHOR_' ) {
|
||||
$duplinbatch = $import_batch_id if FindDuplicate($marcrecord);
|
||||
my $matcher = C4::Matcher->fetch($matcher_id);
|
||||
my @matches = $matcher->get_matches( $marcrecord, my $max_matches = 1 );
|
||||
if ( @matches ) {
|
||||
$duplinbatch = $import_batch_id;
|
||||
next;
|
||||
}
|
||||
else {
|
||||
my $matcher = C4::Matcher->fetch($matcher_id);
|
||||
my @matches = $matcher->get_matches( $marcrecord, my $max_matches = 1 );
|
||||
$duplinbatch = $import_batch_id if @matches;
|
||||
}
|
||||
|
||||
next if $duplinbatch;
|
||||
}
|
||||
|
||||
# add the biblio
|
||||
my $bibitemnum;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue