This is a follow-up for bug 25969. The way we handle itemnumber is too complicated and error prone.
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.
It looks saner than the current code :-D
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>
Playing with items return and transfers is OK with this change.
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?!?
(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
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>
(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.
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>
Sooo much clearer! Passing QA
Pushed to master for 20.11, thanks to everybody involved!
enhancement will not be backported to 20.05.x