X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fcust_main.cgi;h=3a29e2579c6693380c88db8694fd573f6373af54;hb=aa0a7b4128ed5cf56684378c9cb6ebc1c3ec8c1a;hp=f331e5321eb7a624e92a439e030f38eb40c4d156;hpb=77def6c1c51fc6f7273b7c23221f13850d6be1dd;p=freeside.git diff --git a/httemplate/edit/cust_main.cgi b/httemplate/edit/cust_main.cgi index f331e5321..3a29e2579 100755 --- a/httemplate/edit/cust_main.cgi +++ b/httemplate/edit/cust_main.cgi @@ -1,5 +1,5 @@ <% -# +# use vars qw( $cgi $custnum $action $cust_main $p1 @agents $agentnum $last $first $ss $company $address1 $address2 $city $zip @@ -22,7 +22,7 @@ use FS::cust_main_county; #for misplaced logic below use FS::part_pkg; - #for false laziness below + #for false laziness below (now more properly lazy) use FS::svc_acct_pop; #for (other) false laziness below @@ -61,7 +61,8 @@ if ( $cgi->param('error') ) { } else { $custnum=''; $cust_main = new FS::cust_main ( {} ); - $cust_main->setfield('otaker',&getotaker); + $cust_main->otaker( &getotaker ); + $cust_main->referral_custnum( $cgi->param('referral_custnum') ); $saved_pkgpart = 0; $username = ''; $password = ''; @@ -73,13 +74,13 @@ $action = $custnum ? 'Edit' : 'Add'; # top $p1 = popurl(1); -print $cgi->header( '-expires' => 'now' ), header("Customer $action", ''); +print header("Customer $action", ''); print qq!Error: !, $error, "" if $error; print qq!
!, qq!!, - qq!Customer # !, ( $custnum ? $custnum : " (NEW)" ), + qq!Customer # !, ( $custnum ? "$custnum" : " (NEW)" ), ; @@ -130,6 +131,22 @@ if ( $custnum && ! $conf->exists('editreferrals') ) { } } +#referring customer + +print qq!

Referring Customer: !; +if ( $cust_main->referral_custnum ) { + my $referring_cust_main = + qsearchs('cust_main', { custnum => $cust_main->referral_custnum } ); + print ''. + $cust_main->referral_custnum. ': '. + ( $referring_cust_main->company + || $referring_cust_main->last. ', '. $referring_cust_main->first ). + ''; +} else { + print '(none)'; +} # contact info @@ -161,11 +178,16 @@ print <${r}City${r}State/Countryinvoicing_list; print qq! CHECKED! - if ! @invoicing_list || grep { $_ eq 'POST' } @invoicing_list; + if ( ! @invoicing_list && ! $conf->exists('disablepostalinvoicedefault') ) + || grep { $_ eq 'POST' } @invoicing_list; print qq!>Postal mail invoice!; $invoicing_list = join(', ', grep { $_ ne 'POST' } @invoicing_list ); print qq!Email invoice !; @@ -391,6 +414,8 @@ unless ( $custnum ) { if ( @part_pkg ) { +# print "

First package", &itable("#cccccc", "0 ALIGN=LEFT"), +#apiabuse & undesirable wrapping print "

First package", &itable("#cccccc"), qq! Password - + (blank to generate) END - print qq!POP"; + + print 'Access number' + . + &FS::svc_acct_pop::popselector($popnum). + '' + ; } } $otaker = $cust_main->otaker; print qq!!, - qq!

!, "", ;