From 2b49cbe76b94c6c1561aa2bf37beba7d47591190 Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 24 Aug 2005 13:22:27 +0000 Subject: 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 --- httemplate/view/cust_main/billing.html | 97 ++++++++++++++++++++++++---------- 1 file changed, 68 insertions(+), 29 deletions(-) (limited to 'httemplate/view') 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 (Bill now) <%= ntable("#cccccc") %><%= ntable("#cccccc",2) %> - - Tax exempt - <%= $cust_main->tax ? 'yes' : 'no' %> - - - Postal invoices - - <%= ( grep { $_ eq 'POST' } @invoicing_list ) ? 'yes' : 'no' %> - - - - FAX invoices - - <%= ( grep { $_ eq 'FAX' } @invoicing_list ) ? 'yes' : 'no' %> - - - - Email invoices - - <%= join(', ', grep { $_ !~ /^(POST|FAX)$/ } @invoicing_list ) || 'no' %> - - + Billing type @@ -41,10 +20,37 @@ Billing information Card number <%= $cust_main->payinfo_masked %> + +<% +#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 ) = ( '', '' ); +} +%> Expiration - <%= $cust_main->paydate %> - + <%= "$mon/$year" %> + + +<% if ( $cust_main->paystart_month ) { %> + + Start date + <%= $cust_main->paystart_month. '/'. $cust_main->paystart_year %> + +<% } elsif ( $cust_main->payissue ) { %> + + Issue # + <%= $cust_main->payissue %> + +<% } %> + Name on card <%= $cust_main->payname %> @@ -96,10 +102,6 @@ Billing information <% } %> - - Expiration - <%= $cust_main->paydate %> - Attention <%= $cust_main->payname %> @@ -114,12 +116,49 @@ Billing information Authorized by <%= $cust_main->payinfo %> + +<% +#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 ) = ( '', '' ); +} +%> Expiration - <%= $cust_main->paydate %> + <%= "$mon/$year" %> <% } %> + + Tax exempt + <%= $cust_main->tax ? 'yes' : 'no' %> + + + Postal invoices + + <%= ( grep { $_ eq 'POST' } @invoicing_list ) ? 'yes' : 'no' %> + + + + FAX invoices + + <%= ( grep { $_ eq 'FAX' } @invoicing_list ) ? 'yes' : 'no' %> + + + + Email invoices + + <%= join(', ', grep { $_ !~ /^(POST|FAX)$/ } @invoicing_list ) || 'no' %> + + + -- cgit v1.2.1