Bug 27248 - Allow to use list of barcodes/itemnumbers with Batch extend due dates tool
Summary: Allow to use list of barcodes/itemnumbers with Batch extend due dates tool
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Brendan Lawlor
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-12-16 10:45 UTC by Katrin Fischer
Modified: 2025-09-05 13:27 UTC (History)
3 users (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 27248: Add barcode list input to batch extend due dates (4.07 KB, patch)
2025-07-23 15:14 UTC, Brendan Lawlor
Details | Diff | Splinter Review
Bug 27248: Fix display of new due date column in preview table (2.24 KB, patch)
2025-07-23 15:14 UTC, Brendan Lawlor
Details | Diff | Splinter Review
Bug 27248: Add barcode list input to batch extend due dates (4.22 KB, patch)
2025-08-11 07:37 UTC, OpenFifth Sandboxes
Details | Diff | Splinter Review
Bug 27248: Fix display of new due date column in preview table (2.39 KB, patch)
2025-08-11 07:37 UTC, OpenFifth Sandboxes
Details | Diff | Splinter Review
Bug 27248: Add barcode list input to batch extend due dates (4.22 KB, patch)
2025-09-05 13:27 UTC, Brendan Lawlor
Details | Diff | Splinter Review
Bug 27248: Fix display of new due date column in preview table (2.01 KB, patch)
2025-09-05 13:27 UTC, Brendan Lawlor
Details | Diff | Splinter Review
Bug 27248: Add batch extend due dates to report batch ops (6.15 KB, patch)
2025-09-05 13:27 UTC, Brendan Lawlor
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2020-12-16 10:45:33 UTC
In some cases libraries want to use some more complicated criteria for selecting the items that they want to extend the due dates for. For these cases it would be great if SQL reports could be used to make a list that then can be uploaded to the tool, similar to how we manage other batch operations.
Comment 1 Brendan Lawlor 2025-07-23 15:14:25 UTC
Created attachment 184562 [details] [review]
Bug 27248: Add barcode list input to batch extend due dates

This patch adds a barcode list input to batch extend due dates

Test plan:
1. Have some checkouts and copy the barcodes
2. Go to Tools > Batch extend due dates
3. Paste the barcodes in the new input one line at a time
4. Confirm you can extend the due dates for those items
5. Confirm the other limits still work
   For example if you enter a branchcode and a list of barcodes
   only items that were checked out from that branchcode and
   are on the list of items get an updated due date
Comment 2 Brendan Lawlor 2025-07-23 15:14:27 UTC
Created attachment 184563 [details] [review]
Bug 27248: Fix display of new due date column in preview table

This patch removes a duplicate call to new_due_dates.shift so that the
new due date column shows the date for all selected checkouts.

To test:
1. Have some random checkouts
2. Use the batch_extend_due_dates tool with preview results checked
3. Notice only have the selected checkouts have data in the new due date column
4. Apply patch and retry seteps 2-3
5. All selected checkouts now show a date in the new due date column
Comment 3 Brendan Lawlor 2025-07-23 15:21:46 UTC
Batch extend due dates by item barcode was a feature in our previous ILS, so we sometimes still get requests to do this with a list of barcodes.

This patch is a work in progress based on the batch item modification barcode list input. The next step would be to add it to the batch operations drop down list in SQL reports.

Setting this to needs sign off to get some feedback. Thanks!
Comment 4 OpenFifth Sandboxes 2025-08-11 07:37:29 UTC
Created attachment 185301 [details] [review]
Bug 27248: Add barcode list input to batch extend due dates

This patch adds a barcode list input to batch extend due dates

Test plan:
1. Have some checkouts and copy the barcodes
2. Go to Tools > Batch extend due dates
3. Paste the barcodes in the new input one line at a time
4. Confirm you can extend the due dates for those items
5. Confirm the other limits still work
   For example if you enter a branchcode and a list of barcodes
   only items that were checked out from that branchcode and
   are on the list of items get an updated due date

Signed-off-by: Anneli Österman <anneli.osterman@koha-suomi.fi>
Comment 5 OpenFifth Sandboxes 2025-08-11 07:37:30 UTC
Created attachment 185302 [details] [review]
Bug 27248: Fix display of new due date column in preview table

This patch removes a duplicate call to new_due_dates.shift so that the
new due date column shows the date for all selected checkouts.

To test:
1. Have some random checkouts
2. Use the batch_extend_due_dates tool with preview results checked
3. Notice only have the selected checkouts have data in the new due date column
4. Apply patch and retry seteps 2-3
5. All selected checkouts now show a date in the new due date column

Signed-off-by: Anneli Österman <anneli.osterman@koha-suomi.fi>
Comment 6 Anneli Österman 2025-08-11 07:40:47 UTC
The barcode option worked as in test plan.

I'd be happy to test and sign off the SQL report option too, because it would be a more versatile functionality. :)
Comment 7 Owen Leonard 2025-08-27 12:39:11 UTC
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_extend_due_dates.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_extend_due_dates.tt
@@ -170,6 +170,7 @@

+                    [% new_due_dates.size %]

Is this change a mistake? It's just a number floating in space.

I think this needs some further refinement. I would expect that if I was pasting a batch of barcodes that none of the other filters would be relevant. I shouldn't be required to select a range of due dates unless the process was going to select only the barcodes in my batch which matched that due date range (which it does not).

My first instinct is to say we should have a tabbed interface like we have with other batch operations: One tab with the original form with search criteria and another tab with the barcode input.

I assume the bug should be retitled to drop the 'itemnumbers'?
Comment 8 Brendan Lawlor 2025-08-28 13:34:33 UTC
Thanks for testing this Owen!

(In reply to Owen Leonard from comment #7)

> +                    [% new_due_dates.size %]
> 
> Is this change a mistake? It's just a number floating in space.

This is indeed a stray tag from testing.

> I think this needs some further refinement. I would expect that if I was
> pasting a batch of barcodes that none of the other filters would be
> relevant. I shouldn't be required to select a range of due dates unless the
> process was going to select only the barcodes in my batch which matched that
> due date range (which it does not).

The other filters still do work together with the barcode list. The logic is AND for all of them, so for example if you put in a barcode list and a due date from, it will only extend due dates for the barcodes where the current due date is after the due date from.

The range of due dates filter is not required, but I can see how that's not entirely clear too. Only one of the New due date fields is actually required, you can leave the rest of the form blank and it will do all items.

It also wasn't clear to me until I started testing that the Libraries filter is for the checkout branch. I could see a use case for adding the item owning library to this tool at some point too.

For a consortium I think it makes sense to be able to use other filters in tandem with a barcode list as a way to further control and confirm that you are only extending due dates with specific criteria.

> My first instinct is to say we should have a tabbed interface like we have
> with other batch operations: One tab with the original form with search
> criteria and another tab with the barcode input.

Since the barcodes work together with the other filters, I think a single form is more clear, but I will take a closer look at examples on other batch operation forms too.


> I assume the bug should be retitled to drop the 'itemnumbers'?

I think barcodes is what librarians tend to work with more than the itemnumbers, so that's where I started with this. For the next step of integrating this into Report batch operations I don't think it matters much which one is used, but I'd be interested in any opinions on that matter too.
Comment 9 Brendan Lawlor 2025-09-05 13:27:04 UTC
Created attachment 186205 [details] [review]
Bug 27248: Add barcode list input to batch extend due dates

This patch adds a barcode list input to batch extend due dates

Test plan:
1. Have some checkouts and copy the barcodes
2. Go to Tools > Batch extend due dates
3. Paste the barcodes in the new input one line at a time
4. Confirm you can extend the due dates for those items
5. Confirm the other limits still work
   For example if you enter a branchcode and a list of barcodes
   only items that were checked out from that branchcode and
   are on the list of items get an updated due date

Signed-off-by: Anneli Österman <anneli.osterman@koha-suomi.fi>
Comment 10 Brendan Lawlor 2025-09-05 13:27:07 UTC
Created attachment 186206 [details] [review]
Bug 27248: Fix display of new due date column in preview table

This patch removes a duplicate call to new_due_dates.shift so that the
new due date column shows the date for all selected checkouts.

To test:
1. Have some random checkouts
2. Use the batch_extend_due_dates tool with preview results checked
3. Notice only have the selected checkouts have data in the new due date column
4. Apply patch and retry seteps 2-3
5. All selected checkouts now show a date in the new due date column

Signed-off-by: Anneli Österman <anneli.osterman@koha-suomi.fi>
Comment 11 Brendan Lawlor 2025-09-05 13:27:14 UTC
Created attachment 186207 [details] [review]
Bug 27248: Add batch extend due dates to report batch ops

This patch adds a new batch operation for reports that return item numbers

To test:
1. Apply patches and restart_all
2. Have some checkouts
3. Create a report that returns itemnumbers
   example: select * from issues
4. Run the report
6. In the Batch operations drop down menu under Item records
   see a new link for Batch extend due dates
7. Click Batch extend due dates
8. Confirm the tool loads with the item barcodes filled in the form