summaryrefslogtreecommitdiff
path: root/httemplate/search
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2015-09-18 10:18:43 -0700
committerMark Wells <mark@freeside.biz>2015-09-18 10:18:43 -0700
commitc0c5709fb022b83a482d0b35f7094505766d5868 (patch)
tree1cc652dad8a1280f4297c0ab12e8520e610fbd14 /httemplate/search
parent7bce756e86a4307d6cad49a690f22a321acc9981 (diff)
send commission reports by email, #33101
Diffstat (limited to 'httemplate/search')
-rw-r--r--httemplate/search/cust_msg.html3
-rw-r--r--httemplate/search/report_sales_commission_pkg.html10
-rw-r--r--httemplate/search/sales_commission_pkg.html7
3 files changed, 19 insertions, 1 deletions
diff --git a/httemplate/search/cust_msg.html b/httemplate/search/cust_msg.html
index 401f52ebb..e9aece202 100644
--- a/httemplate/search/cust_msg.html
+++ b/httemplate/search/cust_msg.html
@@ -144,11 +144,12 @@ include('/elements/select.html',
include('/elements/select.html',
'field' => 'msgtype',
'curr_value' => $cgi->param('msgtype') || '',
- 'options' => [ '', 'invoice', 'receipt', 'admin' ],
+ 'options' => [ '', 'invoice', 'receipt', 'admin', 'report' ],
'labels' => { '' => '(any)',
'invoice' => 'Invoices',
'receipt' => 'Receipts',
'admin' => 'Admin notices',
+ 'report' => 'Reports',
},
) .
'</TD>
diff --git a/httemplate/search/report_sales_commission_pkg.html b/httemplate/search/report_sales_commission_pkg.html
index 6adf090e9..27906e0c3 100644
--- a/httemplate/search/report_sales_commission_pkg.html
+++ b/httemplate/search/report_sales_commission_pkg.html
@@ -1,5 +1,15 @@
<& /elements/header.html, 'Sales commission report per package' &>
+% if ($FS::CurrentUser::CurrentUser->access_right('Send reports to customers'))
+% {
+<P>
+<& /elements/popup_link-send_report_batch.html,
+ reportname => 'sales_commission_pkg',
+ label => emt('Send these reports by email'),
+&>
+</P>
+% }
+
<FORM ACTION="sales_commission_pkg.html">
<TABLE BGCOLOR="#cccccc" CELLSPACING=0>
diff --git a/httemplate/search/sales_commission_pkg.html b/httemplate/search/sales_commission_pkg.html
index 2b5f2bb0a..9fbe22eca 100644
--- a/httemplate/search/sales_commission_pkg.html
+++ b/httemplate/search/sales_commission_pkg.html
@@ -1,12 +1,17 @@
%# still not a good way to do rows grouped by some field in a search.html
%# report
+%# (there is now, but we're not yet sponsored to switch this over to it)
% if ( $type eq 'xls' ) {
<% $data %>\
% } else {
+% if ( $type eq 'html-print' ) {
+<& /elements/header-popup.html, $title &>
+% } else {
<& /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 {
@@ -22,12 +27,14 @@ td.money:before { content: '<% $money_char %>'; }
.row1 { background-color: #ffffff; }
</STYLE>
<& /elements/table-grid.html &>
+<THEAD>
<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>
+</THEAD>
% my ($custnum, $sales, $commission, $row, $bgcolor) = (0, 0, 0, 0);
% foreach my $cust_pkg ( @cust_pkg ) {
% if ( $custnum ne $cust_pkg->custnum ) {