From b9d2d7f2c80e5e89358bba0b2c3ba1de9f406c82 Mon Sep 17 00:00:00 2001 From: levinse Date: Wed, 16 Feb 2011 07:39:02 +0000 Subject: add barcodes to invoices, HTML part, RT10698 --- httemplate/view/cust_bill-barcode.cgi | 18 ++++++++++++++++++ httemplate/view/cust_bill.cgi | 2 ++ 2 files changed, 20 insertions(+) create mode 100755 httemplate/view/cust_bill-barcode.cgi (limited to 'httemplate') 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' ); + + diff --git a/httemplate/view/cust_bill.cgi b/httemplate/view/cust_bill.cgi index 0928d04bc..3d3fb7028 100755 --- a/httemplate/view/cust_bill.cgi +++ b/httemplate/view/cust_bill.cgi @@ -125,6 +125,8 @@ my %opt = ( 'notice_name' => $notice_name, ); +$opt{'barcode_img'} = 1 if $conf->exists('invoice-barcode'); + my @payby = grep /\w/, $conf->config('payby'); #@payby = (qw( CARD DCRD CHEK DCHK LECB BILL CASH WEST COMP )) @payby = (qw( CARD DCRD CHEK DCHK LECB BILL CASH COMP )) -- cgit v1.2.1