From: ivan Date: Fri, 4 Mar 2005 12:57:53 +0000 (+0000) Subject: report correctly even if the customer record has somehow been removed... X-Git-Tag: BEFORE_FINAL_MASONIZE~675 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=f8e7f53109f36e3c649dc509b61c75c3c44fb519 report correctly even if the customer record has somehow been removed... --- diff --git a/httemplate/search/cust_credit.html b/httemplate/search/cust_credit.html index a3f88cc21..85128bca2 100755 --- a/httemplate/search/cust_credit.html +++ b/httemplate/search/cust_credit.html @@ -41,14 +41,14 @@ : ''; my $count_query = 'SELECT COUNT(*), SUM(amount) '. - 'FROM cust_credit JOIN cust_main USING ( custnum ) '. + 'FROM cust_credit LEFT JOIN cust_main USING ( custnum ) '. $where; my $sql_query = { 'table' => 'cust_credit', 'hashref' => {}, 'extra_sql' => $where, - 'addl_from' => 'JOIN cust_main USING ( custnum )', + 'addl_from' => 'LEFT JOIN cust_main USING ( custnum )', }; my $clink = [ "${p}view/cust_main.cgi?", 'custnum' ]; diff --git a/httemplate/search/cust_pay.cgi b/httemplate/search/cust_pay.cgi index 42b3c01bc..64fe1f93a 100755 --- a/httemplate/search/cust_pay.cgi +++ b/httemplate/search/cust_pay.cgi @@ -68,7 +68,7 @@ my $hsearch = join(' AND ', map { "$_ = '$search{$_}'" } keys %search ); $count_query = "SELECT COUNT(*), SUM(paid) ". - "FROM cust_pay JOIN cust_main USING ( custnum )". + "FROM cust_pay LEFT JOIN cust_main USING ( custnum )". ( $hsearch ? " WHERE $hsearch " : '' ). $search; @@ -77,7 +77,7 @@ 'table' => 'cust_pay', 'hashref' => \%search, 'extra_sql' => "$search ORDER BY _date", - 'addl_from' => 'JOIN cust_main USING ( custnum )', + 'addl_from' => 'LEFT JOIN cust_main USING ( custnum )', }; } else {