Koha/tools
David Cook 3aa5d5ad5b Bug 33989: Only look up authorized value descriptions for items in results
This patch changes the inventory tool so that it only populates the
authorized value descriptions for items that show up in the results.
That is, items that will be viewed by a human.

This change saves a lot of time by not performing unnecessary
database lookups.

Test plan:

0. Apply patch and koha-plack --restart kohadev
1. Go to create a SQL report from SQL
/cgi-bin/koha/reports/guided_reports.pl?phase=Create%20report%20from%20SQL
2. Save a report with the following SQL:
SELECT barcode FROM items where barcode <> '';
3. Run the report
4. Download as CSV
5. Edit the CSV and remove the "barcode" heading

6. Go to edit item for barcode 3999900000001
/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=1&itemnumber=1
7. Add "Damaged status" of "Damaged"
8. Click "Save changes"

9. koha-mysql kohadev
10. update items set notforloan = 9 where barcode = 3999900000001;

11. Go to inventory tool
http://localhost:8081/cgi-bin/koha/tools/inventory.pl
12. Upload barcode file via "Choose file"
13. Uncheck "Compare barcodes list to results"
14. Open F12 tools
15. Click "Submit"
16. Click "OK" on confirm box

17. Note that the inventory job takes around 30 seconds to run
instead of 60 seconds
17b. The exact figures may vary. If you compare with before patch
inventory runs, you'll be saving roughly 18 seconds.
18. Note that "Damaged" appears in the "Damaged" column, which
demonstrates that the authorized value lookup was completed for
the item in the result list

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 30be338c24)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 64c328b9e1)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-07-18 11:33:35 +00:00
..
csv-profiles
access_files.pl Bug 33341: Address some perlcritic errors in 5.36 2023-04-11 10:54:27 +00:00
additional-contents.pl Bug 30718: Use flatpickr's altInput 2022-08-19 08:26:31 -03:00
ajax-inventory.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
automatic_item_modification_by_age.pl Bug 22827: Add age dependency on other fields than dateaccessioned 2022-04-08 15:49:16 +02:00
background-job-progress.pl Bug 28785: Adjust check_cookie_auth calls 2021-10-18 11:28:41 +02:00
batch_delete_records.pl Bug 29697: Replace GetMarcBiblio occurrences with $biblio->metadata->record 2022-07-22 15:24:11 -03:00
batch_extend_due_dates.pl Bug 30718: Use flatpickr's altInput 2022-08-19 08:26:31 -03:00
batch_record_modification.pl Bug 29771: Scalar context for split 2022-03-08 23:03:34 -10:00
batch_records_ajax.pl Bug 22785: Allow option to choose which record match is applied during import 2022-05-03 11:19:50 -10:00
batchMod.pl Bug 31154: (QA follow-up) Fix UI form builder 2022-09-16 10:26:26 -03:00
cleanborrowers.pl Bug 30718: Use flatpickr's altInput 2022-08-19 08:26:31 -03:00
copy-holidays.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
csv-profiles.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
exceptionHolidays.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
export.pl Bug 6936: Allow multiple itemtypes for bib record export 2022-08-22 13:34:38 -03:00
holidays.pl Bug 30718: Use flatpickr's altInput 2022-08-19 08:26:31 -03:00
import_borrowers.pl Bug 27920: (QA follow-up) Change radios to a single select pulldown 2022-11-09 14:37:24 -03:00
inventory.pl Bug 33989: Only look up authorized value descriptions for items in results 2023-07-18 11:33:35 +00:00
letter.pl Bug 32221: Borrowers.password should no longer be an option 2023-01-31 14:08:31 +00:00
manage-marc-import.pl Bug 33412: Fix comparison when checking for overlay framework 2023-05-15 10:35:22 +00:00
marc_modification_templates.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
modborrowers.pl Bug 31095: (follow-up) Iterate debarments in batch mod 2023-02-01 15:40:10 +00:00
newHolidays.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
overduerules.pl Bug 29844: Fix ->search occurrences 2022-02-09 15:36:23 -10:00
page.pl Bug 31385: (follow-up) Same change at intranet side 2022-08-19 11:43:56 -03:00
picture-upload.pl Bug 33341: Address some perlcritic errors in 5.36 2023-04-11 10:54:27 +00:00
problem-reports.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
quotes-upload.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
quotes.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
scheduler.pl Bug 30718: Fix scheduler 2022-08-19 08:26:38 -03:00
showdiffmarc.pl Bug 31526: Follow-up for bug 29697 2022-09-16 10:25:48 -03:00
stage-marc-import.pl Bug 31711: (bug 27421 follow-up) Fix add to basket from a new file 2022-11-15 18:44:30 -03:00
stockrotation.pl Bug 30869: Add the ability to delete stock rotation rotas 2023-03-01 15:32:49 +00:00
tools-home.pl Bug 33595: (bug 26628 follow-up) Fix authorization for tools-home.pl 2023-06-07 10:16:07 +00:00
upload-cover-image.pl Bug 30972: Don't replace biblio's local cover images when uploading an image's image 2022-06-20 10:39:34 -03:00
upload-file.pl Bug 28785: Adjust check_cookie_auth calls 2021-10-18 11:28:41 +02:00
upload.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
viewlog.pl Bug 32037: Check for existence of object before building link 2022-11-04 19:18:54 -03:00