Bug 15055 - Koha generates new subscription item even when it's not necessary
Summary: Koha generates new subscription item even when it's not necessary
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Serials (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-23 15:09 UTC by Joonas Kylmälä
Modified: 2015-10-23 15:19 UTC (History)
1 user (show)

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


Attachments
Bug 15055: Koha generates new subscription item even when it's not necessary (10.08 KB, patch)
2015-10-23 15:19 UTC, Joonas Kylmälä
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Joonas Kylmälä 2015-10-23 15:09:01 UTC
When receiving a subscription item, Koha will assume that you want to create a new subscription item (which will be put in the "expected" status) every time.

How to reproduce this:

1. Someone accidentally changes something to "received" and then changes it back to "expected". -> a new item in subscriptions has been generated
2. Now we go and change that accidentally changed item back to "received". -> a new item in subscriptions has been generated
3. Now there is two new items waiting to be received. Normally there should be just one.
4. and what if someone changes the status 10 times accidentally to received.. Then there would be 10 new items waiting with the status "expected".

Also when you add the last item of that specific subscription period Koha shouldn't generate the maybe future subscriptions item there. There is a huge bug(?) in the C4::Serials::abouttoexpire(), so fixing this might be difficult. The bug is that originally periodic subscription has been changed to non-periodic in the renewal phase and then it doesn't take that account.
Comment 1 Joonas Kylmälä 2015-10-23 15:19:05 UTC
Created attachment 43879 [details] [review]
Bug 15055: Koha generates new subscription item even when it's not necessary

Do checking whether the item which is been received is already in the system
or not. If it is, then do not generate a new subscription item.

Sponsored-by: Vaara-kirjastot

This is a work-in-progress version (may not even apply but look at the code). This doesn't work optimally with the subscription expiration situation (when the abouttoexpire fixed, now it works in some cases)
In order to get this working we need to call the C4::Serials::GenerateNewIssue also when we renew the subscription.