Summary: | Show accurate subscription renewal warning for expired subscriptions | ||
---|---|---|---|
Product: | Koha | Reporter: | Owen Leonard <oleonard> |
Component: | Serials | Assignee: | Jonathan Druart <jonathan.druart> |
Status: | Failed QA --- | QA Contact: | |
Severity: | normal | ||
Priority: | P5 - low | CC: | abl, caroline.cyr-la-rose, colin.campbell, jonathan.druart, kyle, marjorie.barry-vila, sally.healey |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
URL: | /cgi-bin/koha/serials/subscription-detail.pl | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Attachments: |
Bug 8694 - Show accurate subscription renewal warning for expired subscriptions
Subscription that caused an error. Bug 8694: Show accurate subscription renewal warning for expired subscriptions Bug 8694: Show accurate subscription renewal warning for expired subscriptions Bug 8694: Show accurate subscription renewal warning for expired subscriptions |
Description
Owen Leonard
2012-08-28 14:45:46 UTC
Created attachment 11871 [details] [review] Bug 8694 - Show accurate subscription renewal warning for expired subscriptions This patch adds a check of the subscription end date when displaying the "about to expire" message, substituting a "already expired" warning in its place if the expiration date is in the past. To test, view a subscription which is about to expire and a subscription which has already expired. You should see two different versions of the message. Created attachment 11907 [details]
Subscription that caused an error.
Attempting to save this subscription after applying the patch caused the following error:
Usage: Date::Calc::Delta_Days(year1, month1, day1, year2, month2, day2) at /home/koha/kohaclone/serials/subscription-detail.pl line 103.
Created attachment 114437 [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. Created attachment 115246 [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> Works as expected. 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? 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. 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? 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. Did you test the patch, Owen? 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> With the patch the page now says "Subscription expired on..." whether or not the date is in the past or in the future. |