freeside/httemplate/misc print_invoices.cgi,NONE,1.1 email_invoices.cgi,NONE,1.1 fax_invoices.cgi,NONE,1.1 print-invoice.cgi,1.8,1.9 fax-invoice.cgi,1.2,1.3 email-invoice.cgi,1.4,1.5

Ivan Kohler ivan at pouncequick.420.am
Thu Jun 2 02:30:27 PDT 2005


Update of /home/cvs/cvsroot/freeside/httemplate/misc
In directory pouncequick:/tmp/cvs-serv23604/httemplate/misc

Modified Files:
	print-invoice.cgi fax-invoice.cgi email-invoice.cgi 
Added Files:
	print_invoices.cgi email_invoices.cgi fax_invoices.cgi 
Log Message:
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

Index: print-invoice.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/misc/print-invoice.cgi,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- print-invoice.cgi	19 May 2005 08:43:27 -0000	1.8
+++ print-invoice.cgi	2 Jun 2005 09:29:52 -0000	1.9
@@ -1,8 +1,5 @@
 <%
 
-my $conf = new FS::Conf;
-my $lpr = $conf->config('lpr');
-
 #untaint invnum
 my($query) = $cgi->keywords;
 $query =~ /^((.+)-)?(\d+)$/;
@@ -11,17 +8,7 @@
 my $cust_bill = qsearchs('cust_bill',{'invnum'=>$invnum});
 die "Can't find invoice!\n" unless $cust_bill;
 
-        open(LPR,"|$lpr") or die "Can't open $lpr: $!";
-
-        if ( $conf->exists('invoice_latex') ) {
-          print LPR $cust_bill->print_ps('', $template); #( date )
-        } else {
-          print LPR $cust_bill->print_text('', $template); #( date )
-        }
-
-        close LPR
-          or die $! ? "Error closing $lpr: $!"
-                       : "Exit status $? from $lpr";
+$cust_bill->print($template);
 
 my $custnum = $cust_bill->getfield('custnum');
 

--- NEW FILE: fax_invoices.cgi ---
<%

my $server = new FS::UI::Web::JSRPC 'FS::cust_bill_event::process_refax';
$server->process;

%>

--- NEW FILE: print_invoices.cgi ---
<%

my $server = new FS::UI::Web::JSRPC 'FS::cust_bill_event::process_reprint';
$server->process;

%>

Index: fax-invoice.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/misc/fax-invoice.cgi,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- fax-invoice.cgi	19 May 2005 08:43:27 -0000	1.2
+++ fax-invoice.cgi	2 Jun 2005 09:29:52 -0000	1.3
@@ -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 $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');
 

--- NEW FILE: email_invoices.cgi ---
<%

my $server = new FS::UI::Web::JSRPC 'FS::cust_bill_event::process_reemail';
$server->process;

%>

Index: email-invoice.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/misc/email-invoice.cgi,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- email-invoice.cgi	19 May 2005 08:43:27 -0000	1.4
+++ email-invoice.cgi	2 Jun 2005 09:29:52 -0000	1.5
@@ -1,7 +1,5 @@
 <%
 
-my $conf = new FS::Conf;
-
 #untaint invnum
 my($query) = $cgi->keywords;
 $query =~ /^((.+)-)?(\d+)$/;
@@ -10,16 +8,10 @@
 my $cust_bill = qsearchs('cust_bill',{'invnum'=>$invnum});
 die "Can't find invoice!\n" unless $cust_bill;
 
-my $error = send_email(
-  $cust_bill->generate_email(
-    'from'     => 
-      ( $cust_bill->_agent_invoice_from || $conf->config('invoice_from') ),
-    'template' => $template,
-  )
-);
-eidiot($error) if $error;
+$cust_bill->email($template); 
 
 my $custnum = $cust_bill->getfield('custnum');
+
 print $cgi->redirect("${p}view/cust_main.cgi?$custnum");
 
 %>




More information about the freeside-commits mailing list