Bugzilla – Attachment 40573 Details for
Bug 11405
Inventory tool enhancements [OMNIBUS]
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11405 [2] - Skip items with waiting holds
Bug-11405-2---Skip-items-with-waiting-holds.patch (text/plain), 9.44 KB, created by
Kyle M Hall (khall)
on 2015-06-24 11:28:14 UTC
(
hide
)
Description:
Bug 11405 [2] - Skip items with waiting holds
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2015-06-24 11:28:14 UTC
Size:
9.44 KB
patch
obsolete
>From 95f9fe1ef43d910a3a7e2e40af22c36808965166 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Mon, 16 Dec 2013 10:50:31 -0500 >Subject: [PATCH] Bug 11405 [2] - Skip items with waiting holds > >This patch enables items to be skipped for inventory stocktaking >if the item is currently a waiting hold. The intention is to skip >items that should be on the holds waiting shelf in the library. > >Test Plan: >1) Apply this patch >2) Generate a list of barcodes ordered by callnumber >3) Select one of those items and place it on hold, then confirm the hold >4) Remove that barcode from the list of barcodes >5) Browse to the inventory tool, choose your barcodes file >6) Run the inventory tool with that barcode file. >7) Note the tool says that item should have been scanned >8) Click the browsers back button to return to the previous page >9) Check the checkbox for "Skip copies marked as waiting holds" >10) Run the tool again, not it does not flag that item as previously >--- > C4/Items.pm | 61 +++++++++++-------- > .../prog/en/modules/tools/inventory.tt | 5 ++ > tools/inventory.pl | 65 +++++++++++--------- > 3 files changed, 76 insertions(+), 55 deletions(-) > >diff --git a/C4/Items.pm b/C4/Items.pm >index 55bb4bd..727ddd6 100644 >--- a/C4/Items.pm >+++ b/C4/Items.pm >@@ -1024,20 +1024,23 @@ sub GetLostItems { > > =head2 GetItemsForInventory > >-($itemlist, $iTotalRecords) = GetItemsForInventory( { >- minlocation => $minlocation, >- maxlocation => $maxlocation, >- location => $location, >- itemtype => $itemtype, >- ignoreissued => $ignoreissued, >- datelastseen => $datelastseen, >- branchcode => $branchcode, >- branch => $branch, >- offset => $offset, >- size => $size, >- stautshash => $statushash >- interface => $interface, >-} ); >+( $itemlist, $iTotalRecords ) = GetItemsForInventory( >+ { >+ minlocation => $minlocation, >+ maxlocation => $maxlocation, >+ location => $location, >+ itemtype => $itemtype, >+ ignoreissued => $ignoreissued, >+ datelastseen => $datelastseen, >+ branchcode => $branchcode, >+ branch => $branch, >+ offset => $offset, >+ size => $size, >+ stautshash => $statushash, >+ interface => $interface, >+ ignore_holds_waiting => $ignore_holds_waiting, >+ } >+); > > Retrieve a list of title/authors/barcode/callnumber, for biblio inventory. > >@@ -1056,18 +1059,19 @@ $iTotalRecords is the number of rows that would have been returned without the $ > > sub GetItemsForInventory { > my ( $parameters ) = @_; >- my $minlocation = $parameters->{'minlocation'} // ''; >- my $maxlocation = $parameters->{'maxlocation'} // ''; >- my $location = $parameters->{'location'} // ''; >- my $itemtype = $parameters->{'itemtype'} // ''; >- my $ignoreissued = $parameters->{'ignoreissued'} // ''; >- my $datelastseen = $parameters->{'datelastseen'} // ''; >- my $branchcode = $parameters->{'branchcode'} // ''; >- my $branch = $parameters->{'branch'} // ''; >- my $offset = $parameters->{'offset'} // ''; >- my $size = $parameters->{'size'} // ''; >- my $statushash = $parameters->{'statushash'} // ''; >- my $interface = $parameters->{'interface'} // ''; >+ my $minlocation = $parameters->{minlocation} // ''; >+ my $maxlocation = $parameters->{maxlocation} // ''; >+ my $location = $parameters->{location} // ''; >+ my $itemtype = $parameters->{itemtype} // ''; >+ my $ignoreissued = $parameters->{ignoreissued} // ''; >+ my $datelastseen = $parameters->{datelastseen} // ''; >+ my $branchcode = $parameters->{branchcode} // ''; >+ my $branch = $parameters->{branch} // ''; >+ my $offset = $parameters->{offset} // ''; >+ my $size = $parameters->{size} // ''; >+ my $statushash = $parameters->{statushash} // ''; >+ my $interface = $parameters->{interface} // ''; >+ my $ignore_holds_waiting = $parameters->{ignore_holds_waiting} // ''; > > my $dbh = C4::Context->dbh; > my ( @bind_params, @where_strings ); >@@ -1130,6 +1134,11 @@ sub GetItemsForInventory { > push @where_strings, 'issues.date_due IS NULL'; > } > >+ if ( $ignore_holds_waiting ) { >+ $query .= "LEFT JOIN reserves ON items.itemnumber = reserves.itemnumber "; >+ push( @where_strings, q{reserves.found != 'W' OR reserves.found IS NULL} ); >+ } >+ > if ( @where_strings ) { > $query .= 'WHERE '; > $query .= join ' AND ', @where_strings; >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 29db8e8..6616f60 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt >@@ -207,6 +207,11 @@ $(document).ready(function(){ > <input type="checkbox" id="ignoreissued" name="ignoreissued" /></li> > [% END %] > <li> >+ <li> >+ <label for="ignore_holds_waiting">Skip copies marked as waiting holds: </label> >+ <input type="checkbox" id="ignore_holds_waiting" name="ignore_holds_waiting" /> >+ </li> >+ <li> > <label for="CSVexport">Export to CSV file: </label> > <input type="checkbox" name="CSVexport" id="CSVexport" /> > </li> >diff --git a/tools/inventory.pl b/tools/inventory.pl >index a1fae52..4792349 100755 >--- a/tools/inventory.pl >+++ b/tools/inventory.pl >@@ -46,6 +46,7 @@ $maxlocation=$minlocation.'Z' unless ( $maxlocation || ! $minlocation ); > my $location=$input->param('location') || ''; > my $itemtype=$input->param('itemtype'); # FIXME note, template does not currently supply this > my $ignoreissued=$input->param('ignoreissued'); >+my $ignore_holds_waiting = $input->param('ignore_holds_waiting'); > my $datelastseen = $input->param('datelastseen'); > my $markseen = $input->param('markseen'); > my $branchcode = $input->param('branchcode') || ''; >@@ -135,6 +136,7 @@ $template->param( > maxlocation => $maxlocation, > location => $location, > ignoreissued => $ignoreissued, >+ ignore_holds_waiting => $ignore_holds_waiting, > branchcode => $branchcode, > branch => $branch, > datelastseen => $datelastseen, >@@ -241,37 +243,42 @@ if ( $markseen or $op ) { > > # We use datelastseen only when comparing the results to the barcode file. > my $paramdatelastseen = ($compareinv2barcd) ? $datelastseen : ''; >- ($inventorylist, $totalrecords) = GetItemsForInventory( { >- minlocation => $minlocation, >- maxlocation => $maxlocation, >- location => $location, >- itemtype => $itemtype, >- ignoreissued => $ignoreissued, >- datelastseen => $paramdatelastseen, >- branchcode => $branchcode, >- branch => $branch, >- offset => 0, >- size => undef, >- statushash => $staton, >- interface => 'staff', >- } ); >+ ( $inventorylist, $totalrecords ) = GetItemsForInventory( >+ { >+ minlocation => $minlocation, >+ maxlocation => $maxlocation, >+ location => $location, >+ itemtype => $itemtype, >+ ignoreissued => $ignoreissued, >+ datelastseen => $paramdatelastseen, >+ branchcode => $branchcode, >+ branch => $branch, >+ offset => 0, >+ size => undef, >+ statushash => $staton, >+ interface => 'staff', >+ ignore_holds_waiting => $ignore_holds_waiting, >+ } >+ ); > > # For the items that may be marked as "wrong place", we only check the location (callnumbers, location and branch) >- ($wrongplacelist, $totalrecords) = GetItemsForInventory( { >- minlocation => $minlocation, >- maxlocation => $maxlocation, >- location => $location, >- itemtype => undef, >- ignoreissued => undef, >- datelastseen => undef, >- branchcode => $branchcode, >- branch => $branch, >- offset => 0, >- size => undef, >- statushash => undef, >- interface => 'staff', >- } ); >- >+ ( $wrongplacelist, $totalrecords ) = GetItemsForInventory( >+ { >+ minlocation => $minlocation, >+ maxlocation => $maxlocation, >+ location => $location, >+ itemtype => undef, >+ ignoreissued => undef, >+ datelastseen => undef, >+ branchcode => $branchcode, >+ branch => $branch, >+ offset => 0, >+ size => undef, >+ statushash => undef, >+ interface => 'staff', >+ ignore_holds_waiting => $ignore_holds_waiting, >+ } >+ ); > } > > # If "compare barcodes list to results" has been checked, we want to alert for missing items >-- >1.7.2.5
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 11405
:
23582
|
23583
|
23584
|
23585
|
23586
|
23587
|
24173
|
24174
|
24175
|
24176
|
24177
|
24178
|
25037
|
31250
|
31251
|
31252
|
31253
|
31254
|
31255
|
31256
|
40572
|
40573
|
40574
|
40575
|
40576
|
40577
|
40578
|
47027
|
47028
|
47029
|
47030
|
47031
|
47032
|
47033
|
47035
|
47036
|
47037
|
47038
|
47039
|
47040
|
47041
|
47106