summaryrefslogtreecommitdiff
path: root/httemplate/misc/fax-invoice.cgi
diff options
context:
space:
mode:
authorkhoff <khoff>2005-03-21 22:13:39 +0000
committerkhoff <khoff>2005-03-21 22:13:39 +0000
commit18c025613fa052cf4ba8d484f1296cc2a1719a24 (patch)
tree334919583d3ecdd78413ad7405b6092e62f614ad /httemplate/misc/fax-invoice.cgi
parent30189fa2e5987bafeb4714a83b7f130c568b221c (diff)
Added support for FAX invoice destinations using a HylaFAX server.
Faxing plain text invoices is not supported.
Diffstat (limited to 'httemplate/misc/fax-invoice.cgi')
-rwxr-xr-xhttemplate/misc/fax-invoice.cgi25
1 files changed, 25 insertions, 0 deletions
diff --git a/httemplate/misc/fax-invoice.cgi b/httemplate/misc/fax-invoice.cgi
new file mode 100755
index 000000000..46b2a1721
--- /dev/null
+++ b/httemplate/misc/fax-invoice.cgi
@@ -0,0 +1,25 @@
+<%
+
+my $conf = new FS::Conf;
+my $lpr = $conf->config('lpr');
+
+#untaint invnum
+my($query) = $cgi->keywords;
+$query =~ /^(\d*)$/;
+my $invnum = $1;
+my $cust_bill = qsearchs('cust_bill',{'invnum'=>$invnum});
+die "Can't find invoice!\n" unless $cust_bill;
+
+
+my $error = &FS::Misc::send_fax(
+ dialstring => $cust_bill->cust_main->getfield('fax'),
+ docdata => [ $cust_bill->print_ps ],
+);
+
+die $error if $error;
+
+my $custnum = $cust_bill->getfield('custnum');
+
+print $cgi->redirect("${p}view/cust_main.cgi?$custnum");
+
+%>