+% 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',
+&>
+% }
+<& /elements/tr-select.html,
+ 'label' => 'Discounts',
+ 'field' => 'use_discount',
+ 'options' => [ 1, 2 ],
+ 'labels' => { 1 => 'Separate', 2 => 'Do not show' },
+&>
+<& /elements/tr-select.html,
+ 'label' => 'Taxes',
+ 'field' => 'use_taxes',
+ 'options' => [ 1, 2 ],
+ 'labels' => { 1 => 'Separate', 2 => 'Do not show' },
+&>
+
+<TR>
+ <TD ALIGN="right">Colors</TD>
+ <TD>
+% my @names = ();
+%
+% #no particular long-term attachment to this, just trying to replicate
+% # historical behavior so people's graphs don't change color suddenly in 3.x
+% my $hue = 0;
+% my $hue_increment = 125;
+
+ <TABLE>
+% my $anum = 0;
+% foreach my $agent ( @agents ) {
+ <TR <% $anum ? 'STYLE="display:none"' : '' %>
+ ID="agent<%$anum%>-colors"
+ >
+ <TD <% $anum ? '' :'STYLE="display:none"' %>
+ ID="agent<%$anum%>-label"
+ >
+ <% $agent->agent |h %>
+ </TD>
+ <TD>
+% my $col_scheme = Color::Scheme->new
+% ->from_hue($hue) #->from_hex($agent->color)
+% ->scheme('analogic')
+% ;
+%
+% my $cnum = 0;
+% my @colors = ($col_scheme->colors)[ 0,4,8,1,5,9 ];#again some some random historical shite
+% for (@colors) {
+% my $name = "agent$anum-color$cnum";
+% push @names, $name;
+% $cnum++;
+ <INPUT TYPE = "color"
+ NAME = "<% $name %>"
+ ID = "<% $name %>"
+ VALUE = "#<%$_%>"
+ >
+% }
+ </TD>
+ </TR>
+% $anum++;
+% $hue += $hue_increment;
+% }
+ </TABLE>
+ </TD>
+</TR>
+
+<SCRIPT TYPE="text/javascript">
+ $(document).ready(function() {
+% foreach my $name (@names) {
+ $("#<% $name %>").spectrum({
+ clickoutFiresChange: true
+ });
+% }
+ });
+</SCRIPT>
+
+<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>
+