Bug 12054

Summary: Don't allow to create orders for inactive vendors
Product: Koha Reporter: Alessandra Carassiti <a.carassiti>
Component: AcquisitionsAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: indradg, jonathan.druart, kyle, paola.rossi, tomascohen
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Order from an inactive vendor
Bug 12054: Inactive vendors should be inactive
Signed off patch for bug 12054
Bug 12054: Inactive vendors should be inactive
Bug 12054: Inactive vendors should be inactive
Bug 12054: (follow-up) Inactive vendors should be inactive
Bug 12054: Inactive vendors should be inactive
Bug 12054: Inactive vendors should be inactive
Bug 12054: Inactive vendors should be inactive
[PASSED QA] Bug 12054: Inactive vendors should be inactive

Description Alessandra Carassiti 2014-04-09 09:12:40 UTC
Created attachment 26915 [details]
Order from an inactive vendor

When you make a vendor inactive, koha is able to order from it although if the help says you it’s not possible (see the attachment). I think it would be convenient to have at least a message that inform you of the vendor status.
Comment 1 Paola Rossi 2014-12-02 14:54:11 UTC
This bug is still present in master 3.19.
Comment 2 Jonathan Druart 2015-04-28 08:19:43 UTC Comment hidden (obsolete)
Comment 3 Indranil Das Gupta 2015-05-16 11:39:37 UTC
I have problems applying this patch with git bz

Traceback (most recent call last):
  File "/usr/local/bin/git-bz", line 2633, in <module>
    do_attach(*args)
  File "/usr/local/bin/git-bz", line 1999, in do_attach
    attach_commits(bug, commits, edit_comments=global_options.edit)
  File "/usr/local/bin/git-bz", line 1914, in attach_commits
    description, body, obsoletes, statuses, patch_complexities, depends = edit_attachment_comment(bug, commit.subject, body)
  File "/usr/local/bin/git-bz", line 1867, in edit_attachment_comment
    lines = edit_template(template.getvalue())
  File "/usr/local/bin/git-bz", line 811, in edit_template
    f.write(template)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2019' in position 30: ordinal not in range(128)
Comment 4 Indranil Das Gupta 2015-05-16 11:49:14 UTC
(In reply to Indranil Das Gupta from comment #3)
> I have problems applying this patch with git bz

CORRECTION: s/applying/attaching

Patch applies and works correctly as per test plan
Comment 5 Indranil Das Gupta 2015-05-16 11:56:38 UTC Comment hidden (obsolete)
Comment 6 Indranil Das Gupta 2015-05-16 12:03:50 UTC Comment hidden (obsolete)
Comment 7 Indranil Das Gupta 2015-05-16 12:07:53 UTC Comment hidden (obsolete)
Comment 8 Katrin Fischer 2015-05-17 11:15:10 UTC
Hi Indranil, make sure you have checked out the latest version of the fishsoup branch from the git-bz repository on kc.org - that should make the problem disappear.
Comment 9 Katrin Fischer 2015-05-31 21:42:56 UTC
I wonder: should we allow receiving shipments for inactive vendors? There might still be orderes outstanding,when you decide that you don't want to use the vendor for odering in the future.
Comment 10 Katrin Fischer 2015-05-31 21:48:41 UTC
Hm, also, I can still:
- reopen the baskt
- add new orders

This is possible by using the 'view' link from the vendor search page.
Comment 11 Jonathan Druart 2015-06-03 09:43:15 UTC Comment hidden (obsolete)
Comment 12 Jonathan Druart 2015-06-03 09:45:18 UTC
(In reply to Katrin Fischer from comment #9)
> I wonder: should we allow receiving shipments for inactive vendors? There
> might still be orderes outstanding,when you decide that you don't want to
> use the vendor for odering in the future.

(In reply to Katrin Fischer from comment #10)
> Hm, also, I can still:
> - reopen the baskt
> - add new orders
> 
> This is possible by using the 'view' link from the vendor search page.

This patch only prevents to add order to an inactive vendor.

The second one fixes 2 more occurrences where it was possible to add orders (on the basket page).
Comment 13 Katrin Fischer 2015-06-06 15:13:24 UTC
 > > This is possible by using the 'view' link from the vendor search page.
> 
> This patch only prevents to add order to an inactive vendor.

Hi Jonathan, this is not quite correct - you also remove 2 of the 'receive shipments' links, one being in the vendor search result list. I am a bit worried about those, as it will make it difficult to receive pending orders from a 'blocked for future use' vendor. Could we keep them?
Comment 14 Jonathan Druart 2015-06-16 11:16:33 UTC Comment hidden (obsolete)
Comment 15 Jonathan Druart 2015-06-16 11:17:44 UTC
The 2 patches have been squashed and the 'receive shipments' links reintroduced for inactive vendors.
Back to Needs Signoff
Comment 16 Indranil Das Gupta 2015-06-17 00:36:17 UTC Comment hidden (obsolete)
Comment 17 Indranil Das Gupta 2015-06-17 00:39:12 UTC Comment hidden (obsolete)
Comment 18 Kyle M Hall (khall) 2015-07-10 14:50:10 UTC
Created attachment 40925 [details] [review]
[PASSED QA] Bug 12054: Inactive vendors should be inactive

This patch make inactive vendors really inactive.
That means an inactive vendor would not be able to add a basket / add an order.

Revised test plan
=================

1/ In the acquisition module create 2 vendors: 1 active and 1 inactive.

2/ On the acqui/booksellers.pl, acqui/uncertainprice.pl,
   admin/aqcontract.pl and acqui/supplier.pl (pages which include the
   acq toolbar), you should be able to, for both the 'active' as well
   as the inactive vendor :
     (a) add new basket
     (b) add order items to the basket

   Remark: This is *wrong*. You should be able to do so only for active
           vendor.

3/ Apply the patch

4/ Go to the links in step #2 above and select the inactive vendor
   you should no longer be able to:
   (a) add new basket
   (b) add order items to the basket

   Remark: This is the *correct* behaviour

5/ No change should be noted for vendor marked "active", and should
   be able to undertake operations 4 (a), 4 (b) and 4 (c).

   Remark: This is the *correct* behaviour.

6/ run koha qa tests tool

Bug 12054: (follow-up) Inactive vendors should be inactive

Don't display "add order""block and buttons if the vendor is inactive.

Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 19 Tomás Cohen Arazi (tcohen) 2015-07-20 14:06:49 UTC
Patch pushed to master.

Thanks Jonathan!