Bug 11549 - After transferring an order, receive and cancel the receipt will delete the order
Summary: After transferring an order, receive and cancel the receipt will delete the o...
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: Main
Hardware: All All
: P5 - low major
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 11552
  Show dependency treegraph
 
Reported: 2014-01-14 11:03 UTC by Jonathan Druart
Modified: 2014-12-07 20:05 UTC (History)
5 users (show)

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


Attachments
Bug 11549: Add regression test (1.92 KB, patch)
2014-01-14 11:19 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 11549: FIX receive and cancel the receipt after a transfer. (1.34 KB, patch)
2014-01-14 11:19 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 11549: Interpolate variables into SQL statements should not be allowed (970 bytes, patch)
2014-01-14 11:19 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 11549: Add regression test (1.98 KB, patch)
2014-01-15 14:57 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 11549: FIX receive and cancel the receipt after a transfer. (1.41 KB, patch)
2014-01-15 14:57 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 11549: Interpolate variables into SQL statements should not be allowed (1.00 KB, patch)
2014-01-15 14:57 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 11549: [follow-up] Make NewOrder calculate new parent_ordernumber (1.10 KB, patch)
2014-01-17 10:26 UTC, Julian Maurice
Details | Diff | Splinter Review
Bug 11549: [follow-up] Make NewOrder calculate new parent_ordernumber (1.18 KB, patch)
2014-01-17 14:20 UTC, Jonathan Druart
Details | Diff | Splinter Review
[PASSED QA] Bug 11549: Add regression test (2.07 KB, patch)
2014-01-18 20:09 UTC, Katrin Fischer
Details | Diff | Splinter Review
[PASSED QA] Bug 11549: FIX receive and cancel the receipt after a transfer. (1.45 KB, patch)
2014-01-18 20:09 UTC, Katrin Fischer
Details | Diff | Splinter Review
[PASSED QA] Bug 11549: Interpolate variables into SQL statements should not be allowed (1.06 KB, patch)
2014-01-18 20:09 UTC, Katrin Fischer
Details | Diff | Splinter Review
[PASSED QA] Bug 11549: [follow-up] Make NewOrder calculate new parent_ordernumber (1.37 KB, patch)
2014-01-18 20:09 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2014-01-14 11:03:53 UTC
Bug 5349 introduces the ability to transfer an order from a basket to another.
After a transfer, if an order is received and the receipt is canceled, the order will be deleted.
Comment 1 Jonathan Druart 2014-01-14 11:19:28 UTC Comment hidden (obsolete)
Comment 2 Jonathan Druart 2014-01-14 11:19:33 UTC Comment hidden (obsolete)
Comment 3 Jonathan Druart 2014-01-14 11:19:37 UTC Comment hidden (obsolete)
Comment 4 Koha Team University Lyon 3 2014-01-15 14:55:26 UTC
I did several tests of transfers (from a basket, from the receipt page, after a double transfer). Every time, I received the document and cancelled the reception: the document returns as awaiting to be received. The discount of document to be received is OK. Everything is OK for me.
Comment 5 Biblibre Sandboxes 2014-01-15 14:57:04 UTC
Patch tested with a sandbox, by Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Comment 6 Biblibre Sandboxes 2014-01-15 14:57:38 UTC Comment hidden (obsolete)
Comment 7 Biblibre Sandboxes 2014-01-15 14:57:41 UTC Comment hidden (obsolete)
Comment 8 Biblibre Sandboxes 2014-01-15 14:57:45 UTC Comment hidden (obsolete)
Comment 9 Julian Maurice 2014-01-17 10:26:05 UTC Comment hidden (obsolete)
Comment 10 Jonathan Druart 2014-01-17 14:20:09 UTC Comment hidden (obsolete)
Comment 11 Katrin Fischer 2014-01-18 20:09:13 UTC
Created attachment 24546 [details] [review]
[PASSED QA] Bug 11549: Add regression test

test plan:
prove t/db_dependent/Acquisition/TransferOrder.t should fail before the
patch and success after applying it.

Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Testing notes on last patch.
Comment 12 Katrin Fischer 2014-01-18 20:09:25 UTC
Created attachment 24547 [details] [review]
[PASSED QA] Bug 11549: FIX receive and cancel the receipt after a transfer.

To reproduce the issue:
- transfer an order from a basket to another. Note the previous
ordernumber (X) and the new one (Y).
- receive the order
- cancel the receipt
- verify the order has been deleted:
select count(*) from aqorders where ordernumber=Y;
select * from aqorders_transfers where ordernumber_from = X;
The value for ordernumber_to is null.

To test this patch:
- apply this patch
- transfer an order from a basket to another
- receive the order
- cancel the receipt
- verify the order still exist in the basket where the transfer has been
  done.

Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Comment 13 Katrin Fischer 2014-01-18 20:09:36 UTC
Created attachment 24548 [details] [review]
[PASSED QA] Bug 11549: Interpolate variables into SQL statements should not be allowed

Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Comment 14 Katrin Fischer 2014-01-18 20:09:46 UTC
Created attachment 24549 [details] [review]
[PASSED QA] Bug 11549: [follow-up] Make NewOrder calculate new parent_ordernumber

If parent_ordernumber is not set in NewOrder parameter, it is
automatically set to ordernumber.
This patch only avoid code duplication.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
This solution is better!

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script. Also all tests in
t/db_dependent/Acquisitions/.

Confirmed bug and that the patch fixes it.
Comment 15 Galen Charlton 2014-01-23 16:59:27 UTC
Pushed to master.  Thanks, Jonathan!
Comment 16 Fridolin Somers 2014-04-23 16:54:41 UTC
Patches pushed to 3.14.x, will be in 3.14.06