X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=httemplate%2Fedit%2Fcust_main%2Fbilling.html;h=aeb67b662bfe0f994f8771983de9e563e6fdad4c;hb=cb0b8c862de7c7ab68b172faa29167f47894627b;hp=17b1b0cc91fd12b1fcc03c7ad8d878c0e9b3e8fa;hpb=6b303b560caf53f3aed83602faf9d03602fe64b2;p=freeside.git
diff --git a/httemplate/edit/cust_main/billing.html b/httemplate/edit/cust_main/billing.html
index 17b1b0cc9..aeb67b662 100644
--- a/httemplate/edit/cust_main/billing.html
+++ b/httemplate/edit/cust_main/billing.html
@@ -1,66 +1,45 @@
-<%
+%if ( $payby_default eq 'HIDE' ) {
+%
+% $cust_main->payby('BILL') unless $cust_main->payby;
+% my $payby = $cust_main->payby;
-my( $cust_main ) = @_;
-my $conf = new FS::Conf;
-my $payby_default = $conf->config('payby-default');
-
-if ( $payby_default eq 'HIDE' ) {
-
- $cust_main->payby('BILL') unless $cust_main->payby;
-
-%>
-
-
-
-
-
-
+
-
+
-<% } else {
+
- my @invoicing_list = $cust_main->invoicing_list;
+% } else {
+%
+% my $r = qq!* !;
- my $r = qq!* !;
-
-%>
-
-
Billing information
- <%= &ntable("#cccccc") %>
+
Billing information
+ <% &ntable("#cccccc") %>
- <%=$r%>Billing type |
+ <%$r%>Billing type |
-
-
-
-
-
- <%
-
- 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' =>
-
- '',
-
- );
-
- tie my %options, 'Tie::IxHash',
- 'CARD' => 'Credit card',
- 'CHEK' => 'Electronic check',
- 'LECB' => 'Phone bill billing',
- 'BILL' => 'Billing',
- 'COMP' => 'Complimentary',
- ;
- 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} || 'CARD',
- 'layer_callback' => sub { my $layer = shift; $payby{$layer}; },
- );
-
- %>
-
- <%= $widget->html %>
-
-
+ <% $r %> required fields
+% }
+
+<%once>
+
+my $paystate_label = FS::Msgcat::_gettext('paystate');
+$paystate_label = 'Bank state' if $paystate_label =~/^paystate$/;
- <%= $r %> required fields
+%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>
|