Bug 8694 - Show accurate subscription renewal warning for expired subscriptions
Summary: Show accurate subscription renewal warning for expired subscriptions
Status: Failed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: Serials (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact:
URL: /cgi-bin/koha/serials/subscription-de...
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-28 14:45 UTC by Owen Leonard
Modified: 2022-06-09 12:24 UTC (History)
8 users (show)

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


Attachments
Bug 8694 - Show accurate subscription renewal warning for expired subscriptions (3.22 KB, patch)
2012-08-28 15:06 UTC, Owen Leonard
Details | Diff | Splinter Review
Subscription that caused an error. (134.70 KB, image/jpeg)
2012-08-31 12:14 UTC, Kyle M Hall
Details
Bug 8694: Show accurate subscription renewal warning for expired subscriptions (2.53 KB, patch)
2020-12-16 13:44 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 8694: Show accurate subscription renewal warning for expired subscriptions (2.61 KB, patch)
2021-01-18 12:47 UTC, PTFS Europe Sandboxes
Details | Diff | Splinter Review
Bug 8694: Show accurate subscription renewal warning for expired subscriptions (2.88 KB, patch)
2022-06-09 12:11 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2012-08-28 14:45:46 UTC
Currently if you have an expired subscription you see on the subscription detail page a message saying "Subscription will expire [ date in the past ]." It would be more accurate and helpful to say "Subscription expired on [ expiration date ]."
Comment 1 Owen Leonard 2012-08-28 15:06:08 UTC Comment hidden (obsolete)
Comment 2 Kyle M Hall 2012-08-31 12:14:57 UTC Comment hidden (obsolete)
Comment 3 Jonathan Druart 2020-12-16 13:44:02 UTC Comment hidden (obsolete)
Comment 4 PTFS Europe Sandboxes 2021-01-18 12:47:08 UTC Comment hidden (obsolete)
Comment 5 Sally 2021-01-18 12:47:45 UTC
Works as expected.
Comment 6 Katrin Fischer 2021-02-14 16:00:05 UTC
I have problems replicating this. May subscription end date is in the past, but the note doesn't show on the subscription detail page, while it does already show on the serial collection page.

I wonder if the reason I can't see the note is abouttoexpire, but I fail to understand how this one works.

Joubu, can you help?

Would it make sense to change the note on the serial subscription page as well? 
At least we should probably use the same logic in both places?
Comment 7 Jonathan Druart 2021-02-15 15:17:43 UTC
I cannot remember exactly but I know it was painful.

The "logic" is in C4::Serials::abouttoexpire, IIRC I tried to hit the first condition and hardcoded planneddate to be before then after today.
Comment 8 Caroline Cyr La Rose 2021-10-06 16:03:33 UTC
If I may, here's what I have with the current master...

My subscription A expired on September 1st 2021, we are Oct. 6, so it is currently expired. I have received all issues that were in the subscription (and more).

In subscription-detail.pl : "Subscription will expire 09/01/2021. Renew this subscription." In a blue message box. Renew this subscription is a link.

In serials-collection.pl : "Subscription expired" in bold, red and with an exclamation mark icon next to it


My subscription B expired on the same day. BUT I haven't received any issues (I only just created the subscription and didn't do anything else).

Nothing in subscription-detail.pl, nothing in serials-collection.pl.

Once I have received one issue with today's date, the messages appear in both subscription-detail.pl and serials-collection.pl

If I change the received issue and put a date in the past in "Expected on", the messages disappear.


I can't get just one message like Katrin.

But, what I understand is that it has nothing to do with the end of the subscription and more to do with the issues in the subscription?
Comment 9 Owen Leonard 2022-05-12 13:19:52 UTC
I'd love to see this get picked up again. It's a minor issue, but annoying.

When comparing dates in abouttoexpire, perhaps it could return a positive number if the expiration date is in the future and a negative one if it's in the past? Then the template logic could handle which message to display.
Comment 10 Jonathan Druart 2022-06-08 14:31:48 UTC
Did you test the patch, Owen?
Comment 11 Jonathan Druart 2022-06-09 12:11:08 UTC
Created attachment 135879 [details] [review]
Bug 8694: Show accurate subscription renewal warning for expired subscriptions

If a subscription is going to expired we should not phrase the warning
  "Subscription will expire [ date in the past ]."

Test plan:
Create a subscription with relevant expiration date.
The detail page of the subscription show correctly the warning about the
expiration date.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Comment 12 Owen Leonard 2022-06-09 12:24:36 UTC
With the patch the page now says "Subscription expired on..." whether or not the date is in the past or in the future.