Bug 33664 - Add ability to cancel order lines in closed baskets
Summary: Add ability to cancel order lines in closed baskets
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Katrin Fischer
QA Contact: Nick Clemens (kidclamp)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-03 14:35 UTC by Katrin Fischer
Modified: 2024-02-23 08:34 UTC (History)
11 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact: Caroline Cyr La Rose
Documentation submission: https://gitlab.com/koha-community/koha-manual/-/merge_requests/813
Text to go in the release notes:
With the new system preference `CancelOrdersInClosedBaskets` it's now possible to allow for cancelling order lines from closed baskets. This is useful if something cannot be delivered and you don't want to reopen the basket or use go through the receive shipment process. **Sponsored by** *The Research University in the Helmholtz Association (KIT)*
Version(s) released in:
23.11.00


Attachments
Bug 33664: Add ability to cancel order lines in closed baskets (18.07 KB, patch)
2023-07-28 16:16 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 33664: Add ability to cancel order lines in closed baskets (18.12 KB, patch)
2023-07-28 19:43 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 33664: Add ability to cancel order lines in closed baskets (18.01 KB, patch)
2023-10-27 11:35 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 33664: Add ability to cancel order lines in closed baskets (18.00 KB, patch)
2023-10-30 15:35 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 33664: (follow-up) Move check for 'received' to include Modify link (1.74 KB, patch)
2023-10-30 15:35 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 33664: Add ability to cancel order lines in closed baskets (18.07 KB, patch)
2023-10-30 15:45 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 33664: (follow-up) Move check for 'received' to include Modify link (1.80 KB, patch)
2023-10-30 15:45 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2023-05-03 14:35:18 UTC
This is a workflow question: 

At the moment cancelling an order line from the basket summary page is only possible, while the basket is open. For standing orders this means it's always possible, while it's not for other types of orders.

There is now 2 ways to cancel the order:

Option A:
* Reopen the basket
* Cancel the order
* Close the basket

+ Less clicks than option B
- All unreceived order lines will switch status unnecessarily (ordered - new - ordered)
- The basket close date will reset to today's date

Option B:
* Create a new shipment
* 'Fake' an invoice, for example it could be named: Cancellations
* Use the cancelling options from the list of pending orders

+ Close date remains the same
+ Only the cancelled order line will change status
- More clicks and not really convenient

Now the question: Is there a strict reason why we should not permit cancelling from a closed order? The closed order lines will still show in the second table below. We could also add a hint on the cancellation date.
Comment 1 Caroline Cyr La Rose 2023-05-03 15:56:55 UTC
From my library days, I would say it was very common for me to cancel orders I had already sent to the vendor. Mostly when the vendor would later tell me it was not available anymore or they would never get it.

In Koha, I'm not a fan of having to reopen the basket since like you said, it changes the order date. I had never tried option B. It seems like a fiddly workaround for something that should be possible.

From a workflow standpoint, I don't think there is a reason to limit cancelling orders to open baskets only.

From a technical standpoint, we should probably look at what closing the basket does, to know if something would clash with cancelling the order.
Comment 2 Katrin Fischer 2023-05-03 16:03:42 UTC
AFAIK it changes the status if it was new to ordered. If it was received it remains the same. 

Otherwise it should not change a thing and you can already cancel new from the basket and ordered from the receive page... so I think we should be ok.
Comment 3 Michaela Sieber 2023-06-12 14:58:56 UTC
(In reply to Caroline Cyr La Rose from comment #1)
> From my library days, I would say it was very common for me to cancel orders
> I had already sent to the vendor. Mostly when the vendor would later tell me
> it was not available anymore or they would never get it.
> 
> In Koha, I'm not a fan of having to reopen the basket since like you said,
> it changes the order date. I had never tried option B. It seems like a
> fiddly workaround for something that should be possible.
> 

I agree. And yes, it is common to cancel order lines because titles are not available
Comment 4 Mathieu Saby 2023-07-07 09:52:19 UTC
We often cancel orders, from reception module.
It would be more convenient to be able to cancel orders from basket
Comment 5 Katrin Fischer 2023-07-28 16:16:33 UTC
Created attachment 154045 [details] [review]
Bug 33664: Add ability to cancel order lines in closed baskets

At the moment it's only possible to cancel order lines while the
basket is still open or from the pending orders page during processing
a shipment. The latter requires you to add a shipment and fake an
invoice. To make things easier we want to optionally allow cancelling
order lines in closed baskets from the basket summary page.

Before applying the patch:

1) Set up data
* Create a new basket
* Create a few order lines, at least 3
* Close the basket
* Receive shipment and receive one order line

2) Verify current behaviour
* On basket summary page: you cannot cancel while the basket is closed
* On the pending orders page you can cancel

Apply patch, run database update, restart_all

3) Verify new behaviour
* Verify that nothing has changed on pending orders and basket summary
* Switch new system preference CancelOrdersInClosedBaskets to "Allow"
* Verify that pending orders hasn't changed a bit
* Verify that you now can cancel your order lines in the closed basket
  Exception: the received order line should not be cancellable

Test anything else that you think might make sense ;)
Comment 6 Biblibre Sandboxes 2023-07-28 19:43:46 UTC
Created attachment 154053 [details] [review]
Bug 33664: Add ability to cancel order lines in closed baskets

At the moment it's only possible to cancel order lines while the
basket is still open or from the pending orders page during processing
a shipment. The latter requires you to add a shipment and fake an
invoice. To make things easier we want to optionally allow cancelling
order lines in closed baskets from the basket summary page.

Before applying the patch:

1) Set up data
* Create a new basket
* Create a few order lines, at least 3
* Close the basket
* Receive shipment and receive one order line

2) Verify current behaviour
* On basket summary page: you cannot cancel while the basket is closed
* On the pending orders page you can cancel

Apply patch, run database update, restart_all

3) Verify new behaviour
* Verify that nothing has changed on pending orders and basket summary
* Switch new system preference CancelOrdersInClosedBaskets to "Allow"
* Verify that pending orders hasn't changed a bit
* Verify that you now can cancel your order lines in the closed basket
  Exception: the received order line should not be cancellable

Test anything else that you think might make sense ;)

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Comment 7 Katrin Fischer 2023-10-27 11:35:11 UTC
Created attachment 157979 [details] [review]
Bug 33664: Add ability to cancel order lines in closed baskets

At the moment it's only possible to cancel order lines while the
basket is still open or from the pending orders page during processing
a shipment. The latter requires you to add a shipment and fake an
invoice. To make things easier we want to optionally allow cancelling
order lines in closed baskets from the basket summary page.

Before applying the patch:

1) Set up data
* Create a new basket
* Create a few order lines, at least 3
* Close the basket
* Receive shipment and receive one order line

2) Verify current behaviour
* On basket summary page: you cannot cancel while the basket is closed
* On the pending orders page you can cancel

Apply patch, run database update, restart_all

3) Verify new behaviour
* Verify that nothing has changed on pending orders and basket summary
* Switch new system preference CancelOrdersInClosedBaskets to "Allow"
* Verify that pending orders hasn't changed a bit
* Verify that you now can cancel your order lines in the closed basket
  Exception: the received order line should not be cancellable

Test anything else that you think might make sense ;)
Comment 8 Katrin Fischer 2023-10-27 11:36:01 UTC
Too many changes on this template lately, but all nicely rebased now!
Comment 9 Katrin Fischer 2023-10-30 15:35:30 UTC
Created attachment 158075 [details] [review]
Bug 33664: Add ability to cancel order lines in closed baskets

At the moment it's only possible to cancel order lines while the
basket is still open or from the pending orders page during processing
a shipment. The latter requires you to add a shipment and fake an
invoice. To make things easier we want to optionally allow cancelling
order lines in closed baskets from the basket summary page.

Before applying the patch:

1) Set up data
* Create a new basket
* Create a few order lines, at least 3
* Close the basket
* Receive shipment and receive one order line

2) Verify current behaviour
* On basket summary page: you cannot cancel while the basket is closed
* On the pending orders page you can cancel

Apply patch, run database update, restart_all

3) Verify new behaviour
* Verify that nothing has changed on pending orders and basket summary
* Switch new system preference CancelOrdersInClosedBaskets to "Allow"
* Verify that pending orders hasn't changed a bit
* Verify that you now can cancel your order lines in the closed basket
  Exception: the received order line should not be cancellable

Test anything else that you think might make sense ;)
Comment 10 Katrin Fischer 2023-10-30 15:35:33 UTC
Created attachment 158076 [details] [review]
Bug 33664: (follow-up) Move check for 'received' to include Modify link
Comment 11 Nick Clemens (kidclamp) 2023-10-30 15:45:33 UTC
Created attachment 158077 [details] [review]
Bug 33664: Add ability to cancel order lines in closed baskets

At the moment it's only possible to cancel order lines while the
basket is still open or from the pending orders page during processing
a shipment. The latter requires you to add a shipment and fake an
invoice. To make things easier we want to optionally allow cancelling
order lines in closed baskets from the basket summary page.

Before applying the patch:

1) Set up data
* Create a new basket
* Create a few order lines, at least 3
* Close the basket
* Receive shipment and receive one order line

2) Verify current behaviour
* On basket summary page: you cannot cancel while the basket is closed
* On the pending orders page you can cancel

Apply patch, run database update, restart_all

3) Verify new behaviour
* Verify that nothing has changed on pending orders and basket summary
* Switch new system preference CancelOrdersInClosedBaskets to "Allow"
* Verify that pending orders hasn't changed a bit
* Verify that you now can cancel your order lines in the closed basket
  Exception: the received order line should not be cancellable

Test anything else that you think might make sense ;)

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 12 Nick Clemens (kidclamp) 2023-10-30 15:45:35 UTC
Created attachment 158078 [details] [review]
Bug 33664: (follow-up) Move check for 'received' to include Modify link

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 13 Tomás Cohen Arazi 2023-11-01 20:26:36 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 14 Fridolin Somers 2023-11-08 08:41:17 UTC
Enhancement not pushed to 23.05.x