[freeside-commits] freeside/httemplate/search part_pkg.html, 1.5, 1.5.2.1
Ivan,,,
ivan at wavetail.420.am
Fri Feb 17 20:32:31 PST 2012
Update of /home/cvs/cvsroot/freeside/httemplate/search
In directory wavetail.420.am:/tmp/cvs-serv3238
Modified Files:
Tag: FREESIDE_2_3_BRANCH
part_pkg.html
Log Message:
fix per-user commission reports to filter packages they didn't order, RT#15634
Index: part_pkg.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/part_pkg.html,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -u -w -d -r1.5 -r1.5.2.1
--- part_pkg.html 29 Jun 2011 05:19:03 -0000 1.5
+++ part_pkg.html 18 Feb 2012 04:32:29 -0000 1.5.2.1
@@ -1,6 +1,6 @@
<% include( 'elements/search.html',
'title' => $title,
- 'name' => $name,
+ 'name_singular' => $name,
'header' => \@header,
'query' => { 'select' => $select,
'table' => 'part_pkg',
@@ -13,6 +13,7 @@
'fields' => \@fields,
'links' => \@links,
'align' => $align,
+ 'sort_fields' => [],
)
%>
<%init>
@@ -64,6 +65,8 @@
$title = $access_user->name;
+ $match = 'cust_pkg.usernum = '. $access_user->usernum;
+
} else {
push @header, 'Employee';
@@ -187,7 +190,7 @@
my $access_user = qsearchs('access_user', { 'usernum' => $part_pkg->get('usernum'), })
or die "unknown usernum";
- return 0 unless $access_user->user_custnum;
+ return $money_char.'0.00' unless $access_user->user_custnum;
push @arg, $access_user->user_custnum;
} elsif (0) { #agent commission reports
@@ -209,7 +212,9 @@
my $order_by = join(', ', @order_by);
#XXX agent?
-my $count_query = "SELECT COUNT(*) FROM ( SELECT 1 FROM part_pkg $addl_from $extra_sql ) AS num";
+#my $count_query = "SELECT COUNT(*) FROM ( SELECT 1 FROM part_pkg $addl_from $extra_sql ) AS num";
+#mysql?
+my $count_query = "SELECT COUNT(*) FROM ( SELECT DISTINCT part_pkg.pkgpart FROM part_pkg $addl_from $extra_sql ) AS num";
warn $count_query;
</%init>
More information about the freeside-commits
mailing list