summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/cust_main.pm18
-rw-r--r--FS/FS/prospect_main.pm9
2 files changed, 20 insertions, 7 deletions
diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm
index 0586a80..6d5d1d3 100644
--- a/FS/FS/cust_main.pm
+++ b/FS/FS/cust_main.pm
@@ -2183,8 +2183,13 @@ Returns all locations (see L<FS::cust_location>) 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
@@ -3592,9 +3597,12 @@ Returns all the credits (see L<FS::cust_credit>) 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
diff --git a/FS/FS/prospect_main.pm b/FS/FS/prospect_main.pm
index 79efa86..f600b23 100644
--- a/FS/FS/prospect_main.pm
+++ b/FS/FS/prospect_main.pm
@@ -288,8 +288,13 @@ Returns the locations (see L<FS::cust_location>) associated with this prospect.
sub cust_location {
my $self = shift;
- qsearch( 'cust_location', { 'prospectnum' => $self->prospectnum,
- 'custnum' => '' } );
+ qsearch({
+ 'table' => 'cust_location',
+ 'hashref' => { 'prospectnum' => $self->prospectnum,
+ 'custnum' => '',
+ },
+ 'order_by' => 'ORDER BY country, LOWER(state), LOWER(city), LOWER(county), LOWER(address1), LOWER(address2)',
+ });
}
=item qual