From fc263806f5e475559a0c4cfdb70a5f1cefe0ffa3 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Wed, 27 May 2020 13:39:47 -0700 Subject: deposit slips --- httemplate/docs/credits.html | 8 +++++--- httemplate/docs/license.html | 10 ++++++++-- httemplate/search/elements/grouped-search.html | 2 +- httemplate/search/elements/grouped-search/deposit_slip | 8 ++++++++ httemplate/search/elements/grouped-search/html | 6 +++++- httemplate/search/elements/search-deposit_slip.html | 17 +++++++++++++++++ httemplate/search/elements/search.html | 9 +++++++-- 7 files changed, 51 insertions(+), 9 deletions(-) create mode 100644 httemplate/search/elements/grouped-search/deposit_slip create mode 100644 httemplate/search/elements/search-deposit_slip.html (limited to 'httemplate') diff --git a/httemplate/docs/credits.html b/httemplate/docs/credits.html index 4bcb2661f..d71d56351 100644 --- a/httemplate/docs/credits.html +++ b/httemplate/docs/credits.html @@ -29,9 +29,6 @@

Core Team

-Christopher Burger
-Mitch Jackson
-Jim Lucas
Ivan Kohler

@@ -64,6 +61,7 @@ Stephen Bechard
Eric Bosrup
Dickie Bradford
Alex Brelsfoard
+Christopher Burger
Dave Burgess
Joe Camadine
Chris Cappuccio
@@ -76,6 +74,7 @@ Dave Denney
Serge Dolgov
Scott Edwards
Kenny Elliott
+Velimir Gayevskiy
Joshua Goodman
Donald Greer
Joel Griffiths
@@ -85,12 +84,14 @@ Troy Hammonds
Sean Hanson
Dale Hege
Kelly Hickel
+Mitch Jackson
Mark James
Gary Jones
Fernando M. Kiernan
Frederico Caldeira Knabben
Greg Kuhnert
Steven Levithan
+Jim Lucas
Randall Lucas
Foteos Macrides
Roger Mangraviti
@@ -100,6 +101,7 @@ David Peters
Matt Peterson
Luke Pfeifer
Alan Phipps
+Eric Sandeen
Ricardo Signes
Steve Simitzis
Stanislav Sinyagin
diff --git a/httemplate/docs/license.html b/httemplate/docs/license.html index 1b9d10a53..267692005 100644 --- a/httemplate/docs/license.html +++ b/httemplate/docs/license.html @@ -6,7 +6,7 @@

-Copyright © 2005-2017 Freeside Internet Services, Inc.
+Copyright © 2005-2020 Freeside Internet Services, Inc.
Copyright © 2000-2005 Ivan Kohler
Copyright © 1999 Silicon Interactive Software Design
All rights reserved
@@ -152,6 +152,9 @@ licensed under the terms of MIT License. Contains the leaflet JavaScript library Leaflet JS by Vladimir Agafonkin, licensed under the terms of MIT License. +

+Contains a deposit slip template by Vel from LaTeX Typesetting. +

@@ -170,7 +173,6 @@ http://www.iconarchive.com/show/oxygen-icons-by-oxygen-icons.org/Actions-documen licensed under GNU Lesser General Public License

-

Contains icons from iconfinder.com @@ -178,5 +180,9 @@ by Cole Bemis, licensed under the terms of the Creative Commons Attribution 3.0 License.

+

+Contains the GnuMICR font +by Eric Sandeen, licensed under the terms of the GNU GPL. + diff --git a/httemplate/search/elements/grouped-search.html b/httemplate/search/elements/grouped-search.html index 56fc88d38..80a931983 100644 --- a/httemplate/search/elements/grouped-search.html +++ b/httemplate/search/elements/grouped-search.html @@ -42,7 +42,7 @@ <%init> my $type = 'html'; -if ($cgi->param('type') =~ /^(html|html-print|xls)$/) { +if ($cgi->param('type') =~ /^(html|html-print|xls|deposit_slip)$/) { $type = $1; } diff --git a/httemplate/search/elements/grouped-search/deposit_slip b/httemplate/search/elements/grouped-search/deposit_slip new file mode 100644 index 000000000..6e69662c4 --- /dev/null +++ b/httemplate/search/elements/grouped-search/deposit_slip @@ -0,0 +1,8 @@ +<& /search/elements/search-deposit_slip.html, rows=>\@rows, &>\ +<%init> +my %opt = @_; +my $group_info = $m->comp('core', %opt); +#just the first group +my $query = $group_info->{queries}[0]; +my @rows = $query->qsearch; + diff --git a/httemplate/search/elements/grouped-search/html b/httemplate/search/elements/grouped-search/html index ae8086512..24cf50e96 100644 --- a/httemplate/search/elements/grouped-search/html +++ b/httemplate/search/elements/grouped-search/html @@ -114,9 +114,13 @@ my $money = $conf->config('money_char') || '$'; %# download links

<% emt('Download results:') %> % $cgi->param('type', 'xls'); -<% emt('Spreadsheet') %> |  +<% emt('Spreadsheet') %> | % $cgi->param('type', 'html-print'); <% emt('webpage') %> +% if ( ref($query) && $query->{table} eq 'cust_pay' ) { +% $cgi->param('type', 'deposit_slip'); + | <% emt('deposit slip') %> +% } % $cgi->delete('type');

% } diff --git a/httemplate/search/elements/search-deposit_slip.html b/httemplate/search/elements/search-deposit_slip.html new file mode 100644 index 000000000..c7a6cbb18 --- /dev/null +++ b/httemplate/search/elements/search-deposit_slip.html @@ -0,0 +1,17 @@ +<% $deposit_pdf %>\ +<%init> + +my %args = @_; +my $rows = $args{'rows'}; + +my $deposit_pdf = deposit_slip_pdf( + conf => FS::Conf->new, + cust_pay => $rows, +); + +http_header('Content-Type' => 'application/pdf'); +http_header('Content-Disposition' => "filename=deposit.pdf" ); +http_header('Content-Length' => length($deposit_pdf) ); +http_header('Cache-control' => 'max-age=60' ); + + diff --git a/httemplate/search/elements/search.html b/httemplate/search/elements/search.html index 730a51aa3..60548e28e 100644 --- a/httemplate/search/elements/search.html +++ b/httemplate/search/elements/search.html @@ -198,6 +198,10 @@ Example: % <% include('search-xml.html', rows=>$rows, opt=>\%opt ) %> % +% } elsif ( $type eq 'deposit_slip' ) { +% +<% include('search-deposit_slip.html', rows=>$rows, opt=>\%opt ) %> +% % } else { % <% include('search-html.html', @@ -224,8 +228,9 @@ my $curuser = $FS::CurrentUser::CurrentUser; $m->comp('/elements/handle_uri_query'); -my $type = $cgi->param('_type') =~ /^(csv|\w*\.xls|xml|select|html(-print)?)$/ - ? $1 : 'html' ; +my $type = $cgi->param('_type') + =~ /^(csv|\w*\.xls|xml|select|html(-print)?|deposit_slip)$/ + ? $1 : 'html' ; if ( !$curuser->access_right('Download report data') ) { $opt{'disable_download'} = 1; -- cgit v1.2.1