summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2012-04-02 10:37:52 -0700
committerIvan Kohler <ivan@freeside.biz>2012-04-02 10:37:52 -0700
commitf84937b2a6cc6ba63cdab177866b1417c32b1028 (patch)
tree945b3e0bb69355c264f43d5a83e2fde70fef9d98 /httemplate
parent59db9d8aa66fe128a26e512c5172982e041c59ae (diff)
parentc2ee6c5c4f274bbf86729cacd2fe011ea71f725d (diff)
Merge branch 'master' of git.freeside.biz:/home/git/freeside
Diffstat (limited to 'httemplate')
-rwxr-xr-xhttemplate/browse/part_pkg.cgi21
-rwxr-xr-xhttemplate/edit/cust_pay.cgi26
-rwxr-xr-xhttemplate/edit/part_pkg.cgi28
-rwxr-xr-xhttemplate/edit/process/cust_pay.cgi5
-rw-r--r--httemplate/elements/city.html6
-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
-rw-r--r--httemplate/view/cust_main/payment_history.html2
-rw-r--r--httemplate/view/cust_pay.html22
10 files changed, 130 insertions, 17 deletions
diff --git a/httemplate/browse/part_pkg.cgi b/httemplate/browse/part_pkg.cgi
index 766806044..4ca78d718 100755
--- a/httemplate/browse/part_pkg.cgi
+++ b/httemplate/browse/part_pkg.cgi
@@ -45,6 +45,7 @@ my $select = '*';
my $orderby = 'pkgpart';
my %hash = ();
my $extra_count = '';
+my $family_pkgpart;
if ( $cgi->param('active') ) {
$orderby = 'num_active DESC';
@@ -77,6 +78,16 @@ if ( $cgi->param('missing_recur_fee') ) {
)";
}
+if ( $cgi->param('family') =~ /^(\d+)$/ ) {
+ $family_pkgpart = $1;
+ push @where, "family_pkgpart = $1";
+ # Hiding disabled or one-time charges and limiting by classnum aren't
+ # very useful in this mode, so all links should still refer back to the
+ # non-family-limited display.
+ $cgi->param('showdisabled', 1);
+ $cgi->delete('family');
+}
+
push @where, FS::part_pkg->curuser_pkgs_sql
unless $acl_edit_global;
@@ -209,6 +220,16 @@ push @fields, sub {
$part_pkg->part_pkg_discount;
[
+ ( !$family_pkgpart &&
+ $part_pkg->pkgpart == $part_pkg->family_pkgpart ? () : [
+ {
+ 'align'=> 'center',
+ 'colspan' => 2,
+ 'size' => '-1',
+ 'data' => '<b>Show all versions</b>',
+ 'link' => $p.'browse/part_pkg.cgi?family='.$part_pkg->family_pkgpart,
+ }
+ ] ),
[
{ data =>$plan,
align=>'center',
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/part_pkg.cgi b/httemplate/edit/part_pkg.cgi
index e5edcdedc..cd0731370 100755
--- a/httemplate/edit/part_pkg.cgi
+++ b/httemplate/edit/part_pkg.cgi
@@ -24,6 +24,8 @@
'error_callback' => $error_callback,
'field_callback' => $field_callback,
+ 'onsubmit' => 'confirm_submit',
+
'labels' => {
'pkgpart' => 'Package Definition',
'pkg' => 'Package (customer-visible)',
@@ -66,6 +68,8 @@
},
{ field=>'custom', type=>'hidden' },
+ { field=>'family_pkgpart', type=>'hidden' },
+ { field=>'successor', type=>'hidden' },
{ type => 'columnstart' },
@@ -593,7 +597,7 @@ my $javascript = <<'END';
}
- function aux_planchanged(what) {
+ function aux_planchanged(what) { //?
alert('called!');
var plan = what.options[what.selectedIndex].value;
@@ -609,9 +613,29 @@ my $javascript = <<'END';
}
- </SCRIPT>
END
+my $warning =
+ 'Changing the setup or recurring fee will create a new package definition. '.
+ 'Continue?';
+
+if ( $conf->exists('part_pkg-lineage') ) {
+ $javascript .= "
+ function confirm_submit(f) {
+
+ var fields = Array('setup_fee','recur_fee');
+ for(var i=0; i < fields.length; i++) {
+ if ( f[fields[i]].value != f[fields[i]].defaultValue ) {
+ return confirm('$warning');
+ }
+ }
+ return true;
+ }
+";
+}
+
+$javascript .= '</SCRIPT>';
+
tie my %plans, 'Tie::IxHash', %{ FS::part_pkg::plan_info() };
tie my %plan_labels, 'Tie::IxHash',
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/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/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>