From 749873c3201a45cd0525d13cb90ddccc85e11aa6 Mon Sep 17 00:00:00 2001 From: miker Date: Tue, 14 Feb 2006 02:44:02 +0000 Subject: [PATCH] fixing ranged record-copy tree git-svn-id: svn://svn.open-ils.org/ILS/trunk@3065 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../Application/Storage/Publisher/biblio.pm | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/biblio.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/biblio.pm index a72cd6bc74..820c00d6db 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/biblio.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/biblio.pm @@ -95,21 +95,22 @@ sub record_ranged_tree { for my $cp ( $cn->copies(circ_lib => $ou_list) ) { - if ($offset && $offset_count < $offset) { + if ($offset > 0 && $offset_count < $offset) { $offset_count++; next; } - last if ($limit && $limit_count >= $limit); - if ($limit && $limit_count < $limit) { - $limit_count++; - my $copy = $cp->to_fieldmapper; - $copy->status( $cp->status->to_fieldmapper ); - $copy->location( $cp->status->to_fieldmapper ); - push @{ $call_number->copies }, $copy; - } + + last if ($limit > 0 && $limit_count >= $limit); + + my $copy = $cp->to_fieldmapper; + $copy->status( $cp->status->to_fieldmapper ); + $copy->location( $cp->status->to_fieldmapper ); + push @{ $call_number->copies }, $copy; + + $limit_count++; } - last if ($limit && $limit_count >= $limit); + last if ($limit > 0 && $limit_count >= $limit); push @{ $rec->call_numbers }, $call_number if (@{ $call_number->copies }); } -- 2.43.2