summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2016-11-07 17:33:44 -0800
committerIvan Kohler <ivan@freeside.biz>2016-11-07 17:33:44 -0800
commiteb0ec87d37ee1548e93e35e80dfad47f48cb7563 (patch)
tree837e3c89ab4faac2bb3b7650bee8a76fda48eb72
parentfa70a92d28794ffd206394c8f3a4eff669369c6d (diff)
add advertising source selection and display to prospect report
-rw-r--r--FS/FS/prospect_main.pm11
-rw-r--r--httemplate/search/prospect_main.html9
-rw-r--r--httemplate/search/report_prospect_main.html19
3 files changed, 27 insertions, 12 deletions
diff --git a/FS/FS/prospect_main.pm b/FS/FS/prospect_main.pm
index 67e91cf99..76faf0f2c 100644
--- a/FS/FS/prospect_main.pm
+++ b/FS/FS/prospect_main.pm
@@ -406,15 +406,18 @@ sub search {
my @where = ();
my $orderby;
- ##
- # parse agent
- ##
-
+ #agent
if ( $params->{'agentnum'} =~ /^(\d+)$/ and $1 ) {
push @where,
"prospect_main.agentnum = $1";
}
+ #refnum
+ if ( $params->{'refnum'} =~ /^(\d+)$/ and $1 ) {
+ push @where,
+ "prospect_main.refnum = $1";
+ }
+
##
# setup queries, subs, etc. for the search
##
diff --git a/httemplate/search/prospect_main.html b/httemplate/search/prospect_main.html
index 241918b98..d65d4d19d 100644
--- a/httemplate/search/prospect_main.html
+++ b/httemplate/search/prospect_main.html
@@ -6,6 +6,7 @@
'header' => [ '#',
'Prospect',
'Contact(s)',
+ 'Advertising source',
],
'fields' => [ 'prospectnum',
'name',
@@ -16,11 +17,17 @@
}
$pm->prospect_contact
];
+ ''
+ },
+ sub {
+ my $pr = shift->part_referral;
+ $pr ? $pr->referral : '';
},
],
'links' => [ '',
$link,
'', #link to contact edit???
+ '',
],
'agent_virt' => 1,
'disableable' => 1,
@@ -37,7 +44,7 @@ my %search_hash = ();
#scalars
my @scalars = qw (
- agentnum
+ agentnum refnum
);
for my $param ( @scalars ) {
diff --git a/httemplate/search/report_prospect_main.html b/httemplate/search/report_prospect_main.html
index 4834c2047..f2e617f88 100644
--- a/httemplate/search/report_prospect_main.html
+++ b/httemplate/search/report_prospect_main.html
@@ -1,4 +1,4 @@
-<% include('/elements/header.html', 'Prospect Report' ) %>
+<& /elements/header.html, 'Prospect Report' &>
<FORM ACTION="prospect_main.html" METHOD="GET">
@@ -8,11 +8,16 @@
<TH CLASS="background" COLSPAN=2 ALIGN="left"><FONT SIZE="+1">Search options</FONT></TH>
</TR>
- <% include( '/elements/tr-select-agent.html',
- 'curr_value' => scalar($cgi->param('agentnum')),
- 'disable_empty' => 0,
- )
- %>
+ <& /elements/tr-select-agent.html,
+ 'curr_value' => scalar($cgi->param('agentnum')),
+ 'disable_empty' => 0,
+ &>
+
+ <& /elements/tr-select-part_referral.html,
+ 'curr_value' => scalar($cgi->param('refnum')),
+ 'empty_label' => 'all',
+ 'disable_empty' => 0,
+ &>
</TABLE>
@@ -21,7 +26,7 @@
</FORM>
-<% include('/elements/footer.html') %>
+<& /elements/footer.html &>
<%init>
die "access denied"