Bug 7583 - undo receive
Summary: undo receive
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: 3.10
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Julian Maurice
QA Contact: Jonathan Druart
URL:
Keywords:
Depends on:
Blocks: 5336
  Show dependency treegraph
 
Reported: 2012-02-22 19:03 UTC by Nicole C. Engard
Modified: 2013-12-05 20:01 UTC (History)
7 users (show)

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


Attachments
Bug 7583: Cancel a receipt (16.08 KB, patch)
2012-08-08 09:14 UTC, Julian Maurice
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 7583: Cancel a receipt (16.92 KB, patch)
2012-08-10 18:18 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 7583 follow-up: Prevent users to cancel receipt if they can't (4.46 KB, patch)
2012-08-13 14:41 UTC, Julian Maurice
Details | Diff | Splinter Review
Bug 7583 follow-up: Prevent users to cancel receipt if they can't (4.51 KB, patch)
2012-08-14 01:04 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 7583: Cancel a receipt (16.91 KB, patch)
2012-09-07 12:27 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 7583 follow-up: Prevent users to cancel receipt if they can't (4.51 KB, patch)
2012-09-07 12:27 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 7583: Cancel a receipt (16.92 KB, patch)
2012-09-12 14:54 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 7583 follow-up: Prevent users to cancel receipt if they can't (4.51 KB, patch)
2012-09-12 14:54 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nicole C. Engard 2012-02-22 19:03:56 UTC
It would be nice to be able to unreceive an item in acquisitions - or undo a receipt if you happen to have clicked the wrong title or a title by accident
Comment 1 Julian Maurice 2012-08-07 15:04:22 UTC
There is a BibLibre development which do what you want, but it depends on Bug 5336 which depends on Bug 7294 which is waiting for signoff.

BibLibre repository: http://git.biblibre.com/koha_biblibre.git
Branch: itt/ft/MT8378 (commit ed0e9e7ebcdf61c6ab17f4f68f219577754d5a6b)
Comment 2 Julian Maurice 2012-08-08 09:14:35 UTC Comment hidden (obsolete)
Comment 3 Julian Maurice 2012-08-08 09:15:10 UTC
Patch was modified so that it's not dependant anymore on other bugs.
Comment 4 Marc Véron 2012-08-10 18:18:21 UTC Comment hidden (obsolete)
Comment 5 Julian Maurice 2012-08-13 14:41:48 UTC Comment hidden (obsolete)
Comment 6 Julian Maurice 2012-08-13 14:47:18 UTC
(In reply to comment 4)
> I think such things could be fixed in the future during the ongoing work for
> Acquisitions module. Signing off.

I think this could be also fixed now ;-)
This patch prevent the user to be confronted to an error message when parent
order line is already received.
Comment 7 Chris Cormack 2012-08-14 01:03:57 UTC
Nice work Julian, it works well
Comment 8 Chris Cormack 2012-08-14 01:04:23 UTC Comment hidden (obsolete)
Comment 9 Jonathan Druart 2012-09-05 11:51:11 UTC
QA Comments:

All works great and the code is clean. Nothing to say.

Marked as Passed QA.
Comment 10 Jonathan Druart 2012-09-07 12:27:04 UTC Comment hidden (obsolete)
Comment 11 Jonathan Druart 2012-09-07 12:27:11 UTC Comment hidden (obsolete)
Comment 12 Jonathan Druart 2012-09-07 12:27:34 UTC
Rebased patches
Comment 13 Paul Poulain 2012-09-12 14:50:17 UTC
(In reply to comment #12)
> Rebased patches

Epic fail:

syntax error at acqui/parcel.pl line 84, near ");"
Global symbol "$datereceived" requires explicit package name at acqui/parcel.pl line 85.
Global symbol "$datereceived" requires explicit package name at acqui/parcel.pl line 85.
Comment 14 Jonathan Druart 2012-09-12 14:54:50 UTC
Created attachment 12169 [details] [review]
Bug 7583: Cancel a receipt

In acqui/parcel.pl, there is now the possibility to cancel a receipt.
In "Already received" table, just click on "Cancel receipt" and the
order line will go back to pending orders.
If it was a partial receipt, order line is merged to its 'parent' line.
Attached items are modified so that they become attached to the merged
order line.
If AcqCreateItem is 'receiving', attached items are deleted.
If an order line was first partially received, and then completed. You
must cancel the 'parent' order line before cancelling the 'child'.

Signed-off-by: Marc Veron <veron@veron.ch>

The patch behaves like expected, and the feature is really helpfull.

Just a tiny remark about the following message:

-------------
Cannot cancel receipt. Possible reasons :
You are trying to cancel the receipt of an order line whose parent order line is already received. Cancel this parent order line and retry.
-------------

Maybe it would be good
- to explain a little bit more why it happend and re-word the message for non technical people (not everybody understands 'parent' the same way)

- prevent the situation to happen (e.g. forbid order lines to be deleted if they are already received) - but that would be in the scope of an other bug, I think.

I think such things could be fixed in the future during the ongoing work for Acquisitions module. Signing off.
Comment 15 Jonathan Druart 2012-09-12 14:54:59 UTC
Created attachment 12170 [details] [review]
Bug 7583 follow-up: Prevent users to cancel receipt if they can't

Disable the link for cancelling instead of displaying an error message
after the click. This is only valid if parent order line is received,
not if it's deleted.
When the user gets his mouse over the disabled link, he gets a message
telling him which order (ordernumber) blocks him so he knows immediately
which receipt to cancel.
Also improve error messages for non technical people

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Comment 16 Jonathan Druart 2012-09-12 14:56:25 UTC
(In reply to comment #13)
> Epic fail:
> 
> syntax error at acqui/parcel.pl line 84, near ");"
> Global symbol "$datereceived" requires explicit package name at
> acqui/parcel.pl line 85.
> Global symbol "$datereceived" requires explicit package name at
> acqui/parcel.pl line 85.

Outch sorry !
A parenthesis was missing after the conflict, I solved it like:

-my $datereceived = ($op eq ('new' or 'search' )
+my $datereceived = ( $op eq ('new' or 'search' ) )
Comment 17 Paul Poulain 2012-09-13 16:33:59 UTC
Patch pushed to master

I've pushed the patch, but ask for a small follow-up = asking for a confirmation when you click on "cancel receipt".
One would say that you can recieve again if you want. That's true. But you could inadvertently delete an existing item if AcqCreateItem is 'receiving' !

So a confirmation would be more safe.
Comment 18 Julian Maurice 2012-09-14 13:51:04 UTC
Ok in master. Marked as RESOLVED