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

(-)a/C4/Items.pm (-1 / +7 lines)
Lines 1068-1079 sub GetItemsForInventory { Link Here
1068
    my $size         = $parameters->{'size'}         // '';
1068
    my $size         = $parameters->{'size'}         // '';
1069
    my $statushash   = $parameters->{'statushash'}   // '';
1069
    my $statushash   = $parameters->{'statushash'}   // '';
1070
    my $interface    = $parameters->{'interface'}    // '';
1070
    my $interface    = $parameters->{'interface'}    // '';
1071
    my $ccode        = $parameters->{'ccode'}        // '';
1071
1072
1072
    my $dbh = C4::Context->dbh;
1073
    my $dbh = C4::Context->dbh;
1073
    my ( @bind_params, @where_strings );
1074
    my ( @bind_params, @where_strings );
1074
1075
1075
    my $select_columns = q{
1076
    my $select_columns = q{
1076
        SELECT items.itemnumber, barcode, itemcallnumber, title, author, biblio.biblionumber, biblio.frameworkcode, datelastseen, homebranch, location, notforloan, damaged, itemlost, withdrawn, stocknumber
1077
        SELECT items.itemnumber, barcode, itemcallnumber, title, author, biblio.biblionumber, biblio.frameworkcode, datelastseen, homebranch, location, notforloan, damaged, itemlost, withdrawn, stocknumber, ccode
1077
    };
1078
    };
1078
    my $select_count = q{SELECT COUNT(*)};
1079
    my $select_count = q{SELECT COUNT(*)};
1079
    my $query = q{
1080
    my $query = q{
Lines 1090-1095 sub GetItemsForInventory { Link Here
1090
        }
1091
        }
1091
    }
1092
    }
1092
1093
1094
    if ($ccode){
1095
        push @where_strings, 'ccode = ?';
1096
        push @bind_params, $ccode;
1097
    }
1098
1093
    if ($minlocation) {
1099
    if ($minlocation) {
1094
        push @where_strings, 'itemcallnumber >= ?';
1100
        push @where_strings, 'itemcallnumber >= ?';
1095
        push @bind_params, $minlocation;
1101
        push @bind_params, $minlocation;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt (+19 lines)
Lines 14-19 function checkForm() { Link Here
14
        if ( !(
14
        if ( !(
15
            $('#branchloop').val()   ||
15
            $('#branchloop').val()   ||
16
            $('#locationloop').val() ||
16
            $('#locationloop').val() ||
17
            $('#ccodeloop').val() ||
17
            $('#minlocation').val()  ||
18
            $('#minlocation').val()  ||
18
            $('#maxlocation').val()  ||
19
            $('#maxlocation').val()  ||
19
            $('#statuses input:checked').length
20
            $('#statuses input:checked').length
Lines 163-168 $(document).ready(function(){ Link Here
163
        </select>        </li>
164
        </select>        </li>
164
        [% END %]
165
        [% END %]
165
        <li>
166
        <li>
167
            <label for="ccode">Collection code: </label>
168
            <select id="ccodeloop" name="ccode">
169
                    <option value="">Filter collection code</option>
170
                [% FOREACH ccode_value IN ccode_list %]
171
                    [% IF (ccode == ccode_value) %]
172
                        <option value="[% ccode_value.authorised_value %]" selected="selected">[% ccode_value.lib %]</option>
173
                    [% ELSE %]
174
                        <option value="[% ccode_value.authorised_value %]">[% ccode_value.lib %]</option>
175
                    [% END %]
176
                [% END %]
177
            </select>
178
        </li>
179
        <li>
166
            <label for="minlocation">Item callnumber between: </label>
180
            <label for="minlocation">Item callnumber between: </label>
167
                <input type="text" name="minlocation" id="minlocation" value="[% minlocation %]" /> (items.itemcallnumber)  </li>
181
                <input type="text" name="minlocation" id="minlocation" value="[% minlocation %]" /> (items.itemcallnumber)  </li>
168
           <li><label for="maxlocation">...and: </label>
182
           <li><label for="maxlocation">...and: </label>
Lines 231-236 $(document).ready(function(){ Link Here
231
    <input type="hidden" name="location" value="[% location %]" />
245
    <input type="hidden" name="location" value="[% location %]" />
232
    <input type="hidden" name="branchcode" value="[% branchcode %]" />
246
    <input type="hidden" name="branchcode" value="[% branchcode %]" />
233
    <input type="hidden" name="datelastseen" value="[% datelastseen %]" />
247
    <input type="hidden" name="datelastseen" value="[% datelastseen %]" />
248
    <input type="hidden" name="ccode" value="[% ccode %]" />
234
249
235
    [% UNLESS compareinv2barcd %]
250
    [% UNLESS compareinv2barcd %]
236
      <div><a href="#" class="checkall">[Select all]</a> <a href="#" class="clearall">[Clear all]</a></div>
251
      <div><a href="#" class="checkall">[Select all]</a> <a href="#" class="clearall">[Clear all]</a></div>
Lines 242-247 $(document).ready(function(){ Link Here
242
            [% UNLESS compareinv2barcd %]<th>Seen</th>[% END %]
257
            [% UNLESS compareinv2barcd %]<th>Seen</th>[% END %]
243
            <th>Barcode</th>
258
            <th>Barcode</th>
244
            <th>Library</th>
259
            <th>Library</th>
260
            <th>Collection code</th>
245
            <th>Title</th>
261
            <th>Title</th>
246
            <th>Status</th>
262
            <th>Status</th>
247
            <th>Lost</th>
263
            <th>Lost</th>
Lines 267-272 $(document).ready(function(){ Link Here
267
                [% result.location | html %] [% IF ( result.itemcallnumber ) %][[% result.itemcallnumber | html %]][% ELSE %][% END %]
283
                [% result.location | html %] [% IF ( result.itemcallnumber ) %][[% result.itemcallnumber | html %]][% ELSE %][% END %]
268
            </td>
284
            </td>
269
            <td>
285
            <td>
286
            [% result.ccode | html %]
287
            </td>
288
            <td>
270
            <p><a href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=[% result.biblionumber %]" class="openWin">[% result.title | html %]</a></p><p>[% result.author | html %]</p>
289
            <p><a href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=[% result.biblionumber %]" class="openWin">[% result.title | html %]</a></p><p>[% result.author | html %]</p>
271
            </td>
290
            </td>
272
            <td>
291
            <td>
(-)a/tools/inventory.pl (-5 / +12 lines)
Lines 52-57 my $branchcode = $input->param('branchcode') || ''; Link Here
52
my $branch     = $input->param('branch');
52
my $branch     = $input->param('branch');
53
my $op         = $input->param('op');
53
my $op         = $input->param('op');
54
my $compareinv2barcd = $input->param('compareinv2barcd');
54
my $compareinv2barcd = $input->param('compareinv2barcd');
55
my $ccode = $input->param('ccode');
55
56
56
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
57
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
57
    {   template_name   => "tools/inventory.tt",
58
    {   template_name   => "tools/inventory.tt",
Lines 92-97 for my $fwk (keys %$frameworks){ Link Here
92
    }
93
    }
93
}
94
}
94
95
96
my $collection_authorised_value = C4::Koha::GetAuthValCode("items.ccode");
97
my $collections = C4::Koha::GetAuthorisedValues($collection_authorised_value) // [];
98
$template->param( ccode_list => $collections );
99
95
my $statuses = [];
100
my $statuses = [];
96
for my $statfield (qw/items.notforloan items.itemlost items.withdrawn items.damaged/){
101
for my $statfield (qw/items.notforloan items.itemlost items.withdrawn items.damaged/){
97
    my $hash = {};
102
    my $hash = {};
Lines 138-144 $template->param( Link Here
138
    branch                   => $branch,
143
    branch                   => $branch,
139
    datelastseen             => $datelastseen,
144
    datelastseen             => $datelastseen,
140
    compareinv2barcd         => $compareinv2barcd,
145
    compareinv2barcd         => $compareinv2barcd,
141
    notforloanlist           => $notforloanlist
146
    notforloanlist           => $notforloanlist,
147
    ccode                    => $ccode,
142
);
148
);
143
149
144
my @notforloans;
150
my @notforloans;
Lines 253-261 if ( $markseen or $op ) { Link Here
253
      size         => undef,
259
      size         => undef,
254
      statushash   => $staton,
260
      statushash   => $staton,
255
      interface    => 'staff',
261
      interface    => 'staff',
262
      ccode        => $ccode,
256
    } );
263
    } );
257
264
258
    # For the items that may be marked as "wrong place", we only check the location (callnumbers, location and branch)
265
    # For the items that may be marked as "wrong place", we only check the location (callnumbers, location, ccode and branch)
259
    ($wrongplacelist, $totalrecords) = GetItemsForInventory( {
266
    ($wrongplacelist, $totalrecords) = GetItemsForInventory( {
260
      minlocation  => $minlocation,
267
      minlocation  => $minlocation,
261
      maxlocation  => $maxlocation,
268
      maxlocation  => $maxlocation,
Lines 269-274 if ( $markseen or $op ) { Link Here
269
      size         => undef,
276
      size         => undef,
270
      statushash   => undef,
277
      statushash   => undef,
271
      interface    => 'staff',
278
      interface    => 'staff',
279
      ccode        => $ccode,
272
    } );
280
    } );
273
281
274
}
282
}
Lines 382-388 if (defined $input->param('CSVexport') && $input->param('CSVexport') eq 'on'){ Link Here
382
    my @translated_keys;
390
    my @translated_keys;
383
    for my $key (qw / biblioitems.title    biblio.author
391
    for my $key (qw / biblioitems.title    biblio.author
384
                      items.barcode        items.itemnumber
392
                      items.barcode        items.itemnumber
385
                      items.homebranch     items.location
393
                      items.homebranch     items.location   items.ccode
386
                      items.itemcallnumber items.notforloan
394
                      items.itemcallnumber items.notforloan
387
                      items.itemlost       items.damaged
395
                      items.itemlost       items.damaged
388
                      items.withdrawn      items.stocknumber
396
                      items.withdrawn      items.stocknumber
Lines 394-400 if (defined $input->param('CSVexport') && $input->param('CSVexport') eq 'on'){ Link Here
394
    $csv->combine(@translated_keys);
402
    $csv->combine(@translated_keys);
395
    print $csv->string, "\n";
403
    print $csv->string, "\n";
396
404
397
    my @keys = qw / title author barcode itemnumber homebranch location itemcallnumber notforloan lost damaged withdrawn stocknumber /;
405
    my @keys = qw / title author barcode itemnumber homebranch location ccode itemcallnumber notforloan lost damaged withdrawn stocknumber /;
398
    for my $item ( @results ) {
406
    for my $item ( @results ) {
399
        my @line;
407
        my @line;
400
        for my $key (@keys) {
408
        for my $key (@keys) {
401
- 

Return to bug 14393