X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fcust_main.cgi;h=d8edbcd8ea995ad75023249b307c53748db6ed9b;hb=030bef17868168b05a67d9f5866b55da1bb9439c;hp=a76cd36d167eea2d4a6a9c93bfb76e55787ce91c;hpb=b97ccb2b958567490841cfc93d2c4a401d98cdb0;p=freeside.git diff --git a/httemplate/edit/cust_main.cgi b/httemplate/edit/cust_main.cgi index a76cd36d1..d8edbcd8e 100755 --- a/httemplate/edit/cust_main.cgi +++ b/httemplate/edit/cust_main.cgi @@ -17,6 +17,7 @@ my $conf = new FS::Conf; my $error = ''; my($custnum, $username, $password, $popnum, $cust_main, $saved_pkgpart); +my(@invoicing_list); if ( $cgi->param('error') ) { $error = $cgi->param('error'); $cust_main = new FS::cust_main ( { @@ -32,6 +33,7 @@ if ( $cgi->param('error') ) { $username = $cgi->param('username'); $password = $cgi->param('_password'); $popnum = $cgi->param('popnum'); + @invoicing_list = split( /\s*,\s*/, $cgi->param('invoicing_list') ); } elsif ( $cgi->keywords ) { #editing my( $query ) = $cgi->keywords; $query =~ /^(\d+)$/; @@ -41,6 +43,7 @@ if ( $cgi->param('error') ) { $username = ''; $password = ''; $popnum = 0; + @invoicing_list = $cust_main->invoicing_list; } else { $custnum=''; $cust_main = new FS::cust_main ( {} ); @@ -50,6 +53,7 @@ if ( $cgi->param('error') ) { $username = ''; $password = ''; $popnum = 0; + @invoicing_list = (); } $cgi->delete_all(); my $action = $custnum ? 'Edit' : 'Add'; @@ -195,10 +199,13 @@ my($daytime,$night,$fax)=( $cust_main->fax, ); +my $daytime_label = FS::Msgcat::_gettext('daytime') || 'Day Phone'; +my $night_label = FS::Msgcat::_gettext('night') || 'Night Phone'; + print <${r}Country$country_html -Day Phone -Night Phone +$daytime_label +$night_label Fax END @@ -294,8 +301,8 @@ END print <${r}Country$ship_country_html - Day Phone - Night Phone + $daytime_label + $night_label Fax END @@ -350,27 +357,25 @@ if ( $payby_default eq 'HIDE' ) { print qq!'; - foreach my $payby (qw( CARD BILL COMP )) { + 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 ) = (0, 0); - if ( scalar(@_) ) { - my $date = shift || '01-2000'; - 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( $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"; } - print qq!!. + qq!!; } @@ -382,7 +387,7 @@ if ( $payby_default eq 'HIDE' ) { print qq!>Tax Exempt!. qq!invoicing_list; + #my @invoicing_list = $cust_main->invoicing_list; print qq! CHECKED! if ( ! @invoicing_list && ! $conf->exists('disablepostalinvoicedefault') ) || grep { $_ eq 'POST' } @invoicing_list; @@ -400,19 +405,29 @@ if ( $payby_default eq 'HIDE' ) { ); 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
!, + '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( $account, $aba ) = split('@', $payinfo); + 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
!, + '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), ); $cust_main->payby($payby_default) unless $cust_main->payby; - for (qw(CARD BILL COMP)) { + for (qw(CARD DCRD CHEK DCHK LECB BILL COMP)) { print qq!payby eq "$_") { print qq! CHECKED> $paybychecked{$_}!;