get the highest ID
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 3 Mar 2009 04:09:26 +0000 (04:09 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 3 Mar 2009 04:09:26 +0000 (04:09 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@12369 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm

index 1cfd350..f3f63ad 100644 (file)
@@ -401,7 +401,7 @@ sub ro_biblio_ingest_single_object {
        my $xml = OpenILS::Application::Ingest::entityize($bib->marc);
 
        my $cstore = OpenSRF::AppSession->connect( 'open-ils.cstore' );
-       my $cn = $cstore->request( 'open-ils.cstore.direct.asset.call_number.search' => { id => { '!=' => undef } }, { limit => 1 } )->gather(1);
+       my $cn = $cstore->request( 'open-ils.cstore.direct.asset.call_number.search' => { id => { '!=' => undef } }, { limit => 1, order_by => { acn => 'id desc' } } )->gather(1);
     $cstore->disconnect;
 
     my $max_cn = int($cn->id) + 1000;