diff options
author | ivan <ivan> | 2005-08-24 13:22:27 +0000 |
---|---|---|
committer | ivan <ivan> | 2005-08-24 13:22:27 +0000 |
commit | 2b49cbe76b94c6c1561aa2bf37beba7d47591190 (patch) | |
tree | 7dceb6e839c8c1090f48c17348a81764dcebf16d /httemplate/view/cust_main/billing.html | |
parent | 9eb89294e2909ca9a8043b05f2492b7018b14adb (diff) |
customer edit: abstract out billing info to billing.html, re-do payment type selection with HTML::Widgets::SelectLayers, add Switch/Solo/Maestro support for start date & issue #. customer view: re-order fields for consistency. selfservice API: support paystart_month, paystart_year, payissue and payip in MyAccount::process_payment and ::edit_info and Signup::new_customer, FS::cust_main::realtime_bop: support paystart_month paystart_year payissue payip fields
Diffstat (limited to 'httemplate/view/cust_main/billing.html')
-rw-r--r-- | httemplate/view/cust_main/billing.html | 97 |
1 files changed, 68 insertions, 29 deletions
diff --git a/httemplate/view/cust_main/billing.html b/httemplate/view/cust_main/billing.html index 561fff992..30397fd3e 100644 --- a/httemplate/view/cust_main/billing.html +++ b/httemplate/view/cust_main/billing.html @@ -6,28 +6,7 @@ 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 exempt</TD> - <TD BGCOLOR="#ffffff"><%= $cust_main->tax ? 'yes' : 'no' %></TD> -</TR> -<TR> - <TD ALIGN="right">Postal invoices</TD> - <TD BGCOLOR="#ffffff"> - <%= ( grep { $_ eq 'POST' } @invoicing_list ) ? 'yes' : 'no' %> - </TD> -</TR> -<TR> - <TD ALIGN="right">FAX invoices</TD> - <TD BGCOLOR="#ffffff"> - <%= ( grep { $_ eq 'FAX' } @invoicing_list ) ? 'yes' : 'no' %> - </TD> -</TR> -<TR> - <TD ALIGN="right">Email invoices</TD> - <TD BGCOLOR="#ffffff"> - <%= join(', ', grep { $_ !~ /^(POST|FAX)$/ } @invoicing_list ) || 'no' %> - </TD> -</TR> + <TR> <TD ALIGN="right">Billing type</TD> <TD BGCOLOR="#ffffff"> @@ -41,10 +20,37 @@ 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"><%= $cust_main->paydate %></TD> -</TR> + <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> +<% } %> + <TR> <TD ALIGN="right">Name on card</TD> <TD BGCOLOR="#ffffff"><%= $cust_main->payname %></TD> @@ -97,10 +103,6 @@ Billing information <% } %> <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> @@ -114,12 +116,49 @@ Billing information <TD ALIGN="right">Authorized 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"><%= $cust_main->paydate %></TD> + <TD BGCOLOR="#ffffff"><%= "$mon/$year" %></TD> </TR> <% } %> +<TR> + <TD ALIGN="right">Tax exempt</TD> + <TD BGCOLOR="#ffffff"><%= $cust_main->tax ? 'yes' : 'no' %></TD> +</TR> +<TR> + <TD ALIGN="right">Postal invoices</TD> + <TD BGCOLOR="#ffffff"> + <%= ( grep { $_ eq 'POST' } @invoicing_list ) ? 'yes' : 'no' %> + </TD> +</TR> +<TR> + <TD ALIGN="right">FAX invoices</TD> + <TD BGCOLOR="#ffffff"> + <%= ( grep { $_ eq 'FAX' } @invoicing_list ) ? 'yes' : 'no' %> + </TD> +</TR> +<TR> + <TD ALIGN="right">Email invoices</TD> + <TD BGCOLOR="#ffffff"> + <%= join(', ', grep { $_ !~ /^(POST|FAX)$/ } @invoicing_list ) || 'no' %> + </TD> +</TR> + </TABLE></TD></TR></TABLE> |