diff options
author | levinse <levinse> | 2011-02-16 07:39:04 +0000 |
---|---|---|
committer | levinse <levinse> | 2011-02-16 07:39:04 +0000 |
commit | bc03d12fffd22153b5035bc021450387bacc17b8 (patch) | |
tree | 64b94104c0306f0efd485fbf104df51bb006cab7 /httemplate/view | |
parent | b3c2e70e63eb8f7ab2543a4d400f72bd5044a9f9 (diff) |
add barcodes to invoices, HTML part, RT10698
Diffstat (limited to 'httemplate/view')
-rwxr-xr-x | httemplate/view/cust_bill-barcode.cgi | 18 | ||||
-rwxr-xr-x | httemplate/view/cust_bill.cgi | 2 |
2 files changed, 20 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> 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 )) |