freeside/httemplate/view cust_bill-pdf.cgi,1.4,1.5 cust_bill-ps.cgi,1.1,1.2 cust_bill.cgi,1.17,1.18
ivan
ivan at pouncequick.420.am
Tue Oct 5 06:35:48 PDT 2004
Update of /home/cvs/cvsroot/freeside/httemplate/view
In directory pouncequick:/tmp/cvs-serv3843
Modified Files:
cust_bill-pdf.cgi cust_bill-ps.cgi cust_bill.cgi
Log Message:
links to show alternate invoices also
Index: cust_bill-pdf.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/view/cust_bill-pdf.cgi,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- cust_bill-pdf.cgi 2 Apr 2004 13:44:56 -0000 1.4
+++ cust_bill-pdf.cgi 5 Oct 2004 13:35:41 -0000 1.5
@@ -2,13 +2,14 @@
#untaint invnum
my($query) = $cgi->keywords;
-$query =~ /^(\d+)(.pdf)?$/;
-my $invnum = $1;
+$query =~ /^((.+)-)?(\d+)(.pdf)?$/;
+my $templatename = $1;
+my $invnum = $3;
my $cust_bill = qsearchs('cust_bill',{'invnum'=>$invnum});
die "Invoice #$invnum not found!" unless $cust_bill;
-my $pdf = $cust_bill->print_pdf;
+my $pdf = $cust_bill->print_pdf( '', $templatename);
http_header('Content-Type' => 'application/pdf' );
http_header('Content-Length' => length($pdf) );
Index: cust_bill.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/view/cust_bill.cgi,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- cust_bill.cgi 2 Apr 2004 11:23:34 -0000 1.17
+++ cust_bill.cgi 5 Oct 2004 13:35:41 -0000 1.18
@@ -3,8 +3,9 @@
#untaint invnum
my($query) = $cgi->keywords;
-$query =~ /^(\d+)$/;
-my $invnum = $1;
+$query =~ /^((.+)-)?(\d+)$/;
+my $templatename = $1;
+my $invnum = $3;
my $cust_bill = qsearchs('cust_bill',{'invnum'=>$invnum});
die "Invoice #$invnum not found!" unless $cust_bill;
@@ -43,13 +44,27 @@
) {
my $status = $cust_bill_event->status;
$status .= ': '. $cust_bill_event->statustext if $cust_bill_event->statustext;
- print '<TR><TD>'. $cust_bill_event->part_bill_event->event. '</TD><TD>'.
+ my $part_bill_event = $cust_bill_event->part_bill_event;
+ print '<TR><TD>'. $part_bill_event->event;
+
+ if (
+ $part_bill_event->plan eq 'send_alternate'
+ && $part_bill_event->plandata =~ /^templatename (.*)$/m
+ ) {
+ my $templatename = $1;
+ print qq! ( <A HREF="${p}view/cust_bill.cgi?$templatename-$invnum">!.
+ 'view text</A> | '.
+ qq!<A HREF="${p}view/cust_bill-pdf.cgi?$templatename-$invnum.pdf">!.
+ 'view typeset</A> )';
+ }
+
+ print '</TD><TD>'.
time2str("%a %b %e %T %Y", $cust_bill_event->_date). '</TD><TD>'.
$status. '</TD></TR>';
}
print '</TABLE><BR><PRE>';
-print $cust_bill->print_text;
+print $cust_bill->print_text('', $templatename);
#formatting
print <<END;
Index: cust_bill-ps.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/view/cust_bill-ps.cgi,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- cust_bill-ps.cgi 29 Nov 2003 08:08:36 -0000 1.1
+++ cust_bill-ps.cgi 5 Oct 2004 13:35:41 -0000 1.2
@@ -2,12 +2,13 @@
#untaint invnum
my($query) = $cgi->keywords;
-$query =~ /^(\d+)$/;
-my $invnum = $1;
+$query =~ /^((.+)-)?(\d+)$/;
+my $templatename = $1;
+my $invnum = $3;
my $cust_bill = qsearchs('cust_bill',{'invnum'=>$invnum});
die "Invoice #$invnum not found!" unless $cust_bill;
http_header('Content-Type' => 'application/postscript' );
%>
-<%= $cust_bill->print_ps %>
+<%= $cust_bill->print_ps( '', $templatename) %>
More information about the freeside-commits
mailing list