View | Details | Raw Unified | Return to bug 11405
Collapse All | Expand All

(-)a/C4/Items.pm (-26 / +35 lines)
Lines 1024-1043 sub GetLostItems { Link Here
1024
1024
1025
=head2 GetItemsForInventory
1025
=head2 GetItemsForInventory
1026
1026
1027
($itemlist, $iTotalRecords) = GetItemsForInventory( {
1027
( $itemlist, $iTotalRecords ) = GetItemsForInventory(
1028
  minlocation  => $minlocation,
1028
    {
1029
  maxlocation  => $maxlocation,
1029
        minlocation          => $minlocation,
1030
  location     => $location,
1030
        maxlocation          => $maxlocation,
1031
  itemtype     => $itemtype,
1031
        location             => $location,
1032
  ignoreissued => $ignoreissued,
1032
        itemtype             => $itemtype,
1033
  datelastseen => $datelastseen,
1033
        ignoreissued         => $ignoreissued,
1034
  branchcode   => $branchcode,
1034
        datelastseen         => $datelastseen,
1035
  branch       => $branch,
1035
        branchcode           => $branchcode,
1036
  offset       => $offset,
1036
        branch               => $branch,
1037
  size         => $size,
1037
        offset               => $offset,
1038
  stautshash   => $statushash
1038
        size                 => $size,
1039
  interface    => $interface,
1039
        stautshash           => $statushash,
1040
} );
1040
        interface            => $interface,
1041
        ignore_holds_waiting => $ignore_holds_waiting,
1042
    }
1043
);
1041
1044
1042
Retrieve a list of title/authors/barcode/callnumber, for biblio inventory.
1045
Retrieve a list of title/authors/barcode/callnumber, for biblio inventory.
1043
1046
Lines 1056-1073 $iTotalRecords is the number of rows that would have been returned without the $ Link Here
1056
1059
1057
sub GetItemsForInventory {
1060
sub GetItemsForInventory {
1058
    my ( $parameters ) = @_;
1061
    my ( $parameters ) = @_;
1059
    my $minlocation  = $parameters->{'minlocation'}  // '';
1062
    my $minlocation          = $parameters->{minlocation}          // '';
1060
    my $maxlocation  = $parameters->{'maxlocation'}  // '';
1063
    my $maxlocation          = $parameters->{maxlocation}          // '';
1061
    my $location     = $parameters->{'location'}     // '';
1064
    my $location             = $parameters->{location}             // '';
1062
    my $itemtype     = $parameters->{'itemtype'}     // '';
1065
    my $itemtype             = $parameters->{itemtype}             // '';
1063
    my $ignoreissued = $parameters->{'ignoreissued'} // '';
1066
    my $ignoreissued         = $parameters->{ignoreissued}         // '';
1064
    my $datelastseen = $parameters->{'datelastseen'} // '';
1067
    my $datelastseen         = $parameters->{datelastseen}         // '';
1065
    my $branchcode   = $parameters->{'branchcode'}   // '';
1068
    my $branchcode           = $parameters->{branchcode}           // '';
1066
    my $branch       = $parameters->{'branch'}       // '';
1069
    my $branch               = $parameters->{branch}               // '';
1067
    my $offset       = $parameters->{'offset'}       // '';
1070
    my $offset               = $parameters->{offset}               // '';
1068
    my $size         = $parameters->{'size'}         // '';
1071
    my $size                 = $parameters->{size}                 // '';
1069
    my $statushash   = $parameters->{'statushash'}   // '';
1072
    my $statushash           = $parameters->{statushash}           // '';
1070
    my $interface    = $parameters->{'interface'}    // '';
1073
    my $interface            = $parameters->{interface}            // '';
1074
    my $ignore_holds_waiting = $parameters->{ignore_holds_waiting} // '';
1071
1075
1072
    my $dbh = C4::Context->dbh;
1076
    my $dbh = C4::Context->dbh;
1073
    my ( @bind_params, @where_strings );
1077
    my ( @bind_params, @where_strings );
Lines 1130-1135 sub GetItemsForInventory { Link Here
1130
        push @where_strings, 'issues.date_due IS NULL';
1134
        push @where_strings, 'issues.date_due IS NULL';
1131
    }
1135
    }
1132
1136
1137
    if ( $ignore_holds_waiting ) {
1138
        $query .= "LEFT JOIN reserves ON items.itemnumber = reserves.itemnumber ";
1139
        push( @where_strings, q{reserves.found != 'W' OR reserves.found IS NULL} );
1140
    }
1141
1133
    if ( @where_strings ) {
1142
    if ( @where_strings ) {
1134
        $query .= 'WHERE ';
1143
        $query .= 'WHERE ';
1135
        $query .= join ' AND ', @where_strings;
1144
        $query .= join ' AND ', @where_strings;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt (+5 lines)
Lines 207-212 $(document).ready(function(){ Link Here
207
            <input type="checkbox" id="ignoreissued" name="ignoreissued" /></li>
207
            <input type="checkbox" id="ignoreissued" name="ignoreissued" /></li>
208
            [% END %]
208
            [% END %]
209
        <li>
209
        <li>
210
        <li>
211
            <label for="ignore_holds_waiting">Skip copies marked as waiting holds: </label>
212
            <input type="checkbox" id="ignore_holds_waiting" name="ignore_holds_waiting" />
213
        </li>
214
        <li>
210
           <label for="CSVexport">Export to CSV file: </label>
215
           <label for="CSVexport">Export to CSV file: </label>
211
           <input type="checkbox" name="CSVexport" id="CSVexport" />
216
           <input type="checkbox" name="CSVexport" id="CSVexport" />
212
        </li>
217
        </li>
(-)a/tools/inventory.pl (-30 / +36 lines)
Lines 46-51 $maxlocation=$minlocation.'Z' unless ( $maxlocation || ! $minlocation ); Link Here
46
my $location=$input->param('location') || '';
46
my $location=$input->param('location') || '';
47
my $itemtype=$input->param('itemtype'); # FIXME note, template does not currently supply this
47
my $itemtype=$input->param('itemtype'); # FIXME note, template does not currently supply this
48
my $ignoreissued=$input->param('ignoreissued');
48
my $ignoreissued=$input->param('ignoreissued');
49
my $ignore_holds_waiting = $input->param('ignore_holds_waiting');
49
my $datelastseen = $input->param('datelastseen');
50
my $datelastseen = $input->param('datelastseen');
50
my $markseen = $input->param('markseen');
51
my $markseen = $input->param('markseen');
51
my $branchcode = $input->param('branchcode') || '';
52
my $branchcode = $input->param('branchcode') || '';
Lines 135-140 $template->param( Link Here
135
    maxlocation              => $maxlocation,
136
    maxlocation              => $maxlocation,
136
    location                 => $location,
137
    location                 => $location,
137
    ignoreissued             => $ignoreissued,
138
    ignoreissued             => $ignoreissued,
139
    ignore_holds_waiting     => $ignore_holds_waiting,
138
    branchcode               => $branchcode,
140
    branchcode               => $branchcode,
139
    branch                   => $branch,
141
    branch                   => $branch,
140
    datelastseen             => $datelastseen,
142
    datelastseen             => $datelastseen,
Lines 241-277 if ( $markseen or $op ) { Link Here
241
243
242
    # We use datelastseen only when comparing the results to the barcode file.
244
    # We use datelastseen only when comparing the results to the barcode file.
243
    my $paramdatelastseen = ($compareinv2barcd) ? $datelastseen : '';
245
    my $paramdatelastseen = ($compareinv2barcd) ? $datelastseen : '';
244
    ($inventorylist, $totalrecords) = GetItemsForInventory( {
246
    ( $inventorylist, $totalrecords ) = GetItemsForInventory(
245
      minlocation  => $minlocation,
247
        {
246
      maxlocation  => $maxlocation,
248
            minlocation          => $minlocation,
247
      location     => $location,
249
            maxlocation          => $maxlocation,
248
      itemtype     => $itemtype,
250
            location             => $location,
249
      ignoreissued => $ignoreissued,
251
            itemtype             => $itemtype,
250
      datelastseen => $paramdatelastseen,
252
            ignoreissued         => $ignoreissued,
251
      branchcode   => $branchcode,
253
            datelastseen         => $paramdatelastseen,
252
      branch       => $branch,
254
            branchcode           => $branchcode,
253
      offset       => 0,
255
            branch               => $branch,
254
      size         => undef,
256
            offset               => 0,
255
      statushash   => $staton,
257
            size                 => undef,
256
      interface    => 'staff',
258
            statushash           => $staton,
257
    } );
259
            interface            => 'staff',
260
            ignore_holds_waiting => $ignore_holds_waiting,
261
        }
262
    );
258
263
259
    # For the items that may be marked as "wrong place", we only check the location (callnumbers, location and branch)
264
    # For the items that may be marked as "wrong place", we only check the location (callnumbers, location and branch)
260
    ($wrongplacelist, $totalrecords) = GetItemsForInventory( {
265
    ( $wrongplacelist, $totalrecords ) = GetItemsForInventory(
261
      minlocation  => $minlocation,
266
        {
262
      maxlocation  => $maxlocation,
267
            minlocation          => $minlocation,
263
      location     => $location,
268
            maxlocation          => $maxlocation,
264
      itemtype     => undef,
269
            location             => $location,
265
      ignoreissued => undef,
270
            itemtype             => undef,
266
      datelastseen => undef,
271
            ignoreissued         => undef,
267
      branchcode   => $branchcode,
272
            datelastseen         => undef,
268
      branch       => $branch,
273
            branchcode           => $branchcode,
269
      offset       => 0,
274
            branch               => $branch,
270
      size         => undef,
275
            offset               => 0,
271
      statushash   => undef,
276
            size                 => undef,
272
      interface    => 'staff',
277
            statushash           => undef,
273
    } );
278
            interface            => 'staff',
274
279
            ignore_holds_waiting => $ignore_holds_waiting,
280
        }
281
    );
275
}
282
}
276
283
277
# If "compare barcodes list to results" has been checked, we want to alert for missing items
284
# If "compare barcodes list to results" has been checked, we want to alert for missing items
278
- 

Return to bug 11405