Bug 26485 - Simplify itemnumber handling in returns.pl
Summary: Simplify itemnumber handling in returns.pl
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on: 25969
Blocks: 26627
  Show dependency treegraph
 
Reported: 2020-09-18 08:59 UTC by Jonathan Druart
Modified: 2021-06-14 21:33 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.11.00
Circulation function:


Attachments
Bug 26485: Simplify itemnumber handling in returns.pl (3.81 KB, patch)
2020-09-18 09:01 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 26485: Simplify itemnumber handling in returns.pl (3.87 KB, patch)
2020-09-30 15:54 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 26485: Simplify itemnumber handling in returns.pl (3.94 KB, patch)
2020-10-01 09:48 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 26485: Simplify itemnumber handling in returns.pl (3.94 KB, patch)
2020-10-01 10:17 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2020-09-18 08:59:23 UTC
This is a follow-up for bug 25969. The way we handle itemnumber is too complicated and error prone.
Comment 1 Jonathan Druart 2020-09-18 09:01:12 UTC
Created attachment 110321 [details] [review]
Bug 26485: Simplify itemnumber handling in returns.pl

This is a follow-up for bug 25969. The way we handle itemnumber is too complicated and error prone.
Comment 2 Tomás Cohen Arazi (tcohen) 2020-09-29 18:33:20 UTC
It looks saner than the current code :-D
Comment 3 Fridolin Somers 2020-09-30 15:54:43 UTC
Created attachment 110999 [details] [review]
Bug 26485: Simplify itemnumber handling in returns.pl

This is a follow-up for bug 25969. The way we handle itemnumber is too complicated and error prone.

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Comment 4 Fridolin Somers 2020-09-30 15:55:24 UTC
Playing with items return and transfers is OK with this change.
Comment 5 Fridolin Somers 2020-09-30 15:55:54 UTC
OMG we also need to manage $item object :

grep 'Koha::Items->find' circ/returns.pl 
    my $item = Koha::Items->find( $itemnumber );
    my $item = Koha::Items->find({ barcode => $barcode });
        my $item = Koha::Items->find( $itemnumber );
        my $item = Koha::Items->find({ barcode => $bar_code });
    my $item_from_barcode = Koha::Items->find({barcode => $barcode }); # How many times do we fetch this item?!?
Comment 6 Martin Renvoize (ashimema) 2020-10-01 09:47:44 UTC
(In reply to Fridolin SOMERS from comment #5)
> OMG we also need to manage $item object :
> 
> grep 'Koha::Items->find' circ/returns.pl 
>     my $item = Koha::Items->find( $itemnumber );
>     my $item = Koha::Items->find({ barcode => $barcode });
>         my $item = Koha::Items->find( $itemnumber );
>         my $item = Koha::Items->find({ barcode => $bar_code });
>     my $item_from_barcode = Koha::Items->find({barcode => $barcode }); # How
> many times do we fetch this item?!?

Yowsers!.. Lets do this.. perhaps in a new bug
Comment 7 Martin Renvoize (ashimema) 2020-10-01 09:48:58 UTC
Created attachment 111028 [details] [review]
Bug 26485: Simplify itemnumber handling in returns.pl

This is a follow-up for bug 25969. The way we handle itemnumber is too complicated and error prone.

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 8 Jonathan Druart 2020-10-01 09:50:24 UTC
(In reply to Martin Renvoize from comment #6)
> (In reply to Fridolin SOMERS from comment #5)
> > OMG we also need to manage $item object :
> > 
> > grep 'Koha::Items->find' circ/returns.pl 
> >     my $item = Koha::Items->find( $itemnumber );
> >     my $item = Koha::Items->find({ barcode => $barcode });
> >         my $item = Koha::Items->find( $itemnumber );
> >         my $item = Koha::Items->find({ barcode => $bar_code });
> >     my $item_from_barcode = Koha::Items->find({barcode => $barcode }); # How
> > many times do we fetch this item?!?
> 
> Yowsers!.. Lets do this.. perhaps in a new bug

I think there is one already (without patch), but cannot find it.
Comment 9 Martin Renvoize (ashimema) 2020-10-01 10:17:25 UTC
Created attachment 111029 [details] [review]
Bug 26485: Simplify itemnumber handling in returns.pl

This is a follow-up for bug 25969. The way we handle itemnumber is too complicated and error prone.

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 10 Martin Renvoize (ashimema) 2020-10-01 10:20:18 UTC
Sooo much clearer!

Passing QA
Comment 11 Jonathan Druart 2020-10-08 14:20:58 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 12 Lucas Gass (lukeg) 2020-11-09 20:34:32 UTC
enhancement will not be backported to 20.05.x