X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=htdocs%2Fview%2Fcust_main.cgi;h=b1c0bbb01544c07fd665b7fd8b783afcd727266c;hb=e03778f753c3458e669fb261a013e6c2931c2dd7;hp=ca5fcd94f70820d06656814b351b335d683432a0;hpb=4a792d96bf1739a603a4ba08d6d680fa854455f3;p=freeside.git diff --git a/htdocs/view/cust_main.cgi b/htdocs/view/cust_main.cgi index ca5fcd94f..b1c0bbb01 100755 --- a/htdocs/view/cust_main.cgi +++ b/htdocs/view/cust_main.cgi @@ -1,6 +1,6 @@ #!/usr/bin/perl -Tw # -# cust_main.cgi: View a customer +# $Id: cust_main.cgi,v 1.4 1998-12-17 09:57:21 ivan Exp $ # # Usage: cust_main.cgi custnum # http://server.name/path/cust_main.cgi?custnum @@ -31,28 +31,46 @@ # bmccane@maxbaud.net 98-apr-3 # # lose background, FS::CGI ivan@sisd.com 98-sep-2 +# +# $Log: cust_main.cgi,v $ +# Revision 1.4 1998-12-17 09:57:21 ivan +# s/CGI::(Base|Request)/CGI.pm/; +# +# Revision 1.3 1998/11/15 13:14:20 ivan +# first pass as per-customer custom pricing +# +# Revision 1.2 1998/11/13 11:28:08 ivan +# s/CGI-modules/CGI.pm/;, relative URL's with popurl +# use strict; -use CGI::Base qw(:DEFAULT :CGI); # CGI module +use CGI; use CGI::Carp qw(fatalsToBrowser); use Date::Format; use FS::UID qw(cgisuidsetup); use FS::Record qw(qsearchs qsearch); -use FS::CGI qw(header menubar); - -my($cgi) = new CGI::Base; -$cgi->get; +use FS::CGI qw(header menubar popurl table); +use FS::cust_credit; +use FS::cust_pay; +use FS::cust_bill; +use FS::part_pkg; +use FS::cust_pkg; +use FS::part_referral; +use FS::agent; +use FS::cust_main; + +my($cgi) = new CGI; &cgisuidsetup($cgi); -SendHeaders(); # one guess. -print header("Customer View", menubar( - 'Main Menu' => '../', +print $cgi->header, header("Customer View", menubar( + 'Main Menu' => popurl(2) )),< END -#untaint custnum & get customer record -$QUERY_STRING =~ /^(\d+)$/; +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; @@ -66,13 +84,13 @@ print "
Customer #$custnum
", qq!Payment History !; #bill now linke -print qq!
!, +print qq!
!, qq!Bill this customer now
!; #formatting print qq!
Customer Information!, qq!!, - qq!
Edit this information
!; #agentnum @@ -163,13 +181,13 @@ print "

Order taken by ", $hashref->{otaker}, ""; #formatting print qq!


Packages!, qq!
Click on package number to view/edit package.!, - qq!
Add/Edit packages!, + qq!
Add/Edit packages!, qq!

!; #display packages #formatting -print qq!
\n!, +print qq!
!, table, "\n", qq!
\n!, qq!!, "", + $part_pkg->getfield('comment'), + qq!!, + qq!!, + qq!!, + qq!!, + "", "", @@ -217,7 +240,7 @@ print "
#Package!, qq!Dates
Setup!, @@ -187,11 +205,16 @@ foreach $package (@packages) { my($part_pkg)=qsearchs('part_pkg',{ 'pkgpart' => $pref->{pkgpart} } ); - print qq!
{pkgnum}, qq!">!, $pref->{pkgnum}, qq!", $part_pkg->getfield('pkg'), " - ", - $part_pkg->getfield('comment'), "
", $pref->{setup} ? time2str("%D",$pref->{setup} ) : "" , "
"; print qq!

Payment History!, qq!
!, qq!Click on invoice to view invoice/enter payment.
!, - qq!!, + qq!!, qq!Post Credit / Refund

!; #get payment history @@ -232,7 +255,7 @@ my($bill); foreach $bill (@bills) { my($bref)=$bill->hashref; push @history, - $bref->{_date} . qq!\t{invnum} . qq!">Invoice #! . $bref->{invnum} . qq! (Balance \$! . $bref->{owed} . qq!)\t! . $bref->{charged} . qq!\t\t\t!; @@ -274,8 +297,7 @@ foreach $credit (@credits) { } #formatting - print < + print "
", table, <
Date Description