X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main.cgi;h=322f0674e933ac9962ee7ca06b2f74bae5a56aa4;hb=6a953c149c5f4423cafc510e34c60b41bd7d0ef9;hp=bc76301d4980c6e864cab40cee61fa7791dea80c;hpb=22a35047ecdffff80110e06cc08fc84f9ddba9b0;p=freeside.git
diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi
index bc76301d4..322f0674e 100755
--- a/httemplate/view/cust_main.cgi
+++ b/httemplate/view/cust_main.cgi
@@ -1,11 +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+)$/;
@@ -13,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') ) {
@@ -37,491 +70,800 @@ print "This customer's signup URL: ".
"$signupurl?ref=$custnum
";
}
-print '';
-
-print &itable(), '
';
-
-print '';
-
- print "Billing address", &ntable("#cccccc"), " |
",
- &ntable("#cccccc",2),
- ' |
Contact name | ',
- '',
- $cust_main->last, ', ', $cust_main->first,
- ' | ';
-print 'SS# | ',
- $cust_main->ss || ' ', ' | '
- if $conf->exists('show_ss');
-
-print '
',
- 'Company | ',
- $cust_main->company,
- ' |
',
- 'Address | ',
- $cust_main->address1,
- ' |
',
- ;
- print ' | ',
- $cust_main->address2, ' |
'
- if $cust_main->address2;
- print 'City | ',
- $cust_main->city,
- ' | State | ',
- $cust_main->state,
- ' | Zip | ',
- $cust_main->zip, ' |
',
- 'Country | ',
- $cust_main->country,
- ' |
',
- ;
- print 'Day Phone | ',
- $cust_main->daytime || ' ', ' |
',
- 'Night Phone | ',
- $cust_main->night || ' ', ' |
',
- 'Fax | ',
- $cust_main->fax || ' ', ' |
',
- '', ""
- ;
-
- if ( defined $cust_main->dbdef_table->column('ship_last') ) {
-
- my $pre = $cust_main->ship_last ? 'ship_' : '';
-
- print "
Service address", &ntable("#cccccc"), "",
- &ntable("#cccccc",2),
- ' |
Contact name | ',
- '',
- $cust_main->get("${pre}last"), ', ', $cust_main->get("${pre}first"),
- ' |
',
- 'Company | ',
- $cust_main->get("${pre}company"),
- ' |
',
- 'Address | ',
- $cust_main->get("${pre}address1"),
- ' |
',
- ;
- print ' | ',
- $cust_main->get("${pre}address2"), ' |
'
- if $cust_main->get("${pre}address2");
- print 'City | ',
- $cust_main->get("${pre}city"),
- ' | State | ',
- $cust_main->get("${pre}state"),
- ' | Zip | ',
- $cust_main->get("${pre}zip"), ' |
',
- 'Country | ',
- $cust_main->get("${pre}country"),
- ' |
',
- ;
- print 'Day Phone | ',
- '',
- $cust_main->get("${pre}daytime") || ' ', ' |
',
- 'Night Phone | '.
- '',
- $cust_main->get("${pre}night") || ' ', ' |
',
- 'Fax | ',
- $cust_main->get("${pre}fax") || ' ', ' |
',
- '', ""
- ;
+%>
+
+
+<%= &itable() %>
+
+
+ <%= include('cust_main/contacts.html', $cust_main ) %>
+ |
+
+ <%= include('cust_main/misc.html', $cust_main ) %>
+ <% if ( $conf->config('payby-default') ne 'HIDE' ) { %>
+
+ <%= include('cust_main/billing.html', $cust_main ) %>
+ <% } %>
+ |
+
+
+<%
+if ( defined $cust_main->dbdef_table->column('comments')
+ && $cust_main->comments =~ /[^\s\n\r]/ ) {
+%>
+
+Comments
+<%= ntable("#cccccc") %><%= ntable("#cccccc",2) %>
+ |
+
+ <%= encode_entities($cust_main->comments) %>
+ |
+
+
+<% } %>
+
+<% if ( $conf->config('ticket_system') ) { %>
+
+ <%= include('cust_main/tickets.html', $cust_main ) %>
+<% } %>
+
+
+
+
!;
- print "";
+}
-print '';
+print qq!Packages !,
+ qq!( Bulk order and cancel packages (preserves services) )!,
+;
-if ( defined $cust_main->dbdef_table->column('comments')
- && $cust_main->comments )
-{
- print "
Comments", &ntable("#cccccc"), "",
- &ntable("#cccccc",2),
- ' |
', $cust_main->comments,
- ' |
';
-}
+#begin display packages
-print '';
-
-print '
'.
- '