You can delete almost everything in acq, but not vendors. Vendors can only be deactivated but still show up in search results. Although almost everything else in acq can be deleted (budgets, funds, orders (reopen + delete), im not sure it should be possible to delete vendors. An option to filter search results to show only active vendors would be a nice feature.
*** Bug 5111 has been marked as a duplicate of this bug. ***
upping from enhancement, since it seems like an oversight to me, something that needs to be there (we can delete everything else ... why not vendors?).
--- Comment #1 from Owen Leonard <oleonard@myacpl.org> --- This came up in an IRC discussion at one point, and it was pointed out that you shouldn't be able to delete a vendor from which orders have been placed because that would mess up information in other places. If a vendor delete option is added it should have a method of checking to see if the vendor ID is in use anywhere else. ---- i agree with owen's comment on bug 5111 but that's the same deal with bibs and items - you can't delete them if they're used - but you can delete them
These code in supplier.pl to do the deletion. What's needed is a button to call it and some code to check we are not deleting a supplier with orders. It strikes me you might want to flag a bookseller as inactive, i.e. retained for historic info but flagged as not to use for new orders
Created attachment 7398 [details] [review] proposed patch A "Delete" button now appears on the bookseller display page, but only if this vendor doesn't have any basket.
This looks like it's working well, but I think we need to add, at the very least, a JavaScript prompt asking the user to confirm the deletion. Even better would be to have that JS prompt backed up by a server-side prompt, but I realize we don't always stick to that standard.
Created attachment 7532 [details] [review] proposed patch #2 Good remark, we are deleting vendors without history here (no valuable data can be lost) so I wasn't struck by the lack of confirmation but it's always important indeed. I added a JS control. The deletion link passes through this control so it's impossible to delete without the confirmation. If you think of something else and have an idea for a server-side check, let me know and I'll see what I can do.
This no longer applies.
Hi Adrien, the patch applies fine for me, but I see a problem. My test cases were: 1) vendor without orders > Ok, can be deleted 2) vendor with orders > Ok, can NOT be deleted 3) vendor with subscription > Not ok, can be deleted, but this should not be possible. Serials and acquisitions share vendors, so we should check for orders and subscriptions here.
Created attachment 7830 [details] [review] proposed patch #3 Added a check for any subscription link.
Hi Adrien, sorry, your patch does not apply any longer - I think it's because of bug 7113. Could you fix your patch to use booksellerid and resubmit please?
Created attachment 7982 [details] [review] proposed patch #4 Modified after changes induced by bug 7113.
Created attachment 8071 [details] [review] Bug 4969: allows deletion of booksellers With JS check before delete.
Created attachment 8072 [details] [review] [SIGNED-OFF] Bug 4969: deletion of suppliers If a vendor/bookseller has no basket/subscription link, it can now be deleted (after a JS confirmation). Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Verified that I can only delete vendors without linked orders or subscriptions.
Only a small note: I was a bit irritated that deleting the vendor redirected to the acq home page, because I had expected it to redirect to my vendor list. This is probably debatable - the list does not make much sense when you had only one result for yoru search. In my case I was going through the list deleting vendors so did a wider search.
New template param safely added, as well as a conditional check for basketcount before deletion. Template <li> element has id. Marking as Passed QA.
this patch can also be considered as an ENH, but it's worth having it in 3.6 I also checked the JS message was translatable
The patches for this bug do not apply to 3.6. If you want this included in 3.6.x, please rebase on 3.6.x and reset the version to rel_3_6.
This bug seems to cover the "vendors cannot be deleted" aspect of the bug but not the "show only active vendors" part. Does it need a follow-up in order to be considered fixed?
I still think it would be a nice enhancement. And a way to shorten your search result list for special libraries. I think we can leave the bug open, but obsolete the patch that will not go into 3.6.x now probably.
We still need a "hide inactive vendors" function. If vendors cannot be deleted because they have associated basket/order/invoices, then they need to be able to be hidden when they are no longer in use. Another option would be to allow deletion of vendors but only with a superlibrarian account and 4x levels of confirmation (i.e. confirm you want to delete all invoices for X vendor (show them). Now confirm you want to delete all orders for this vendor (show them). Now confirm you want to delete all baskets for this vendor (show them). (accept all three) Delete this vendor?) Would probably also need a warning that doing this will upset acquisitions history. All of that seems like a lot of work to simply achieve "my list of vendors is too long and I only use 4 of these 150 vendors I have in my system" so probably better to just do something useful with the inactive flag.
Created attachment 60803 [details] [review] Bug 4969: Toggle showing of all/active vendors This patch provides the functionality to hide inactive vendors from the vendor search. To test: 1) Make sure at least one vendor is inactive 2) Do a vendor search 3) Confirm the link to show only active vendors works, and is replaced with a link to show all vendors when clicked 4) Confirm the link to show all vendors works, and is replaced with a link to show only active vendors when clicked Sponsored-by: Catalyst IT
Created attachment 60807 [details] [review] Bug 4969: Toggle showing of all/active vendors This patch provides the functionality to hide inactive vendors from the vendor search. To test: 1) Make sure at least one vendor is inactive 2) Do a vendor search 3) Confirm the link to show only active vendors works, and is replaced with a link to show all vendors when clicked 4) Confirm the link to show all vendors works, and is replaced with a link to show only active vendors when clicked Sponsored-by: Catalyst IT Followed test plan, works as expected Signed-off-by: Marc Véron <veron@veron.ch>
Created attachment 60893 [details] [review] Bug 4969: Toggle showing of all/active vendors This patch provides the functionality to hide inactive vendors from the vendor search. To test: 1) Make sure at least one vendor is inactive 2) Do a vendor search 3) Confirm the link to show only active vendors works, and is replaced with a link to show all vendors when clicked 4) Confirm the link to show all vendors works, and is replaced with a link to show only active vendors when clicked Sponsored-by: Catalyst IT Followed test plan, works as expected Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 60894 [details] [review] Bug 4969: Cursor should be pointer for links Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 60895 [details] [review] Bug 4969: Do not jump to the top on click Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 60896 [details] [review] Bug 4969: Do not display the new link if we are seeing all baskets of a given vendor Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Pushed to master for 17.05, thanks Aleisha, Jonathan!
Like! This won't get ported back to 16.11.x as it is an enhancement.