1 <% include('/elements/header.html', 'Sales Report' ) %>
3 <FORM ACTION="cust_bill_pkg.cgi" METHOD="GET">
5 <TABLE BGCOLOR="#cccccc" CELLSPACING=0>
8 <TH CLASS="background" COLSPAN=2 ALIGN="left"><FONT SIZE="+1"><% mt('Search options') |h %></FONT></TH>
11 <% include('/elements/tr-select-from_to.html' ) %>
14 <TD ALIGN="right"><INPUT TYPE="checkbox" NAME="projection" VALUE="1"></TD>
15 <TD>Show projected data for future months</TD>
18 <SCRIPT TYPE="text/javascript">
19 function enable_agent_totals(obj) {
20 %# enable it iff we are breaking down by agent AND something else
21 obj.form.agent_totals.disabled = !(
22 obj.form.agentnum.value == '' && (
23 obj.form.refnum.value == '' ||
24 document.getElementById('class_agg_break_breakdown').checked ||
25 obj.form.use_setup.value == 1 ||
26 obj.form.use_usage.value == 1
31 function class_mode_changed() {
32 var options = document.getElementsByName('class_mode');
34 for(var i=0; i < options.length; i++) {
35 if (options[i].checked) {
36 mode = options[i].value;
40 var div_pkg = document.getElementById('pkg_class');
41 var div_report = document.getElementById('report_class');
43 div_pkg.style.display = '';
44 div_report.style.display = 'none';
45 } else if (mode == 'report') {
46 div_pkg.style.display = 'none';
47 div_report.style.display = '';
50 window.onload = class_mode_changed;
53 <& /elements/tr-select-agent.html,
54 'field' => 'agentnum',
57 'pre_options' => [ 'all' => 'all (aggregate)' ],
58 'empty_label' => 'all (breakdown)',
59 'onchange' => 'enable_agent_totals',
62 <& /elements/tr-select-cust_class.html,
63 'field' => 'cust_classnum',
64 'label' => 'Customer class',
68 <& /elements/tr-select-part_referral.html,
70 'label' => 'Advertising source ',
72 'pre_options' => [ 'all' => 'all (aggregate)' ],
73 'empty_label' => 'all (breakdown)',
74 'onchange' => 'enable_agent_totals'
80 <INPUT TYPE="radio" NAME="class_mode" VALUE="pkg" onchange="class_mode_changed('pkg')" CHECKED>
81 <% emt('Package class') %>
83 <INPUT TYPE="radio" NAME="class_mode" VALUE="report" onchange="class_mode_changed('report')">
84 <% emt('Report class') %>
93 <& /elements/select-pkg_class.html,
94 'field' => 'classnum',
97 'pre_options' => [ #'all' => 'all (aggregate)',
98 # '' => 'all (breakdown)',
99 '0' => '(empty class)' ],
100 'disable_empty' => 1,
101 'onchange' => 'enable_agent_totals',
104 <DIV ID="report_class" STYLE="display: none">
105 <& /elements/select-table.html,
106 'field' => 'report_optionnum',
107 'table' => 'part_pkg_report_option',
108 'name_col' => 'name',
109 'value_col' => 'num',
112 'pre_options' => [ #'all' => 'all (aggregate)',
113 # '' => 'all (breakdown)',
114 '0' => '(empty class)' ],
115 'disable_empty' => 1,
116 'onchange' => 'enable_agent_totals',
122 <INPUT TYPE="radio" NAME="class_agg_break" ID="class_agg_break_aggregate" VALUE="aggregate" onchange="enable_agent_totals(this)" CHECKED>
123 <% emt('Aggregate') %>
125 <INPUT TYPE="radio" NAME="class_agg_break" ID="class_agg_break_breakdown" VALUE="breakdown" onchange="enable_agent_totals(this)">
126 <% emt('Breakdown') %>
137 <TH CLASS="background" COLSPAN=2> </TH>
141 <TH CLASS="background" COLSPAN=2 ALIGN="left"><FONT SIZE="+1"><% mt('Display options') |h %></FONT></TH>
146 <TD ALIGN="right"><INPUT TYPE="checkbox" NAME="separate_0freq" VALUE="1"></TD>
147 <TD>Separate one-time vs. recurring sales</TD>
151 % foreach ( qw(Setup Usage) ) {
152 <& /elements/tr-select.html,
153 'label' => "$_ fees",
154 'field' => 'use_'.lc($_),
155 'options' => [ 0, 1, 2 ],
156 'labels' => { 0 => 'Combine', 1 => 'Separate', 2 => 'Do not show' },
157 'onchange'=> 'enable_agent_totals',
162 <TD ALIGN="right"><INPUT TYPE="checkbox" NAME="agent_totals" VALUE="1" DISABLED="1"></TD>
163 <TD>Show per-agent subtotals</TD>
167 <TD ALIGN="right"><INPUT TYPE="checkbox" NAME="use_override" VALUE="1"></TD>
168 <TD>Separate sub-packages from parents</TD>
172 <TD ALIGN="right"><INPUT TYPE="checkbox" NAME="average_per_cust_pkg" VALUE="1"></TD>
173 <TD>Average per customer package</TD>
177 <TD ALIGN="right"><INPUT TYPE="checkbox" NAME="distribute" VALUE="1"></TD>
178 <TD>Distribute recurring fees over billing period</TD>
183 <BR><INPUT TYPE="submit" VALUE="Display">
186 <% include('/elements/footer.html') %>
190 unless $FS::CurrentUser::CurrentUser->access_right('Financial reports');