2 % my( $cust_main ) = @_;
3 % my @invoicing_list = $cust_main->invoicing_list;
4 % my $conf = new FS::Conf;
5 % my $money_char = $conf->config('money_char') || '$';
10 (<A HREF="<% $p %>misc/bill.cgi?<% $cust_main->custnum %>">Bill now</A>)
11 <% ntable("#cccccc") %><TR><TD><% ntable("#cccccc",2) %>
13 %( my $balance = $cust_main->balance )
14 % =~ s/^(\-?)(.*)$/<FONT SIZE=+1>$1<\/FONT>$money_char$2/;
19 <TD ALIGN="right">Balance due</TD>
20 <TD BGCOLOR="#ffffff"><B><% $balance %></B></TD>
24 <TD ALIGN="right">Billing type</TD>
25 <TD BGCOLOR="#ffffff">
26 % if ( $cust_main->payby eq 'CARD' || $cust_main->payby eq 'DCRD' ) {
29 Credit card <% $cust_main->payby eq 'CARD' ? '(automatic)' : '(on-demand)' %>
33 <TD ALIGN="right">Card number</TD>
34 <TD BGCOLOR="#ffffff"><% $cust_main->payinfo_masked %></TD>
37 %#false laziness w/elements/select-month_year.html & edit/cust_main/billing.html
39 %my $date = $cust_main->paydate || '12-2037';
40 %if ( $date =~ /^(\d{4})-(\d{1,2})-\d{1,2}$/ ) { #PostgreSQL date format
41 % ( $mon, $year ) = ( $2, $1 );
42 %} elsif ( $date =~ /^(\d{1,2})-(\d{1,2}-)?(\d{4}$)/ ) {
43 % ( $mon, $year ) = ( $1, $3 );
45 % warn "unrecognized expiration date format: $date";
46 % ( $mon, $year ) = ( '', '' );
51 <TD ALIGN="right">Expiration</TD>
52 <TD BGCOLOR="#ffffff"><% "$mon/$year" %></TD>
54 % if ( $cust_main->paystart_month ) {
57 <TD ALIGN="right">Start date</TD>
58 <TD BGCOLOR="#ffffff"><% $cust_main->paystart_month. '/'. $cust_main->paystart_year %>
60 % } elsif ( $cust_main->payissue ) {
63 <TD ALIGN="right">Issue #</TD>
64 <TD BGCOLOR="#ffffff"><% $cust_main->payissue %>
70 <TD ALIGN="right">Name on card</TD>
71 <TD BGCOLOR="#ffffff"><% $cust_main->payname %></TD>
73 % } elsif ( $cust_main->payby eq 'CHEK' || $cust_main->payby eq 'DCHK') {
74 % my( $account, $aba ) = split('@', $cust_main->payinfo );
78 Electronic check <% $cust_main->payby eq 'CHEK' ? '(automatic)' : '(on-demand)' %>
82 <TD ALIGN="right">ABA/Routing code</TD>
83 <TD BGCOLOR="#ffffff"><% $aba %></TD>
86 <TD ALIGN="right">Account number</TD>
87 <TD BGCOLOR="#ffffff"><% 'x'x(length($account)-2). substr($account,(length($account)-2)) %></TD>
90 <TD ALIGN="right">Bank name</TD>
91 <TD BGCOLOR="#ffffff"><% $cust_main->payname %></TD>
93 % } elsif ( $cust_main->payby eq 'LECB' ) {
94 % $cust_main->payinfo =~ /^(\d{3})(\d{3})(\d{4})$/;
95 % my $payinfo = "$1-$2-$3";
99 Phone bill billing
103 <TD ALIGN="right">Phone number</TD>
104 <TD BGCOLOR="#ffffff"><% $payinfo %></TD>
106 % } elsif ( $cust_main->payby eq 'BILL' ) {
112 % if ( $cust_main->payinfo ) {
115 <TD ALIGN="right">P.O. </TD>
116 <TD BGCOLOR="#ffffff"><% $cust_main->payinfo %></TD>
122 <TD ALIGN="right">Attention</TD>
123 <TD BGCOLOR="#ffffff"><% $cust_main->payname %></TD>
125 % } elsif ( $cust_main->payby eq 'COMP' ) {
132 <TD ALIGN="right">Authorized by</TD>
133 <TD BGCOLOR="#ffffff"><% $cust_main->payinfo %></TD>
136 %#false laziness w/above etc.
138 %my $date = $cust_main->paydate || '12-2037';
139 %if ( $date =~ /^(\d{4})-(\d{1,2})-\d{1,2}$/ ) { #PostgreSQL date format
140 % ( $mon, $year ) = ( $2, $1 );
141 %} elsif ( $date =~ /^(\d{1,2})-(\d{1,2}-)?(\d{4}$)/ ) {
142 % ( $mon, $year ) = ( $1, $3 );
144 % warn "unrecognized expiration date format: $date";
145 % ( $mon, $year ) = ( '', '' );
150 <TD ALIGN="right">Expiration</TD>
151 <TD BGCOLOR="#ffffff"><% "$mon/$year" %></TD>
157 <TD ALIGN="right">Tax exempt</TD>
158 <TD BGCOLOR="#ffffff"><% $cust_main->tax ? 'yes' : 'no' %></TD>
161 <TD ALIGN="right">Postal invoices</TD>
162 <TD BGCOLOR="#ffffff">
163 <% ( grep { $_ eq 'POST' } @invoicing_list ) ? 'yes' : 'no' %>
167 <TD ALIGN="right">FAX invoices</TD>
168 <TD BGCOLOR="#ffffff">
169 <% ( grep { $_ eq 'FAX' } @invoicing_list ) ? 'yes' : 'no' %>
173 <TD ALIGN="right">Email invoices</TD>
174 <TD BGCOLOR="#ffffff">
175 <% join(', ', grep { $_ !~ /^(POST|FAX)$/ } @invoicing_list ) || 'no' %>
178 % if ( $conf->exists('voip-cust_cdr_spools') ) {
181 <TD ALIGN="right">Spool CDRs</TD>
182 <TD BGCOLOR="#ffffff"><% $cust_main->spool_cdr ? 'yes' : 'no' %></TD>
187 </TABLE></TD></TR></TABLE>