summaryrefslogtreecommitdiff
path: root/httemplate/view/cust_main
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/view/cust_main')
-rw-r--r--httemplate/view/cust_main/billing.html99
-rwxr-xr-xhttemplate/view/cust_main/packages.html280
-rw-r--r--httemplate/view/cust_main/payment_history.html88
-rw-r--r--httemplate/view/cust_main/quick-charge.html28
-rw-r--r--httemplate/view/cust_main/tickets.html2
5 files changed, 148 insertions, 349 deletions
diff --git a/httemplate/view/cust_main/billing.html b/httemplate/view/cust_main/billing.html
index 5786a0711..561fff992 100644
--- a/httemplate/view/cust_main/billing.html
+++ b/httemplate/view/cust_main/billing.html
@@ -6,7 +6,28 @@
Billing information
(<A HREF="<%= $p %>misc/bill.cgi?<%= $cust_main->custnum %>">Bill now</A>)
<%= ntable("#cccccc") %><TR><TD><%= ntable("#cccccc",2) %>
-
+<TR>
+ <TD ALIGN="right">Tax&nbsp;exempt</TD>
+ <TD BGCOLOR="#ffffff"><%= $cust_main->tax ? 'yes' : 'no' %></TD>
+</TR>
+<TR>
+ <TD ALIGN="right">Postal&nbsp;invoices</TD>
+ <TD BGCOLOR="#ffffff">
+ <%= ( grep { $_ eq 'POST' } @invoicing_list ) ? 'yes' : 'no' %>
+ </TD>
+</TR>
+<TR>
+ <TD ALIGN="right">FAX&nbsp;invoices</TD>
+ <TD BGCOLOR="#ffffff">
+ <%= ( grep { $_ eq 'FAX' } @invoicing_list ) ? 'yes' : 'no' %>
+ </TD>
+</TR>
+<TR>
+ <TD ALIGN="right">Email&nbsp;invoices</TD>
+ <TD BGCOLOR="#ffffff">
+ <%= join(', ', grep { $_ !~ /^(POST|FAX)$/ } @invoicing_list ) || 'no' %>
+ </TD>
+</TR>
<TR>
<TD ALIGN="right">Billing&nbsp;type</TD>
<TD BGCOLOR="#ffffff">
@@ -20,37 +41,10 @@ Billing information
<TD ALIGN="right">Card number</TD>
<TD BGCOLOR="#ffffff"><%= $cust_main->payinfo_masked %></TD>
</TR>
-
-<%
-#false laziness w/elements/select-month_year.html & edit/cust_main/billing.html
-my( $mon, $year );
-my $date = $cust_main->paydate || '12-2037';
-if ( $date =~ /^(\d{4})-(\d{1,2})-\d{1,2}$/ ) { #PostgreSQL date format
- ( $mon, $year ) = ( $2, $1 );
-} elsif ( $date =~ /^(\d{1,2})-(\d{1,2}-)?(\d{4}$)/ ) {
- ( $mon, $year ) = ( $1, $3 );
-} else {
- warn "unrecognized expiration date format: $date";
- ( $mon, $year ) = ( '', '' );
-}
-%>
<TR>
<TD ALIGN="right">Expiration</TD>
- <TD BGCOLOR="#ffffff"><%= "$mon/$year" %></TD>
-</TR>
-
-<% if ( $cust_main->paystart_month ) { %>
- <TR>
- <TD ALIGN="right">Start date</TD>
- <TD BGCOLOR="#ffffff"><%= $cust_main->paystart_month. '/'. $cust_main->paystart_year %>
- </TR>
-<% } elsif ( $cust_main->payissue ) { %>
- <TR>
- <TD ALIGN="right">Issue #</TD>
- <TD BGCOLOR="#ffffff"><%= $cust_main->payissue %>
- </TR>
-<% } %>
-
+ <TD BGCOLOR="#ffffff"><%= $cust_main->paydate %></TD>
+</TR>
<TR>
<TD ALIGN="right">Name on card</TD>
<TD BGCOLOR="#ffffff"><%= $cust_main->payname %></TD>
@@ -69,7 +63,7 @@ if ( $date =~ /^(\d{4})-(\d{1,2})-\d{1,2}$/ ) { #PostgreSQL date format
</TR>
<TR>
<TD ALIGN="right">Account number</TD>
- <TD BGCOLOR="#ffffff"><%= 'x'x(length($account)-2). substr($account,(length($account)-2)) %></TD>
+ <TD BGCOLOR="#ffffff"><%= $account %></TD>
</TR>
<TR>
<TD ALIGN="right">Bank name</TD>
@@ -103,6 +97,10 @@ if ( $date =~ /^(\d{4})-(\d{1,2})-\d{1,2}$/ ) { #PostgreSQL date format
<% } %>
<TR>
+ <TD ALIGN="right">Expiration</TD>
+ <TD BGCOLOR="#ffffff"><%= $cust_main->paydate %></TD>
+</TR>
+<TR>
<TD ALIGN="right">Attention</TD>
<TD BGCOLOR="#ffffff"><%= $cust_main->payname %></TD>
</TR>
@@ -116,49 +114,12 @@ if ( $date =~ /^(\d{4})-(\d{1,2})-\d{1,2}$/ ) { #PostgreSQL date format
<TD ALIGN="right">Authorized&nbsp;by</TD>
<TD BGCOLOR="#ffffff"><%= $cust_main->payinfo %></TD>
</TR>
-
-<%
-#false laziness w/above etc.
-my( $mon, $year );
-my $date = $cust_main->paydate || '12-2037';
-if ( $date =~ /^(\d{4})-(\d{1,2})-\d{1,2}$/ ) { #PostgreSQL date format
- ( $mon, $year ) = ( $2, $1 );
-} elsif ( $date =~ /^(\d{1,2})-(\d{1,2}-)?(\d{4}$)/ ) {
- ( $mon, $year ) = ( $1, $3 );
-} else {
- warn "unrecognized expiration date format: $date";
- ( $mon, $year ) = ( '', '' );
-}
-%>
<TR>
<TD ALIGN="right">Expiration</TD>
- <TD BGCOLOR="#ffffff"><%= "$mon/$year" %></TD>
+ <TD BGCOLOR="#ffffff"><%= $cust_main->paydate %></TD>
</TR>
<% } %>
-<TR>
- <TD ALIGN="right">Tax&nbsp;exempt</TD>
- <TD BGCOLOR="#ffffff"><%= $cust_main->tax ? 'yes' : 'no' %></TD>
-</TR>
-<TR>
- <TD ALIGN="right">Postal&nbsp;invoices</TD>
- <TD BGCOLOR="#ffffff">
- <%= ( grep { $_ eq 'POST' } @invoicing_list ) ? 'yes' : 'no' %>
- </TD>
-</TR>
-<TR>
- <TD ALIGN="right">FAX&nbsp;invoices</TD>
- <TD BGCOLOR="#ffffff">
- <%= ( grep { $_ eq 'FAX' } @invoicing_list ) ? 'yes' : 'no' %>
- </TD>
-</TR>
-<TR>
- <TD ALIGN="right">Email&nbsp;invoices</TD>
- <TD BGCOLOR="#ffffff">
- <%= join(', ', grep { $_ !~ /^(POST|FAX)$/ } @invoicing_list ) || 'no' %>
- </TD>
-</TR>
-
</TABLE></TD></TR></TABLE>
diff --git a/httemplate/view/cust_main/packages.html b/httemplate/view/cust_main/packages.html
index ece1b62bb..068a8276f 100755
--- a/httemplate/view/cust_main/packages.html
+++ b/httemplate/view/cust_main/packages.html
@@ -5,10 +5,6 @@
my $packages = get_packages($cust_main, $conf);
%>
-<STYLE TYPE="text/css">
-.package .provision { font-weight: bold }
-</STYLE>
-
<A NAME="cust_pkg"><FONT SIZE="+2">Packages</FONT></A>
<%= include('order_pkg.html', $cust_main ) %>
@@ -75,10 +71,12 @@ foreach my $pkg (sort pkgsort_pkgnum_cancel @$packages) {
(&nbsp;<%=pkg_dates_link($pkg)%>&nbsp;|&nbsp;<%=pkg_customize_link($pkg,$cust_main->custnum)%>&nbsp;)
<% } %>
</TD>
- <TD ROWSPAN=<%=$rowspan%>>
- <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH="100%">
-
<%
+ #foreach (qw(setup last_bill next_bill susp expire cancel)) {
+ # print qq! <TD ROWSPAN=$rowspan>! . pkg_datestr($pkg,$_,$conf) . qq!</TD>\n!;
+ #}
+ print "<TD ROWSPAN=$rowspan>". &itable('');
+
sub myfreq {
my $part_pkg = shift;
my $freq = $part_pkg->freq_pretty;
@@ -86,190 +84,92 @@ foreach my $pkg (sort pkgsort_pkgnum_cancel @$packages) {
$freq;
}
- #this should use cust_pkg->status and cust_pkg->statuscolor eventually
-
- my $colspan = $conf->exists('cust_pkg-display_times') ? 8 : 4;
- my $width = $conf->exists('cust_pkg-display_times') ? '38%' : '56%';
+ if ( $pkg->{cancel} ) { #status: cancelled
+
+ print '<TR><TD><FONT COLOR="#ff0000"><B>Cancelled&nbsp;</B></FONT></TD>'.
+ '<TD>'. pkg_datestr($pkg,'cancel',$conf). '</TD></TR>';
+ unless ( $pkg->{setup} ) {
+ print '<TR><TD COLSPAN=2>Never billed</TD></TR>';
+ } else {
+ print "<TR><TD>Setup&nbsp;</TD><TD>".
+ pkg_datestr($pkg, 'setup',$conf). '</TD></TR>';
+ print "<TR><TD>Last&nbsp;bill&nbsp;</TD><TD>".
+ pkg_datestr($pkg, 'last_bill',$conf). '</TD></TR>'
+ if $pkg->{'last_bill'};
+ print "<TR><TD>Suspended&nbsp;</TD><TD>".
+ pkg_datestr($pkg, 'susp',$conf). '</TD></TR>'
+ if $pkg->{'susp'};
+ }
- #false laziness w/edit/REAL_cust_pkg.cgi
- my( $billed_or_prepaid, $last_bill_or_renewed, $next_bill_or_prepaid_until );
- unless ( $pkg->{'part_pkg'}->is_prepaid ) {
- $billed_or_prepaid = 'billed';
- $last_bill_or_renewed = 'Last&nbsp;bill';
- $next_bill_or_prepaid_until = 'Next&nbsp;bill';
} else {
- $billed_or_prepaid = 'prepaid';
- $last_bill_or_renewed = 'Renewed';
- $next_bill_or_prepaid_until = 'Prepaid&nbsp;until';
- }
-
-%>
-
-<% if ( $pkg->{cancel} ) { %> <!-- #status: cancelled -->
-
- <TR>
- <TD WIDTH="<%=$width%>" ALIGN="right"><FONT COLOR="#ff0000"><B>Cancelled&nbsp;</B></FONT></TD>
- <%= pkg_datestr($pkg,'cancel',$conf) %>
- </TR>
-
- <% unless ( $pkg->{setup} ) { %>
-
- <TR>
- <TD COLSPAN=<%=$colspan%>>Never billed</TD>
- </TR>
-
- <% } else { %>
-
- <TR>
- <TD WIDTH="<%=$width%>" ALIGN="right">Setup&nbsp;</TD>
- <%= pkg_datestr($pkg, 'setup',$conf) %>
- </TR>
-
- <% if ( $pkg->{'last_bill'} ) { %>
- <TR>
- <TD WIDTH="<%=$width%>" ALIGN="right"><%= $last_bill_or_renewed %>&nbsp;</TD>
- <%= pkg_datestr($pkg, 'last_bill',$conf) %>
- </TR>
- <% } %>
-
- <% if ( $pkg->{'susp'} ) { %>
- <TR>
- <TD WIDTH="<%=$width%>" ALIGN="right">Suspended&nbsp;</TD>
- <%= pkg_datestr($pkg, 'susp',$conf) %>
- </TR>
- <% } %>
-
- <% } %>
-
-<% } else { %>
-
- <% if ( $pkg->{susp} ) { %> <!-- #status: suspended -->
-
- <TR>
- <TD WIDTH="<%=$width%>" ALIGN="right"><FONT COLOR="#FF9900"><B>Suspended</B>&nbsp;</FONT></TD>
- <%= pkg_datestr($pkg,'susp',$conf) %>
- </TR>
-
- <% unless ( $pkg->{setup} ) { %>
-
- <TR>
- <TD COLSPAN=<%=$colspan%>>Never billed</TD>
- </TR>
-
- <% } else { %>
-
- <TR>
- <TD WIDTH="<%=$width%>" ALIGN="right">Setup&nbsp;</TD>
- <%= pkg_datestr($pkg, 'setup',$conf) %>
- </TR>
-
- <% } %>
-
- <% if ( $pkg->{'last_bill'} ) { %>
- <TR>
- <TD WIDTH="<%=$width%>" ALIGN="right"><%= $last_bill_or_renewed %>&nbsp;</TD>
- <%= pkg_datestr($pkg, 'last_bill',$conf) %>
- </TR>
- <% } %>
-
- <!-- # next bill ?? -->
- <% if ( $pkg->{'expire'} ) { %>
- <TR>
- <TD WIDTH="<%=$width%>" ALIGN="right">Expires&nbsp;</TD>
- <%= pkg_datestr($pkg, 'expire',$conf) %>
- </TR>
- <% } %>
+ if ( $pkg->{susp} ) { #status: suspended
+ print '<TR><TD><FONT COLOR="#FF9900"><B>Suspended</B>&nbsp;</FONT></TD>'.
+ '<TD>'. pkg_datestr($pkg,'susp',$conf). '</TD></TR>';
+ unless ( $pkg->{setup} ) {
+ print '<TR><TD COLSPAN=2>Never billed</TD></TR>';
+ } else {
+ print "<TR><TD>Setup&nbsp;</TD><TD>".
+ pkg_datestr($pkg, 'setup',$conf). '</TD></TR>';
+ }
+ print "<TR><TD>Last&nbsp;bill&nbsp;</TD><TD>".
+ pkg_datestr($pkg, 'last_bill',$conf). '</TD></TR>'
+ if $pkg->{'last_bill'};
+ # next bill ??
+ print "<TR><TD>Expires&nbsp;</TD><TD>".
+ pkg_datestr($pkg, 'expire',$conf). '</TD></TR>'
+ if $pkg->{'expire'};
+ print '<TR><TD COLSPAN=2>(&nbsp;'. pkg_unsuspend_link($pkg).
+ '&nbsp;|&nbsp;'. pkg_cancel_link($pkg). '&nbsp;)</TD></TR>';
+
+ } else { #status: active
+
+ unless ( $pkg->{setup} ) { #not setup
+
+ print '<TR><TD COLSPAN=2>Not&nbsp;yet&nbsp;billed&nbsp;(';
+ unless ( $pkg->{freq} ) {
+ print 'one-time&nbsp;charge)</TD></TR>';
+ print '<TR><TD COLSPAN=2>(&nbsp;'. pkg_cancel_link($pkg).
+ '&nbsp;)</TD</TR>';
+ } else {
+ print 'billed&nbsp;'. myfreq($pkg->{part_pkg}). ')</TD></TR>';
+ }
+
+ } else { #setup
+
+ unless ( $pkg->{freq} ) {
+ print "<TR><TD COLSPAN=2>One-time&nbsp;charge</TD></TR>".
+ '<TR><TD>Billed&nbsp;</TD><TD>'.
+ pkg_datestr($pkg,'setup',$conf). '</TD></TR>';
+ } else {
+ print '<TR><TD COLSPAN=2><FONT COLOR="#00CC00"><B>Active</B></FONT>'.
+ ',&nbsp;billed&nbsp;'. myfreq($pkg->{part_pkg}). '</TD></TR>'.
+ '<TR><TD>Setup&nbsp;</TD><TD>'.
+ pkg_datestr($pkg, 'setup',$conf). '</TD></TR>';
+ }
+
+ }
+
+ print "<TR><TD>Last&nbsp;bill&nbsp;</TD><TD>".
+ pkg_datestr($pkg, 'last_bill',$conf). '</TD></TR>'
+ if $pkg->{'last_bill'};
+ print "<TR><TD>Next&nbsp;bill&nbsp;</TD><TD>".
+ pkg_datestr($pkg, 'next_bill',$conf). '</TD></TR>'
+ if $pkg->{'next_bill'};
+ print "<TR><TD>Expires&nbsp;</TD><TD>".
+ pkg_datestr($pkg, 'expire',$conf). '</TD></TR>'
+ if $pkg->{'expire'};
+ if ( $pkg->{freq} ) {
+ print '<TR><TD COLSPAN=2>(&nbsp;'. pkg_suspend_link($pkg).
+ '&nbsp;|&nbsp;'. pkg_cancel_link($pkg). '&nbsp;)</TD></TR>';
+ }
- <TR>
- <TD COLSPAN=<%=$colspan%>>(&nbsp;<%= pkg_unsuspend_link($pkg) %>&nbsp;|&nbsp;<%= pkg_cancel_link($pkg) %>&nbsp;)</TD>
- </TR>
-
- <% } else { %> <!-- #status: active -->
-
- <% unless ( $pkg->{setup} ) { %> <!-- #not setup -->
-
- <% unless ( $pkg->{'freq'} ) { %>
-
- <TR>
- <TD COLSPAN=<%=$colspan%>>Not&nbsp;yet&nbsp;billed&nbsp;(one-time&nbsp;charge)</TD>
- </TR>
-
- <TR>
- <TD COLSPAN=<%=$colspan%>>(&nbsp;<%= pkg_cancel_link($pkg) %>&nbsp;)</TD>
- </TR>
-
- <% } else { %>
-
- <TR>
- <TD COLSPAN=<%=$colspan%>>Not&nbsp;yet&nbsp;billed&nbsp;(<%= $billed_or_prepaid %>&nbsp;<%= myfreq($pkg->{part_pkg}) %>)</TD>
- </TR>
-
- <% } %>
-
- <% } else { %> <!-- #setup -->
-
- <% unless ( $pkg->{freq} ) { %>
-
- <TR>
- <TD COLSPAN=<%=$colspan%>>One-time&nbsp;charge</TD>
- </TR>
-
- <TR>
- <TD WIDTH="<%=$width%>" ALIGN="right">Billed&nbsp;</TD>
- <%= pkg_datestr($pkg,'setup',$conf) %>
- </TR>
-
- <% } else { %>
-
- <TR>
- <TD COLSPAN=<%=$colspan%>><FONT COLOR="#00CC00"><B>Active</B></FONT>,&nbsp;<%= $billed_or_prepaid %>&nbsp;<%= myfreq($pkg->{part_pkg}) %></TD>
- </TR>
-
- <TR>
- <TD WIDTH="<%=$width%>" ALIGN="right">Setup&nbsp;</TD>
- <%= pkg_datestr($pkg, 'setup',$conf) %>
- </TR>
-
- <% } %>
-
- <% } %>
-
- <% if ( $pkg->{'last_bill'} ) { %>
- <TR>
- <TD WIDTH="<%=$width%>" ALIGN="right"><%= $last_bill_or_renewed %>&nbsp;</TD>
- <%= pkg_datestr($pkg, 'last_bill',$conf) %>
- </TR>
- <% } %>
-
- <% if ( $pkg->{'next_bill'} ) { %>
- <TR>
- <TD WIDTH="<%=$width%>" ALIGN="right"><%= $next_bill_or_prepaid_until %>&nbsp;</TD>
- <%= pkg_datestr($pkg, 'next_bill',$conf) %>
- </TR>
- <% } %>
-
- <% if ( $pkg->{'expire'} ) { %>
- <TR>
- <TD WIDTH="<%=$width%>" ALIGN="right">Expires&nbsp;</TD>
- <%= pkg_datestr($pkg, 'expire',$conf) %>
- </TR>
- <% } %>
-
- <% if ( $pkg->{freq} ) { %>
- <TR>
- <TD COLSPAN=<%=$colspan%>>(&nbsp;<%= pkg_suspend_link($pkg) %>&nbsp;|&nbsp;<%= pkg_cancel_link($pkg) %>&nbsp;)</TD>
- </TR>
- <% } %>
-
- <% } %>
+ }
-<% } %>
+ }
-</TABLE>
-</TD>
+ print "</TABLE></TD>\n";
-<%
if ($rowspan == 0) { print qq!</TR>\n!; next; }
my $cnt = 0;
@@ -442,15 +342,9 @@ sub pkgsort_pkgnum_cancel {
sub pkg_datestr {
my($pkg, $field, $conf) = @_ or return '';
return '&nbsp;' unless $pkg->{$field};
- my $format = '<TD align="left"><B>%b</B></TD>'.
- '<TD align="right"><B>&nbsp;%o,</B></TD>'.
- '<TD align="right"><B>&nbsp;%Y</B></TD>';
- #$format .= '&nbsp;<FONT SIZE=-3>%l:%M:%S%P&nbsp;%z</FONT>'
- $format .= '<TD ALIGN="right"><B>&nbsp;%l</TD>'.
- '<TD ALIGN="center"><B>:</B></TD>'.
- '<TD ALIGN="left"><B>%M</B></TD>'.
- '<TD ALIGN="left"><B>&nbsp;%P</B></TD>'
- if $conf->exists('cust_pkg-display_times');
+ my $format = $conf->exists('pkg_showtimes')
+ ? '<B>%D</B>&nbsp;<FONT SIZE=-3>%l:%M:%S%P&nbsp;%z</FONT>'
+ : '<B>%b&nbsp;%o,&nbsp;%Y</B>';
( my $strip = time2str($format, $pkg->{$field}) ) =~ s/ (\d)/$1/g;
$strip;
}
diff --git a/httemplate/view/cust_main/payment_history.html b/httemplate/view/cust_main/payment_history.html
index ec99b8c54..db01ebbcf 100644
--- a/httemplate/view/cust_main/payment_history.html
+++ b/httemplate/view/cust_main/payment_history.html
@@ -1,63 +1,13 @@
<%
my( $cust_main ) = @_;
- my $custnum = $cust_main->custnum;
-
my $conf = new FS::Conf;
-
- my @payby = grep /\w/, $conf->config('payby');
- #@payby = (qw( CARD DCRD CHEK DCHK LECB BILL CASH WEST COMP ))
- @payby = (qw( CARD DCRD CHEK DCHK LECB BILL CASH COMP ))
- unless @payby;
- my %payby = map { $_=>1 } @payby;
-
- my $s = 0;
-
+ my $custnum = $cust_main->custnum;
%>
<BR><BR><A NAME="history"><FONT SIZE="+2">Payment History</FONT></A><BR>
-
-<% if ( $payby{'BILL'} ) { %>
-
- <%= $s++ ? ' | ' : '' %>
- <A HREF="<%= $p %>edit/cust_pay.cgi?payby=BILL;custnum=<%= $custnum %>">Post check payment</A>
-
-<% } %>
-
-<% if ( $payby{'CASH'} ) { %>
-
- <%= $s++ ? ' | ' : '' %>
- <A HREF="<%= $p %>edit/cust_pay.cgi?payby=CASH;custnum=<%= $custnum %>">Post cash payment</A>
-
-<% } %>
-
-<% if ( $payby{'WEST'} ) { %>
-
- <%= $s++ ? ' | ' : '' %>
- <A HREF="<%= $p %>edit/cust_pay.cgi?payby=WEST;custnum=<%= $custnum %>">Post Western Union payment</A>
-
-<% } %>
-
-<% if ( $payby{'CARD'} || $payby{'DCRD'} ) { %>
-
- <%= $s++ ? ' | ' : '' %>
- <A HREF="<%= $p %>misc/payment.cgi?payby=CARD;custnum=<%= $custnum %>">Process credit card payment</A>
-
-<% } %>
-
-<% if ( $payby{'CHEK'} || $payby{'DCHK'} ) { %>
-
- <%= $s++ ? ' | ' : '' %>
- <A HREF="<%= $p %>misc/payment.cgi?payby=CHEK;custnum=<%= $custnum %>">Process electronic check (ACH) payment</A>
-
-<% } %>
-
-<% if ( $payby{'MCRD'} ) { %>
-
- <%= $s++ ? ' | ' : '' %>
- <A HREF="<%= $p %>edit/cust_pay.cgi?payby=MCRD;custnum=<%= $custnum %>">Post manual credit card payment</A>
-
-<% } %>
-
+<A HREF="<%= $p %>edit/cust_pay.cgi?custnum=<%= $custnum %>">Post cash/check payment</A>
+| <A HREF="<%= $p %>misc/payment.cgi?payby=CARD;custnum=<%= $custnum %>">Process credit card payment</A>
+| <A HREF="<%= $p %>misc/payment.cgi?payby=CHEK;custnum=<%= $custnum %>">Process electronic check (ACH) payment</A>
<BR><A HREF="<%= $p %>edit/cust_credit.cgi?<%= $custnum %>">Post credit</A>
<BR>
@@ -101,12 +51,8 @@ foreach my $cust_pay ($cust_main->cust_pay) {
$payby =~ s/^BILL$/Check #/ if $payinfo;
$payby =~ s/^CHEK$/Electronic check /;
$payby =~ s/^PREP$/Prepaid card /;
- $payby =~ s/^CARD$/Credit card #/;
- $payby =~ s/^COMP$/Complimentary by /;
- $payby =~ s/^CASH$/Cash/;
- $payby =~ s/^WEST$/Western Union/;
- $payby =~ s/^MCRD$/Manual credit card/;
$payby =~ s/^BILL$//;
+ $payby =~ s/^(CARD|COMP)$/$1 /;
my $info = $payby ? " ($payby$payinfo)" : '';
my( $pre, $post, $desc, $apply, $ext ) = ( '', '', '', '', '' );
@@ -172,14 +118,14 @@ foreach my $cust_pay ($cust_main->cust_pay) {
my $void = '';
if ( $cust_pay->closed !~ /^Y/i
- && ( $cust_pay->payby ne 'CARD' || $conf->exists('cc-void') )
+ && $cust_pay->payby ne 'CARD'
&& ( $cust_pay->payby ne 'CHEK' || $conf->exists('echeck-void') )
) {
$void = qq! (<A HREF="javascript:areyousure('!.
qq!${p}misc/void-cust_pay.cgi?!. $cust_pay->paynum.
qq!', 'Are you sure you want to void this payment?')"!.
qq! TITLE="Void this payment from the database!.
- ( $cust_pay->payby =~ /^(CARD|CHEK)$/
+ ( $cust_pay->payby eq 'CHEK'
? ' (do not send anything to the payment gateway)'
: ''
). '"'.
@@ -229,24 +175,11 @@ foreach my $cust_pay_void ($cust_main->cust_pay_void) {
$payby =~ s/^(CARD|COMP)$/$1 /;
my $info = $payby ? " ($payby$payinfo)" : '';
- my $unvoid = '';
- if ( $cust_pay_void->closed !~ /^Y/i && $conf->exists('unvoid') ) {
- $unvoid = qq! (<A HREF="javascript:areyousure('!.
- qq!${p}misc/unvoid-cust_pay_void.cgi?!. $cust_pay_void->paynum.
- qq!', 'Are you sure you want to unvoid this payment?')"!.
- qq! TITLE="Unvoid this payment from the database!.
- ( $cust_pay_void->payby =~ /^(CARD|CHEK)$/
- ? ' (do not send anything to the payment gateway)'
- : ''
- ). '"'.
- qq!>unvoid</A>)!;
- }
-
push @history, {
'date' => $cust_pay_void->_date,
'desc' => "<DEL>Payment $info</DEL> <I>voided ".
time2str("%D", $cust_pay_void->void_date).
- " by ". $cust_pay_void->otaker. '</i>'. $unvoid,
+ " by ". $cust_pay_void->otaker. '</i>',
'void_payment' => $cust_pay_void->paid,
};
@@ -326,10 +259,7 @@ foreach my $cust_credit ($cust_main->cust_credit) {
push @history, {
'date' => $cust_credit->_date,
'desc' => $pre. "Credit$post by ". $cust_credit->otaker.
- ( $cust_credit->reason
- ? ' ('. $cust_credit->reason. ')'
- : ''
- ).
+ ' ('. $cust_credit->reason. ')'.
"$desc$apply$delete$unapply",
'credit' => $cust_credit->amount,
};
diff --git a/httemplate/view/cust_main/quick-charge.html b/httemplate/view/cust_main/quick-charge.html
index 2fe3d5f3d..0b51586d1 100644
--- a/httemplate/view/cust_main/quick-charge.html
+++ b/httemplate/view/cust_main/quick-charge.html
@@ -1,18 +1,32 @@
<%
my( $cust_main ) = @_;
+ my $conf = new FS::Conf;
%>
<FORM ACTION="<%=$p%>edit/process/quick-charge.cgi" METHOD="POST">
-
<INPUT TYPE="hidden" NAME="custnum" VALUE="<%= $cust_main->custnum %>">
-
Description:<INPUT TYPE="text" NAME="pkg">
+&nbsp;Amount:<INPUT TYPE="text" NAME="amount" SIZE=6>
+&nbsp;<%
+
+ #false laziness w/ edit/part_pkg.cgi
+ if ( $conf->exists('enable_taxclasses') ) {
+ print '<SELECT NAME="taxclass">';
+ my $sth = dbh->prepare('SELECT DISTINCT taxclass FROM cust_main_county')
+ or die dbh->errstr;
+ $sth->execute or die $sth->errstr;
+ foreach my $taxclass ( map $_->[0], @{$sth->fetchall_arrayref} ) {
+ print qq!<OPTION VALUE="$taxclass"!;
+ #print ' SELECTED' if $taxclass eq $hashref->{taxclass};
+ print qq!>$taxclass</OPTION>!;
+ }
+ print '</SELECT>';
+ } else {
+ print '<INPUT TYPE="hidden" NAME="taxclass" VALUE="">';
+ }
-Amount:<INPUT TYPE="text" NAME="amount" SIZE=6>
-
-<%= include('/elements/select-taxclass.html') %>
-
+%>
+
<INPUT TYPE="submit" VALUE="One-time charge">
-
</FORM>
diff --git a/httemplate/view/cust_main/tickets.html b/httemplate/view/cust_main/tickets.html
index 72d68152a..ea70d701d 100644
--- a/httemplate/view/cust_main/tickets.html
+++ b/httemplate/view/cust_main/tickets.html
@@ -30,7 +30,7 @@
Highest priority tickets
(<A HREF="<%= FS::TicketSystem->href_customer_tickets($cust_main->custnum) %>">View all tickets for this customer</A>)
-(<A HREF="<%= FS::TicketSystem->href_new_ticket($cust_main, join(', ', grep { $_ !~ /^(POST|FAX)$/ } $cust_main->invoicing_list ) ) %>">New ticket for this customer</A>)
+(<A HREF="<%= FS::TicketSystem->href_new_ticket($cust_main->custnum, join(', ', grep { $_ !~ /^(POST|FAX)$/ } $cust_main->invoicing_list ) ) %>">New ticket for this customer</A>)
<%= table() %>
<TR>
<TH>#</TH>