summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
authorivan <ivan>2010-04-05 01:23:53 +0000
committerivan <ivan>2010-04-05 01:23:53 +0000
commit7ab23ad39e05768c8da8cb419b9d88fee052684f (patch)
tree21ab989839f3654733aba76b8d517915fa7b2526 /httemplate
parent28dfe346fa452704befb385908919c204405e7b4 (diff)
last fix for employee commisssion report, RT#6991
Diffstat (limited to 'httemplate')
-rw-r--r--httemplate/search/part_pkg.html12
1 files changed, 7 insertions, 5 deletions
diff --git a/httemplate/search/part_pkg.html b/httemplate/search/part_pkg.html
index 384db7288..c6c05b873 100644
--- a/httemplate/search/part_pkg.html
+++ b/httemplate/search/part_pkg.html
@@ -169,10 +169,11 @@ if (1) { #commission reports
push @fields, sub {
my $part_pkg = shift;
my $sql = "SELECT SUM(amount) FROM cust_credit
- INNER 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',
+ LEFT JOIN cust_event USING ( eventnum )
+ LEFT JOIN part_event USING ( eventpart )
+ LEFT JOIN cust_pkg ON ( cust_event.tablenum = cust_pkg.pkgnum )
+ WHERE eventnum IS NOT NULL
+ AND action IN ( 'pkg_employee_credit',
'pkg_employee_credit_pkg'
)
AND cust_credit._date >= $beginning
@@ -187,7 +188,8 @@ if (1) { #commission reports
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