Bugzilla – Attachment 63634 Details for
Bug 18651
Move of checkouts is still not correctly handled
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18651: Update issue_id in AddReturn
Bug-18651-Update-issueid-in-AddReturn.patch (text/plain), 2.52 KB, created by
Kyle M Hall (khall)
on 2017-05-22 18:06:40 UTC
(
hide
)
Description:
Bug 18651: Update issue_id in AddReturn
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2017-05-22 18:06:40 UTC
Size:
2.52 KB
patch
obsolete
>From 9707f8675f9e8d2ed310c6e12851bcefabe6e941 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 22 May 2017 12:02:20 -0300 >Subject: [PATCH] Bug 18651: Update issue_id in AddReturn > >1. AddReturn returns a $issue hashref with the old issue_id value >=> At first glance it does not affect anything, but would be good to fix >it for future uses. > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > C4/Circulation.pm | 5 ++++- > t/db_dependent/Circulation/Returns.t | 6 ++++-- > 2 files changed, 8 insertions(+), 3 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index a439021..41f6c70 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -1939,8 +1939,9 @@ sub AddReturn { > } > > eval { >- MarkIssueReturned( $borrowernumber, $item->{'itemnumber'}, >+ my $issue_id = MarkIssueReturned( $borrowernumber, $item->{'itemnumber'}, > $circControlBranch, $return_date, $borrower->{'privacy'} ); >+ $issue->{issue_id} = $issue_id; > }; > if ( $@ ) { > $messages->{'Wrongbranch'} = { >@@ -2205,6 +2206,8 @@ sub MarkIssueReturned { > $item->last_returned_by( $patron ); > } > }); >+ >+ return $issue_id; > } > > =head2 _debar_user_on_return >diff --git a/t/db_dependent/Circulation/Returns.t b/t/db_dependent/Circulation/Returns.t >index de7bf64..fe98452 100644 >--- a/t/db_dependent/Circulation/Returns.t >+++ b/t/db_dependent/Circulation/Returns.t >@@ -263,7 +263,7 @@ subtest "AddReturn logging on statistics table (item-level_itypes=0)" => sub { > }; > > subtest 'Handle ids duplication' => sub { >- plan tests => 1; >+ plan tests => 2; > > my $biblio = $builder->build( { source => 'Biblio' } ); > my $item = $builder->build( >@@ -283,8 +283,10 @@ subtest 'Handle ids duplication' => sub { > my $checkout = AddIssue( $patron, $item->{barcode} ); > $builder->build({ source => 'OldIssue', value => { issue_id => $checkout->issue_id } }); > >- my @a = AddReturn( $item->{barcode} ); >+ my ($doreturn, $messages, $issue, $borrower) = AddReturn( $item->{barcode} ); > my $old_checkout = Koha::Old::Checkouts->find( $checkout->issue_id ); >+ >+ isnt( $checkout->issue_id, $issue->{issue_id}, 'AddReturn should return the issue with the new issue_id' ); > isnt( $old_checkout->itemnumber, $item->{itemnumber}, 'If an item is checked-in, it should be moved to old_issues even if the issue_id already existed in the table' ); > }; > >-- >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 18651
:
63629
|
63630
|
63631
|
63632
|
63633
|
63634
|
63635
|
63636
|
63637
|
63654
|
63659
|
63706
|
64352
|
64353
|
64354
|
64355
|
64356
|
64357
|
64394
|
64395
|
64396
|
64397
|
64398
|
64399
|
64448
|
64449
|
64450
|
64451
|
64452
|
64453
|
64454
|
64455
|
64489
|
64490
|
64495
|
65134