[freeside-commits] freeside/httemplate/search part_pkg.html, 1.1, 1.2

Ivan,,, ivan at wavetail.420.am
Sun Apr 4 18:23:55 PDT 2010


Update of /home/cvs/cvsroot/freeside/httemplate/search
In directory wavetail.420.am:/tmp/cvs-serv3176

Modified Files:
	part_pkg.html 
Log Message:
last fix for employee commisssion report, RT#6991

Index: part_pkg.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/part_pkg.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -w -d -r1.1 -r1.2
--- part_pkg.html	30 Mar 2010 12:12:56 -0000	1.1
+++ part_pkg.html	5 Apr 2010 01:23:53 -0000	1.2
@@ -169,10 +169,11 @@
   push @fields, sub {
     my $part_pkg = shift;
     my $sql = "SELECT SUM(amount) FROM cust_credit
-                   INNER JOIN cust_event USING ( eventnum )
+                   LEFT JOIN cust_event USING ( eventnum )
                    LEFT  JOIN part_event USING ( eventpart )
                    LEFT  JOIN cust_pkg ON ( cust_event.tablenum = cust_pkg.pkgnum )
-                 WHERE action IN ( 'pkg_employee_credit',
+                 WHERE eventnum IS NOT NULL
+                   AND action IN ( 'pkg_employee_credit',
                                    'pkg_employee_credit_pkg'
                                  )
                    AND cust_credit._date >= $beginning
@@ -187,7 +188,8 @@
       my $access_user = qsearchs('access_user', { 'usernum' => $part_pkg->get('usernum'), })
         or die "unknown usernum";
 
-      push @arg, $access_user->user_custnum or return 0;
+      return 0 unless $access_user->user_custnum;
+      push @arg, $access_user->user_custnum;
 
     } elsif (0) { #agent commission reports
       push @arg, 'XXXagent_custnum'; #$agent->agent_custnum



More information about the freeside-commits mailing list