X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main.cgi;h=22c4191021cf4fc67a89775942146ced12ec57fa;hb=165868b01df15958f51498f4a67117d92176680b;hp=7dbdc13566d46ae1309860505154e6a93e16173a;hpb=9f96bd19b87cb0084dda17da070f3bb5dadd4823;p=freeside.git
diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi
index 7dbdc1356..22c419102 100755
--- a/httemplate/view/cust_main.cgi
+++ b/httemplate/view/cust_main.cgi
@@ -3,7 +3,6 @@
my $conf = new FS::Conf;
-#false laziness with view/cust_pkg.cgi, but i'm trying to make that go away so
my %uiview = ();
my %uiadd = ();
foreach my $part_svc ( qsearch('part_svc',{}) ) {
@@ -15,6 +14,16 @@ 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+)$/;
@@ -22,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') ) {
@@ -54,7 +78,7 @@ print '
';
print "Billing address", &ntable("#cccccc"), " | ",
&ntable("#cccccc",2),
- ' |
Contact name | ',
+ '
Contact name | ',
'',
$cust_main->last, ', ', $cust_main->first,
' | ';
@@ -83,8 +107,8 @@ print '
',
$cust_main->country,
'',
;
- my $daytime_label = FS::Msgcat::_gettext('daytime') || 'Day Phone';
- my $night_label = FS::Msgcat::_gettext('night') || 'Night 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 || ' ', ' |
',
@@ -144,7 +168,7 @@ print '';
print '';
print &ntable("#cccccc"), " | ", &ntable("#cccccc",2),
- ' |
Customer number | ',
+ ' |
Customer number | ',
$custnum, ' |
',
;
@@ -162,13 +186,13 @@ print '';
my $referral = qsearchs('part_referral', {
'refnum' => $cust_main->refnum
} );
- print ' | Advertising source | ',
+ 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 =
@@ -198,22 +222,23 @@ if ( $conf->config('payby-default') ne 'HIDE' ) {
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' ) {
- my $payinfo = $cust_main->payinfo;
- $payinfo = 'x'x(length($payinfo)-4). substr($payinfo,(length($payinfo)-4));
- 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 | ',
$payinfo, ' |
',
'Expiration | ',
@@ -221,9 +246,11 @@ if ( $conf->config('payby-default') ne 'HIDE' ) {
' |
Name on card | ',
$cust_main->payname, ' |
'
;
- } elsif ( $cust_main->payby eq 'CHEK' ) {
+ } elsif ( $cust_main->payby eq 'CHEK' || $cust_main->payby eq 'DCHK') {
my( $account, $aba ) = split('@', $cust_main->payinfo );
- print 'Electronic check',
+ print 'Electronic check ',
+ ( $cust_main->payby eq 'CHEK' ? '(automatic)' : '(on-demand)' ),
+ '',
'Account number | ',
$account, ' |
',
'ABA/Routing code | ',
@@ -231,6 +258,13 @@ if ( $conf->config('payby-default') ne 'HIDE' ) {
' |
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. | ',
@@ -243,7 +277,7 @@ if ( $conf->config('payby-default') ne 'HIDE' ) {
;
} elsif ( $cust_main->payby eq 'COMP' ) {
print 'Complimentary |
',
- 'Authorized by | ',
+ ' |
Authorized by | ',
$cust_main->payinfo, ' |
',
'Expiration | ',
$cust_main->paydate, ' |
',
@@ -257,7 +291,7 @@ if ( $conf->config('payby-default') ne 'HIDE' ) {
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).
@@ -266,29 +300,43 @@ if ( defined $cust_main->dbdef_table->column('comments')
' |
';
}
-print '';
+%>
+
+
-print '
'.
- '
+
+<%
if ( $conf->config('payby-default') ne 'HIDE' ) {
- print '
'.
+ print
qq!