summaryrefslogtreecommitdiff
path: root/httemplate/elements/tr-select-agent-sales.html
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2014-01-29 21:53:45 -0800
committerIvan Kohler <ivan@freeside.biz>2014-01-29 21:53:45 -0800
commit9c78a52fcd35d7d0c39a4798d583ca4d7b20fd73 (patch)
treeb59ebf8083fd589107f6b5db3d27acff2d0b718a /httemplate/elements/tr-select-agent-sales.html
parentdee2a3280f4649d82f35a39bb4e548b27c20b673 (diff)
sales person report w/package breakdown, RT#22090
Notes
Notes: more like #25819
Diffstat (limited to 'httemplate/elements/tr-select-agent-sales.html')
-rw-r--r--httemplate/elements/tr-select-agent-sales.html47
1 files changed, 47 insertions, 0 deletions
diff --git a/httemplate/elements/tr-select-agent-sales.html b/httemplate/elements/tr-select-agent-sales.html
new file mode 100644
index 000000000..e1920bea4
--- /dev/null
+++ b/httemplate/elements/tr-select-agent-sales.html
@@ -0,0 +1,47 @@
+<%doc>
+
+Example:
+
+ <& /elements/tr-select-agent-sales.html,
+ 'agent_empty_label' => '(any)', #defaults to "all"
+ 'sales_disable_empty' => 1, #defaults with empty enabled
+ &>
+
+</%doc>
+% if ( $curuser->report_salesnum ) {
+
+ <INPUT TYPE="hidden" NAME="agentnum" VALUE="<% $curuser->report_sales->agentnum %>">
+ <INPUT TYPE="hidden" NAME="salesnum" VALUE="<% $curuser->report_salesnum %>">
+
+% } else {
+
+ <& /elements/tr-select-agent.html,
+ 'onchange' => 'agent_changed(this)',
+ 'empty_label' => $opt{agent_empty_label},
+ &>
+
+ <SCRIPT TYPE="text/javascript">
+
+ function agent_changed(what) {
+ salesnum_agentnum_changed(what);
+ }
+
+ <&| /elements/onload.js &>
+ agent_changed(document.getElementById('agentnum'))
+ </&>
+
+ </SCRIPT>
+
+ <& /elements/tr-select-sales.html,
+ 'empty_label' => 'all',
+ 'disable_empty' => $opt{sales_disable_empty},
+ &>
+
+% }
+<%init>
+
+my %opt = @_;
+
+my $curuser = $FS::CurrentUser::CurrentUser;
+
+</%init>