Bug 13870 - Add warnings about subscriptions and orders when deleting items
Summary: Add warnings about subscriptions and orders when deleting items
Status: Failed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Thibaud Guillot
QA Contact: Testopia
URL:
Keywords:
: 14271 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-03-18 22:38 UTC by Katrin Fischer
Modified: 2023-11-17 21:40 UTC (History)
3 users (show)

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


Attachments
Bug 13870: Added a visual warning message on the item batch form (5.45 KB, patch)
2023-03-02 15:17 UTC, Thibaud Guillot
Details | Diff | Splinter Review
Bug 13870: Added a visual warning message on the item batch form (5.53 KB, patch)
2023-06-09 10:34 UTC, Thibaud Guillot
Details | Diff | Splinter Review
Bug 13870: Add columns in batch delete mode (5.63 KB, patch)
2023-06-09 10:35 UTC, Thibaud Guillot
Details | Diff | Splinter Review
Bug 13870: Add columns in batch delete mode (5.79 KB, patch)
2023-09-12 20:35 UTC, Emily-Rose Francoeur
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2015-03-18 22:38:57 UTC
The batch record deletion tool checks for items, holds and checkouts. It would be a nice enhancement to also show linked subscriptions and orders. This would then match the checks done in acquisitions in order to be able to delete the record when cancelling an order line.
Comment 1 Katrin Fischer 2015-05-25 12:51:58 UTC
*** Bug 14271 has been marked as a duplicate of this bug. ***
Comment 2 Thibaud Guillot 2023-03-02 15:17:00 UTC Comment hidden (obsolete)
Comment 3 Thibaud Guillot 2023-06-09 10:34:57 UTC
Created attachment 152235 [details] [review]
Bug 13870: Added a visual warning message on the item batch form

I add a visual warn on item linked to subscription or concern
by an order. I don't think that pop-up could be the solution so I put a
warn triangle aside the delete action to
I don't think another pop-up is the ideal solution so I chose to integrate a yellow triangle
right next to the action leading to the deletion of the 'item' with a hover message
if a subscription or order is linked. I'm looking forward to your feedback :)

Test plan :

1) Apply this patch
2) Be sure to have item with order or can concern by a subscription
3) Edit them to go on the batch form
4) See the yellow triangle next to the 'delete' action in 'actions'
dropdown menu
Comment 4 Thibaud Guillot 2023-06-09 10:35:00 UTC
Created attachment 152236 [details] [review]
Bug 13870: Add columns in batch delete mode
Comment 5 Emily-Rose Francoeur 2023-09-12 20:35:23 UTC
Created attachment 155576 [details] [review]
Bug 13870: Add columns in batch delete mode

Signed-off-by: Émily-Rose Francoeur <emily-rose.francoeur@inLibro.com>
Comment 6 Katrin Fischer 2023-10-07 18:58:24 UTC
Hi Thibaud,

I was excited to see this, but it turned out a little bit different to what I had expected:

1) The bug was filed for the 'batch record deletion tool'. Your patch deals with deleting single items. This can be fixed rather easily by changing the bug description and re-filing (see bug 35005)

2) For orders, I think we need to make some difference between an order that has been completed and one that is still pending. Deleting an item that is linked to a pending order would get us in trouble. Throwing out an old item purchased long ago not.

Concerning order status would be: new, ordered, partial
OK to delete: cancelled, complete

4) This line appears unrelated to the intention of the patch:

+    $i->{nomod} = 1 unless $patron->can_edit_items_from($item->homebranch);


5) The warnings messages you created are untranslatable, they need to be moved into the templates:

cataloguing/additem.pl
+    if ($i_order) {
+        $warning_messages{$i->{itemnumber}} = sprintf('There is an order (ordernumber %s) on this item', $i_order->{ordernumber} );
+    }
+    if ($i_serialid) {
+        $warning_messages{$i->{itemnumber}} = 'A subscription is linked to this item'

6) The subscription count on item batch modification doesn't seem to work right. I added a subscription and created an item on receiving an issue, so it's linked to the subscription. But it still said "None" on the batch mod page.

7) The order count on item batch modification doesn't appear to work either. I added an order with 'create items on order' and that item to the batch edit - The column remained at "None".

8) The notes work OK on the normal item editing form. I like the approach with the little warning sign.

9) QA tools are failing for a missing filter and tidiness.
Comment 7 Fridolin Somers 2023-11-17 21:40:19 UTC
Hi,

    my $i_order = GetOrderFromItemnumber($itemnumber);
    my $i_serialid = Koha::Serial::Items->search( {itemnumber => $itemnumber} )->get_column('serialid');

Is there a performance impact ?

Better prefetch linked tables maybe.