-<& /elements/header.html, $title &>
-<P ALIGN="right" CLASS="noprint">
-Download full results<BR>
-as <A HREF="<% $cgi->self_url %>;_type=xls">Excel spreadsheet</A></P>
-<BR>
-<STYLE TYPE="text/css">
-td.cust_head {
- border-left: none;
- border-right: none;
- padding-top: 0.5em;
- font-weight: bold;
- background-color: #ffffff;
-}
-td.money { text-align: right; }
-td.money:before { content: '<% $money_char %>'; }
-.row0 { background-color: #eeeeee; }
-.row1 { background-color: #ffffff; }
-</STYLE>
-<& /elements/table-grid.html &>
- <TR STYLE="background-color: #cccccc">
- <TH CLASS="grid">Package</TH>
- <TH CLASS="grid">Sales</TH>
- <TH CLASS="grid">Percentage</TH>
- <TH CLASS="grid">Commission</TH>
- </TR>
-% my ($custnum, $sales, $commission, $row, $bgcolor) = (0, 0, 0, 0);
-% foreach my $cust_pkg ( @cust_pkg ) {
-% if ( $custnum ne $cust_pkg->custnum ) {
-% # start of a new customer section
-% my $cust_main = $cust_pkg->cust_main;
-% my $label = $cust_main->custnum . ': '. $cust_main->name;
-% $bgcolor = 0;
- <TR>
- <TD COLSPAN=4 CLASS="cust_head">
- <A HREF="<%$p%>view/cust_main.cgi?<%$cust_main->custnum%>"><% $label %></A>
- </TD>
- </TR>
-% }
- <TR CLASS="row<% $bgcolor %>">
- <TD CLASS="grid"><% $cust_pkg->pkg_label %></TD>
- <TD CLASS="money"><% sprintf('%.2f', $cust_pkg->sum_charged) %></TD>
- <TD ALIGN="right"><% $cust_pkg->percent %>%</TD>
- <TD CLASS="money"><% sprintf('%.2f',
- $cust_pkg->sum_charged * $cust_pkg->percent / 100) %></TD>
- </TR>
-% $sales += $cust_pkg->sum_charged;
-% $commission += $cust_pkg->sum_charged * $cust_pkg->percent / 100;
-% $row++;
-% $bgcolor = 1-$bgcolor;
-% $custnum = $cust_pkg->custnum;
-% }
- <TR STYLE="background-color: #f5f6be">
- <TD CLASS="grid">
- <% emt('[quant,_1,package] with commission', $row) %>
- </TD>
- <TD CLASS="money"><% sprintf('%.2f', $sales) %></TD>
- <TD></TD>
- <TD CLASS="money"><% sprintf('%.2f', $commission) %></TD>
- </TR>
-</TABLE>
-<& /elements/footer.html &>
+<& elements/commission.html,
+ 'title' => $title,
+ 'name_singular' => 'agent',
+ 'header' => [ 'Agent' ],
+ 'fields' => [ 'agent' ],
+ 'links' => [ '' ],
+ 'align' => 'l',
+ 'query' => \%query,
+ 'count_query' => $count_query,
+ 'disableable' => 1,
+ 'sales_detail_link' => $sales_link,
+ 'credit_detail_link' => $commission_link,
+&>