freeside/httemplate/search cust_credit.html,1.3,1.4 cust_pay.cgi,1.13,1.14

ivan ivan at pouncequick.420.am
Fri Mar 4 04:57:55 PST 2005


Update of /home/cvs/cvsroot/freeside/httemplate/search
In directory pouncequick:/tmp/cvs-serv15337

Modified Files:
	cust_credit.html cust_pay.cgi 
Log Message:
report correctly even if the customer record has somehow been removed...

Index: cust_pay.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/cust_pay.cgi,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- cust_pay.cgi	4 Mar 2005 12:34:55 -0000	1.13
+++ cust_pay.cgi	4 Mar 2005 12:57:53 -0000	1.14
@@ -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 {

Index: cust_credit.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/cust_credit.html,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- cust_credit.html	4 Mar 2005 12:34:55 -0000	1.3
+++ cust_credit.html	4 Mar 2005 12:57:53 -0000	1.4
@@ -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' ];




More information about the freeside-commits mailing list