From 1d15d22917b9e91fbb9b5a195f94bf3b71fe304a Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 8 Feb 2007 22:19:56 +0000 Subject: [PATCH 1/1] use a LIMIT to retreive the first record, don't rely on qsearchs to trim it for you - it is inefficient and outputs long verbose warnings --- FS/FS/cust_pkg.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm index ea959ab11..b2ef2a259 100644 --- a/FS/FS/cust_pkg.pm +++ b/FS/FS/cust_pkg.pm @@ -693,7 +693,7 @@ sub last_reason { my $cust_pkg_reason = qsearchs( { 'table' => 'cust_pkg_reason', 'hashref' => { 'pkgnum' => $self->pkgnum, }, - 'extra_sql'=> 'ORDER BY date DESC', + 'extra_sql'=> 'ORDER BY date DESC LIMIT 1', } ); qsearchs ( 'reason', { 'reasonnum' => $cust_pkg_reason->reasonnum } ) if $cust_pkg_reason; -- 2.11.0