Bug 29983

Summary: Display the return claims column in the circulation overdues page (overdue.tt)
Product: Koha Reporter: Jérémy Breuillard <jeremy.breuillard>
Component: AcquisitionsAssignee: Jérémy Breuillard <jeremy.breuillard>
Status: Pushed to master --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: david, jeremy.breuillard, jonathan.druart+koha, sally.healey, tomascohen
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
This enhancement adds the "Return claims" column to the circulation overdues page, like it is on a patron's check out and details pages. Display or hide the column using the column settings options. It can also be configured using the table settings options in the administration area - it is hidden by default.
Version(s) released in:
22.11.00
Attachments: Bug 29983: Display the pretend claim column in overdue.tt
Bug 29983: Display the pretend claim column in overdue.tt
Bug 29983: Display the pretend claim column in overdue.tt
Bug 29983: Display the pretend claim column in overdue.tt
Bug 29983: Display the pretend claim column in overdue.tt
Bug 29983: Display the pretend claim column in overdue.tt
Bug 29983: Display the pretend claim column in overdue.tt
Bug 29983: Display the pretend claim column in overdue.tt
Bug 29983: Format dates in templates using KohaDates (and display the time part)
Bug 29983: Show the column by default but hide if the feature is disabled
Bug 29983: Fix xt/author/valid-templates.t

Description Jérémy Breuillard 2022-01-31 12:48:20 UTC
Whenever we use a syspref about the return claims (ClaimReturned...):
The column "Return claims" from the checkouts table on page 'moremember.pl' should be displayed on the 'overdues.pl' page too.
Comment 1 Jérémy Breuillard 2022-01-31 13:53:50 UTC Comment hidden (obsolete)
Comment 2 Owen Leonard 2022-01-31 15:57:29 UTC
Please rebase on master!
Comment 3 Jérémy Breuillard 2022-02-01 10:21:59 UTC Comment hidden (obsolete)
Comment 4 Jérémy Breuillard 2022-02-01 10:28:19 UTC Comment hidden (obsolete)
Comment 5 Owen Leonard 2022-02-01 12:07:11 UTC
This seems to be working well except on the checkout page. The "Claim returned" button in the table of checkouts doesn't trigger the modal.
Comment 6 Jérémy Breuillard 2022-02-02 16:21:30 UTC Comment hidden (obsolete)
Comment 7 Jérémy Breuillard 2022-02-03 08:54:40 UTC
Bug found and fixed. Let me know if its done correctly
Comment 8 sandboxes@biblibre.com 2022-02-07 16:38:42 UTC
Created attachment 130240 [details] [review]
Bug 29983: Display the pretend claim column in overdue.tt

This patch displays the column "Return claims" from the page "moremember.pl" to the page "overdues.pl". Rebase on master.

Test plan:
1)Use a patron with at least 1 item who should be checked out soon
2)Home > Patron > Patron details for [name]
3)Click on the 'Checkout' button down the page to show the full table and notice the "Return Claims" column
4)Now go to Home > Circulation > Overdues
5)Find the patron who has to check out and have a look at the table
6)Apply patch and repeat 4) and 5) -> the "Return Claim" column is now displayed on the table

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Comment 9 Sally 2022-02-07 16:39:48 UTC
Works as described.
Comment 10 Katrin Fischer 2022-03-27 10:32:19 UTC
Overall this looks great and I am quite happy to see the code has been moved to an include. Some small 'complaints', hopefully all easy to fix:

1) Translation

I believe we now need to change this to use the single underscore as it was moved from a .js to an .inc file:

+                content = __("Unable to claim as returned");

2) Column configuration

The new column should be added to the column configuration for this report. Some libraries are not using the return claims feature and then it's nice when it can be hidden by default and it also helps when you want to print the table to slim it down.

3) QA test tools

 FAIL	koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt
   FAIL	  valid_template
		modal-claims-js: not found

 FAIL	koha-tmpl/intranet-tmpl/prog/en/modules/circ/overdue.tt
   FAIL	  filters
		missing_filter at line 125 (                <span class="badge">[% overdueloo.return_claim_created_on %]</span>)
Comment 11 Jérémy Breuillard 2022-04-28 11:39:43 UTC
Created attachment 134223 [details] [review]
Bug 29983: Display the pretend claim column in overdue.tt

This patch displays the column "Return claims" from the page "moremember.pl" to the page "overdues.pl". Rebase on master.

Test plan:
1) Use a patron with at least 1 item who should be checked out soon
2) Home > Patron > Patron details for [name]
3) Click on the 'Checkout' button down the page to show the full table and notice the "Return Claims" column
4) Now go to Home > Circulation > Overdues
5) Find the patron who has to check out and have a look at the table
6) Apply patch and repeat 4) and 5) -> the "Return Claim" column is now displayed on the table
Comment 12 David Nind 2022-06-19 20:43:44 UTC
Created attachment 136334 [details] [review]
Bug 29983: Display the pretend claim column in overdue.tt

This patch displays the column "Return claims" from the page "moremember.pl" to the page "overdues.pl". Rebase on master.

Test plan:
1) Use a patron with at least 1 item who should be checked out soon
2) Home > Patron > Patron details for [name]
3) Click on the 'Checkout' button down the page to show the full table and notice the "Return Claims" column
4) Now go to Home > Circulation > Overdues
5) Find the patron who has to check out and have a look at the table
6) Apply patch and repeat 4) and 5) -> the "Return Claim" column is now displayed on the table

Signed-off-by: David Nind <david@davidnind.com>
Comment 13 David Nind 2022-06-19 20:54:05 UTC
Testing notes (using koha-testing-docker):

1. Add a new authorized value for LOST, for example: Authorized value = 5, Description = Claimed returned.
2. Add the authorized value (5) to the ClaimReturnedLostValue system preference.
3. Note that if ClaimReturnedLostValue is not set, then the "Return claims" column is not displayed on the patron's check out and details pages, but can be displayed or hidden using the column settings button.
4. Check out an item to a patron so that it is overdue (when checking out: expand the "Checkout settings" link under the barcode entry field, and specify the due date to an earlier date than today).
5. View the patron's details page and note that the "Return claims" column is displayed.
6. View the overdues page in the circulation module.
7. Note that there is no "Return claims" column, and it doesn't appear in the list of columns that can be displayed or hidden.
8. After the patch is applied, the "Return claims" column can now be displayed or hidden.
9. The column can also be configured using the table settings options in the administration area - the default is for it to be hidden.
Comment 14 Jonathan Druart 2022-08-01 13:37:51 UTC
Why do we display the column if the feature is disabled?
Comment 15 Jonathan Druart 2022-08-01 13:42:38 UTC
And why do we hide the column by default?
Comment 16 Jonathan Druart 2022-08-01 13:47:23 UTC
I am about to submit patches here.
Comment 17 Jonathan Druart 2022-08-01 14:00:22 UTC
Created attachment 138470 [details] [review]
Bug 29983: Display the pretend claim column in overdue.tt

This patch displays the column "Return claims" from the page "moremember.pl" to the page "overdues.pl". Rebase on master.

Test plan:
1) Use a patron with at least 1 item who should be checked out soon
2) Home > Patron > Patron details for [name]
3) Click on the 'Checkout' button down the page to show the full table and notice the "Return Claims" column
4) Now go to Home > Circulation > Overdues
5) Find the patron who has to check out and have a look at the table
6) Apply patch and repeat 4) and 5) -> the "Return Claim" column is now displayed on the table

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 18 Jonathan Druart 2022-08-01 14:00:26 UTC
Created attachment 138471 [details] [review]
Bug 29983: Format dates in templates using KohaDates (and display the time part)

The time part is displayed on the checkout list

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 19 Jonathan Druart 2022-08-01 14:00:31 UTC
Created attachment 138472 [details] [review]
Bug 29983: Show the column by default but hide if the feature is disabled

Prior to this patch there was a blink, the column was displayed then
hidden if the column was hidden.
Also we could display the column even if the feature was disabled.

Now the column is shown by default, and hidden if the feature is
disabled.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 20 Jonathan Druart 2022-08-01 14:00:49 UTC
Jérémy, can you confirm that you agree with the 2 follow-ups please?
Comment 21 Jérémy Breuillard 2022-08-05 09:18:04 UTC
(In reply to Jonathan Druart from comment #20)
> Jérémy, can you confirm that you agree with the 2 follow-ups please?

It is better, I agree with that
Comment 22 Tomás Cohen Arazi 2022-08-05 17:46:57 UTC
There's a false-positive error detected by QA tools:

 FAIL	koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt
   FAIL	  valid_template
		modal-claims-js: not found

noting here only for documentation purposes.
Comment 23 Tomás Cohen Arazi 2022-08-05 17:55:04 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!
Comment 24 Jonathan Druart 2022-08-08 12:18:46 UTC
(In reply to Tomás Cohen Arazi from comment #22)
> There's a false-positive error detected by QA tools:
> 
>  FAIL	koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt
>    FAIL	  valid_template
> 		modal-claims-js: not found

It was not a false-positive, xt/author/valid-templates.t is failing now.
Comment 25 Jonathan Druart 2022-08-08 12:19:48 UTC
Created attachment 138801 [details] [review]
Bug 29983: Fix xt/author/valid-templates.t

#   Failed test '/kohadevbox/koha/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt'
 #   at xt/author/valid-templates.t line 141.
 # file error - modal-claims-js: not found
 # Looks like you failed 1 test of 757.
Comment 26 Tomás Cohen Arazi 2022-08-08 12:57:00 UTC
> (In reply to Tomás Cohen Arazi from comment #22)
> > There's a false-positive error detected by QA tools:
> > 
> >  FAIL	koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt
> >    FAIL	  valid_template
> > 		modal-claims-js: not found
> 
> It was not a false-positive, xt/author/valid-templates.t is failing now.

Well, circulation.tt includes checkouts-table.inc, which includes modal-claims.inc
That's why I thought this was a false negative. I'm fine with the follow-up, but it feels the tests are wrong then. Or maybe I'm too tired to think clearly XD
Comment 27 Jonathan Druart 2022-08-08 13:16:25 UTC
It's how it's working. We have exclusions but I would not add circulation.tt.

So yes, the test is not as best as it could be, but his patch is the easiest way to make it pass again.
Comment 28 Tomás Cohen Arazi 2022-08-08 13:17:22 UTC
Follow-up pushed, thanks!