From 2f057aa80e429a549fb9fd9449eae8475c994796 Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 11 Jul 1998 03:49:08 +0000 Subject: [PATCH] Initial revision --- htdocs/view/cust_bill.cgi | 79 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100755 htdocs/view/cust_bill.cgi diff --git a/htdocs/view/cust_bill.cgi b/htdocs/view/cust_bill.cgi new file mode 100755 index 000000000..96101d004 --- /dev/null +++ b/htdocs/view/cust_bill.cgi @@ -0,0 +1,79 @@ +#!/usr/bin/perl -Tw +# +# Usage: cust_bill.cgi invnum +# http://server.name/path/cust_bill.cgi?invnum +# +# Note: Should be run setuid freeside as user nobody. +# +# this is a quick & ugly hack which does little more than add some formatting to the ascii output from /dbin/print-invoice +# +# ivan@voicenet.com 96-dec-05 +# +# added navigation bar +# ivan@voicenet.com 97-jan-30 +# +# now uses Invoice.pm +# ivan@voicenet.com 97-jun-30 +# +# what to do if cust_bill search errors? +# ivan@voicenet.com 97-jul-7 +# +# s/FS::Search/FS::Record/; $cgisuidsetup($cgi); ivan@sisd.com 98-mar-14 +# +# Changes to allow page to work at a relative position in server +# bmccane@maxbaud.net 98-apr-3 +# +# also print 'printed' field ivan@sisd.com 98-jul-10 + +use strict; +use IO::File; +use CGI::Base qw(:DEFAULT :CGI); # CGI module +use CGI::Carp qw(fatalsToBrowser); +use FS::UID qw(cgisuidsetup); +use FS::Record qw(qsearchs); +use FS::Invoice; + +my($cgi) = new CGI::Base; +$cgi->get; +&cgisuidsetup($cgi); + +#untaint invnum +$QUERY_STRING =~ /^(\d+)$/; +my($invnum)=$1; + +my($cust_bill) = qsearchs('cust_bill',{'invnum'=>$invnum}); +die "Invoice #$invnum not found!" unless $cust_bill; +my($custnum) = $cust_bill->getfield('custnum'); + +my($printed) = $cust_bill->printed; + +SendHeaders(); # one guess. +print < + + Invoice View + + +
+

Invoice View

+ View this customer (#$custnum) | Main menu +

+ +
+ Enter payments (check/cash) against this invoice +
Reprint this invoice +

(Printed $printed times) +
+
+END
+
+bless($cust_bill,"FS::Invoice");
+print $cust_bill->print_text;
+
+	#formatting
+	print <
+  
+
+END
+
-- 
2.11.0