From da8315006fef75fc8e30caee4312c29e72f85f41 Mon Sep 17 00:00:00 2001 From: Tiffany Little Date: Thu, 30 Mar 2023 15:14:38 -0400 Subject: [PATCH] LP1618199_PreferISBN13_liattr Signed-off-by: Tiffany Little --- .../perlmods/lib/OpenILS/Application/Acq/Lineitem.pm | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Lineitem.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Lineitem.pm index 063386bc14..9c82377cba 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Lineitem.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Lineitem.pm @@ -296,13 +296,24 @@ sub set_default_order_ident { if (grep {$_->order_ident eq 't'} @{$li->attributes}) { return ; } # Caller wants us to apply a default order identifier - # If there's an ISBN13, use that first + # Use the first ISBN as the default. - ($attr) = grep { + # my ($attr) = grep {$_->attr_name eq 'isbn'} @{$li->attributes}; + +#for my $name (qw/issn upc/) { +# ($attr) = grep { +# $_->attr_name eq $name and + # $_->attr_type eq 'lineitem_marc_attr_definition' +# } @$li->attributes; +# return $attr if $attr; +# } + + my ($attr) = grep { $_->attr_name eq 'isbn' and $_->attr_type eq 'lineitem_marc_attr_definition' and length($_->attr_value) == 13 - } @$attrs; + } @{$li->attributes}; + if (!$attr) { return; } -- 2.11.0