Bug 5343

Summary: Subscription cost (Link serial and acqui modules)
Product: Koha Reporter: Paul Poulain <paul.poulain>
Component: SerialsAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Katrin Fischer <katrin.fischer>
Severity: new feature    
Priority: P5 - low CC: bgkriegel, claire.hernandez, jonathan.druart, katrin.fischer, koha.aixmarseille, koha, kohapatch, mathsabypro
Version: Main   
Hardware: All   
OS: All   
URL: http://wiki.koha-community.org/wiki/Cost_serials_RFC
See Also: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8456
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8415
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9346
Change sponsored?: Sponsored Patch complexity: Medium patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 5335    
Bug Blocks: 7288, 9896, 9898, 9937, 10145, 16385, 23352, 30451    
Attachments: Bug 5343: Link serial and acqui modules
Bug 5343: Link serial and acqui modules
Bug 5343: Link serial and acqui modules
Bug 5343: Link serial and acqui modules
Bug 5343: Followup FIX quantity received if items are created when receiving
Bug 5343: Followup FIX quantity received if items are created when receiving
Bug 5343: Followup: invoicenumber no longer exists, use invoiceid.
Bug 5343: Link serial and acqui modules
Bug 5343: Followup FIX quantity received if items are created when receiving
Bug 5343: Followup: invoicenumber no longer exists, use invoiceid.
Bug 5343: It is not possible to add a subscription for another supplier
Bug 5343: Link serial and acqui modules
Bug 5343: Followup FIX quantity received if items are created when receiving
Bug 5343: Followup: invoicenumber no longer exists, use invoiceid.
Bug 5343: It is not possible to add a subscription for another supplier
Bug 5343: Link serial and acqui modules (squached)
Bug 5343: Followup: remove useless string on the serials result page
Bug 5343: Link serial and acqui modules
Bug 5343: Followup FIX quantity received if items are created when receiving
Bug 5343: Followup: invoicenumber no longer exists, use invoiceid.
Bug 5343: It is not possible to add a subscription for another supplier
Bug 5343: Followup: remove useless string on the serials result page
screenshot of subscription search when creating an order from a subscription
Bug 5343: Fix non english string
Bug 5343: Fix non english string
[PASSED QA] Bug 5343: Link serial and acqui modules
[PASSED QA] Bug 5343: Followup FIX quantity received if items are created when receiving
[PASSED QA] Bug 5343: Followup: invoicenumber no longer exists, use invoiceid.
[PASSED QA] Bug 5343: It is not possible to add a subscription for another supplier
[PASSED QA] Bug 5343: Followup: remove useless string on the serials result page
[PASSED QA] Bug 5343: Fix non english string
[PASSED QA] Bug 5343: Fix non english string

Description Paul Poulain 2010-11-02 02:48:11 UTC
When adding a subscription, the librarian will be able to enter the price of a subscription, the budget, and the VAT (defaulted to the supplier default VAT). If the librarian enters informations, a basket, a basket group will be automatically created with the appropriate informations
Comment 1 Jonathan Druart 2012-08-17 07:56:21 UTC
This patch will allow to create a new order from a subscription.

It is currently blocked by Bug 5335.
Comment 2 Jonathan Druart 2012-10-23 14:43:14 UTC Comment hidden (obsolete)
Comment 3 Jonathan Druart 2012-10-23 15:17:21 UTC Comment hidden (obsolete)
Comment 4 Katrin Fischer 2012-10-23 15:37:21 UTC
Jonathan, have you seen this is a duplicate to bug 8415 and related bug 8456? I tried to get the patch Amit Gupta created from Biblibres patch working and did some follow-ups - I am happy to test this as soon as there is time. But could you take a look maybe at the other bugs?
Comment 5 Jonathan Druart 2012-10-24 07:27:08 UTC
(In reply to comment #4)
> Jonathan, have you seen this is a duplicate to bug 8415 and related bug
> 8456? I tried to get the patch Amit Gupta created from Biblibres patch
> working and did some follow-ups - I am happy to test this as soon as there
> is time. But could you take a look maybe at the other bugs?

Hi Katrin,
Yes I know...
But it was easiest to me to recreate the patch from scratch rather than created somes followups for others patches.
Several remarks you made for Bug 8415 and Bug 8456 are fixed in my patch.
Comment 6 Jonathan Druart 2012-10-24 07:38:51 UTC
*** Bug 8456 has been marked as a duplicate of this bug. ***
Comment 7 Jonathan Druart 2012-10-24 07:39:11 UTC
*** Bug 8415 has been marked as a duplicate of this bug. ***
Comment 8 Katrin Fischer 2012-10-24 10:27:49 UTC
Hi Jonathan,

that's ok - I figured that was the reason and working on the patch it makes a lot of sense to me to redo it. I really got stuck in the end and found a lot of problems. All I was hoping for is that you take a look at the remarks to see if they still apply to your new patch and close the other bugs - which you did :)
Comment 9 Jonathan Druart 2013-03-04 09:05:34 UTC Comment hidden (obsolete)
Comment 10 Owen Leonard 2013-03-18 17:43:43 UTC
I get this error when searching for a subscription in Step 4:

Can't use string (" [my search string] ") as a HASH ref while "strict refs" in use at /home/oleonard/kohaclone/C4/Serials.pm line 669.
Comment 11 Jonathan Druart 2013-03-19 08:39:49 UTC Comment hidden (obsolete)
Comment 12 Koha Team University Lyon 3 2013-03-19 10:37:00 UTC
There's a problem at step 10 : I can't receive the order because I can't fill Quantity received in page orderreceive.pl
(syspref AcqCreateItem =Create an item when placing an order)
Comment 13 Jonathan Druart 2013-03-20 10:29:09 UTC Comment hidden (obsolete)
Comment 14 Jonathan Druart 2013-03-20 10:29:40 UTC
(In reply to comment #12)
> There's a problem at step 10 : I can't receive the order because I can't
> fill Quantity received in page orderreceive.pl
> (syspref AcqCreateItem =Create an item when placing an order)

It should be fixed with this last patch.
Comment 15 Jonathan Druart 2013-03-20 11:12:35 UTC Comment hidden (obsolete)
Comment 16 Jonathan Druart 2013-03-20 12:45:53 UTC Comment hidden (obsolete)
Comment 17 Mathieu Saby 2013-03-20 13:04:01 UTC
patch does not apply
M. Saby
Comment 18 Jonathan Druart 2013-03-21 13:28:55 UTC Comment hidden (obsolete)
Comment 19 Jonathan Druart 2013-03-21 13:29:00 UTC Comment hidden (obsolete)
Comment 20 Jonathan Druart 2013-03-21 13:29:04 UTC Comment hidden (obsolete)
Comment 21 Koha Team University Lyon 3 2013-03-21 13:31:26 UTC
just a functionnal comment : when a vendor is choosen in the subscription, it's not logical if it can be order by another vendor in acquisitions module.
So after the search of subsrciption (step 4 in test plan), only the subscription with this vendor or with no vendor should be "Orderable"
Comment 22 Jonathan Druart 2013-03-21 14:18:38 UTC Comment hidden (obsolete)
Comment 23 Jonathan Druart 2013-03-22 09:03:42 UTC Comment hidden (obsolete)
Comment 24 Jonathan Druart 2013-03-22 09:03:46 UTC Comment hidden (obsolete)
Comment 25 Jonathan Druart 2013-03-22 09:03:49 UTC Comment hidden (obsolete)
Comment 26 Jonathan Druart 2013-03-22 09:03:54 UTC Comment hidden (obsolete)
Comment 27 Fridolin Somers 2013-03-22 09:22:06 UTC Comment hidden (obsolete)
Comment 28 Jonathan Druart 2013-03-22 09:42:29 UTC Comment hidden (obsolete)
Comment 29 Jonathan Druart 2013-03-22 09:46:22 UTC Comment hidden (obsolete)
Comment 30 Jonathan Druart 2013-03-22 09:46:26 UTC Comment hidden (obsolete)
Comment 31 Jonathan Druart 2013-03-22 09:46:31 UTC Comment hidden (obsolete)
Comment 32 Jonathan Druart 2013-03-22 09:46:35 UTC Comment hidden (obsolete)
Comment 33 Jonathan Druart 2013-03-22 09:46:38 UTC Comment hidden (obsolete)
Comment 34 Koha Team AMU 2013-03-22 09:50:36 UTC
Test OK

OK on order and on receive.

We have the information on cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=
Comment 35 Katrin Fischer 2013-03-22 09:59:01 UTC
Looking at this now.
Comment 36 Katrin Fischer 2013-03-22 10:20:50 UTC
On the subscription search screen I think it would be a little bit better to have the last column empty or saying "Cannot be ordered" (asked Kyle and Brendan :) )

Still testing - can be easily dealt with in a little follow up.
Comment 37 Katrin Fischer 2013-03-22 10:22:58 UTC
Created attachment 16748 [details]
screenshot of subscription search when creating an order from a subscription

Attaching a screenshot to illustrate - should also not be a link in this case. Maybe leaving it empty would be easiest.
Comment 38 Jonathan Druart 2013-03-22 10:42:28 UTC Comment hidden (obsolete)
Comment 39 Jonathan Druart 2013-03-22 10:42:47 UTC
(In reply to comment #36)
> On the subscription search screen I think it would be a little bit better to
> have the last column empty or saying "Cannot be ordered" (asked Kyle and
> Brendan :) )

"Orderable" smelt quite bad :)
Comment 40 Katrin Fischer 2013-03-22 10:48:29 UTC
I have some more little typos:
See basket informations
See invoice informations 
= information

and fund = Fund

- If you don't get to it I can make a little follow up on my own for that.
Comment 41 Jonathan Druart 2013-03-22 10:54:42 UTC Comment hidden (obsolete)
Comment 42 Katrin Fischer 2013-03-22 11:12:31 UTC
Created attachment 16764 [details] [review]
[PASSED QA] Bug 5343: Link serial and acqui modules

DB changements:
- Adds 2 fields: subscription.reneweddate and aqorders.subscriptionid.
- Removes 2 unused fields: aqorders.serialid and aqorders.subscription.

Main test plan:
1) Create a subscription
2) Create a bookseller and a basket
3) Add a new order 'from a subscription'
4) Search your subscription and check if results are correct
5) Click on the "order" link
6) Check the biblio information are filled in the form
7) Select a budget and fill some price information.
8) retry steps 3 and 4. Verify you cannot order the same subscription.
Message:Outstanding order (only one order per subscription is allowed).
9) click on your subscription (already added) and check you have a new
table "Acquisition details" with your price information in the "Ordered
amount" line.
10) receive this order
11) On your subscription detail page, the "Spent amount" line must be
filled with your price information.
12) Re order the same subscription. Now you are allowed to. Prices
information have to be filled with the previous information.
13) Retry some orders and click on a maximum of links in order to find a
bug :)

Signed-off-by: Leila Arkab <koha.aixmarseille@gmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Comments on last patch.
Comment 43 Katrin Fischer 2013-03-22 11:12:57 UTC
Created attachment 16765 [details] [review]
[PASSED QA] Bug 5343: Followup FIX quantity received if items are created when receiving

For subscriptions, if items are created when receiving, the quantity
received is always 1, not 0.

+ UI: Show the subscription search form (instead of hidden)

Signed-off-by: Leila Arkab <koha.aixmarseille@gmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Comment 44 Katrin Fischer 2013-03-22 11:13:18 UTC
Created attachment 16766 [details] [review]
[PASSED QA] Bug 5343: Followup: invoicenumber no longer exists, use invoiceid.

A previous patch replaces invoicenumber with invoiceid.

Signed-off-by: Leila Arkab <koha.aixmarseille@gmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Comment 45 Katrin Fischer 2013-03-22 11:13:41 UTC
Created attachment 16767 [details] [review]
[PASSED QA] Bug 5343: It is not possible to add a subscription for another supplier

If a supplier is defined for a subscription, you cannot order this
subscription to another supplier. If no supplier is defined, you can.

FIX: If a cancelled order is linked to a subscription, you can order it.

Signed-off-by: Leila Arkab <koha.aixmarseille@gmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Comment 46 Katrin Fischer 2013-03-22 11:14:05 UTC
Created attachment 16768 [details] [review]
[PASSED QA] Bug 5343: Followup: remove useless string on the serials result page

Signed-off-by: Leila Arkab <koha.aixmarseille@gmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Comment 47 Katrin Fischer 2013-03-22 11:14:25 UTC
Created attachment 16769 [details] [review]
[PASSED QA] Bug 5343: Fix non english string

Replace "Not orderable" with "Cannot be ordered"

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Comment 48 Katrin Fischer 2013-03-22 11:14:52 UTC
Created attachment 16770 [details] [review]
[PASSED QA] Bug 5343: Fix non english string

Replace "Not orderable" with "Cannot be ordered"
and 3 others typos

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests and QA script pass.

Testing notes:
- Ordered same subscription multiple times
- Tried different settings of AcqCreateItem for a full
  workflow from order to receive
- Undid a receipt and checked correct behaviour
- Ordered a book in between, to see item creation and
  receiving still works.

Note for documentation:
Acquisition details on the subscription only show the
last invoice and the last order. You can of course find
all orders/invoices using the acquisition search.

Overall very nice much needed functionality!
Comment 49 Jared Camins-Esakov 2013-03-23 03:59:38 UTC
Because I have received many requests for this feature from both developers and librarians, these patches have been pushed to master prior to the feature freeze. However, there are no unit tests for the new routines, which is bad. Therefore, if no unit tests have been offered have by March 29, I will revert the feature and it can be reviewed for inclusion in the 3.14 release.
Comment 50 Jonathan Druart 2013-03-27 14:13:42 UTC
(In reply to comment #49)
> Because I have received many requests for this feature from both developers
> and librarians, these patches have been pushed to master prior to the
> feature freeze. However, there are no unit tests for the new routines, which
> is bad. Therefore, if no unit tests have been offered have by March 29, I
> will revert the feature and it can be reviewed for inclusion in the 3.14
> release.

Please reports to bug 9937 for UT.