X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main.cgi;h=4ca777d6aed04381ec7d9ec72bfe521edc60fd1d;hb=f9938915b0df2609f41c24d761d607595d5d0a34;hp=322f0674e933ac9962ee7ca06b2f74bae5a56aa4;hpb=8d4abaa99403699aa5b5f02e899d2ea33980f913;p=freeside.git
diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi
index 322f0674e..4ca777d6a 100755
--- a/httemplate/view/cust_main.cgi
+++ b/httemplate/view/cust_main.cgi
@@ -1,869 +1,187 @@
-
-<%
+<% include("/elements/header.html","Customer View: ". $cust_main->name ) %>
-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+)$/;
-my $custnum = $1;
-my $cust_main = qsearchs('cust_main',{'custnum'=>$custnum});
-die "Customer not found!" unless $cust_main;
-
-print qq!Edit this customer!;
+% if ( $curuser->access_right('Edit customer') ) {
+ Edit this customer |
+% }
-%>
+
+
+
+
-
-<%
+% if ( $curuser->access_right('Cancel customer')
+% && $cust_main->ncancelled_pkgs
+% ) {
-print qq! | !.
- 'Cancel this customer'
- if $cust_main->ncancelled_pkgs;
+ <% cust_cancel_link($cust_main) %> |
-print qq! | !.
- 'Delete this customer'
- if $conf->exists('deletecustomers');
+% }
-unless ( $conf->exists('disable_customer_referrals') ) {
- print qq! | !,
- qq!Refer a new customer!;
+% if ( $conf->exists('deletecustomers')
+% && $curuser->access_right('Delete customer')
+% ) {
+ Delete this customer |
+% }
- print qq! | !,
- qq!View this customer's referrals!;
-}
+% unless ( $conf->exists('disable_customer_referrals') ) {
+ Refer a new customer |
+ View this customer's referrals
+% }
-print '
';
+
-my $signupurl = $conf->config('signupurl');
-if ( $signupurl ) {
-print "This customer's signup URL: ".
- "$signupurl?ref=$custnum
";
-}
+% if ( $curuser->access_right('Billing event reports')
+% || $curuser->access_right('View customer billing events')
+% ) {
+
+ View billing events for this customer
+
+
+% }
+
+%my $signupurl = $conf->config('signupurl');
+%if ( $signupurl ) {
+ This customer's signup URL: <% $signupurl %>?ref=<% $custnum %>
+% }
-%>
-<%= &itable() %>
+
- <%= include('cust_main/contacts.html', $cust_main ) %> + <% include('cust_main/contacts.html', $cust_main ) %> | -- <%= include('cust_main/misc.html', $cust_main ) %> - <% if ( $conf->config('payby-default') ne 'HIDE' ) { %> + |
+ <% include('cust_main/misc.html', $cust_main ) %>
+% if ( $conf->config('payby-default') ne 'HIDE' ) {
+
- <%= include('cust_main/billing.html', $cust_main ) %> - <% } %> + <% include('cust_main/billing.html', $cust_main ) %> +% } + |
<%= encode_entities($cust_main->comments) %>+
<% encode_entities($cust_main->comments) %>
Package | -Status | -Services | -|
---|---|---|---|
>
- <%=$pkg->{pkgnum}%>:
- <%=$pkg->{pkg}%> - <%=$pkg->{comment}%> -<% unless ($pkg->{cancel}) { %> - ( <%=pkg_change_link($pkg)%> ) - ( <%=pkg_dates_link($pkg)%> | <%=pkg_customize_link($pkg,$custnum)%> ) -<% } %> - |
-<%
- #foreach (qw(setup last_bill next_bill susp expire cancel)) {
- # print qq! ! . pkg_datestr($pkg,$_,$conf) . qq! | \n!; - #} - print "". &itable(''); - - sub myfreq { - my $part_pkg = shift; - my $freq = $part_pkg->freq_pretty; - $freq =~ s/ / /g; - $freq; - } - - if ( $pkg->{cancel} ) { #status: cancelled - - print ' | |
Cancelled | '. - ''. pkg_datestr($pkg,'cancel',$conf). ' | ||
Never billed | |||
Setup | ". - pkg_datestr($pkg, 'setup',$conf). ' | ||
Last bill | ". - pkg_datestr($pkg, 'last_bill',$conf). ' | ||
Suspended | ". - pkg_datestr($pkg, 'susp',$conf). ' | ||
Suspended | '. - ''. pkg_datestr($pkg,'susp',$conf). ' | ||
Never billed | |||
Setup | ". - pkg_datestr($pkg, 'setup',$conf). ' | ||
Last bill | ". - pkg_datestr($pkg, 'last_bill',$conf). ' | ||
Expires | ". - pkg_datestr($pkg, 'expire',$conf). ' | ||
( '. pkg_unsuspend_link($pkg). - ' | '. pkg_cancel_link($pkg). ' ) | |||
Not yet billed ('; - unless ( $pkg->{freq} ) { - print 'one-time charge) | |||
( '. pkg_cancel_link($pkg). - ' ) | '; - } else { - print 'billed '. myfreq($pkg->{part_pkg}). ')|||
One-time charge | |||
Billed | '. - pkg_datestr($pkg,'setup',$conf). ' | ||
Active'. - ', billed '. myfreq($pkg->{part_pkg}). ' | |||
Setup | '. - pkg_datestr($pkg, 'setup',$conf). ' | ||
Last bill | ". - pkg_datestr($pkg, 'last_bill',$conf). ' | ||
Next bill | ". - pkg_datestr($pkg, 'next_bill',$conf). ' | ||
Expires | ". - pkg_datestr($pkg, 'expire',$conf). ' | ||
( '. pkg_suspend_link($pkg). - ' | '. pkg_cancel_link($pkg). ' ) |