From 1ac67d263ee577a9e5cbe3810b5f45eea753c3b9 Mon Sep 17 00:00:00 2001 From: David Cook Date: Tue, 26 Aug 2025 06:54:08 +0000 Subject: [PATCH] Bug 38946: Add enumchron to inventory table This patch adds "Serial enumeration / chronology" to the inventory table output. Test plan: 0. Apply the patch 1. Go to http://localhost:8081/cgi-bin/koha/tools/inventory.pl 2. Click "Submit" 3. Note that a "Serial enumeration / chronology" column appears in the results 4. For the top result, go into the bib record and then add a "Serial enumeration / chronology" to the item in question 5. Re-run the inventory 6. Note that the "Serial enumeration / chronology" now has a value in iy 7. Click "Columns" and hide the column 8. Try again using the CSV export and note that the new column appears again --- C4/Items.pm | 2 +- admin/columns_settings.yml | 2 ++ koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt | 5 +++++ tools/inventory.pl | 4 ++-- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/C4/Items.pm b/C4/Items.pm index 2c22518dc5..67c381e256 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -603,7 +603,7 @@ sub GetItemsForInventory { my $max_cnsort = GetClassSort( $class_source, undef, $maxlocation ); my $select_columns = q{ - SELECT DISTINCT(items.itemnumber), barcode, itemcallnumber, title, author, biblio.biblionumber, biblio.frameworkcode, datelastseen, homebranch, location, notforloan, damaged, itemlost, withdrawn, stocknumber, items.cn_sort, ccode + SELECT DISTINCT(items.itemnumber), barcode, itemcallnumber, title, author, biblio.biblionumber, biblio.frameworkcode, datelastseen, homebranch, location, notforloan, damaged, itemlost, withdrawn, stocknumber, items.cn_sort, ccode, enumchron }; my $select_count = q{SELECT COUNT(DISTINCT(items.itemnumber))}; diff --git a/admin/columns_settings.yml b/admin/columns_settings.yml index 7b9e4e7ec8..a6dc345c0f 100644 --- a/admin/columns_settings.yml +++ b/admin/columns_settings.yml @@ -2607,6 +2607,8 @@ modules: columnname: call_number cannot_be_toggled: 1 cannot_be_modified: 1 + - + columnname: enumchron - columnname: library - 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 ba68b0eb97..a01b8e90d8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt @@ -311,6 +311,7 @@ [% END %] Barcode Call number + Serial enumeration / chronology Library Collection Title @@ -335,6 +336,10 @@ [% result.itemcallnumber | html %] + + [% result.enumchron | html %] + + [% Branches.GetName( result.homebranch ) | html %] [% result.location | html %] diff --git a/tools/inventory.pl b/tools/inventory.pl index 8e735d40e4..01d9cb3aed 100755 --- a/tools/inventory.pl +++ b/tools/inventory.pl @@ -436,7 +436,7 @@ if ( defined $input->param('CSVexport') && $input->param('CSVexport') eq 'on' ) qw / biblioitems.title biblio.author items.barcode items.itemnumber items.homebranch items.location items.ccode - items.itemcallnumber items.notforloan + items.itemcallnumber items.enumchron items.notforloan items.itemlost items.damaged items.withdrawn items.stocknumber / @@ -451,7 +451,7 @@ if ( defined $input->param('CSVexport') && $input->param('CSVexport') eq 'on' ) print $csv->string, "\n"; my @keys = - qw/ title author barcode itemnumber homebranch location ccode itemcallnumber notforloan itemlost damaged withdrawn stocknumber /; + qw/ title author barcode itemnumber homebranch location ccode itemcallnumber enumchron notforloan itemlost damaged withdrawn stocknumber /; for my $item (@$loop) { my @line; for my $key (@keys) { -- 2.39.5