3 my @invoicing_list = $cust_main->invoicing_list;
7 (<A HREF="<%= $p %>misc/bill.cgi?<%= $cust_main->custnum %>">Bill now</A>)
8 <%= ntable("#cccccc") %><TR><TD><%= ntable("#cccccc",2) %>
11 <TD ALIGN="right">Billing type</TD>
12 <TD BGCOLOR="#ffffff">
14 <% if ( $cust_main->payby eq 'CARD' || $cust_main->payby eq 'DCRD' ) { %>
16 Credit card <%= $cust_main->payby eq 'CARD' ? '(automatic)' : '(on-demand)' %>
20 <TD ALIGN="right">Card number</TD>
21 <TD BGCOLOR="#ffffff"><%= $cust_main->payinfo_masked %></TD>
25 #false laziness w/elements/select-month_year.html & edit/cust_main/billing.html
27 my $date = $cust_main->paydate || '12-2037';
28 if ( $date =~ /^(\d{4})-(\d{1,2})-\d{1,2}$/ ) { #PostgreSQL date format
29 ( $mon, $year ) = ( $2, $1 );
30 } elsif ( $date =~ /^(\d{1,2})-(\d{1,2}-)?(\d{4}$)/ ) {
31 ( $mon, $year ) = ( $1, $3 );
33 warn "unrecognized expiration date format: $date";
34 ( $mon, $year ) = ( '', '' );
38 <TD ALIGN="right">Expiration</TD>
39 <TD BGCOLOR="#ffffff"><%= "$mon/$year" %></TD>
42 <% if ( $cust_main->paystart_month ) { %>
44 <TD ALIGN="right">Start date</TD>
45 <TD BGCOLOR="#ffffff"><%= $cust_main->paystart_month. '/'. $cust_main->paystart_year %>
47 <% } elsif ( $cust_main->payissue ) { %>
49 <TD ALIGN="right">Issue #</TD>
50 <TD BGCOLOR="#ffffff"><%= $cust_main->payissue %>
55 <TD ALIGN="right">Name on card</TD>
56 <TD BGCOLOR="#ffffff"><%= $cust_main->payname %></TD>
59 <% } elsif ( $cust_main->payby eq 'CHEK' || $cust_main->payby eq 'DCHK') {
60 my( $account, $aba ) = split('@', $cust_main->payinfo );
63 Electronic check <%= $cust_main->payby eq 'CHEK' ? '(automatic)' : '(on-demand)' %>
67 <TD ALIGN="right">ABA/Routing code</TD>
68 <TD BGCOLOR="#ffffff"><%= $aba %></TD>
71 <TD ALIGN="right">Account number</TD>
72 <TD BGCOLOR="#ffffff"><%= 'x'x(length($account)-2). substr($account,(length($account)-2)) %></TD>
75 <TD ALIGN="right">Bank name</TD>
76 <TD BGCOLOR="#ffffff"><%= $cust_main->payname %></TD>
79 <% } elsif ( $cust_main->payby eq 'LECB' ) {
80 $cust_main->payinfo =~ /^(\d{3})(\d{3})(\d{4})$/;
81 my $payinfo = "$1-$2-$3";
84 Phone bill billing
88 <TD ALIGN="right">Phone number</TD>
89 <TD BGCOLOR="#ffffff"><%= $payinfo %></TD>
92 <% } elsif ( $cust_main->payby eq 'BILL' ) { %>
98 <% if ( $cust_main->payinfo ) { %>
100 <TD ALIGN="right">P.O. </TD>
101 <TD BGCOLOR="#ffffff"><%= $cust_main->payinfo %></TD>
106 <TD ALIGN="right">Attention</TD>
107 <TD BGCOLOR="#ffffff"><%= $cust_main->payname %></TD>
110 <% } elsif ( $cust_main->payby eq 'COMP' ) { %>
116 <TD ALIGN="right">Authorized by</TD>
117 <TD BGCOLOR="#ffffff"><%= $cust_main->payinfo %></TD>
121 #false laziness w/above etc.
123 my $date = $cust_main->paydate || '12-2037';
124 if ( $date =~ /^(\d{4})-(\d{1,2})-\d{1,2}$/ ) { #PostgreSQL date format
125 ( $mon, $year ) = ( $2, $1 );
126 } elsif ( $date =~ /^(\d{1,2})-(\d{1,2}-)?(\d{4}$)/ ) {
127 ( $mon, $year ) = ( $1, $3 );
129 warn "unrecognized expiration date format: $date";
130 ( $mon, $year ) = ( '', '' );
134 <TD ALIGN="right">Expiration</TD>
135 <TD BGCOLOR="#ffffff"><%= "$mon/$year" %></TD>
141 <TD ALIGN="right">Tax exempt</TD>
142 <TD BGCOLOR="#ffffff"><%= $cust_main->tax ? 'yes' : 'no' %></TD>
145 <TD ALIGN="right">Postal invoices</TD>
146 <TD BGCOLOR="#ffffff">
147 <%= ( grep { $_ eq 'POST' } @invoicing_list ) ? 'yes' : 'no' %>
151 <TD ALIGN="right">FAX invoices</TD>
152 <TD BGCOLOR="#ffffff">
153 <%= ( grep { $_ eq 'FAX' } @invoicing_list ) ? 'yes' : 'no' %>
157 <TD ALIGN="right">Email invoices</TD>
158 <TD BGCOLOR="#ffffff">
159 <%= join(', ', grep { $_ !~ /^(POST|FAX)$/ } @invoicing_list ) || 'no' %>
163 </TABLE></TD></TR></TABLE>