${r}!.emt('Expiration').qq! !.
% ''.
%
% include('/elements/select-month_year.html',
@@ -280,7 +365,7 @@
%
% ''.
%
-% qq!${r}Amount !.
+% qq!${r}!.emt('Amount').qq! !.
% qq! !.
%
% ' '.
@@ -296,7 +381,7 @@
%
% ''.
%
-% qq!${r}Amount !.
+% qq!${r}!.emt('Amount').qq! !.
% qq! !.
%
% ' '.
@@ -312,7 +397,7 @@
%
% '',
'layer_callback' => sub { my $layer = shift; $payby{$layer}; },
- )
- %>
+ 'onchange' => 'init_payauto_changed();',
+ &>
<% &ntable("#cccccc") %>
@@ -361,14 +446,28 @@
% my @exempt_groups = grep /\S/, $conf->config('tax-cust_exempt-groups');
-
- tax eq "Y" ? 'CHECKED' : '' %>> Tax Exempt<% @exempt_groups ? ' (all taxes)' : '' %>
-
+% if ( $conf->exists('cust_class-tax_exempt')
+% || $conf->exists('tax-cust_exempt-groups-require_individual_nums')
+% )
+% {
+
+
+
+% } else {
+
+
+ tax eq "Y" ? 'CHECKED' : '' %>> Tax Exempt<% @exempt_groups ? ' (all taxes)' : '' %>
+
+
+% }
% foreach my $exempt_group ( @exempt_groups ) {
-% #escape $exempt_group for NAME
+% my $cust_main_exemption = $cust_main->tax_exemption($exempt_group);
+% #escape $exempt_group for NAME etc.
+% my $checked = ($cust_main_exemption || $cgi->param("tax_$exempt_group"));
- tax_exemption($exempt_group) ? 'CHECKED' : '' %>> Tax Exempt (<% $exempt_group %> taxes)
+ onChange="tax_changed(this)"> Tax Exempt (<% $exempt_group %> taxes)
+ - Exemption number exempt_number : '' ) |h %>" <% $checked ? '' : 'DISABLED' %>>
% }
@@ -382,7 +481,7 @@
? 'CHECKED'
: ''
- %>> Postal mail invoice
+ %>> <% mt('Postal mail invoices') |h %>
@@ -394,7 +493,7 @@
? 'CHECKED'
: ''
- %>> Fax invoice
+ %>> <% mt('Fax invoices') |h %>
@@ -402,29 +501,63 @@
% }
+ invoice_noemail eq 'Y' )
+ ? ''
+ : 'CHECKED'
+
+ %>> <% mt('Email invoices') |h %>
+
+
+
+
+% unless ( $conf->exists('cust-email-high-visibility')) {
+
- <% $conf->exists('cust_main-require_invoicing_list_email') ? $r : '' %>Email address(es)
+ <% $conf->exists('cust_main-require_invoicing_list_email', $agentnum)
+ ? $r : '' %>Email address(es)
+% }
+
+% if ( $conf->exists('cust_main-select-prorate_day') ) {
+
+ <% mt('Prorate day (1-28)') |h %>
+
+
+
+
+% } else {
+
+% }
+
+
+ <% mt('Invoice terms') |h %>
+
+ <& /elements/select-terms.html,
+ 'curr_value' => $cust_main->invoice_terms,
+ &>
+
+
- Invoice terms
+ <% mt('Credit limit') |h %>
-
- Default (<% $conf->config('invoice_default_terms') || 'Payable upon receipt' %>)
-% foreach my $term ( 'Payable upon receipt',
-% ( map "Net $_", 0, 10, 15, 20, 30, 45, 60 ),
-% ) {
- invoice_terms eq $term ? ' SELECTED' : '' %>><% $term %>
-% }
-
+
+ credit_limit) %><% length($cust_main->credit_limit) ? '' : ' DISABLED' %>>
+ credit_limit) ? '' : ' CHECKED'%>> <% mt('Unlimited') |h %>
% if ( $conf->exists('voip-cust_cdr_spools') ) {
- spool_cdr eq "Y" ? 'CHECKED' : '' %>> Spool CDRs
+ spool_cdr eq "Y" ? 'CHECKED' : '' %>> <% mt('Spool CDRs') |h %>
% } else {
@@ -432,16 +565,36 @@
% if ( $conf->exists('voip-cust_cdr_squelch') ) {
- squelch_cdr eq "Y" ? 'CHECKED' : '' %>> Omit CDRs from invoices
+ squelch_cdr eq "Y" ? 'CHECKED' : '' %>> <% mt($conf->exists('voip-cdr_email') ? 'Omit CDRs from printed invoices' : 'Omit CDRs from invoices') |h %>
% } else {
% }
+% if ( $conf->exists('voip-cust_email_csv_cdr') ) {
+
+ email_csv_cdr eq "Y" ? 'CHECKED' : '' %>> <% mt('Attach CDRs as CSV to emailed invoices') |h %>
+
+% } else {
+
+% }
+
+% if ( $conf->exists('voip-cust_accountcode_cdr') ) {
+
+
+ accountcode_cdr eq "Y" ? 'CHECKED' : '' %>
+ > <% mt('Breakdown CDRs by accountcode') |h %>
+
+% } else {
+
+% }
% if ( $show_term || $cust_main->cdr_termination_percentage ) {
- CDR termination settlement
+ <% mt('CDR termination settlement') |h %>
% }
+%my @available_locales = $conf->config('available-locales');
+%if ( scalar(@available_locales) ) {
+% push @available_locales, ''
+% unless $cust_main->locale && $conf->exists('cust_main-require_locale');
+% my %locale_labels = map {
+% my %ll;
+% my %info = FS::Locales->locale_info($_);
+% $ll{$_} = $info{name} . " (" . $info{country} . ")";
+% %ll;
+% } FS::Locales->locales;
+%
+% my $label = ( $conf->exists('cust_main-require_locale') ? $r : '' ).
+% emt('Invoicing locale');
+
+ <& /elements/tr-select.html,
+ 'label' => $label,
+ 'field' => 'locale',
+ 'options' => \@available_locales,
+ 'labels' => \%locale_labels,
+ 'curr_value' => $cust_main->locale,
+ &>
+% }
+
- <% $r %> required fields
+ <% $r %><% mt('required fields') |h %>
% }
+
+
<%once>
my $paystate_label = FS::Msgcat::_gettext('paystate');
@@ -477,10 +657,15 @@ my @payby = grep /\w/, $conf->config('payby');
@payby = (qw( CARD DCRD CHEK DCHK LECB BILL CASH COMP ))
unless @payby;
-#false laziness w/view/cust_main/billing.html
-my $term_sql = "SELECT COUNT(*) FROM cust_pkg LEFT JOIN part_pkg USING ( pkgpart ) WHERE custnum = ? AND plan = 'cdr_termination' LIMIT 1";
-my $term_sth = dbh->prepare($term_sql) or die dbh->errstr;
-$term_sth->execute($cust_main->custnum) or die $term_sth->errstr;
-my $show_term = $term_sth->fetchrow_arrayref->[0];
+my $show_term = '';
+if ( $cust_main->custnum ) {
+ #false laziness w/view/cust_main/billing.html
+ my $term_sql = "SELECT COUNT(*) FROM cust_pkg LEFT JOIN part_pkg USING ( pkgpart ) WHERE custnum = ? AND plan = 'cdr_termination' LIMIT 1";
+ my $term_sth = dbh->prepare($term_sql) or die dbh->errstr;
+ $term_sth->execute($cust_main->custnum) or die $term_sth->errstr;
+ $show_term = $term_sth->fetchrow_arrayref->[0];
+}
+
+my $agentnum = $cust_main->agentnum if $cust_main->custnum;
%init>