${r}Contact name (last, first) |
-END
-
-print < ,
-
-END
-
-print <SS# | |
-Company | |
-${r}Address | |
- | |
-${r}City | | ${r}State/Country | | ${r}Zip | | !;
-my($daytime,$night,$fax)=(
- $cust_main->daytime,
- $cust_main->night,
- $cust_main->fax,
-);
+ <% include('/elements/tr-select-part_referral.html') %>
+% }
-print <Day Phone | |
-Night Phone | |
-Fax | |
-END
-print "$r required fields ";
+
+%
+%my $referring_cust_main = '';
+%if ( $cust_main->referral_custnum
+% and $referring_cust_main =
+% qsearchs('cust_main', { custnum => $cust_main->referral_custnum } )
+%) {
+%
-# service address
-if ( defined $cust_main->dbdef_table->column('ship_last') ) {
+
+ Referring customer |
+
+ <% $cust_main->referral_custnum %>: <% $referring_cust_main->name %>
+ |
+
+
+% } elsif ( ! $conf->exists('disable_customer_referrals') ) {
- print "\n", <
- function changed(what) {
- what.form.same.checked = false;
- }
- function samechanged(what) {
- if ( what.checked ) {
-END
-print " what.form.ship_$_.value = what.form.$_.value;\n"
- for (qw( last first company address1 address2 city zip daytime night fax ));
-print <
-END
-
- print ' Service address ',
- '(ship_last ) {
- print ' CHECKED';
- foreach (
- qw( last first company address1 address2 city state zip daytime night fax)
- ) {
- $cust_main->set("ship_$_", $cust_main->get($_) );
- }
- }
- print '>same as billing address) ';
-
- my($ship_last,$ship_first,$ship_company,$ship_address1,$ship_address2,$ship_city,$ship_zip)=(
- $cust_main->ship_last,
- $cust_main->ship_first,
- $cust_main->ship_company,
- $cust_main->ship_address1,
- $cust_main->ship_address2,
- $cust_main->ship_city,
- $cust_main->ship_zip,
- );
- print &itable("#cccccc"), <${r}Contact name (last, first) |
-END
-
- print < ,
-
-END
-
- print <
- Company | |
- ${r}Address | |
- | |
- ${r}City | | ${r}State/Country | | ${r}Zip | | !;
+
+ Referring customer |
+
+
+ <% include('/elements/search-cust_main.html',
+ 'field_name' => 'referral_custnum',
+ )
+ %>
+ |
+
+% } else {
- my($ship_daytime,$ship_night,$ship_fax)=(
- $cust_main->ship_daytime,
- $cust_main->ship_night,
- $cust_main->ship_fax,
- );
- print <Day Phone | |
- Night Phone | |
- Fax | |
-END
+
+% }
- print "$r required fields ";
-}
+
-# 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";
+
+
+
+Billing address
+<% include('cust_main/contact.html', $cust_main, '', 'bill_changed(this)', '' ) %>
+
+
+% if ( defined $cust_main->dbdef_table->column('ship_last') ) {
+
+
+
+%
+% 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,
+ 'invoicing_list' => \@invoicing_list,
+ )
+%>
-print "$r required fields for each billing type";
+
+
+
+
+<% include('/elements/footer.html') %>
-%>
| |