${r}Contact name (last, first) |
-END
-
- print < ,
-
-END
-
- print <
- Company | |
- ${r}Address | |
- | |
- ${r}City | | ${r}State |
-END
-
- #false laziness with regular state
- $cust_main->ship_country( $countrydefault ) unless $cust_main->ship_country;
-
- $cust_main->ship_state( $conf->config('statedefault') || 'CA' )
- unless $cust_main->ship_state || $cust_main->ship_country ne 'US';
-
- my($ship_county_html, $ship_state_html, $ship_country_html) =
- FS::cust_main_county::regionselector( $cust_main->ship_county,
- $cust_main->ship_state,
- $cust_main->ship_country,
- 'ship_',
- 'changed(this)', );
-
- print "$ship_county_html $ship_state_html";
-
- print qq! | ${r}Zip | | !;
-
- my($ship_daytime,$ship_night,$ship_fax)=(
- $cust_main->ship_daytime,
- $cust_main->ship_night,
- $cust_main->ship_fax,
- );
-
- print <${r}Country | $ship_country_html |
- Day Phone | |
- Night Phone | |
- Fax | |
-END
-
- print "${r}required fields ";
+ @invoicing_list = $cust_main->invoicing_list;
+ $ss = $conf->exists('unmask_ss') ? $cust_main->ss : $cust_main->masked('ss');
+ $stateid = $cust_main->masked('stateid');
+ $payinfo = $cust_main->paymask;
-}
+} else { #new customer
-# billing info
-
-sub expselect {
- my $prefix = shift;
- 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";
- }
- }
+ die "access denied"
+ unless $curuser->access_right('New customer');
- my $return = qq!/";
-
- $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 = (
- '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"),
-);
-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),
-);
-for (qw(CARD BILL COMP)) {
- print qq!payby eq "$_") {
- print qq! CHECKED> $paybychecked{$_} | !;
- } else {
- print qq!> $payby{$_}!;
+ if ( $cgi->param('lock_pkgpart') =~ /^(\d+)$/ ) {
+ my $pkgpart = $1;
+ my $part_pkg = qsearchs('part_pkg', { 'pkgpart' => $pkgpart } )
+ or die "unknown pkgpart $pkgpart";
+ my $svcpart = $part_pkg->svcpart;
+ $pkgpart_svcpart = $pkgpart.'_'.$svcpart;
}
-}
-
-print " $r required fields for each billing type";
-if ( defined $cust_main->dbdef_table->column('comments') ) {
- print "
Comments", &itable("#cccccc"),
- qq!",
- " | ";
}
-unless ( $custnum ) {
- # pry the wrong place for this logic. also pretty expensive
- #use FS::part_pkg;
-
- #false laziness, copied from FS::cust_pkg::order
- my $pkgpart;
- if ( scalar(@agents) == 1 ) {
- # $pkgpart->{PKGPART} is true iff $custnum may purchase PKGPART
- my($agent)=qsearchs('agent',{'agentnum'=> $agentnum });
- $pkgpart = $agent->pkgpart_hashref;
- } else {
- #can't know (agent not chosen), so, allow all
- my %typenum;
- foreach my $agent ( @agents ) {
- next if $typenum{$agent->typenum}++;
- #fixed in 5.004_05 #$pkgpart->{$_}++ foreach keys %{ $agent->pkgpart_hashref }
- foreach ( keys %{ $agent->pkgpart_hashref } ) { $pkgpart->{$_}++; } #5.004_04 workaround
- }
- }
- #eslaf
-
- my @part_pkg = grep { $_->svcpart('svc_acct') && $pkgpart->{ $_->pkgpart } }
- qsearch( 'part_pkg', { 'disabled' => '' } );
-
- if ( @part_pkg ) {
-
-# print "
First package", &itable("#cccccc", "0 ALIGN=LEFT"),
-#apiabuse & undesirable wrapping
- print "
First package", &itable("#cccccc"),
- qq! | ";
-
- #false laziness: (mostly) copied from edit/svc_acct.cgi
- #$ulen = $svc_acct->dbdef_table->column('username')->length;
- my $ulen = dbdef->table('svc_acct')->column('username')->length;
- my $ulen2 = $ulen+2;
- my $passwordmax = $conf->config('passwordmax') || 8;
- my $pmax2 = $passwordmax + 2;
- print <Username |
- |
-Password |
-
-(blank to generate) |
-END
-
- print 'Access number | '
- .
- &FS::svc_acct_pop::popselector($popnum).
- ' | '
- ;
- }
-}
-
-my $otaker = $cust_main->otaker;
-print qq!!,
- qq! !,
- " |