Bugzilla – Attachment 99821 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.76 KB, created by
Tomás Cohen Arazi (tcohen)
on 2020-02-29 20:14:29 UTC
(
hide
)
Description:
Bug 15985: Include transacting library in fines
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2020-02-29 20:14:29 UTC
Size:
4.76 KB
patch
obsolete
>From 27b511013fbd12735f8a390597a34c7b48250be7 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> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > Koha/Checkout.pm | 12 ++++++++++++ > .../intranet-tmpl/prog/en/modules/members/pay.tt | 10 +++++++--- > members/pay.pl | 1 + > t/db_dependent/Koha/Checkouts.t | 6 +++++- > 4 files changed, 25 insertions(+), 4 deletions(-) > >diff --git a/Koha/Checkout.pm b/Koha/Checkout.pm >index 72cf41b9e0..cdb4738005 100644 >--- a/Koha/Checkout.pm >+++ b/Koha/Checkout.pm >@@ -28,6 +28,7 @@ use Koha::Checkouts::ReturnClaims; > use Koha::Database; > use Koha::DateUtils; > use Koha::Items; >+use Koha::Libraries; > > use base qw(Koha::Object); > >@@ -161,6 +162,17 @@ sub claim_returned { > }; > } > >+=head library >+ >+=cut >+ >+sub library { >+ my ($self) = @_; >+ >+ my $library_rs = $self->_result->branch; >+ return Koha::Library->_new_from_dbic( $library_rs ); >+} >+ > =head2 Internal methods > > =head3 _type >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 a4e4568a06..e0c708767f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt >@@ -46,6 +46,7 @@ > <th class="NoSort"> </th> > <th class="NoSort">Actions</th> > <th>Account type</th> >+ <th class="checked-out-from">Checked out from</th> > <th>Description</th> > <th class="title-string">Date</th> > <th>Barcode</th> >@@ -83,6 +84,9 @@ > <td> > [% PROCESS account_type_description account=line %] > </td> >+ <td class="checked-out-from"> >+ [% line.checkout.library.branchname %] >+ </td> > <td> > [%- IF line.description %][% line.description | html %][% END %] > [% IF line.itemnumber %]([% line.item.biblio.title | html %])[% END %] >@@ -117,16 +121,16 @@ > > <tfoot> > <tr> >- <td class="total" colspan="10">Total due:</td> >+ <td class="total" colspan="11">Total due:</td> > <td style="text-align: right;">[% total | $Price %]</td> > </tr> > [% IF outstanding_credits.total_outstanding < 0 %] > <tr> >- <td class="total" colspan="10">Outstanding credits could be applied: </td> >+ <td class="total" colspan="11">Outstanding credits could be applied: </td> > <td class="credit" style="text-align: right;"><button type="submit" id="apply_credits" name="apply_credits" value="apply_credits" class="btn btn-default btn-sm">Apply <strong class="credit">[% outstanding_credits.total_outstanding | $Price %]</strong></button></td> > </tr> > <tr> >- <td class="total" colspan="10">Total due if credit applied:</td> >+ <td class="total" colspan="11">Total due if credit applied:</td> > <td style="text-align: right;">[% total + outstanding_credits.total_outstanding | $Price %]</td> > </tr> > [% END %] >diff --git a/members/pay.pl b/members/pay.pl >index e70e195146..39e2dc372f 100755 >--- a/members/pay.pl >+++ b/members/pay.pl >@@ -39,6 +39,7 @@ use C4::Stats; > use C4::Koha; > use C4::Overdues; > use Koha::Patrons; >+use Koha::Checkouts; > > use Koha::Patron::Categories; > use URI::Escape; >diff --git a/t/db_dependent/Koha/Checkouts.t b/t/db_dependent/Koha/Checkouts.t >index dfb90e42a8..3bfa8cd755 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 C4::Circulation; > use Koha::Checkouts; >@@ -50,6 +50,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' ); > >@@ -125,5 +128,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.25.0
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