X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fcust_main.pm;h=5f77ab5f672bb0aa4e0fe50fad24dad5c71d12b5;hp=be02f9c9b9565021980e097dfa8a53fff44f750d;hb=229373d8ab3b19351e14f345eb42344b8ed72d35;hpb=341adb07d0f22f7386b0d1055aa5d6d6120198ca diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index be02f9c9b..5f77ab5f6 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -1951,8 +1951,13 @@ Returns all locations (see L) for this customer. sub cust_location { my $self = shift; - qsearch('cust_location', { 'custnum' => $self->custnum, - 'prospectnum' => '' } ); + qsearch({ + 'table' => 'cust_location', + 'hashref' => { 'custnum' => $self->custnum, + 'prospectnum' => '', + }, + 'order_by' => 'ORDER BY country, LOWER(state), LOWER(city), LOWER(county), LOWER(address1), LOWER(address2)', + }); } =item cust_contact @@ -3364,9 +3369,12 @@ Returns all the credits (see L) for this customer. sub cust_credit { my $self = shift; - map { $_ } #return $self->num_cust_credit unless wantarray; - sort { $a->_date <=> $b->_date } - qsearch( 'cust_credit', { 'custnum' => $self->custnum } ) + + #return $self->num_cust_credit unless wantarray; + + map { $_ } #behavior of sort undefined in scalar context + sort { $a->_date <=> $b->_date } + qsearch( 'cust_credit', { 'custnum' => $self->custnum } ) } =item cust_credit_pkgnum