From 18c025613fa052cf4ba8d484f1296cc2a1719a24 Mon Sep 17 00:00:00 2001 From: khoff Date: Mon, 21 Mar 2005 22:13:39 +0000 Subject: Added support for FAX invoice destinations using a HylaFAX server. Faxing plain text invoices is not supported. --- httemplate/misc/fax-invoice.cgi | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 httemplate/misc/fax-invoice.cgi (limited to 'httemplate/misc/fax-invoice.cgi') 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"); + +%> -- cgit v1.2.1 From c28a4c33a88dfa354436f81a2e213638088adcf1 Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 19 May 2005 08:43:27 +0000 Subject: re-email/fax/print links should respect template, also add direct re-send links like the view links and convert view/cust_bill.cgi to proper template --- httemplate/misc/fax-invoice.cgi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'httemplate/misc/fax-invoice.cgi') diff --git a/httemplate/misc/fax-invoice.cgi b/httemplate/misc/fax-invoice.cgi index 46b2a1721..d490b8e79 100755 --- a/httemplate/misc/fax-invoice.cgi +++ b/httemplate/misc/fax-invoice.cgi @@ -5,15 +5,15 @@ my $lpr = $conf->config('lpr'); #untaint invnum my($query) = $cgi->keywords; -$query =~ /^(\d*)$/; -my $invnum = $1; +$query =~ /^((.+)-)?(\d+)$/; +my $template = $2; +my $invnum = $3; 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 ], + docdata => [ $cust_bill->print_ps('', $template) ], ); die $error if $error; -- cgit v1.2.1 From 684a478c0f88e5bf6d1d3f32f4618089146b5709 Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 2 Jun 2005 09:29:56 +0000 Subject: add ability to search on a date range of invoice events and then reprint or reemail (boy was that a bit more work than i expected), closes: Bug#946 --- httemplate/misc/fax-invoice.cgi | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'httemplate/misc/fax-invoice.cgi') diff --git a/httemplate/misc/fax-invoice.cgi b/httemplate/misc/fax-invoice.cgi index d490b8e79..94fee2cf2 100755 --- a/httemplate/misc/fax-invoice.cgi +++ b/httemplate/misc/fax-invoice.cgi @@ -1,8 +1,5 @@ <% -my $conf = new FS::Conf; -my $lpr = $conf->config('lpr'); - #untaint invnum my($query) = $cgi->keywords; $query =~ /^((.+)-)?(\d+)$/; @@ -11,12 +8,7 @@ my $invnum = $3; 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('', $template) ], -); - -die $error if $error; +$cust_bill->fax($template); my $custnum = $cust_bill->getfield('custnum'); -- cgit v1.2.1