Bugzilla – Attachment 33625 Details for
Bug 12971
Regression: Patron print summary doesn't show checkouts
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 12971 - Regression: Patron print summary doesn't show checkouts
SIGNED-OFF-Bug-12971---Regression-Patron-print-sum.patch (text/plain), 13.83 KB, created by
Owen Leonard
on 2014-11-17 19:42:42 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 12971 - Regression: Patron print summary doesn't show checkouts
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2014-11-17 19:42:42 UTC
Size:
13.83 KB
patch
obsolete
>From 18f7f32949fa2ed53ed555346382ae800ef94b22 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Mon, 17 Nov 2014 12:31:05 -0500 >Subject: [PATCH] [SIGNED-OFF] Bug 12971 - Regression: Patron print summary > doesn't show checkouts >Content-Type: text/plain; charset="utf-8" > >A patron's print summary should contain a list of checked out items >as it did in 3.16.2 and earlier. > >Please note, as of 3.16.2 reserves were no longer part of the print >summary and thus are not part of this bug fixing patch. > >Test Plan: >1) Find a patron with checked out items >2) Choose Print -> Print summary >3) Note the lack of a list of checkouts >4) Apply this patch >5) Reload the page >5) Print the summary again >6) Note the list of checkouts > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > .../prog/en/includes/members-toolbar.inc | 2 +- > .../prog/en/modules/members/moremember-print.tt | 196 +++++++++----------- > members/summary-print.pl | 101 ++++++++++ > 3 files changed, 191 insertions(+), 108 deletions(-) > create mode 100755 members/summary-print.pl > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc >index 870f254..828c564 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc >@@ -115,7 +115,7 @@ function export_barcodes() { > } > var slip_re = /slip/; > function printx_window(print_type) { >- var handler = print_type.match(slip_re) ? "printslip" : "moremember"; >+ var handler = print_type.match(slip_re) ? "printslip" : "summary-print"; > window.open("/cgi-bin/koha/members/" + handler + ".pl?borrowernumber=[% borrowernumber %]&print=" + print_type, "printwindow"); > return false; > } >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-print.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-print.tt >index 4c71072..e60a8e1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-print.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-print.tt >@@ -1,121 +1,103 @@ > [% USE Koha %] >+[% USE Branches %] > [% USE KohaDates %] > [% INCLUDE 'doc-head-open.inc' %] >-<title>Summary for [% firstname %] [% surname %] ([% cardnumber %])</title> >-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> >-<link rel="shortcut icon" href="[% IF ( IntranetFavicon ) %][% IntranetFavicon %][% ELSE %][% interface %]/[% theme %]/img/favicon.ico[% END %]" type="image/x-icon" /> >-<link rel="stylesheet" type="text/css" href="[% themelang %]/css/print.css" /> >-[% INCLUDE 'slip-print.inc' #printThenClose %] >-<body id="pat_moremember-print" class="pat" onload="printThenClose();"> >- >+ <title>Summary for [% firstname %] [% surname %] ([% cardnumber %])</title> >+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> >+ <link rel="shortcut icon" href="[% IF ( IntranetFavicon ) %][% IntranetFavicon %][% ELSE %][% interface %]/[% theme %]/img/favicon.ico[% END %]" type="image/x-icon" /> >+ <link rel="stylesheet" type="text/css" href="[% themelang %]/css/print.css" /> >+ [% INCLUDE 'slip-print.inc' #printThenClose %] > </head> >-<body> >+<body id="pat_moremember-print" class="pat" onload="printThenClose();"> >+ <div id="main"> >+ <h3><a href="/cgi-bin/koha/circ/circulation.pl?findborrower=[% cardnumber %]">Account summary: [% firstname %] [% surname %] ([% cardnumber %])</a></h3> > >-<div id="main"> >+ <ul> >+ <li>[% address %]<br />[% address2 %]</li> >+ <li>[% city %], [% zipcode %]</li> >+ <li>[% IF ( phone ) %][% phone %][% ELSE %](no phone number on file)[% END %]</li> >+ <li>[% IF ( email ) %][% email %][% ELSE %](no primary email on file)[% END %]</li> >+ [% IF ( emailpro ) %] >+ <li>[% emailpro %]</li> >+ [% END %] >+ <li>Registration date: [% dateenrolled | $KohaDates %]</li> >+ <li>Expiration date: [% dateexpiry | $KohaDates %]</li> >+ <li>Library: [% Branches.GetName( branchcode ) %]</li> >+ <li>Category: [% description %]</li> >+ </ul> > >-<h3><a href="/cgi-bin/koha/circ/circulation.pl?findborrower=[% cardnumber %]">Account summary: [% firstname %] [% surname %] ([% cardnumber %])</a></h3> >+ [% IF ( issues ) %] >+ <table> >+ <caption>Items checked out</caption> >+ <tr> >+ <th>Title</th> >+ <th>Author</th> >+ <th>Call no</th> >+ <th>Item type</th> >+ <th>Date due</th> >+ <th>Barcode</th> >+ <th>Charge</th> >+ <th>Price</th> >+ <th>Status</th> >+ </tr> > >-<ul><li>[% address %]<br />[% address2 %]</li><li>[% city %], [% zipcode %]</li> >-<li>[% IF ( phone ) %][% phone %][% ELSE %](no phone number on file)[% END %]</li> >-<li>[% IF ( email ) %][% email %][% ELSE %](no primary email on file)[% END %]</li> >-[% IF ( emailpro ) %]<li>[% emailpro %]</li>[% END %] >-<li>Registration date: [% dateenrolled %]</li> >-<li>Expiration date: [% dateexpiry %]</li> >-<li>Library: [% branchname %]</li> >-<li>Category: [% description %]</li> >-</ul> >+ [% FOREACH issueloo IN issues %] >+ [% IF ( issueloo.red ) %]<tr class="overdue">[% ELSE %]<tr>[% END %] >+ <td> >+ [% issueloo.title |html %] >+ <a href="/cgi-bin/koha/catalogue/detail.pl?item=[% issueloo.itemnumber %]&biblionumber=[% issueloo.biblionumber %]&bi=[% issueloo.biblioitemnumber %]"></a> >+ </td> >+ <td>[% issueloo.author %]</td> >+ <td>[% issueloo.itemcallnumber %]</td> >+ <td>[% issueloo.itemtype_description %]</td> >+ <td>[% issueloo.date_due %]</td> >+ <td>[% issueloo.barcode %]</td> >+ <td>[% issueloo.charge %]</td> >+ <td>[% issueloo.replacementprice %]</td> >+ <td>[% IF ( issueloo.red ) %]Overdue![% ELSE %] [% END %]</td> >+ </tr> >+ [% END %] > >-[% IF ( issueloop ) %] >-<table> >- <caption>Items checked out</caption> >- <tr> >- <th>Title</th> >- <th>Author</th> >- <th>Call no</th> >- <th>Item type</th> >- <th>Date due</th> >- <th>Barcode</th> >- <th>Charge</th> >- <th>Price</th> >- <th>Status</th> >- </tr> >+ <tr> >+ <td colspan="6" style="text-align: right; font-weight:bold;">Totals:</td> >+ <td>[% totaldue %]</td> >+ <td>[% totalprice %]</td> >+ <td colspan="3"> </td> >+ </tr> >+ </table> >+ [% END %] > >- [% FOREACH issueloo IN issueloop %] >- [% IF ( issueloo.red ) %]<tr class="overdue">[% ELSE %]<tr>[% END %] >- <td> >- [% issueloo.title |html %] >- <a href="/cgi-bin/koha/catalogue/detail.pl?item=[% issueloo.itemnumber %]&biblionumber=[% issueloo.biblionumber %]&bi=[% issueloo.biblioitemnumber %]"> >- </a> >- </td> >- <td>[% issueloo.author %]</td> >- <td>[% issueloo.itemcallnumber %]</td> >- <td>[% issueloo.itemtype_description %]</td> >- <td>[% issueloo.date_due %]</td> >- <td>[% issueloo.barcode %]</td> >- <td>[% issueloo.charge %]</td> >- <td>[% issueloo.replacementprice %]</td> >- <td>[% IF ( issueloo.red ) %]Overdue![% ELSE %] [% END %]</td> >- </tr> >- [% END %] >- <tr> >- <td colspan="6" style="text-align: right; font-weight:bold;">Totals:</td> >- <td>[% totaldue %]</td> >- <td>[% totalprice %]</td> >- <td colspan="3"> </td> >- </tr> >- </table> >- [% END %] >- >-[% IF ( reserveloop ) %] >-<table> >- <caption>Items on Reserve</caption> >- <tr> >- <th>Title</th> >- <th>Author</th> >- <th>Format</th> >- <th>Requested</th> >- </tr> >+ [% IF ( accounts && ( totaldue != '0.00' ) ) %] >+ <table> >+ <caption>Account fines and payments</caption> >+ <tr> >+ <th>Description of charges</th> >+ <th>Date</th> >+ <th>Amount</th> >+ <th>Outstanding</th> >+ </tr> > >-[% FOREACH reserveloo IN reserveloop %] >- <tr> >- <td><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% reserveloo.biblionumber %]">[% reserveloo.btitle %]</a></td> >- <td>[% reserveloo.author %]</td> >- <td>[% reserveloo.description %]</td> >- <td>[% reserveloo.reservedate2 %]</td> >- </tr> >- [% END %] >-</table> >-[% END %] >+ [% FOREACH account IN accounts %] >+ [% NEXT IF account.amountoutstanding == '0.00' %] >+ <tr> >+ <td> >+ [% IF ( account.itemnumber ) %]<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% account.biblionumber %]&itemnumber=[% account.itemnumber %]">[% END %] >+ [% account.description %] [% IF ( account.printtitle ) %] [% account.title |html %][% END %] >+ [% IF ( account.itemnumber ) %]</a>[% END %] >+ </td> >+ <td>[% account.date | $KohaDates %]</td> >+ <td>[% account.amount %]</td> >+ <td>[% account.amountoutstanding %]</td> >+ </tr> >+ [% END %] > >-[% IF ( accounts && ( totaldue != '0.00' ) ) %] >-<table> >- <caption>Account fines and payments</caption> >- <tr> >- <th>Description of charges</th> >- <th>Date</th> >- <th>Amount</th> >- <th>Outstanding</th> >- </tr> >- [% FOREACH account IN accounts %] >- [% NEXT IF account.amountoutstanding == '0.00' %] >- <tr> >- <td> >- [% IF ( account.itemnumber ) %]<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% account.biblionumber %]&itemnumber=[% account.itemnumber %]">[% END %] >- [% account.description %] [% IF ( account.printtitle ) %] [% account.title |html %][% END %] >- [% IF ( account.itemnumber ) %]</a>[% END %] >- </td> >- <td>[% account.date | $KohaDates %]</td> >- <td>[% account.amount %]</td> >- <td>[% account.amountoutstanding %]</td> >- </tr> >+ <tfoot> >+ <tr> >+ <td colspan="3">Total due</td> >+ <td colspan="2">[% totaldue %]</td> >+ </tr> >+ </tfoot> >+ </table> > [% END %] >- <tfoot> >- <tr> >- <td colspan="3">Total due</td> >- <td colspan="2">[% totaldue %]</td> >- </tr> >- </tfoot> >-</table> >-[% END %] > > [% INCLUDE 'intranet-bottom.inc' %] >diff --git a/members/summary-print.pl b/members/summary-print.pl >new file mode 100755 >index 0000000..ea227dd >--- /dev/null >+++ b/members/summary-print.pl >@@ -0,0 +1,101 @@ >+#!/usr/bin/perl >+ >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it under the >+# terms of the GNU General Public License as published by the Free Software >+# Foundation; either version 3 of the License, or (at your option) any later >+# version. >+# >+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY >+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR >+# A PARTICULAR PURPOSE. See the GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License along >+# with Koha; if not, write to the Free Software Foundation, Inc., >+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. >+ >+use Modern::Perl; >+ >+use CGI; >+ >+use C4::Auth; >+use C4::Output; >+use C4::Members; >+use C4::Koha qw( getitemtypeinfo ); >+use C4::Circulation qw( GetIssuingCharges ); >+ >+my $input = CGI->new; >+my $borrowernumber = $input->param('borrowernumber'); >+ >+my ( $template, $loggedinuser, $cookie ) = get_template_and_user( >+ { >+ template_name => "members/moremember-print.tt", >+ query => $input, >+ type => "intranet", >+ authnotrequired => 0, >+ flagsrequired => { circulate => "circulate_remaining_permissions" }, >+ debug => 1, >+ } >+); >+ >+my $data = GetMember( 'borrowernumber' => $borrowernumber ); >+ >+my ( $total, $accts, $numaccts ) = GetMemberAccountRecords($borrowernumber); >+foreach my $accountline (@$accts) { >+ $accountline->{amount} = sprintf '%.2f', $accountline->{amount}; >+ $accountline->{amountoutstanding} = sprintf '%.2f', >+ $accountline->{amountoutstanding}; >+ >+ if ( $accountline->{accounttype} ne 'F' >+ && $accountline->{accounttype} ne 'FU' ) >+ { >+ $accountline->{printtitle} = 1; >+ } >+} >+ >+my $roadtype = >+ C4::Koha::GetAuthorisedValueByCode( 'ROADTYPE', $data->{streettype} ); >+ >+our $totalprice = 0; >+$template->param( >+ %$data, >+ >+ borrowernumber => $borrowernumber, >+ address => $data->{'streetnumber'} . " $roadtype " . $data->{'address'}, >+ >+ accounts => $accts, >+ totaldue => sprintf( "%.2f", $total ), >+ >+ issues => build_issue_data( GetPendingIssues($borrowernumber) ), >+ totalprice => $totalprice, >+); >+ >+output_html_with_http_headers $input, $cookie, $template->output; >+ >+sub build_issue_data { >+ my $issues = shift; >+ >+ my $return; >+ >+ my $today = DateTime->now( time_zone => C4::Context->tz ); >+ $today->truncate( to => 'day' ); >+ >+ foreach my $issue ( @{$issues} ) { >+ >+ my %row = %{$issue}; >+ $totalprice += $issue->{replacementprice}; >+ >+ #find the charge for an item >+ my ( $charge, $itemtype ) = >+ GetIssuingCharges( $issue->{itemnumber}, $borrowernumber ); >+ >+ my $itemtypeinfo = getitemtypeinfo($itemtype); >+ $row{'itemtype_description'} = $itemtypeinfo->{description}; >+ >+ $row{'charge'} = sprintf( "%.2f", $charge ); >+ >+ push( @{$return}, \%row ); >+ } >+ return $return; >+} >-- >1.7.9.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 12971
:
33621
|
33623
|
33625
|
33628
|
33650
|
33664
|
33665
|
33666
|
35484