X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main.cgi;h=322f0674e933ac9962ee7ca06b2f74bae5a56aa4;hb=6a953c149c5f4423cafc510e34c60b41bd7d0ef9;hp=7dbdc13566d46ae1309860505154e6a93e16173a;hpb=9f96bd19b87cb0084dda17da070f3bb5dadd4823;p=freeside.git
diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi
index 7dbdc1356..322f0674e 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') ) {
@@ -46,249 +70,86 @@ 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,
- ' |
',
- ;
- 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_label.
- ' | ',
- $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 ''. $daytime_label. ' | ',
- '',
- $cust_main->get("${pre}daytime") || ' ', ' |
',
- ''. $night_label. ' | '.
- '',
- $cust_main->get("${pre}night") || ' ', ' |
',
- 'Fax | ',
- $cust_main->get("${pre}fax") || ' ', ' |
',
- '', ""
- ;
-
- }
-
-print '';
-
-print '';
+%>
- print &ntable("#cccccc"), " | ", &ntable("#cccccc",2),
- ' |
Customer number | ',
- $custnum, ' |
',
- ;
+
+<%= &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 ) %>
+ <% } %>
+ |
+
+
- my @agents = qsearch( 'agent', {} );
- my $agent;
- unless ( scalar(@agents) == 1 ) {
- $agent = qsearchs('agent',{ 'agentnum' => $cust_main->agentnum } );
- print 'Agent | ',
- $agent->agentnum, ": ", $agent->agent, ' |
';
+<%
+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 ) %>
+<% } %>
+
+
+
+
';
+<%
if ( $conf->config('payby-default') ne 'HIDE' ) {
- print '
'.
+ print
qq!