projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
03be368
)
agent-virtual contract end date report, #71964
author
Mark Wells
<mark@freeside.biz>
Fri, 26 Aug 2016 22:44:02 +0000
(15:44 -0700)
committer
Mark Wells
<mark@freeside.biz>
Fri, 26 Aug 2016 22:44:12 +0000
(15:44 -0700)
httemplate/search/cust_pkg-date.html
patch
|
blob
|
history
diff --git
a/httemplate/search/cust_pkg-date.html
b/httemplate/search/cust_pkg-date.html
index
1b93775
..
5bb772b
100644
(file)
--- a/
httemplate/search/cust_pkg-date.html
+++ b/
httemplate/search/cust_pkg-date.html
@@
-36,6
+36,8
@@
my @sort_fields = ( map '', @fields ); # should only ever sort by $col
push @header, FS::UI::Web::cust_header($cust_fields);
push @fields, \&FS::UI::Web::cust_fields;
push @header, FS::UI::Web::cust_header($cust_fields);
push @fields, \&FS::UI::Web::cust_fields;
+my $agentnums_sql = $curuser->agentnums_sql('table' => 'cust_main');
+
my $query = {
'table' => 'cust_pkg',
'addl_from' => FS::UI::Web::join_cust_main('cust_pkg', 'cust_pkg'),
my $query = {
'table' => 'cust_pkg',
'addl_from' => FS::UI::Web::join_cust_main('cust_pkg', 'cust_pkg'),
@@
-43,11
+45,13
@@
my $query = {
$col => { op => '!=', value => '' },
'cancel' => '',
},
$col => { op => '!=', value => '' },
'cancel' => '',
},
- 'order_by' => "ORDER BY $col",
+ 'extra_sql' => ' AND '.$agentnums_sql,
+ 'order_by' => "ORDER BY $col",
};
my $count_query =
};
my $count_query =
- "SELECT COUNT(*) FROM cust_pkg WHERE $col IS NOT NULL AND cancel IS NULL";
+ "SELECT COUNT(*) FROM cust_pkg JOIN cust_main USING (custnum) ".
+ "WHERE $col IS NOT NULL AND cancel IS NULL AND $agentnums_sql";
my $pkg_link = sub {
my $self = shift;
my $pkg_link = sub {
my $self = shift;