<% include('/elements/tr-select-from_to.html' ) %>
-<% include('/elements/tr-select-agent.html',
- 'label' => 'For agent: ',
- 'disable_empty' => 0,
- )
-%>
-
-<% include('/elements/tr-select-pkg_class.html',
- 'pre_options' => [ '0' => 'all' ],
- 'empty_label' => '(empty class)',
- )
-%>
+<TR>
+ <TD ALIGN="right"><INPUT TYPE="checkbox" NAME="projection" VALUE="1"></TD>
+ <TD>Show projected data for future months</TD>
+</TR>
+
+<SCRIPT TYPE="text/javascript">
+function enable_agent_totals(obj) {
+%# enable it iff we are breaking down by agent AND something else
+ obj.form.agent_totals.disabled = !(
+ obj.form.agentnum.value == '' && (
+ obj.form.refnum.value == '' ||
+ obj.form.classnum.value == 0 ||
+ obj.form.use_setup.value == 1 ||
+ obj.form.use_usage.value == 1
+ )
+ );
+}
+
+function mode_changed() {
+ var options = document.getElementsByName('mode');
+ var mode;
+ for(var i=0; i < options.length; i++) {
+ if (options[i].checked) {
+ mode = options[i].value;
+ }
+ }
+
+ var div_pkg = document.getElementById('pkg_class');
+ var div_report = document.getElementById('report_class');
+ if (mode == 'pkg') {
+ div_pkg.style.display = '';
+ div_report.style.display = 'none';
+ } else if (mode == 'report') {
+ div_pkg.style.display = 'none';
+ div_report.style.display = '';
+ }
+}
+window.onload = mode_changed;
+</SCRIPT>
+
+<& /elements/tr-select-agent.html,
+ 'field' => 'agentnum',
+ 'label' => 'Agent ',
+ 'disable_empty' => 0,
+ 'pre_options' => [ 'all' => 'all (aggregate)' ],
+ 'empty_label' => 'all (breakdown)',
+ 'onchange' => 'enable_agent_totals',
+&>
+
+<& /elements/tr-select-cust_class.html,
+ 'field' => 'cust_classnum',
+ 'label' => 'Customer class',
+ 'multiple' => 1,
+&>
+
+<& /elements/tr-select-part_referral.html,
+ 'field' => 'refnum',
+ 'label' => 'Advertising source ',
+ 'disable_empty' => 0,
+ 'pre_options' => [ 'all' => 'all (aggregate)' ],
+ 'empty_label' => 'all (breakdown)',
+ 'onchange' => 'enable_agent_totals'
+&>
+
+<TR>
+ <TD ALIGN="right">
+ <INPUT TYPE="radio" NAME="mode" VALUE="pkg" onchange="mode_changed('pkg')" CHECKED>
+ <% emt('Package class') %>
+ <BR>
+ <INPUT TYPE="radio" NAME="mode" VALUE="report" onchange="mode_changed('report')">
+ <% emt('Report class') %>
+ </TD>
+ <TD>
+ <DIV ID="pkg_class">
+ <& /elements/select-pkg_class.html,
+ 'field' => 'classnum',
+ 'pre_options' => [ 'all' => 'all (aggregate)',
+ '' => 'all (breakdown)',
+ '0' => '(empty class)' ],
+ 'disable_empty' => 1,
+ 'onchange' => 'enable_agent_totals',
+ &>
+ </DIV>
+ <DIV ID="report_class" STYLE="display: none">
+ <& /elements/select-table.html,
+ 'field' => 'report_optionnum',
+ 'table' => 'part_pkg_report_option',
+ 'name_col' => 'name',
+ 'value_col' => 'num',
+ 'pre_options' => [ 'all' => 'all (aggregate)',
+ '' => 'all (breakdown)',
+ '0' => '(empty class)' ],
+ 'disable_empty' => 1,
+ 'onchange' => 'enable_agent_totals',
+ &>
+ </DIV>
+ </TD>
+</TR>
<!--
<TR>
</TR>
-->
+% foreach ( qw(Setup Usage) ) {
+<& /elements/tr-select.html,
+ 'label' => "$_ fees",
+ 'field' => 'use_'.lc($_),
+ 'options' => [ 0, 1, 2 ],
+ 'labels' => { 0 => 'Combine', 1 => 'Separate', 2 => 'Do not show' },
+ 'onchange'=> 'enable_agent_totals',
+&>
+% }
+
+<TR>
+ <TD ALIGN="right"><INPUT TYPE="checkbox" NAME="agent_totals" VALUE="1" DISABLED="1"></TD>
+ <TD>Show per-agent subtotals</TD>
+</TR>
+
+<TR>
+ <TD ALIGN="right"><INPUT TYPE="checkbox" NAME="use_override" VALUE="1"></TD>
+ <TD>Separate sub-packages from parents</TD>
+</TR>
+
+<TR>
+ <TD ALIGN="right"><INPUT TYPE="checkbox" NAME="average_per_cust_pkg" VALUE="1"></TD>
+ <TD>Average per customer package</TD>
+</TR>
+
+<TR>
+ <TD ALIGN="right"><INPUT TYPE="checkbox" NAME="distribute" VALUE="1"></TD>
+ <TD>Distribute recurring fees over billing period</TD>
+</TR>
+
</TABLE>
<BR><INPUT TYPE="submit" VALUE="Display">