summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
authorivan <ivan>2004-10-05 13:52:28 +0000
committerivan <ivan>2004-10-05 13:52:28 +0000
commitb740db94f284cc882958fa6e78f73c8017783578 (patch)
tree87d042450f8dbc17d46d9c7a7d8b9235bcddc0b5 /httemplate
parente6b504f1d05efe176bb91c40cca089b41d2d2f49 (diff)
links to show alternate invoices also
Diffstat (limited to 'httemplate')
-rwxr-xr-xhttemplate/view/cust_bill.cgi55
1 files changed, 31 insertions, 24 deletions
diff --git a/httemplate/view/cust_bill.cgi b/httemplate/view/cust_bill.cgi
index 116cd6dcc..bda5d769b 100755
--- a/httemplate/view/cust_bill.cgi
+++ b/httemplate/view/cust_bill.cgi
@@ -31,40 +31,47 @@ print '<BR><BR>';
my $conf = new FS::Conf;
if ( $conf->exists('invoice_latex') ) {
+ my $link = "${p}view/cust_bill-pdf.cgi?";
+ $link .= "$templatename-" if $templatename;
+ $link .= "$invnum.pdf";
print menubar(
- 'View typeset invoice' => "${p}view/cust_bill-pdf.cgi?$invnum.pdf",
+ 'View typeset invoice' => $link,
), '<BR><BR>';
}
#false laziness with search/cust_bill_event.cgi
-print table(). '<TR><TH>Event</TH><TH>Date</TH><TH>Status</TH></TR>';
-foreach my $cust_bill_event (
- sort { $a->_date <=> $b->_date } $cust_bill->cust_bill_event
-) {
- my $status = $cust_bill_event->status;
- $status .= ': '. $cust_bill_event->statustext if $cust_bill_event->statustext;
- 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
+unless ( $templatename ) {
+ print table(). '<TR><TH>Event</TH><TH>Date</TH><TH>Status</TH></TR>';
+ foreach my $cust_bill_event (
+ sort { $a->_date <=> $b->_date } $cust_bill->cust_bill_event
) {
- 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> )';
+ my $status = $cust_bill_event->status;
+ $status .= ': '. $cust_bill_event->statustext
+ if $cust_bill_event->statustext;
+ 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 '</TD><TD>'.
- time2str("%a %b %e %T %Y", $cust_bill_event->_date). '</TD><TD>'.
- $status. '</TD></TR>';
+ print '</TABLE><BR>';
}
-print '</TABLE><BR><PRE>';
-print $cust_bill->print_text('', $templatename);
+
+print '<PRE>'. $cust_bill->print_text('', $templatename);
#formatting
print <<END;