X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=httemplate%2Fview%2Fcust_main.cgi;h=101fe2cfffc6f2d9c94c9b458eea5e224608d77a;hb=0c81ee14be99875c8f9f9e34a442a23543333611;hp=624fe37d15607a0a4f6504e59ebea5e6aec56558;hpb=65615896de6e2474953722ea25122174b151d289;p=freeside.git
diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi
index 624fe37d1..101fe2cff 100755
--- a/httemplate/view/cust_main.cgi
+++ b/httemplate/view/cust_main.cgi
@@ -1,1021 +1,165 @@
-
-<%
+%
+%
+%my $conf = new FS::Conf;
+%
+%my $curuser = $FS::CurrentUser::CurrentUser;
+%
+%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;
+%
+%
-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)
-));
-
-%>
-
-
+<% include("/elements/header.html","Customer View: ". $cust_main->name ) %>
+% if ( $curuser->access_right('Edit customer') ) {
-<%
+ Edit this customer |
+% }
-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('Cancel customer')
+% && $cust_main->ncancelled_pkgs
+% ) {
+%
-print '';
-
-print '
'.
- '
+ <% include('cust_main/contacts.html', $cust_main ) %> + | +
+ <% include('cust_main/misc.html', $cust_main ) %>
+% if ( $conf->config('payby-default') ne 'HIDE' ) {
-my $packages = get_packages($cust_main, $conf);
+ + <% include('cust_main/billing.html', $cust_main ) %> +% } -if ( @$packages ) { -%> -
+Comments +<% ntable("#cccccc") %> | ||||
<% ntable("#cccccc",2) %> | |||||
>
- <%=$pkg->{pkgnum}%>:
- <%=$pkg->{pkg}%> - <%=$pkg->{comment}%> -<% unless ($pkg->{cancel}) { %> - ( <%=pkg_change_link($pkg)%> ) - ( <%=pkg_dates_link($pkg)%> | <%=pkg_customize_link($pkg,$custnum)%> ) -<% } %> + |
+ <% encode_entities($cust_main->comments) %> |
-<%
- #foreach (qw(setup last_bill next_bill susp expire cancel)) {
- # print qq! ! . pkg_datestr($pkg,$_,$conf) . qq! | \n!; - #} - print "". &itable(''); - - sub freq { - - #false laziness w/edit/part_pkg.cgi - my %freq = ( #move this - '1d' => 'daily', - '1w' => 'weekly', - '2w' => 'biweekly (every 2 weeks)', - '1' => 'monthly', - '2' => 'bimonthly (every 2 months)', - '3' => 'quarterly (every 3 months)', - '6' => 'semiannually (every 6 months)', - '12' => 'annually', - '24' => 'biannually (every 2 years)', - ); - - my $freq = shift; - exists $freq{$freq} ? $freq{$freq} : "every $freq months"; - } - - #eomove - - 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 '. freq($pkg->{freq}). ')|||||
One-time charge | |||||
Billed | '. - pkg_datestr($pkg,'setup',$conf). ' | ||||
Active'. - ', billed '. freq($pkg->{freq}). ' | |||||
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). ' ) |