${r}Contact name (last, first) |
-END
+% if ( $conf->exists('cust_main-enable_birthdate') ) {
- print < ,
-
-END
+
+ <% ntable("#cccccc", 2) %>
+ <% include ('/elements/tr-input-date-field.html',
+ 'birthdate',
+ $cust_main->birthdate,
+ 'Date of Birth',
+ $conf->config('date_format') || "%m/%d/%Y",
+ 1)
+ %>
- 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)', );
+
+Billing address
+<% include('cust_main/contact.html', $cust_main, '', 'bill_changed(this)', '' ) %>
- print "$ship_county_html $ship_state_html";
+
+% if ( defined $cust_main->dbdef_table->column('ship_last') ) {
- print qq! | ${r}Zip | | !;
- my($ship_daytime,$ship_night,$ship_fax)=(
- $cust_main->ship_daytime,
- $cust_main->ship_night,
- $cust_main->ship_fax,
- );
+
+%
+% my $checked = '';
+% my $disabled = '';
+% my $disabledselect = '';
+% unless ( $cust_main->ship_last && $same ne 'Y' ) {
+% $checked = 'CHECKED';
+% $disabled = 'DISABLED STYLE="background-color: #dddddd"';
+% foreach (
+% qw( last first company address1 address2 city county state zip country
+% daytime night fax )
+% ) {
+% $cust_main->set("ship_$_", $cust_main->get($_) );
+% }
+% }
+%
+
+
+
+Service address
+(>same as billing address)
+<% include('cust_main/contact.html', $cust_main, 'ship_', '', $disabled ) %>
+% }
+
+
+
+
+<% include( 'cust_main/billing.html', $cust_main,
+ 'payinfo' => $payinfo,
+ 'invoicing_list' => \@invoicing_list,
+ )
+%>
- print qq!';
-
- foreach my $payby (qw( CARD DCRD CHEK DCHK LECB BILL COMP )) {
- foreach my $field (qw( payinfo payname )) {
- print qq!';
- }
+',
- &table("#cccccc"), "";
-
- my($payinfo, $payname)=(
- $cust_main->payinfo,
- $cust_main->payname,
- );
+ 'same',
- 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"),
-);
-
- if ( $cust_main->dbdef_table->column('paycvv') ) {
- foreach my $payby ( grep { exists $payby{$_} } qw(CARD DCRD) ) { #1.4/1.5 bs
- $payby{$payby} .= qq! CVV2 (help) !;
- }
- }
+ 'ship_last', 'ship_first', 'ship_company',
+ 'ship_address1', 'ship_address2', 'ship_city',
+ 'ship_county', 'ship_state', 'ship_zip', 'ship_country',
+ 'ship_daytime','ship_night', 'ship_fax',
- my( $account, $aba ) = split('@', $payinfo);
+ 'select' // XXX key
+ );
- 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),
-);
+ var layervars = new Array(
+ 'payauto',
+ 'payinfo', 'payinfo1', 'payinfo2',
+ 'payname', 'exp_month', 'exp_year', 'paycvv',
+ 'paystart_month', 'paystart_year', 'payissue',
+ 'payip',
+ 'paid'
+ );
- if ( $cust_main->dbdef_table->column('paycvv') ) {
- my $paycvv = $cust_main->paycvv;
+ var billing_bottomvars = new Array(
+ 'tax',
+ 'invoicing_list', 'invoicing_list_POST', 'invoicing_list_FAX',
+ 'spool_cdr'
+ );
- foreach my $payby ( grep { exists $payby{$_} } qw(CARD DCRD) ) { #1.4/1.5 bs
- $paybychecked{$payby} .= qq! CVV2 (help) !;
- }
+ for ( f=0; f < topvars.length; f++ ) {
+ var field = topvars[f];
+ copyelement( document.topform.elements[field],
+ document.bottomform.elements[field]
+ );
}
-
- $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{$_}!;
- }
+ var layerform = document.topform.select.options[document.topform.select.selectedIndex].value;
+ for ( f=0; f < layervars.length; f++ ) {
+ var field = layervars[f];
+ copyelement( document.forms[layerform].elements[field],
+ document.bottomform.elements[field]
+ );
}
- print " $r required fields for each billing type";
-
-}
+ for ( f=0; f < billing_bottomvars.length; f++ ) {
+ var field = billing_bottomvars[f];
+ copyelement( document.billing_bottomform.elements[field],
+ document.bottomform.elements[field]
+ );
+ }
-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
+function copyelement(from, to) {
+ if ( from == undefined ) {
+ to.value = '';
+ } else if ( from.type == 'select-one' ) {
+ to.value = from.options[from.selectedIndex].value;
+ //alert(from + " (" + from.type + "): " + to.name + " => (" + from.selectedIndex + ") " + to.value);
+ } else if ( from.type == 'checkbox' ) {
+ if ( from.checked ) {
+ to.value = from.value;
+ } else {
+ to.value = '';
}
- }
- #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).
- ' | '
- ;
}
+ //alert(from + " (" + from.type + "): " + to.name + " => " + to.value);
}
-my $otaker = $cust_main->otaker;
-print qq!!,
- qq! !,
- " |