From 54881cdd086ce6c5cc6ae488187f44e0ae88ad46 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 14 Jul 2015 15:02:42 +0100 Subject: [PATCH] [PASSED QA] Bug 10005: Inventory - Add an option to not check in items The inventory tools automatically check in items, this patch adds it as an option. Test plan: 1/ Check an item out, fill a file with its barcode, and use this file in the inventory tools. 2/ Check the new checkbox and confirm that the item is not checked in 3/ Repeat again and don't check it, the behavior should be the same as before this patch. Signed-off-by: Jason Robb Signed-off-by: Katrin Fischer Added a missing . Patch works as expected. --- .../intranet-tmpl/prog/en/modules/tools/inventory.tt | 4 ++++ tools/inventory.pl | 19 +++++++++++-------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt index fdac5fa..5143b3c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt @@ -214,6 +214,10 @@ $(document).ready(function(){ +
  • + + +
  • diff --git a/tools/inventory.pl b/tools/inventory.pl index a4bf639..2192dbd 100755 --- a/tools/inventory.pl +++ b/tools/inventory.pl @@ -52,6 +52,7 @@ my $branchcode = $input->param('branchcode') || ''; my $branch = $input->param('branch'); my $op = $input->param('op'); my $compareinv2barcd = $input->param('compareinv2barcd'); +my $dont_checkin = $input->param('dont_checkin'); my ( $template, $borrowernumber, $cookie ) = get_template_and_user( { template_name => "tools/inventory.tt", @@ -209,14 +210,16 @@ if ( $uploadbarcodes && length($uploadbarcodes) > 0 ) { ModItem( { datelastseen => $date }, undef, $item->{'itemnumber'} ); push @scanned_items, $item; $count++; - $qonloan->execute($barcode); - if ($qonloan->rows){ - my $data = $qonloan->fetchrow_hashref; - my ($doreturn, $messages, $iteminformation, $borrower) =AddReturn($barcode, $data->{homebranch}); - if ($doreturn){ - push @errorloop, {'barcode'=>$barcode,'ERR_ONLOAN_RET'=>1} - } else { - push @errorloop, {'barcode'=>$barcode,'ERR_ONLOAN_NOT_RET'=>1} + unless ( $dont_checkin ) { + $qonloan->execute($barcode); + if ($qonloan->rows){ + my $data = $qonloan->fetchrow_hashref; + my ($doreturn, $messages, $iteminformation, $borrower) =AddReturn($barcode, $data->{homebranch}); + if ($doreturn){ + push @errorloop, {'barcode'=>$barcode,'ERR_ONLOAN_RET'=>1} + } else { + push @errorloop, {'barcode'=>$barcode,'ERR_ONLOAN_NOT_RET'=>1} + } } } } else { -- 1.9.1