1 <% include("/elements/header.html", 'Invoice templates') %>
3 <% include('/elements/table-grid.html') %>
4 % my $bgcolor1 = '#eeeeee';
5 % my $bgcolor2 = '#ffffff';
9 <TH CLASS="grid" BGCOLOR="#cccccc">Template</TH>
10 <TH CLASS="grid" BGCOLOR="#cccccc">HTML</TH>
11 <TH CLASS="grid" BGCOLOR="#cccccc">Print/PDF (typeset)</TH>
12 <TH CLASS="grid" BGCOLOR="#cccccc">Plaintext</TH>
15 % foreach my $templatename ( '', @templatenames ) {
16 % my $tname = length($templatename) ? "_$templatename" : '';
18 % if ( $bgcolor eq $bgcolor1 ) {
19 % $bgcolor = $bgcolor2;
21 % $bgcolor = $bgcolor1;
24 % my $display = length($templatename) ? $templatename : '<i>(Default)</i>';
28 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
32 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
34 % my( $logo_label, $logo_link_label)= length( $templatename )
35 % ? labels("logo_$templatename.png")
37 <% $logo_label %> Logo
38 (<A HREF="<% $p %>edit/invoice_logo.html?type=png;name=<% $templatename %>"><% $logo_link_label %></A>)
41 % foreach my $suffix (qw( returnaddress notes footer), '' ) {
42 % my $file = "invoice_html$suffix$tname";
43 % my($label, $link_label) = length($templatename)
47 <% $label %> <% $suffix2name{$suffix} %>
48 (<A HREF="<% $p %>edit/invoice_template.html?type=html;suffix=<% $suffix %>;name=<% $templatename %>"><% $link_label %></A>)
55 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
57 % my( $logo_label, $logo_link_label)= length( $templatename )
58 % ? labels("logo_$templatename.eps")
60 <% $logo_label %> Logo
61 (<A HREF="<% $p %>edit/invoice_logo.html?type=eps;name=<% $templatename %>"><% $logo_link_label %></A>)
64 % foreach my $suffix (qw( returnaddress notes footer smallfooter), '' ) {
65 % my $file = "invoice_latex$suffix$tname";
66 % my($label, $link_label) = length($templatename)
70 <% $label %> <% $suffix2name{$suffix} %>
71 (<A HREF="<% $p %>edit/invoice_template.html?type=latex;suffix=<% $suffix %>;name=<% $templatename %>"><% $link_label %></A>)
78 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
80 % my( $txt_label, $txtlink_label)=
81 % length( $templatename )
82 % ? labels("invoice_template_$templatename.png")
83 % : ( 'Main template', 'edit' );
85 (<A HREF="<% $p %>edit/invoice_template.html?type=text;name=<% $templatename %>"><% $txtlink_label %></A>)
93 <% include("/elements/footer.html") %>
98 'returnaddress' => 'Return address',
100 'footer' => 'Footer',
101 'smallfooter' => 'Small footer',
102 '' => 'Main template',
105 my $conf = new FS::Conf;
108 my $filename = shift;
109 if ( $conf->exists($filename) ) {
110 ( 'Custom', 'edit' );
112 ( 'Standard', 'customize' );
120 unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
122 my @templatenames = $conf->invoice_templatenames;