summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate')
-rwxr-xr-xhttemplate/edit/cust_pay.cgi26
-rwxr-xr-xhttemplate/edit/process/cust_pay.cgi5
-rw-r--r--httemplate/elements/city.html6
-rw-r--r--httemplate/elements/menu.html2
-rw-r--r--httemplate/elements/tr-select-cust_tag.html2
-rw-r--r--httemplate/graph/cust_signup.html29
-rw-r--r--httemplate/graph/report_cust_signup.html6
-rwxr-xr-xhttemplate/search/cust_main.cgi2
-rw-r--r--httemplate/search/elements/search-html.html6
-rw-r--r--httemplate/search/elements/search.html10
-rw-r--r--httemplate/view/cust_main/payment_history.html2
-rw-r--r--httemplate/view/cust_pay.html22
12 files changed, 98 insertions, 20 deletions
diff --git a/httemplate/edit/cust_pay.cgi b/httemplate/edit/cust_pay.cgi
index 3fd9c79eb..7a1bb00fa 100755
--- a/httemplate/edit/cust_pay.cgi
+++ b/httemplate/edit/cust_pay.cgi
@@ -18,7 +18,7 @@
<INPUT TYPE="hidden" NAME="payby" VALUE="<% $payby %>">
<INPUT TYPE="hidden" NAME="paybatch" VALUE="<% $paybatch %>">
-<BR><BR>
+<BR>
<% mt('Payment') |h %>
<% ntable("#cccccc", 2) %>
@@ -56,7 +56,29 @@
<TD ALIGN="right"><% mt('Check #') |h %></TD>
<TD COLSPAN=2><INPUT TYPE="text" NAME="payinfo" VALUE="<% $payinfo %>" SIZE=10></TD>
</TR>
-% }
+% }
+% elsif ( $payby eq 'CASH' and $conf->exists('require_cash_deposit_info') ) {
+ <TR>
+ <TD ALIGN="right"><% mt('Bank') |h %></TD>
+ <TD COLSPAN=3><INPUT TYPE="text" NAME="bank" VALUE="<% $cgi->param('bank') %>"></TD>
+ </TR>
+ <TR>
+ <TD ALIGN="right"><% mt('Check #') |h %></TD>
+ <TD COLSPAN=2><INPUT TYPE="text" NAME="payinfo" VALUE="<% $payinfo %>" SIZE=10></TD>
+ </TR>
+ <TR>
+ <TD ALIGN="right"><% mt('Teller #') |h %></TD>
+ <TD COLSPAN=2><INPUT TYPE="text" NAME="teller" VALUE="<% $cgi->param('teller') %>" SIZE=10></TD>
+ </TR>
+ <TR>
+ <TD ALIGN="right"><% mt('Depositor') |h %></TD>
+ <TD COLSPAN=3><INPUT TYPE="text" NAME="depositor" VALUE="<% $cgi->param('depositor') %>"></TD>
+ </TR>
+ <TR>
+ <TD ALIGN="right"><% mt('Account #') |h %></TD>
+ <TD COLSPAN=2><INPUT TYPE="text" NAME="account" VALUE="<% $cgi->param('account') %>" SIZE=18></TD>
+ </TR>
+% }
<TR>
% if ( $link eq 'custnum' || $link eq 'popup' ) {
diff --git a/httemplate/edit/process/cust_pay.cgi b/httemplate/edit/process/cust_pay.cgi
index e74f9022f..06f5e64d5 100755
--- a/httemplate/edit/process/cust_pay.cgi
+++ b/httemplate/edit/process/cust_pay.cgi
@@ -28,6 +28,8 @@
%}
<%init>
+my $conf = FS::Conf->new;
+
$cgi->param('linknum') =~ /^(\d+)$/
or die "Illegal linknum: ". $cgi->param('linknum');
my $linknum = $1;
@@ -46,6 +48,7 @@ my $new = new FS::cust_pay ( {
$_, scalar($cgi->param($_));
} qw( paid payby payinfo paybatch
pkgnum discount_term
+ bank depositor account teller
)
#} fields('cust_pay')
} );
@@ -57,6 +60,6 @@ push @rights, 'Post cash payment' if $new->payby eq 'CASH';
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right(\@rights);
-my $error = $new->insert( 'manual' => 1 );
+my $error ||= $new->insert( 'manual' => 1 );
</%init>
diff --git a/httemplate/elements/city.html b/httemplate/elements/city.html
index f6d2b4bad..6a2142f29 100644
--- a/httemplate/elements/city.html
+++ b/httemplate/elements/city.html
@@ -107,7 +107,11 @@ function <% $pre %>county_changed(what, callback) {}
<% $text_style %>
>
-% if ( !$disable_select ) {
+% if ( $disable_select ) {
+%# avoid JS errors
+<INPUT TYPE="hidden" ID="city_select">
+% }
+% else {
<SELECT NAME = "<%$pre%>city_select"
ID = "<%$pre%>city_select"
diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html
index d61d44e89..ce2bbe9c0 100644
--- a/httemplate/elements/menu.html
+++ b/httemplate/elements/menu.html
@@ -106,7 +106,7 @@ $report_customers_lists{'with USPS-unvalidated addresses'} = [ $fsurl. 'search/c
tie my %report_customers, 'Tie::IxHash';
$report_customers{'List customers'} = [ \%report_customers_lists, 'List customers' ]
- if $curuser->access_right('List customers');
+ if $curuser->access_right('List all customers');
$report_customers{'Zip code distribution'} = [ $fsurl. 'search/report_cust_main-zip.html', 'Zip codes by number of customers' ];
$report_customers{'Customer signup report'} = [ $fsurl. 'graph/report_cust_signup.html', 'New customer signups by date' ],
$report_customers{'Advanced customer reports'} = [ $fsurl. 'search/report_cust_main.html', 'by status, signup date, agent, etc.' ]
diff --git a/httemplate/elements/tr-select-cust_tag.html b/httemplate/elements/tr-select-cust_tag.html
index b2b6d967e..5312644ef 100644
--- a/httemplate/elements/tr-select-cust_tag.html
+++ b/httemplate/elements/tr-select-cust_tag.html
@@ -28,7 +28,7 @@ my $cgi = $opt{'cgi'};
my $is_report = $opt{'is_report'};
my @curr_tagnum = ();
-if ( $cgi->param('error') ) {
+if ( $cgi && $cgi->param('error') ) {
@curr_tagnum = $cgi->param('tagnum');
} elsif ( $opt{'custnum'} ) {
@curr_tagnum = map $_->tagnum,
diff --git a/httemplate/graph/cust_signup.html b/httemplate/graph/cust_signup.html
index dd9100f1e..a3eb702f2 100644
--- a/httemplate/graph/cust_signup.html
+++ b/httemplate/graph/cust_signup.html
@@ -9,7 +9,7 @@
'agentnum' => $agentnum,
'sprintf' => '%u',
'disable_money' => 1,
- 'bottom_total' => (scalar @items > 1 ? 1 : 0),
+ 'bottom_total' => (scalar @items > 1 && !$indirect ? 1 : 0),
'bottom_link' => $bottom_link,
'link_fromparam' => 'signupdate_begin',
'link_toparam' => 'signupdate_end',
@@ -59,25 +59,34 @@ elsif ( $cgi->param('refnum') =~ /^(\d*)$/ ) {
}
}
+my $indirect = ($cgi->param('indirect') eq 'Y' ? 1 : 0);
+
my (@items, @labels, @colors, @params, @links);
my $hue = 0;
-my $hue_increment = 125;
+my $hue_increment = 75;
my @signup_colors;
foreach my $referral (@referral) {
+ my %params = ('refnum' => $referral->refnum) unless $all_referral;
+
push @items, 'signups';
push @labels, ( $all_referral ? 'Signups' : $referral->referral );
- push @params, ( $all_referral ? [] : [ 'refnum' => $referral->refnum ] );
+ push @params, [ %params ];
push @links, $link . ($all_referral ? '' : "refnum=".$referral->refnum.';');
- if ( !@signup_colors ) {
- @signup_colors = Color::Scheme->new
- ->from_hue($hue)
- ->scheme('analogic')
- ->colors;
- $hue += $hue_increment;
+ # rotate hue for each referral type
+ @signup_colors = Color::Scheme->new->from_hue($hue)->colors;
+ $hue += $hue_increment;
+ push @colors, $signup_colors[0];
+ if ( $indirect ) {
+ push @items, 'signups';
+ push @labels, $all_referral ?
+ 'Referrals' :
+ $referral->referral . ' referrals';
+ push @params, [ %params, 'indirect' => 1 ];
+ push @links, '';
+ push @colors, $signup_colors[1];
}
- push @colors, shift @signup_colors;
}
</%init>
diff --git a/httemplate/graph/report_cust_signup.html b/httemplate/graph/report_cust_signup.html
index 9d3f5006b..12dec8e6a 100644
--- a/httemplate/graph/report_cust_signup.html
+++ b/httemplate/graph/report_cust_signup.html
@@ -22,6 +22,12 @@
)
%>
+<& /elements/tr-td-label.html, label => 'Show customer referrals' &>
+<TD>
+ <INPUT TYPE="checkbox" NAME="indirect" VALUE="Y">
+</TD>
+</TR>
+
</TABLE>
<BR><INPUT TYPE="submit" VALUE="Display">
diff --git a/httemplate/search/cust_main.cgi b/httemplate/search/cust_main.cgi
index aae8c7e99..859ef04e6 100755
--- a/httemplate/search/cust_main.cgi
+++ b/httemplate/search/cust_main.cgi
@@ -334,7 +334,7 @@
my $curuser = $FS::CurrentUser::CurrentUser;
die "access denied"
- unless $curuser->access_right('List customers');
+ unless $curuser->access_right('List all customers');
my $conf = new FS::Conf;
my $maxrecords = $conf->config('maxsearchrecordsperpage');
diff --git a/httemplate/search/elements/search-html.html b/httemplate/search/elements/search-html.html
index af0c8fc09..53167c26e 100644
--- a/httemplate/search/elements/search-html.html
+++ b/httemplate/search/elements/search-html.html
@@ -130,7 +130,9 @@
</TD>
-% unless ( $opt{'disable_download'} || $type eq 'html-print' ) {
+% if ( $curuser->access_right('Download report data')
+% and !$opt{'disable_download'}
+% and $type ne 'html-print' ) {
<TD ALIGN="right">
@@ -470,6 +472,8 @@
% }
<%init>
+my $curuser = $FS::CurrentUser::CurrentUser;
+
my %args = @_;
my $type = $args{'type'};
my $header = $args{'header'};
diff --git a/httemplate/search/elements/search.html b/httemplate/search/elements/search.html
index 81ec4d082..9bc66b6fa 100644
--- a/httemplate/search/elements/search.html
+++ b/httemplate/search/elements/search.html
@@ -170,7 +170,6 @@ Example:
%
<% include('search-csv.html', header=>$header, rows=>$rows, opt=>\%opt ) %>
%
-% #} elsif ( $type eq 'excel' ) {
% } elsif ( $type =~ /\.xls$/ ) {
%
<% include('search-xls.html', header=>$header, rows=>$rows, opt=>\%opt ) %>
@@ -179,7 +178,7 @@ Example:
%
<% include('search-xml.html', rows=>$rows, opt=>\%opt ) %>
%
-% } else { # regular HTML
+% } else {
%
<% include('search-html.html',
type => $type,
@@ -205,6 +204,11 @@ my $curuser = $FS::CurrentUser::CurrentUser;
my $type = $cgi->param('_type') =~ /^(csv|\w*\.xls|xml|select|html(-print)?)$/
? $1 : 'html' ;
+if ( !$curuser->access_right('Download report data') ) {
+ $opt{'disable_download'} = 1;
+ $type = 'html';
+}
+
my %align = (
'l' => 'left',
'r' => 'right',
@@ -363,6 +367,8 @@ unless ( $type =~ /^(csv|\w*.xls)$/) {
$maxrecords ||= $confmax;
}
+ $opt{'disable_maxselect'} ||= $conf->exists('disable_maxselect');
+
$limit = $maxrecords ? "LIMIT $maxrecords" : '';
$offset = $cgi->param('offset') =~ /^(\d+)$/ ? $1 : 0;
diff --git a/httemplate/view/cust_main/payment_history.html b/httemplate/view/cust_main/payment_history.html
index b5b716199..c453ffadc 100644
--- a/httemplate/view/cust_main/payment_history.html
+++ b/httemplate/view/cust_main/payment_history.html
@@ -13,6 +13,7 @@
'cust_main' => $cust_main,
'actionlabel' => emt('Enter check payment'),
'width' => 392,
+ 'height' => 392,
&>
% }
@@ -24,6 +25,7 @@
'cust_main' => $cust_main,
'actionlabel' => emt('Enter cash payment'),
'width' => 392,
+ 'height' => 392,
&>
% }
diff --git a/httemplate/view/cust_pay.html b/httemplate/view/cust_pay.html
index d02f1543d..f9c8bc19c 100644
--- a/httemplate/view/cust_pay.html
+++ b/httemplate/view/cust_pay.html
@@ -98,6 +98,28 @@
% }
+% if ( $cust_pay->payby eq 'CASH' && $cust_pay->payinfo ) {
+ <TR>
+ <TD ALIGN="right"><% mt('Bank') |h %></TD>
+ <TD BGCOLOR="#FFFFFF"><B><% $cust_pay->bank %></B></TD>
+ </TR>
+
+ <TR>
+ <TD ALIGN="right"><% mt('Teller #') |h %></TD>
+ <TD BGCOLOR="#FFFFFF"><B><% $cust_pay->teller %></B></TD>
+ </TR>
+
+ <TR>
+ <TD ALIGN="right"><% mt('Depositor') |h %></TD>
+ <TD BGCOLOR="#FFFFFF"><B><% $cust_pay->depositor %></B></TD>
+ </TR>
+
+ <TR>
+ <TD ALIGN="right"><% mt('Account #') |h %></TD>
+ <TD BGCOLOR="#FFFFFF"><B><% $cust_pay->account %></B></TD>
+ </TR>
+% }
+
% if ( $conf->exists('pkg-balances') && $cust_pay->pkgnum ) {
% my $cust_pkg = qsearchs('cust_pkg', { 'pkgnum' => $cust_pay->pkgnum } );
<TR>