X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main%2Fbilling.html;h=5786a0711bf976aab78802a5e60637497dadb42b;hb=ba78aad5a6ccc0b6e8264dcb71ad5f0dc1947326;hp=18a203bd6de9ca33cadbc564b88295861e3659a6;hpb=8d4abaa99403699aa5b5f02e899d2ea33980f913;p=freeside.git
diff --git a/httemplate/view/cust_main/billing.html b/httemplate/view/cust_main/billing.html
index 18a203bd6..5786a0711 100644
--- a/httemplate/view/cust_main/billing.html
+++ b/httemplate/view/cust_main/billing.html
@@ -6,22 +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' %>
- |
-
-
- Email invoices |
-
- <%= join(', ', grep { $_ ne 'POST' } @invoicing_list ) || 'no' %>
- |
-
+
Billing type |
@@ -35,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 %> |
@@ -57,7 +69,7 @@ Billing information
Account number |
- <%= $account %> |
+ <%= 'x'x(length($account)-2). substr($account,(length($account)-2)) %> |
Bank name |
@@ -91,10 +103,6 @@ Billing information
<% } %>
- Expiration |
- <%= $cust_main->paydate %> |
-
-
Attention |
<%= $cust_main->payname %> |
@@ -108,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' %>
+ |
+
+