X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main.cgi;h=4d27765d0125776d8e9a56a2614b6ae2922fe79d;hp=9595a07e1e720134bbcb6249bf6fa12565c402d8;hb=b3e85cf7a5a514f185c7d9c5ba50550c759c9ab5;hpb=1fd6d8cf5d7854860ef4fd10ed89828e0c04ec39
diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi
index 9595a07e1..4d27765d0 100755
--- a/httemplate/view/cust_main.cgi
+++ b/httemplate/view/cust_main.cgi
@@ -1,12 +1,29 @@
-
+
<%
my $conf = new FS::Conf;
+my %uiview = ();
+my %uiadd = ();
+foreach my $part_svc ( qsearch('part_svc',{}) ) {
+ $uiview{$part_svc->svcpart} = popurl(2). "view/". $part_svc->svcdb . ".cgi";
+ $uiadd{$part_svc->svcpart}= popurl(2). "edit/". $part_svc->svcdb . ".cgi";
+}
+
print header("Customer View", menubar(
'Main Menu' => popurl(2)
));
+%>
+
+
+
+<%
+
die "No customer specified (bad URL)!" unless $cgi->keywords;
my($query) = $cgi->keywords; # needs parens with my, ->keywords returns array
$query =~ /^(\d+)$/;
@@ -14,10 +31,25 @@ my $custnum = $1;
my $cust_main = qsearchs('cust_main',{'custnum'=>$custnum});
die "Customer not found!" unless $cust_main;
-print qq!Edit this customer!;
-print qq! | Delete this customer!
+print qq!Edit this customer!;
+
+%>
+
+
+
+<%
+
+print qq! | !.
+ 'Cancel this customer'
+ if $cust_main->ncancelled_pkgs;
+
+print qq! | !.
+ 'Delete this customer'
if $conf->exists('deletecustomers');
unless ( $conf->exists('disable_customer_referrals') ) {
@@ -46,11 +78,15 @@ print '
';
print "Billing address", &ntable("#cccccc"), " | ",
&ntable("#cccccc",2),
- ' |
Contact name | ',
+ '
Contact name | ',
'',
$cust_main->last, ', ', $cust_main->first,
- ' | SS# | ',
- $cust_main->ss || ' ', ' |
',
+ '';
+print 'SS# | ',
+ $cust_main->ss || ' ', ' | '
+ if $conf->exists('show_ss');
+
+print '',
'Company | ',
$cust_main->company,
' |
',
@@ -71,9 +107,13 @@ print '';
$cust_main->country,
' | ',
;
- print 'Day Phone | ',
+ my $daytime_label = FS::Msgcat::_gettext('daytime') || 'Day Phone';
+ my $night_label = FS::Msgcat::_gettext('night') || 'Night Phone';
+ print ' |
'. $daytime_label.
+ ' | ',
$cust_main->daytime || ' ', ' |
',
- 'Night Phone | ',
+ ' |
'. $night_label.
+ ' | ',
$cust_main->night || ' ', ' |
',
'Fax | ',
$cust_main->fax || ' ', ' |
',
@@ -110,10 +150,10 @@ print '';
$cust_main->get("${pre}country"),
' | ',
;
- print 'Day Phone | ',
+ print '
'. $daytime_label. ' | ',
'',
$cust_main->get("${pre}daytime") || ' ', ' |
',
- 'Night Phone | '.
+ '
'. $night_label. ' | '.
'',
$cust_main->get("${pre}night") || ' ', ' |
',
'Fax | ',
@@ -128,7 +168,7 @@ print ' | ';
print '';
print &ntable("#cccccc"), " |
", &ntable("#cccccc",2),
- ' |
Customer number | ',
+ ' |
Customer number | ',
$custnum, ' |
',
;
@@ -146,13 +186,13 @@ print '';
my $referral = qsearchs('part_referral', {
'refnum' => $cust_main->refnum
} );
- print ' | Referral | ',
+ print ' |
Advertising source | ',
$referral->refnum, ": ", $referral->referral, ' |
';
}
print 'Order taker | ',
$cust_main->otaker, ' |
';
- print 'Referring Customer | ';
+ print ' |
Referring Customer | ';
my $referring_cust_main = '';
if ( $cust_main->referral_custnum
&& ( $referring_cust_main =
@@ -176,31 +216,55 @@ print ' | ';
print ' ';
+if ( $conf->config('payby-default') ne 'HIDE' ) {
+
my @invoicing_list = $cust_main->invoicing_list;
print "Billing information (",
qq!!, "Bill now)",
&ntable("#cccccc"), " |
", &ntable("#cccccc",2),
- ' |
Tax exempt | ',
+ ' |
Tax exempt | ',
$cust_main->tax ? 'yes' : 'no',
' |
',
- 'Postal invoices | ',
+ ' |
Postal invoices | ',
( grep { $_ eq 'POST' } @invoicing_list ) ? 'yes' : 'no',
' |
',
- 'Email invoices | ',
+ ' |
Email invoices | ',
join(', ', grep { $_ ne 'POST' } @invoicing_list ) || 'no',
' |
',
- 'Billing type | ',
+ ' |
Billing type | ',
;
- if ( $cust_main->payby eq 'CARD' ) {
- print 'Credit card |
',
+ if ( $cust_main->payby eq 'CARD' || $cust_main->payby eq 'DCRD' ) {
+ my $payinfo = $cust_main->payinfo_masked;
+ print 'Credit card ',
+ ( $cust_main->payby eq 'CARD' ? '(automatic)' : '(on-demand)' ),
+ '',
'Card number | ',
- $cust_main->payinfo, ' |
',
+ $payinfo, '',
'Expiration | ',
$cust_main->paydate, ' |
',
'Name on card | ',
$cust_main->payname, ' |
'
;
+ } elsif ( $cust_main->payby eq 'CHEK' || $cust_main->payby eq 'DCHK') {
+ my( $account, $aba ) = split('@', $cust_main->payinfo );
+ print 'Electronic check ',
+ ( $cust_main->payby eq 'CHEK' ? '(automatic)' : '(on-demand)' ),
+ '',
+ 'Account number | ',
+ $account, ' |
',
+ 'ABA/Routing code | ',
+ $aba, ' |
',
+ 'Bank name | ',
+ $cust_main->payname, ' |
'
+ ;
+ } elsif ( $cust_main->payby eq 'LECB' ) {
+ $cust_main->payinfo =~ /^(\d{3})(\d{3})(\d{4})$/;
+ my $payinfo = "$1-$2-$3";
+ print 'Phone bill billing',
+ 'Phone number | ',
+ $payinfo, ' |
',
+ ;
} elsif ( $cust_main->payby eq 'BILL' ) {
print 'Billing';
print 'P.O. | ',
@@ -213,7 +277,7 @@ print ' ';
;
} elsif ( $cust_main->payby eq 'COMP' ) {
print 'Complimentary |
',
- 'Authorized by | ',
+ ' |
Authorized by | ',
$cust_main->payinfo, ' |
',
'Expiration | ',
$cust_main->paydate, ' |
',
@@ -222,286 +286,766 @@ print '
';
print "";
+}
+
print '';
if ( defined $cust_main->dbdef_table->column('comments')
- && $cust_main->comments )
+ && $cust_main->comments =~ /[^\s\n\r]/ )
{
- print "
Comments", &ntable("#cccccc"), "",
- &ntable("#cccccc",2),
- ' |
', $cust_main->comments,
+ print " Comments". &ntable("#cccccc"). "".
+ &ntable("#cccccc",2).
+ ' | '.
+ encode_entities($cust_main->comments).
' | ';
}
-print ' |
';
+%>
-print '
'.
- '