[freeside-commits] freeside/httemplate/view/cust_main billing.html, 1.2, 1.3

Ivan,,, ivan at wavetail.420.am
Wed Aug 24 06:22:29 PDT 2005


Update of /home/cvs/cvsroot/freeside/httemplate/view/cust_main
In directory wavetail:/tmp/cvs-serv27204/httemplate/view/cust_main

Modified Files:
	billing.html 
Log Message:
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

Index: billing.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/view/cust_main/billing.html,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- billing.html	21 Mar 2005 22:13:39 -0000	1.2
+++ billing.html	24 Aug 2005 13:22:27 -0000	1.3
@@ -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&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">
@@ -41,10 +20,37 @@
   <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>
+  <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 @@
   <% } %>
 
 <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 @@
   <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"><%= $cust_main->paydate %></TD>
+  <TD BGCOLOR="#ffffff"><%= "$mon/$year" %></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>
 



More information about the freeside-commits mailing list