X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fcust_main.cgi;h=e10c85f01862ee2cd77b471c151d31afadeff904;hb=cccd0b7cd38a88c131e19981be38434f87abe194;hp=a8f202fbb937504b13b46b02daccd4d95f037442;hpb=f1da1afefb2501e1514d267612fafa87f0ac8108;p=freeside.git diff --git a/httemplate/edit/cust_main.cgi b/httemplate/edit/cust_main.cgi index a8f202fbb..e10c85f01 100755 --- a/httemplate/edit/cust_main.cgi +++ b/httemplate/edit/cust_main.cgi @@ -35,6 +35,7 @@ if ( $cgi->param('error') ) { $popnum = $cgi->param('popnum'); @invoicing_list = split( /\s*,\s*/, $cgi->param('invoicing_list') ); $same = $cgi->param('same'); + $cust_main->setfield('paid' => $cgi->param('paid')) if $cgi->param('paid'); } elsif ( $cgi->keywords ) { #editing my( $query ) = $cgi->keywords; $query =~ /^(\d+)$/; @@ -104,59 +105,65 @@ my $agentnum = $cust_main->agentnum || $agents[0]->agentnum; #default to first <% } %> + + <% +my $refnum = $cust_main->refnum || $conf->config('referraldefault') || 0; +if ( $custnum && ! $conf->exists('editreferrals') ) { +%> -# (referral and referring customer still need to be "template"ized) + -#referral +<% + } else { -my $refnum = $cust_main->refnum || $conf->config('referraldefault') || 0; -if ( $custnum && ! $conf->exists('editreferrals') ) { - print qq!!; -} else { - my(@referrals) = qsearch('part_referral',{}); - if ( scalar(@referrals) == 0 ) { - eidiot "You have not created any advertising sources. You must create at least one advertising source before adding a customer. Go to ". popurl(2). "browse/part_referral.cgi and create one or more advertising sources."; - } elsif ( scalar(@referrals) == 1 ) { - $refnum ||= $referrals[0]->refnum; - print qq!!; - } else { - print qq!

${r}Advertising source "; - } -} + my(@referrals) = qsearch('part_referral',{}); + if ( scalar(@referrals) == 0 ) { + eidiot "You have not created any advertising sources. You must create at least one advertising source before adding a customer. Go to ". popurl(2). "browse/part_referral.cgi and create one or more advertising sources."; + } elsif ( scalar(@referrals) == 1 ) { + $refnum ||= $referrals[0]->refnum; +%> + + + +<% } else { %> + +

<%=$r%>Advertising source + +<% } %> -#referring customer +<% } %> + + -#print qq!

Referring Customer: !; +<% my $referring_cust_main = ''; if ( $cust_main->referral_custnum and $referring_cust_main = qsearchs('cust_main', { custnum => $cust_main->referral_custnum } ) ) { - print '

Referring Customer: '. - $cust_main->referral_custnum. ': '. - ( $referring_cust_main->company - || $referring_cust_main->last. ', '. $referring_cust_main->first ). - ''; -} elsif ( ! $conf->exists('disable_customer_referrals') ) { - print '

Referring customer number: '; -} else { - print ''; -} - %> +

Referring Customer: + <%= $cust_main->referral_custnum %>: <%= $referring_cust_main->name %> + + +<% } elsif ( ! $conf->exists('disable_customer_referrals') ) { %> + +

Referring customer number: + + +<% } else { %> + + + +<% } %> +

@@ -173,11 +180,17 @@ function bill_changed(what) { <% for (qw( last first company address1 address2 city zip daytime night fax )) { %> what.form.ship_<%=$_%>.value = what.form.<%=$_%>.value; <% } %> + what.form.ship_country.selectedIndex = what.form.country.selectedIndex; - ship_country_changed(what.form.ship_country); - what.form.ship_state.selectedIndex = what.form.state.selectedIndex; - ship_state_changed(what.form.ship_state); - what.form.ship_county.selectedIndex = what.form.county.selectedIndex; + function fix_ship_state() { + what.form.ship_state.selectedIndex = what.form.state.selectedIndex; + } + ship_country_changed(what.form.ship_country, fix_ship_state ); + + function fix_ship_county() { + what.form.ship_county.selectedIndex = what.form.county.selectedIndex; + } + ship_state_changed(what.form.ship_state, fix_ship_county ); } } function samechanged(what) { @@ -249,7 +262,8 @@ function bottomfixup(what) { 'payinfo', 'payinfo1', 'payinfo2', 'payname', 'exp_month', 'exp_year', 'paycvv', 'paystart_month', 'paystart_year', 'payissue', - 'payip' + 'payip', + 'paid' ); var billing_bottomvars = new Array( @@ -300,7 +314,7 @@ function copyelement(from, to) { to.value = from.value; } } - //alert(from + ": " + to.name + " => " + to.value); + //alert(from + " (" + from.type + "): " + to.name + " => " + to.value); } @@ -328,6 +342,7 @@ function copyelement(from, to) { 'payname', 'exp_month', 'exp_year', 'paycvv', 'paystart_month', 'paystart_year', 'payissue', 'payip', + 'paid', 'tax', 'invoicing_list', 'invoicing_list_POST', 'invoicing_list_FAX'