Bugzilla – Attachment 58163 Details for
Bug 15985
Include checkout library in fines
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Attachment to Bug 15985 - Include transacting library in fines
Bug-15985---Include-transacting-library-in-fines.patch (text/plain), 4.74 KB, created by
Jason Robb
on 2016-12-13 18:05:14 UTC
(
hide
)
Description:
[SIGNED-OFF] Attachment to Bug 15985 - Include transacting library in fines
Filename:
MIME Type:
Creator:
Jason Robb
Created:
2016-12-13 18:05:14 UTC
Size:
4.74 KB
patch
obsolete
>From af0fbbe8317074c62932fcfa663f197e1b431d36 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Tue, 13 Dec 2016 13:23:18 +0000 >Subject: [PATCH] Bug 15985 - Include transacting library in fines > >Some librarians would like to see the library an item was checked out >from in the fines table on the fines payment page. > >Test Plan: >1) Apply this patch >2) Find a patron with overdue items that have fines >3) Browse to the pay fines page >4) Note the new "checked out from" column > >Signed-off-by: Jason Robb <jrobb@sekls.org> >--- > Koha/Checkout.pm | 14 +++++++++++--- > koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt | 8 ++++++-- > members/pay.pl | 2 ++ > t/db_dependent/Koha/Checkouts.t | 6 +++++- > 4 files changed, 24 insertions(+), 6 deletions(-) > >diff --git a/Koha/Checkout.pm b/Koha/Checkout.pm >index 358f41c..eb8c144 100644 >--- a/Koha/Checkout.pm >+++ b/Koha/Checkout.pm >@@ -19,9 +19,7 @@ package Koha::Checkout; > > use Modern::Perl; > >-use Carp; >- >-use Koha::Database; >+use Koha::Libraries; > > use base qw(Koha::Object); > >@@ -35,6 +33,16 @@ Koha::Checkout - Koha Checkout object class > > =cut > >+=head library >+ >+=cut >+ >+sub library { >+ my ($self) = @_; >+ >+ return Koha::Libraries->find( $self->branchcode ); >+} >+ > =head3 type > > =cut >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt >index b37ce3c..9451096 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt >@@ -75,6 +75,7 @@ function enableCheckboxActions(){ > <tr> > <th> </th> > <th>Fines & charges</th> >+ <th class="checked-out-from">Checked out from</th> > <th>Description</th> > <th>Payment note</th> > <th>Account type</th> >@@ -86,7 +87,7 @@ function enableCheckboxActions(){ > </thead> > <tfoot> > <tr> >- <td class="total" colspan="8">Total due:</td> >+ <td class="total" colspan="9">Total due:</td> > <td style="text-align: right;">[% total | format('%.2f') %]</td> > </tr> > </tfoot> >@@ -115,6 +116,9 @@ function enableCheckboxActions(){ > <input type="hidden" name="notify_level[% line.accountlines_id %]" value="[% line.notify_level %]" /> > <input type="hidden" name="totals[% line.accountlines_id %]" value="[% line.totals %]" /> > </td> >+ <td class="checked-out-from"> >+ [% line.checkout.library.branchname %] >+ </td> > <td> > [% SWITCH line.accounttype %] > [% CASE 'Pay' %]Payment, thanks >@@ -152,7 +156,7 @@ function enableCheckboxActions(){ > [% IF ( account_grp.total ) %] > <tr> > >- <td class="total" colspan="8" style="text-align: right;">Sub total:</td> >+ <td class="total" colspan="9" style="text-align: right;">Sub total:</td> > <td style="text-align: right;">[% account_grp.total | format('%.2f') %]</td> > </tr> > [% END %] >diff --git a/members/pay.pl b/members/pay.pl >index bfca78b..6df625e 100755 >--- a/members/pay.pl >+++ b/members/pay.pl >@@ -41,6 +41,7 @@ use C4::Koha; > use C4::Overdues; > use C4::Members::Attributes qw(GetBorrowerAttributes); > use Koha::Patron::Images; >+use Koha::Checkouts; > > use Koha::Patron::Categories; > use URI::Escape; >@@ -127,6 +128,7 @@ sub add_accounts_to_template { > GetBorNotifyAcctRecord( $borrowernumber, $notify_id ); > if ( @{$accountlines} ) { > my $totalnotify = AmountNotify( $notify_id, $borrowernumber ); >+ map { $_->{checkout} = Koha::Checkouts->find($_->{issue_id} ) } @$accountlines; > push @{$accounts}, > { accountlines => $accountlines, > notify => $notify_id, >diff --git a/t/db_dependent/Koha/Checkouts.t b/t/db_dependent/Koha/Checkouts.t >index e8b1341..ec565e6 100644 >--- a/t/db_dependent/Koha/Checkouts.t >+++ b/t/db_dependent/Koha/Checkouts.t >@@ -19,7 +19,7 @@ > > use Modern::Perl; > >-use Test::More tests => 4; >+use Test::More tests => 6; > > use Koha::Checkout; > use Koha::Checkouts; >@@ -49,6 +49,9 @@ my $new_checkout_2 = Koha::Checkout->new( > } > )->store; > >+is( $new_checkout_1->library->branchcode, $library->{branchcode}, 'Got correct library for checkout1' ); >+is( $new_checkout_2->library->branchcode, $library->{branchcode}, 'Got correct library for checkout2' ); >+ > like( $new_checkout_1->issue_id, qr|^\d+$|, 'Adding a new checkout should have set the issue_id' ); > is( Koha::Checkouts->search->count, $nb_of_checkouts + 2, 'The 2 checkouts should have been added' ); > >@@ -58,6 +61,7 @@ is( $retrieved_checkout_1->itemnumber, $new_checkout_1->itemnumber, 'Find a chec > $retrieved_checkout_1->delete; > is( Koha::Checkouts->search->count, $nb_of_checkouts + 1, 'Delete should have deleted the checkout' ); > >+ > $schema->storage->txn_rollback; > > 1; >-- >2.1.4
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 15985
:
58157
|
58163
|
71165
|
72611
|
72612
|
90317
|
90318
|
90364
|
90478
|
97177
|
97178
|
97179
|
97180
|
99821
|
99822
|
99823
|
99824
|
99825
|
103152
|
103153
|
103154
|
103155
|
103156
|
103157
|
104491
|
104492
|
105144
|
105398