summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan <ivan>2007-12-15 01:45:22 +0000
committerivan <ivan>2007-12-15 01:45:22 +0000
commit45c73e0d548b950dd29c21d863c239f6114a2083 (patch)
tree6b65b7e8a1a7b3e3cb724d1b214563f3a921ed1d
parentdf52f854e367f6342e480c22cb6ec7b8244fd334 (diff)
fix earlier drain bramage
-rw-r--r--FS/FS/cust_bill.pm3
-rwxr-xr-xhttemplate/search/cust_bill.html2
2 files changed, 3 insertions, 2 deletions
diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm
index 1f6f85b44..c59948808 100644
--- a/FS/FS/cust_bill.pm
+++ b/FS/FS/cust_bill.pm
@@ -2879,7 +2879,7 @@ sub search_sql {
#$orderby = 'ORDER BY cust_bill.custnum ASC, cust_bill._date DESC';
my @newest_where = map { my $x = $_;
- $x = s/\bcust_bill\./newest_cust_bill./g;
+ $x =~ s/\bcust_bill\./newest_cust_bill./g;
$x;
}
grep ! /^cust_main./, @search;
@@ -2887,6 +2887,7 @@ sub search_sql {
? ' AND '. join(' AND ', @newest_where)
: '';
+
push @search, "cust_bill._date = (
SELECT(MAX(newest_cust_bill._date)) FROM cust_bill AS newest_cust_bill
WHERE newest_cust_bill.custnum = cust_bill.custnum
diff --git a/httemplate/search/cust_bill.html b/httemplate/search/cust_bill.html
index fe2f6e5f8..69384b813 100755
--- a/httemplate/search/cust_bill.html
+++ b/httemplate/search/cust_bill.html
@@ -144,7 +144,7 @@ if ( $cgi->param('invnum') =~ /^\s*(FS-)?(\d+)\s*$/ ) {
'$%.2f outstanding balance',
];
}
- $count_query .= " FROM cust_bill $join_cust_main WHERE $extra_sql";
+ $count_query .= " FROM cust_bill $join_cust_main $extra_sql";
$sql_query = {
'table' => 'cust_bill',