Bugzilla – Attachment 169143 Details for
Bug 18657
Inventory tool should display more statuses/problems
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18657: Add the possibility to add lost items to the report
Bug-18657-Add-the-possibility-to-add-lost-items-to.patch (text/plain), 4.94 KB, created by
Baptiste Wojtkowski (bwoj)
on 2024-07-18 15:01:32 UTC
(
hide
)
Description:
Bug 18657: Add the possibility to add lost items to the report
Filename:
MIME Type:
Creator:
Baptiste Wojtkowski (bwoj)
Created:
2024-07-18 15:01:32 UTC
Size:
4.94 KB
patch
obsolete
>From 45e84bdf321d2bbb73c1354963f84081c5a9bb6c Mon Sep 17 00:00:00 2001 >From: Baptiste Wojtkowski <bski@laposte.net> >Date: Thu, 18 Jul 2024 15:05:58 +0200 >Subject: [PATCH] Bug 18657: Add the possibility to add lost items to the > report > >Currently the tool reports: >Incorrect not-for-loan values >Wrong place >Checked out > >We should have: >Optional display of items w/o problems >Display of missing/lost items now marked found > >TEST PLAN >1 - Mark an item as lost >2 - Go to tools->inventory >3 - Fill in the barcode list with the barcode of the item, notice there > is one checkbox in "Additional options" >4 - Submit -> there should be no result >5 - Apply patches and redo 1,2&3 >6 - Notice there are now 3 checkboxes in "Additional options" >7 - Click on "Add lost items to the report" >8 - Submit -> there is now one line in the report with problem "Item was lost and is now marked as found" >9 - Go to tools->inventory >10 - Click on "Add lost items to the report" >11 - Submit -> there is no line in the report >12 - Go to tools->inventory >13 - Click on "Add items without problem to the report" >11 - Submit -> there is now line in the report with an empty problem >--- > .../prog/en/modules/tools/inventory.tt | 6 ++++++ > tools/inventory.pl | 18 ++++++++++++++++++ > 2 files changed, 24 insertions(+) > >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 60c4c8e..79665ed 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt >@@ -252,6 +252,10 @@ > <label for="CSVexport">Export to CSV file: </label> > <input type="checkbox" name="CSVexport" id="CSVexport" /> > </li> >+ <li> >+ <label for="ReportLostItems">Add losts items to the report: </label> >+ <input type="checkbox" name="ReportLostItems" id="ReportLostItems" /> >+ </li> > </ol> > </fieldset> > >@@ -368,6 +372,8 @@ > <span>No barcode</span><br/> > [% ELSIF problem.key == 'out_of_order' %] > <span>Item may be shelved out of order</span><br/> >+ [% ELSIF problem.key == 'lost' %] >+ <span>Item was lost and is now marked as found</span><br/> > [% END %] > [% END %] > </td> >diff --git a/tools/inventory.pl b/tools/inventory.pl >index e38d7c4..473a334 100755 >--- a/tools/inventory.pl >+++ b/tools/inventory.pl >@@ -123,6 +123,11 @@ for my $authvfield (@$statuses) { > } > } > >+my $report_lost_items; >+if ( defined $input->param('ReportLostItems') && $input->param('ReportLostItems') eq 'on' ) { >+ $report_lost_items = "1"; >+} >+ > # if there's a list of not for loans types selected use it rather than > # the full set. > @notforloans = @{$staton->{'items.notforloan'}} if defined $staton->{'items.notforloan'} and scalar @{$staton->{'items.notforloan'}} > 0; >@@ -162,6 +167,7 @@ my $results = {}; > my @scanned_items; > my @errorloop; > my $moddatecount = 0; >+my @lost_items; > if ( $op eq 'cud-inventory' > && ( ( $uploadbarcodes && length($uploadbarcodes) > 0 ) || ( $barcodelist && length($barcodelist) > 0 ) ) ) > { >@@ -225,6 +231,9 @@ if ( $op eq 'cud-inventory' > next; > } > # Modify date last seen for scanned items, remove lost status >+ if ( $item->unblessed->{itemlost} ) { >+ push @lost_items, $barcode; >+ } > $item->set({ itemlost => 0, datelastseen => $date_dt })->store; > my $item_unblessed = $item->unblessed; > $moddatecount++; >@@ -335,6 +344,12 @@ for ( my $i = 0; $i < @scanned_items; $i++ ) { > $item->{problems}->{wrongplace} = 1; > additemtoresults( $item, $results ); > } >+ >+ # Report a lost item if asked >+ if ( @lost_items && ( scalar grep { $_ eq $item->{barcode} } @lost_items ) && $report_lost_items ) { >+ $item->{problems}->{lost} = 1; >+ additemtoresults( $item, $results ); >+ } > } > > # Compare barcodes with inventory list, report no_barcode and not_scanned. >@@ -418,8 +433,11 @@ if (defined $input->param('CSVexport') && $input->param('CSVexport') eq 'on'){ > $errstr .= "checked out,"; > } elsif( $key eq 'out_of_order' ) { > $errstr .= "shelved out of order,"; >+ } elsif ( $key eq 'lost' ) { >+ $errstr .= "item was lost"; > } > } >+ > $errstr =~ s/,$//; > push @line, $errstr; > $csv->combine(@line); >-- >2.43.0
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 18657
:
169141
|
169142
|
169143
|
169144
|
170012
|
170013
|
176017
|
176018
|
176019