fix new tax report w/FS::tax_rate_location->location_sql, RT#12332
[freeside.git] / FS / FS / cust_main.pm
index babb50f..cf4c6d9 100644 (file)
@@ -2211,12 +2211,13 @@ Returns all notes (see L<FS::cust_main_note>) for this customer.
 =cut
 
 sub notes {
-  my $self = shift;
-  #order by?
+   my($self,$orderby_classnum) = (shift,shift);
+   my $orderby = "_DATE DESC";
+   $orderby = "CLASSNUM ASC, $orderby" if $orderby_classnum;
   qsearch( 'cust_main_note',
            { 'custnum' => $self->custnum },
           '',
-          'ORDER BY _DATE DESC'
+          "ORDER BY $orderby",
         );
 }
 
@@ -3854,7 +3855,7 @@ sub statuscolor { shift->cust_statuscolor(@_); }
 
 sub cust_statuscolor {
   my $self = shift;
-  $self->statuscolors->{$self->cust_status};
+  __PACKAGE__->statuscolors->{$self->cust_status};
 }
 
 =item tickets