Bug 16116 - Change of issue publication date doesn't reflect on the next issue generated
Summary: Change of issue publication date doesn't reflect on the next issue generated
Status: RESOLVED DUPLICATE of bug 18356
Alias: None
Product: Koha
Classification: Unclassified
Component: Serials (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Bouzid Fergani
QA Contact: Testopia
URL:
Keywords:
Depends on: 12671
Blocks:
  Show dependency treegraph
 
Reported: 2016-03-21 20:21 UTC by Francois Charbonnier
Modified: 2022-05-11 19:55 UTC (History)
7 users (show)

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


Attachments
Bug 16116 - Fix problem change of issue publication date doesn't reflect on the next issue generated (3.74 KB, patch)
2016-12-16 19:03 UTC, Bouzid Fergani
Details | Diff | Splinter Review
Bug 16116 - Add unit tests (2.89 KB, patch)
2016-12-16 20:35 UTC, Bouzid Fergani
Details | Diff | Splinter Review
Bug 16116 - Fix problem change of issue publication date doesn't reflect on the next issue generated (3.74 KB, patch)
2017-03-10 19:10 UTC, Bouzid Fergani
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 16116 - Fix problem change of issue publication date doesn't reflect on the next issue generated (3.81 KB, patch)
2017-04-14 09:48 UTC, Josef Moravec
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Francois Charbonnier 2016-03-21 20:21:45 UTC
I noticed in 3.20, but also in master, that you can't change the next
issue publication date when editing a serial subscription anymore.

And, that we lost a feature I liked when receiving a new issue. Before 3.20,
when receiving a new issue, you could change the "Published on" date and
Koha will adjust the subscription's next issue publication date for all
the new issues to be received.

Test plan :

1. In Cataloging > New with Z39.50, look for issn = 1536-6596 (National Geographic) into the LCC z39.60 server. Add the record.

2. Add a new subscription for National Geographic. Fill-in the form.
- use the default values of the first page
- for the second page :
First issue publication date = 10/01/2016
Frequency = 1/month
Subscription lenght = 12 issues
Subscription start date = 01/01/2016
Numbering pattern = Number
Begins with = 1
- Save

3. Receive the first issue. Change the status to "received". Note that the "Published on" date = 10/01/2016. This date goes to the "Date published" column in the serial collection page.

4. The second issue is generated. Edit serial to receive the issue.

5. Change the "Published on" date to 11/02/2016. Change the status to "received". Save.

6. "Date published" for the next issue generated is : 10/03/2016. Before 3.20, it would have been "11/03/2016". It was a shortcut to change the Next issue publication date from the subscription.

7. Edit the subscription. Change the "Next issue publication date" to : 11/03/2016. 

8. Go back to the serial collection page. Date published for the last expected issue = 11/03/2016

9. Receive the issue. Change the status to "received". Save

10. The next issue generated is 10/04/2016. It should have been 11/04/2016.
Comment 1 Francois Charbonnier 2016-03-21 20:23:15 UTC
Could it
be https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12671 (Guess next serial date when there are several issues per unit) that
broke this feature?
Comment 2 Gaetan Boisson 2016-03-22 12:40:46 UTC
Confirmed. I was not able to change the next issue date in a durable fashion. This might be a bigger problem than it seems, because in certain situations (a "double issue" that skips a month, that is number 36 is for February and march, and number 37 is for April) this is the recommended way of handling it. I haven't tested this toroughly yet. Maybe the number guessing method makes sure we don't get two issues for April, but there would be a lot of edge cases to try.
Comment 3 Julian Maurice 2016-03-22 12:54:41 UTC
(In reply to Francois Charbonnier from comment #1)
> Could it
> be https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12671 (Guess
> next serial date when there are several issues per unit) that
> broke this feature?

Probably.

I just looked at the code quickly and I think the problem comes from the _get_next_date_* subroutines where we force the day (or day and month) to the same as firstacquidate. Maybe it's not necessary.
Comment 4 Bouzid Fergani 2016-12-16 19:03:11 UTC
Created attachment 58265 [details] [review]
Bug 16116 - Fix problem change of issue publication date doesn't reflect on the next issue generated

Test plan :

1. In Cataloging > New with Z39.50, look for issn = 1536-6596 (National Geographic) into the LCC z39.60 server. Add the record.

2. Add a new subscription for National Geographic. Fill-in the form.
- use the default values of the first page
- for the second page :
First issue publication date = 10/01/2016
Frequency = 1/month
Subscription lenght = 12 issues
Subscription start date = 01/01/2016
Numbering pattern = Number
Begins with = 1
- Save

3. Receive the first issue. Change the status to "received". Note that the "Published on" date = 10/01/2016. This date goes to the "Date published" column in the serial collection page.

4. The second issue is generated. Edit serial to receive the issue.

5. Change the "Published on" date to 14/02/2016. Change the status to "received". Save.

6. "Date published" for the next issue generated is : 14/03/2016.
Comment 5 Bouzid Fergani 2016-12-16 20:35:54 UTC Comment hidden (obsolete)
Comment 6 Bouzid Fergani 2017-03-10 19:10:05 UTC
Created attachment 61002 [details] [review]
Bug 16116 - Fix problem change of issue publication date doesn't reflect on the next issue generated

Test plan :

1. In Cataloging > New with Z39.50, look for issn = 1536-6596 (National Geographic) into the LCC z39.60 server. Add the record.

2. Add a new subscription for National Geographic. Fill-in the form.
- use the default values of the first page
- for the second page :
First issue publication date = 10/01/2016
Frequency = 1/month
Subscription lenght = 12 issues
Subscription start date = 01/01/2016
Numbering pattern = Number
Begins with = 1
- Save

3. Receive the first issue. Change the status to "received". Note that the "Published on" date = 10/01/2016. This date goes to the "Date published" column in the serial collection page.

4. The second issue is generated. Edit serial to receive the issue.

5. Change the "Published on" date to 14/02/2016. Change the status to "received". Save.

6. "Date published" for the next issue generated is : 14/03/2016.
Comment 7 Bouzid Fergani 2017-03-10 19:11:50 UTC
Hi All,
I deteted patch unit test because it test a local sub.
Thanks
Comment 8 Josef Moravec 2017-04-14 09:48:51 UTC
Created attachment 62163 [details] [review]
[SIGNED-OFF] Bug 16116 - Fix problem change of issue publication date doesn't reflect on the next issue generated

Test plan :

1. In Cataloging > New with Z39.50, look for issn = 1536-6596 (National Geographic) into the LCC z39.60 server. Add the record.

2. Add a new subscription for National Geographic. Fill-in the form.
- use the default values of the first page
- for the second page :
First issue publication date = 10/01/2016
Frequency = 1/month
Subscription lenght = 12 issues
Subscription start date = 01/01/2016
Numbering pattern = Number
Begins with = 1
- Save

3. Receive the first issue. Change the status to "received". Note that the "Published on" date = 10/01/2016. This date goes to the "Date published" column in the serial collection page.

4. The second issue is generated. Edit serial to receive the issue.

5. Change the "Published on" date to 14/02/2016. Change the status to "received". Save.

6. "Date published" for the next issue generated is : 14/03/2016.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 9 Marcel de Rooy 2017-05-09 13:57:38 UTC
Would it be possible for Francois, Gaetan or Julian to test this patch too?
I am not so sure if the proposed changes really solve all problems in this area.
Another signoff would not be a bad idea.

Another point (referring to an earlier remark):
> Before 3.20, when receiving a new issue, you could change the "Published on" 
> date and Koha will adjust the subscription's next issue publication date for
> all the new issues to be received.

Would it be an idea to add an option to the subscription that makes it possible to rebase issue dates somehow ? We now have a 'buggy' mix of using last issue and first acqui date. Maybe an additional base date to use optionally (overruling first acqui)? Other ideas ?
Comment 10 Marcel de Rooy 2017-05-12 06:18:43 UTC
Moving this patch out of the SO queue for now.
This should not be pushed in its current form just before release.
Comment 11 Katrin Fischer 2017-06-08 14:18:17 UTC
Hi Marcel, can this go back into the queue now? 

I am currently trying to figure out a way for the library to change the date an issue is published and am failing... I think this really needs a solution.
Comment 12 Marcel de Rooy 2017-06-08 15:00:03 UTC
(In reply to Katrin Fischer from comment #11)
> Hi Marcel, can this go back into the queue now? 
> 
> I am currently trying to figure out a way for the library to change the date
> an issue is published and am failing... I think this really needs a solution.

I have spent some more time on this problem.
Please look at bug 18356, bug 18607 and bug 18697. That solution also includes releasing the link with firstacqui date and solves several computational problems.
It is imo a completer solution and supported by tests.
For that reason I would propose to close this bug if these patches have been QAed.
Comment 13 Marcel de Rooy 2017-06-20 13:55:05 UTC
Closing this bug in favor of bug 18356, bug 18607 and bug 18697. These have been pushed recently.
Comment 14 Marcel de Rooy 2017-06-20 14:58:21 UTC

*** This bug has been marked as a duplicate of bug 18356 ***