Bugzilla – Attachment 72611 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]
Bug 15985 - Include transacting library in fines
Bug-15985---Include-transacting-library-in-fines.patch (text/plain), 4.62 KB, created by
Kyle M Hall (khall)
on 2018-03-09 15:44:02 UTC
(
hide
)
Description:
Bug 15985 - Include transacting library in fines
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2018-03-09 15:44:02 UTC
Size:
4.62 KB
patch
obsolete
>From ce24958e6786af3a0e4b0f8a22579ba832db27d0 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 | 9 ++++++--- > members/pay.pl | 2 ++ > t/db_dependent/Koha/Checkouts.t | 6 +++++- > 4 files changed, 26 insertions(+), 5 deletions(-) > >diff --git a/Koha/Checkout.pm b/Koha/Checkout.pm >index b7a752c..2678c60 100644 >--- a/Koha/Checkout.pm >+++ b/Koha/Checkout.pm >@@ -21,11 +21,12 @@ package Koha::Checkout; > use Modern::Perl; > > use Carp; >+use DateTime; > > use Koha::Database; >-use DateTime; > use Koha::DateUtils; > use Koha::Items; >+use Koha::Libraries; > > use base qw(Koha::Object); > >@@ -88,6 +89,17 @@ sub patron { > return Koha::Patron->_new_from_dbic( $patron_rs ); > } > >+=head library >+ >+=cut >+ >+sub library { >+ my ($self) = @_; >+ >+ my $library_rs = $self->_result->branch; >+ return Koha::Library->_new_from_dbic( $library_rs ); >+} >+ > =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 34b6d11..099b32a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt >@@ -40,6 +40,7 @@ > <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> >@@ -49,7 +50,7 @@ > </thead> > <tfoot> > <tr> >- <td class="total" colspan="6">Total due:</td> >+ <td class="total" colspan="7">Total due:</td> > <td style="text-align: right;">[% total | $Price %]</td> > </tr> > </tfoot> >@@ -74,6 +75,9 @@ > <input type="hidden" name="amountoutstanding[% line.accountlines_id %]" value="[% line.amountoutstanding %]" /> > <input type="hidden" name="borrowernumber[% line.accountlines_id %]" value="[% line.borrowernumber %]" /> > </td> >+ <td class="checked-out-from"> >+ [% line.checkout.library.branchname %] >+ </td> > <td> > [% SWITCH line.accounttype %] > [% CASE 'Pay' %]Payment, thanks >@@ -109,8 +113,7 @@ > [% END %] > [% 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 | $Price %]</td> > </tr> > [% END %] >diff --git a/members/pay.pl b/members/pay.pl >index 05b73e5..bb6573c 100755 >--- a/members/pay.pl >+++ b/members/pay.pl >@@ -40,6 +40,7 @@ use C4::Koha; > use C4::Overdues; > use C4::Members::Attributes qw(GetBorrowerAttributes); > use Koha::Patrons; >+use Koha::Checkouts; > > use Koha::Patron::Categories; > use URI::Escape; >@@ -135,6 +136,7 @@ sub add_accounts_to_template { > my $biblio = $item->biblio; > $account_line->{biblionumber} = $biblio->biblionumber; > $account_line->{title} = $biblio->title; >+ $account_line->{checkout} = Koha::Checkouts->find($accountline->{issue_id}); > } > push @accounts, $account_line; > } >diff --git a/t/db_dependent/Koha/Checkouts.t b/t/db_dependent/Koha/Checkouts.t >index c8ec4c5..8cbffc6 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 => 7; >+use Test::More tests => 9; > > use Koha::Checkouts; > use Koha::Database; >@@ -49,6 +49,9 @@ my $new_checkout_2 = Koha::Checkout->new( > } > )->store; > >+is( $new_checkout_1->library->id, $library->{branchcode}, 'Got correct library for checkout1' ); >+is( $new_checkout_2->library->id, $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' ); > >@@ -103,5 +106,6 @@ subtest 'patron' => sub { > $retrieved_checkout_1->delete; > is( Koha::Checkouts->search->count, $nb_of_checkouts + 1, 'Delete should have deleted the checkout' ); > >+ > $schema->storage->txn_rollback; > >-- >2.10.2
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