summaryrefslogtreecommitdiff
path: root/httemplate/view/cust_bill-barcode.cgi
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/view/cust_bill-barcode.cgi')
-rwxr-xr-xhttemplate/view/cust_bill-barcode.cgi18
1 files changed, 18 insertions, 0 deletions
diff --git a/httemplate/view/cust_bill-barcode.cgi b/httemplate/view/cust_bill-barcode.cgi
new file mode 100755
index 000000000..dd8f8b814
--- /dev/null
+++ b/httemplate/view/cust_bill-barcode.cgi
@@ -0,0 +1,18 @@
+<% $png %>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('View invoices');
+
+my $conf = new FS::Conf;
+
+die 'invalid query' unless $cgi->param('invnum');
+
+my $cust_bill = qsearchs('cust_bill', { 'invnum' => $cgi->param('invnum') } )
+or die 'unknown invnum';
+
+my $png = $cust_bill->invoice_barcode(0);
+
+http_header('Content-Type' => 'image/png' );
+
+</%init>