${r}Country | $ship_country_html |
- Day Phone | |
- Night Phone | |
+ $daytime_label | |
+ $night_label | |
Fax | |
END
@@ -333,48 +345,102 @@ sub expselect {
$return;
}
-print "
Billing information", &itable("#cccccc"),
- qq!tax eq "Y";
-print qq!>Tax Exempt |
!;
-print qq!invoicing_list;
-print qq! CHECKED!
- if ( ! @invoicing_list && ! $conf->exists('disablepostalinvoicedefault') )
- || grep { $_ eq 'POST' } @invoicing_list;
-print qq!>Postal mail invoice |
!;
-my $invoicing_list = join(', ', grep { $_ ne 'POST' } @invoicing_list );
-print qq!Email invoice |
!;
-
-print "Billing type |
",
- "",
- &table("#cccccc"), "";
-
-my($payinfo, $payname)=(
- $cust_main->payinfo,
- $cust_main->payname,
-);
+my $payby_default = $conf->config('payby-default');
+
+if ( $payby_default eq 'HIDE' ) {
+
+ $cust_main->payby('BILL') unless $cust_main->payby;
+
+ foreach my $field (qw( tax payby )) {
+ print qq!';
+ }
+
+ print qq!';
+
+ foreach my $payby (qw( CARD DCRD CHEK DCHK LECB BILL COMP )) {
+ foreach my $field (qw( payinfo payname )) {
+ print qq!';
+ }
+
+ #false laziness w/expselect
+ my( $m, $y );
+ my $date = $cust_main->paydate || '12-2037';
+ if ( $date =~ /^(\d{4})-(\d{1,2})-\d{1,2}$/ ) { #PostgreSQL date format
+ ( $m, $y ) = ( $2, $1 );
+ } elsif ( $date =~ /^(\d{1,2})-(\d{1,2}-)?(\d{4}$)/ ) {
+ ( $m, $y ) = ( $1, $3 );
+ } else {
+ die "unrecognized expiration date format: $date";
+ }
-my %payby = (
- 'CARD' => qq!Credit card
${r}
${r}Exp !. expselect("CARD"). qq!
${r}Name on card
!,
- 'BILL' => qq!Billing
P.O.
${r}Exp !. expselect("BILL", "12-2037"). qq!
Attention
!,
- 'COMP' => qq!Complimentary
${r}Approved by
${r}Exp !. expselect("COMP"),
+ print qq!!.
+ qq!!;
+
+ }
+
+} else {
+
+ print "
Billing information", &itable("#cccccc"),
+ qq!
tax eq "Y";
+ print qq!>Tax Exempt |
!.
+ qq!invoicing_list;
+ print qq! CHECKED!
+ if ( ! @invoicing_list && ! $conf->exists('disablepostalinvoicedefault') )
+ || grep { $_ eq 'POST' } @invoicing_list;
+ print qq!>Postal mail invoice |
!;
+ my $invoicing_list = join(', ', grep { $_ ne 'POST' } @invoicing_list );
+ print qq!Email invoice |
!;
+
+ print "Billing type |
",
+ "",
+ &table("#cccccc"), "";
+
+ my($payinfo, $payname)=(
+ $cust_main->payinfo,
+ $cust_main->payname,
+ );
+
+ my %payby = (
+ 'CARD' => qq!Credit card (automatic)
${r}
${r}Exp !. expselect("CARD"). qq!
${r}Name on card
!,
+ 'DCRD' => qq!Credit card (on-demand)
${r}
${r}Exp !. expselect("DCRD"). qq!
${r}Name on card
!,
+ 'CHEK' => qq!Electronic check (automatic)
${r}Account number
${r}ABA/Routing code
${r}Bank name !,
+ 'DCHK' => qq!Electronic check (on-demand)
${r}Account number
${r}ABA/Routing code
${r}Bank name !,
+ 'LECB' => qq!Phone bill billing
${r}Phone number !,
+ 'BILL' => qq!Billing
P.O.
Attention
!,
+ 'COMP' => qq!Complimentary
${r}Approved by
${r}Exp !. expselect("COMP"),
);
-my %paybychecked = (
- 'CARD' => qq!Credit card
${r}
${r}Exp !. expselect("CARD", $cust_main->paydate). qq!
${r}Name on card
!,
- 'BILL' => qq!Billing
P.O.
${r}Exp !. expselect("BILL", $cust_main->paydate). qq!
Attention
!,
- 'COMP' => qq!Complimentary
${r}Approved by
${r}Exp !. expselect("COMP", $cust_main->paydate),
+
+ my( $account, $aba ) = split('@', $payinfo);
+
+ my %paybychecked = (
+ 'CARD' => qq!Credit card (automatic)
${r}
${r}Exp !. expselect("CARD", $cust_main->paydate). qq!
${r}Name on card
!,
+ 'DCRD' => qq!Credit card (on-demand)
${r}
${r}Exp !. expselect("DCRD", $cust_main->paydate). qq!
${r}Name on card
!,
+ 'CHEK' => qq!Electronic check (automatic)
${r}Account number
${r}ABA/Routing code
${r}Bank name !,
+ 'DCHK' => qq!Electronic check (on-demand)
${r}Account number
${r}ABA/Routing code
${r}Bank name !,
+ 'LECB' => qq!Phone bill billing
${r}Phone number !,
+ 'BILL' => qq!Billing
P.O.
Attention
!,
+ 'COMP' => qq!Complimentary
${r}Approved by
${r}Exp !. expselect("COMP", $cust_main->paydate),
);
-for (qw(CARD BILL COMP)) {
- print qq!payby eq "$_") {
- print qq! CHECKED> $paybychecked{$_} | !;
- } else {
- print qq!> $payby{$_}!;
+
+ $cust_main->payby($payby_default) unless $cust_main->payby;
+ for (qw(CARD DCRD CHEK DCHK LECB BILL COMP)) {
+ print qq!payby eq "$_") {
+ print qq! CHECKED> $paybychecked{$_} | !;
+ } else {
+ print qq!> $payby{$_}!;
+ }
}
-}
-print "
$r required fields for each billing type";
+ print "$r required fields for each billing type";
+
+}
if ( defined $cust_main->dbdef_table->column('comments') ) {
print "
Comments", &itable("#cccccc"),
@@ -419,7 +485,7 @@ unless ( $custnum ) {
foreach my $part_pkg ( @part_pkg ) {
print qq!