1 <FONT CLASS="fsinnerbox-title"><% mt('Billing information') |h %></FONT>
2 % my $yes = emt('yes');
5 <TABLE CLASS="fsinnerbox">
7 % if ( $cust_main->complimentary ) {
9 <TH ALIGN="right"><% mt('Complimentary') |h %></TH>
14 %( my $balance = $cust_main->balance )
15 % =~ s/^(\-?)(.*)$/<FONT SIZE=+1>$1<\/FONT>$money_char$2/;
18 <TH ALIGN="right"><% mt('Balance due') |h %></TH>
19 <TD><B><% $balance %></B></TD>
22 % if ( $conf->exists('cust_main-select-prorate_day') ) {
24 <TH ALIGN="right"><% mt('Prorate day of month') |h %></TH>
25 <TD><% $cust_main->prorate_day %>
30 % if ( $conf->exists('cust_main-select-billday')
31 % && qsearch({ 'table' => 'cust_payby',
32 % 'hashref' => { 'custnum' => $cust_main->custnum, },
33 % 'extra_sql' => "AND payby IN ( 'CARD', 'CHEK' )",
34 % 'order_by' => 'LIMIT 1',
39 <TH ALIGN="right"><% mt('Payment day of month') |h %></TH>
40 <TD><% $cust_main->billday %>
45 % if ( $cust_main->po_number ) {
47 <TH ALIGN="right"><% mt('Purchase Order #') |h %></TH>
48 <TD><% $cust_main->po_number %></TD>
52 % my @exempt_groups = grep /\S/, $conf->config('tax-cust_exempt-groups');
54 % unless ( $conf->exists('cust_class-tax_exempt')
55 % || $conf->exists('tax-cust_exempt-groups-require_individual_nums')
59 <TH ALIGN="right"><% mt('Tax exempt') |h %><% @exempt_groups ? ' ('.emt('all taxes').')' : '' %></TH>
60 <TD><% $cust_main->tax ? $yes : $no %></TD>
64 % foreach my $exempt_group ( @exempt_groups ) {
65 % my $cust_main_exemption = $cust_main->tax_exemption($exempt_group);
67 <TH ALIGN="right"><% mt('Tax exempt') |h %> (<% $exempt_group %> taxes)</TH>
68 <TD><% $cust_main_exemption ? $yes : $no %>
69 <% $cust_main_exemption ? $cust_main_exemption->exempt_number : '' |h %>
74 % if ( $conf->config('tax_data_vendor') eq 'cch' ) {
76 <TH ALIGN="right"><% mt('Tax location') |h %></TH>
77 % my $tax_location = $conf->exists('tax-ship_address')
78 % ? $cust_main->ship_location
79 % : $cust_main->bill_location;
80 <TD><% $tax_location->geocode('cch') %></TD>
84 <TH ALIGN="right"><% mt('Postal mail invoices') |h %></TH>
86 <% ( grep { $_ eq 'POST' } @invoicing_list )
87 ? $yes. ( $cust_main->invoice_attn
88 ? ', attn: '. $cust_main->invoice_attn
96 <TH ALIGN="right"><% mt('Email invoices') |h %></TH>
98 <% $cust_main->invoice_noemail ? $no : $yes %>
101 % unless ( $conf->exists('cust-email-high-visibility')) {
103 <TH ALIGN="right"><% mt('Email address(es)') |h %></TH>
105 <% join(', ', grep { $_ !~ /^(POST|FAX)$/ } @invoicing_list ) || $no %>
106 % if ( $cust_main->message_noemail ) {
108 <SPAN STYLE="font-size: small"><% emt('(do not send notices)') %></SPAN>
114 <TH ALIGN="right"><% mt('Invoice terms') |h %></TH>
116 <% $cust_main->invoice_terms
117 || emt('Default').' ('. ( $conf->config('invoice_default_terms', $cust_main->agentnum)
118 || emt('Payable upon receipt')
125 <TH ALIGN="right"><% mt('Credit limit') |h %></TH>
127 % my $default_credit_limit = $conf->config('default_credit_limit');
128 <% length($cust_main->credit_limit)
129 ? $money_char. sprintf("%.2f", $cust_main->credit_limit)
130 : $default_credit_limit
131 ? "Default ($money_char". sprintf("%.2f", $default_credit_limit). ")"
134 % if ( $cust_main->num_cust_main_credit_limit ) {
135 <A HREF="<% $p %>search/cust_main_credit_limit.html?custnum=<% $cust_main->custnum %>">(incidents)</A>
140 % if ( $conf->exists('voip-cust_cdr_spools') ) {
142 <TH ALIGN="right"><% mt('Spool CDRs') |h %></TH>
143 <TD><% $cust_main->spool_cdr ? $yes : $no %></TD>
147 % if ( $conf->exists('voip-cust_cdr_squelch') ) {
149 <TH ALIGN="right"><% mt($conf->exists('voip-cdr_email') ? 'Print CDRs' : 'Show CDRs') |h %></TH>
150 <TD><% $cust_main->squelch_cdr ? $no : $yes %></TD>
154 % if ( $conf->exists('voip-cust_accountcode_cdr') ) {
156 <TH ALIGN="right"><% mt('Breakdown CDRs by accountcode') |h %></TH>
157 <TD><% $cust_main->accountcode_cdr ? $yes : $no %></TD>
161 % if ( $conf->exists('voip-cust_email_csv_cdr') ) {
163 <TH ALIGN="right"><% mt('Email CDRs as CSV') |h %></TH>
164 <TD><% $cust_main->email_csv_cdr ? $yes : $no %></TD>
168 % if ( $show_term || $cust_main->cdr_termination_percentage ) {
170 <TH ALIGN="right"><% mt('CDR termination settlement') |h %></TH>
171 <TD><% $cust_main->cdr_termination_percentage %><% $cust_main->cdr_termination_percentage =~ /\d/ ? '%' : '' %></TD>
175 % if ( $cust_main->currency ) {
177 <TH ALIGN="right"><% mt('Invoicing currency') |h %></TH>
178 <TD><% $cust_main->currency. ': '. code2currency($cust_main->currency) %></TD>
182 % if ( $cust_main->locale ) {
183 % my %locale_info = FS::Locales->locale_info($cust_main->locale);
185 <TH ALIGN="right"><% mt('Invoicing locale') |h %></TH>
186 <TD><% $locale_info{name} . " (" . $locale_info{country} .")" %></TD>
194 my( $cust_main ) = @_;
195 my @invoicing_list = $cust_main->invoicing_list;
196 my $conf = new FS::Conf;
197 my $money_char = $conf->config('money_char') || '$';
199 #false laziness w/edit/cust_main/billing.html
200 my $term_sql = "SELECT COUNT(*) FROM cust_pkg LEFT JOIN part_pkg USING ( pkgpart ) WHERE custnum = ? AND plan = 'cdr_termination' LIMIT 1";
201 my $term_sth = dbh->prepare($term_sql) or die dbh->errstr;
202 $term_sth->execute($cust_main->custnum) or die $term_sth->errstr;
203 my $show_term = $term_sth->fetchrow_arrayref->[0];