Bug 10005: Inventory - Add an option to not check in items
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 14 Jul 2015 14:02:42 +0000 (15:02 +0100)
committerMason James <mtj@kohaaloha.com>
Fri, 2 Oct 2015 10:37:03 +0000 (23:37 +1300)
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 <jrobb@sekls.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Added a missing </li>.
Patch works as expected.
Signed-off-by: Mason James <mtj@kohaaloha.com>

koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt
tools/inventory.pl

index c2d9a8c..8c02c8d 100644 (file)
@@ -201,6 +201,10 @@ $(document).ready(function(){
             <label for="compareinv2barcd">Compare barcodes list to results: </label>
             <input type="checkbox" name="compareinv2barcd" id="compareinv2barcd" />
         </li>
+        <li>
+            <label for="dont_checkin">Do not check in items scanned during inventory: </label>
+            <input type="checkbox" name="dont_checkin" id="dont_checkin" />
+        </li>
         </ol>
   </fieldset>
             <input type="hidden" name="op" value="do_it" />
index 2ed4de8..cd687d0 100755 (executable)
@@ -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",
@@ -171,14 +172,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 {