X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=httemplate%2Fedit%2Fcust_main%2Fbilling.html;h=a1927fa6e0dbf04acc5ff064c951dd9ee7f6f65c;hb=fdc247b504359ca9e74f63daa771f49393fd70ed;hp=a9b3c1f757d596d9442b2aca59c6cf589dcf1584;hpb=88c42d0423368bf52d593021f704bfa38845ff71;p=freeside.git
diff --git a/httemplate/edit/cust_main/billing.html b/httemplate/edit/cust_main/billing.html
index a9b3c1f75..a1927fa6e 100644
--- a/httemplate/edit/cust_main/billing.html
+++ b/httemplate/edit/cust_main/billing.html
@@ -1,70 +1,44 @@
-<%
+%if ( $payby_default eq 'HIDE' ) {
+% $cust_main->payby('BILL') unless $cust_main->payby;
+% my $payby = $cust_main->payby;
-my( $cust_main, %options ) = @_;
-my @invoicing_list = @{ $options{'invoicing_list'} };
-my $conf = new FS::Conf;
-my $payby_default = $conf->config('payby-default');
-
-my @payby = grep /\w/, $conf->config('payby');
-#@payby = (qw( CARD DCRD CHEK DCHK LECB BILL CASH WEST COMP ))
-@payby = (qw( CARD DCRD CHEK DCHK LECB BILL CASH COMP ))
- unless @payby;
-
-if ( $payby_default eq 'HIDE' ) {
-
- $cust_main->payby('BILL') unless $cust_main->payby;
-
-%>
-
-
-
-
-
-
+
+
-
-
-<% } else {
-
- my $r = qq!* !;
-
-%>
-
-
Billing information
- <%= &ntable("#cccccc") %>
+
<% mt('Billing information') |h %>
+ <% &ntable("#cccccc") %>
- <%=$r%>Billing type |
+ <%$r%><% mt('Billing type') |h %> |
+ function init_payauto_changed(){
+ var f = document.getElementById('CARD_payauto');
+ if(f != null) payauto_changed(f);
+ f = document.getElementById('CHEK_payauto');
+ if(f != null) payauto_changed(f);
+ }
-
-
-
-
- <%
-
- my($payby, $payinfo, $payname)=(
- $cust_main->payby,
- $cust_main->payinfo,
- $cust_main->payname,
- );
- my( $account, $aba ) = split('@', $payinfo);
-
- my $disabled = 'DISABLED style="background-color: #dddddd"';
- my $text_disabled = 'style="color: #999999"';
- if ( $payby =~ /^(CARD|DCRD)$/ && cardtype($payinfo) =~ /^(Switch|Solo)$/ ) {
- $disabled = 'style="background-color: #ffffff"';
- $text_disabled = 'style="color: #000000";'
- }
-
- my %payby = (
-
- 'CARD' =>
-
- '',
-
- 'CHEK' =>
-
- '',
-
- 'LECB' =>
-
- '',
-
- 'BILL' =>
-
- '',
-
- 'COMP' =>
-
- '',
-
- 'CASH' =>
-
- '',
-
- 'WEST' =>
-
- '',
-
- 'MCRD' =>
-
- '',
-
- );
-
-
- my %allopt = (
- 'CARD' => 'Credit card',
- 'CHEK' => 'Electronic check',
- 'LECB' => 'Phone bill billing',
- 'BILL' => 'Billing',
- 'CASH' => 'Cash', # initial payment, then billing',
- 'WEST' => 'Western Union', # initial payment, then billing',
- 'MCRD' => 'Manual credit card', # initial payment, then billing',
- 'COMP' => 'Complimentary',
- );
- if ( $cust_main->custnum ) { #don't offer CASH/WEST/MCRD initial payment types
- # when editing customer
- delete $allopt{$_} for qw(CASH WEST MCRD);
- }
-
- tie my %options, 'Tie::IxHash',
- map { $_ => $allopt{$_} }
- grep { exists $allopt{$_} }
- @payby;
-
- my %payby2option = (
- ( map { $_ => $_ } keys %options ),
- 'DCRD' => 'CARD',
- 'DCHK' => 'CHEK',
- );
-
- my $widget = new HTML::Widgets::SelectLayers(
- 'options' => \%options,
- #'form_name' => 'dummy',
- #'form_action' => 'nothingyet',
- #chops bottom of page in IE# 'under_position' => 'absolute',
- 'html_between' => '
',
- 'selected_layer' => $payby2option{$payby || $payby_default || $payby[0] },
- 'layer_callback' => sub { my $layer = shift; $payby{$layer}; },
- );
-
- %>
-
- <%= $widget->html %>
-
-
+ <% $r %> <% mt('required fields') |h %>
+% }
+
+<%once>
- <%= $r %> required fields
+my $paystate_label = FS::Msgcat::_gettext('paystate');
+$paystate_label = 'Bank state' if $paystate_label =~/^paystate$/;
+
+%once>
+<%init>
+
+my( $cust_main, %options ) = @_;
+my @invoicing_list = @{ $options{'invoicing_list'} };
+my $payinfo = $options{'payinfo'};
+my $conf = new FS::Conf;
+my $payby_default = $conf->config('payby-default');
+
+my @payby = grep /\w/, $conf->config('payby');
+#@payby = (qw( CARD DCRD CHEK DCHK LECB BILL CASH WEST COMP ))
+@payby = (qw( CARD DCRD CHEK DCHK LECB BILL CASH COMP ))
+ unless @payby;
-<% } %>
+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];
+}
+%init>
|