projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5fa459e
)
continue sales person work: customer and package selection, commissions, reporting...
author
Ivan Kohler
<ivan@freeside.biz>
Sat, 24 Aug 2013 06:10:52 +0000
(23:10 -0700)
committer
Ivan Kohler
<ivan@freeside.biz>
Sat, 24 Aug 2013 06:10:52 +0000
(23:10 -0700)
FS/FS/cust_main/Search.pm
patch
|
blob
|
history
FS/FS/cust_pkg.pm
patch
|
blob
|
history
httemplate/search/cust_main.html
patch
|
blob
|
history
httemplate/search/cust_pkg.cgi
patch
|
blob
|
history
httemplate/search/report_cust_main.html
patch
|
blob
|
history
httemplate/search/report_cust_pkg.html
patch
|
blob
|
history
diff --git
a/FS/FS/cust_main/Search.pm
b/FS/FS/cust_main/Search.pm
index
590b706
..
b022985
100644
(file)
--- a/
FS/FS/cust_main/Search.pm
+++ b/
FS/FS/cust_main/Search.pm
@@
-579,7
+579,16
@@
sub search {
}
##
}
##
- # do the same for user
+ # parse sales person
+ ##
+
+ if ( $params->{'salesnum'} =~ /^(\d+)$/ ) {
+ push @where, ($1 > 0 ) ? "cust_main.salesnum = $1"
+ : 'cust_main.salesnum IS NULL';
+ }
+
+ ##
+ # parse usernum
##
if ( $params->{'usernum'} =~ /^(\d+)$/ and $1 ) {
##
if ( $params->{'usernum'} =~ /^(\d+)$/ and $1 ) {
diff --git
a/FS/FS/cust_pkg.pm
b/FS/FS/cust_pkg.pm
index
3e638a6
..
19ef1f3
100644
(file)
--- a/
FS/FS/cust_pkg.pm
+++ b/
FS/FS/cust_pkg.pm
@@
-4169,6
+4169,25
@@
sub search {
}
##
}
##
+ # parse customer sales person
+ ##
+
+ if ( $params->{'cust_main_salesnum'} =~ /^(\d+)$/ ) {
+ push @where, ($1 > 0) ? "cust_main.salesnum = $1"
+ : 'cust_main.salesnum IS NULL';
+ }
+
+
+ ##
+ # parse sales person
+ ##
+
+ if ( $params->{'salesnum'} =~ /^(\d+)$/ ) {
+ push @where, ($1 > 0) ? "cust_pkg.salesnum = $1"
+ : 'cust_pkg.salesnum IS NULL';
+ }
+
+ ##
# parse custnum
##
# parse custnum
##
diff --git
a/httemplate/search/cust_main.html
b/httemplate/search/cust_main.html
index
24348ff
..
66a3a98
100755
(executable)
--- a/
httemplate/search/cust_main.html
+++ b/
httemplate/search/cust_main.html
@@
-41,7
+41,7
@@
my %search_hash = ();
#scalars
my @scalars = qw (
#scalars
my @scalars = qw (
- agentnum status address zip paydate_year paydate_month invoice_terms
+ agentnum s
alesnum s
tatus address zip paydate_year paydate_month invoice_terms
no_censustract with_geocode with_email POST no_POST
custbatch usernum
cancelled_pkgs
no_censustract with_geocode with_email POST no_POST
custbatch usernum
cancelled_pkgs
@@
-51,7
+51,7
@@
my @scalars = qw (
for my $param ( @scalars ) {
$search_hash{$param} = scalar( $cgi->param($param) )
for my $param ( @scalars ) {
$search_hash{$param} = scalar( $cgi->param($param) )
- if
$cgi->param($param
);
+ if
length($cgi->param($param)
);
}
#lists
}
#lists
diff --git
a/httemplate/search/cust_pkg.cgi
b/httemplate/search/cust_pkg.cgi
index
1cb61bc
..
32b5a69
100755
(executable)
--- a/
httemplate/search/cust_pkg.cgi
+++ b/
httemplate/search/cust_pkg.cgi
@@
-156,8
+156,11
@@
my %search_hash = ();
$search_hash{'query'} = $cgi->keywords;
#scalars
$search_hash{'query'} = $cgi->keywords;
#scalars
-for (qw( agentnum custnum magic status custom cust_fields pkgbatch )) {
- $search_hash{$_} = $cgi->param($_) if $cgi->param($_);
+for (qw( agentnum cust_main_salesnum salesnum custnum magic status custom
+ cust_fields pkgbatch
+ ))
+{
+ $search_hash{$_} = $cgi->param($_) if length($cgi->param($_));
}
#arrays
}
#arrays
diff --git
a/httemplate/search/report_cust_main.html
b/httemplate/search/report_cust_main.html
index
bac4346
..
ebff7fa
100755
(executable)
--- a/
httemplate/search/report_cust_main.html
+++ b/
httemplate/search/report_cust_main.html
@@
-14,6
+14,13
@@
'disable_empty' => 0,
&>
'disable_empty' => 0,
&>
+ <& /elements/tr-select-sales.html,
+ 'curr_value' => scalar($cgi->param('salesnum')),
+ 'pre_options' => [ '' => 'all',
+ 0 => '(none)', ],
+ 'disable_empty' => 1,
+ &>
+
<& /elements/tr-select-cust_main-status.html,
'label' => emt('Status'),
&>
<& /elements/tr-select-cust_main-status.html,
'label' => emt('Status'),
&>
diff --git
a/httemplate/search/report_cust_pkg.html
b/httemplate/search/report_cust_pkg.html
index
e47bbb1
..
6cf297c
100755
(executable)
--- a/
httemplate/search/report_cust_pkg.html
+++ b/
httemplate/search/report_cust_pkg.html
@@
-18,8
+18,27
@@
'disable_empty' => 0,
)
%>
'disable_empty' => 0,
)
%>
+
+ <& /elements/tr-select-sales.html,
+ 'label' => 'Customer sales person',
+ 'element_name' => 'cust_main_salesnum',
+ 'id' => 'cust_main_salesnum',
+ 'curr_value' => scalar($cgi->param('cust_main_salesnum')),
+ 'pre_options' => [ '' => 'all',
+ 0 => '(none)', ],
+ 'disable_empty' => 1,
+ &>
+
% }
% }
+ <& /elements/tr-select-sales.html,
+ 'label' => 'Package sales person',
+ 'curr_value' => scalar($cgi->param('salesnum')),
+ 'pre_options' => [ '' => 'all',
+ 0 => '(none)', ],
+ 'disable_empty' => 1,
+ &>
+
<% include( '/elements/tr-select-cust_pkg-status.html',
'onchange' => 'status_changed(this);',
)
<% include( '/elements/tr-select-cust_pkg-status.html',
'onchange' => 'status_changed(this);',
)