Bug 13993 - Set correct orderstatus when order is transferred from one vendor to another
Summary: Set correct orderstatus when order is transferred from one vendor to another
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Amit Gupta
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-14 08:24 UTC by Amit Gupta
Modified: 2016-06-21 21:38 UTC (History)
7 users (show)

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


Attachments
Order transfer (33.33 KB, image/png)
2015-04-14 08:36 UTC, Amit Gupta
Details
Bug 13993 - Transfer order from one vendor to another vendor previous orderstatus is not changed (1.43 KB, patch)
2015-04-14 08:43 UTC, Amit Gupta
Details | Diff | Splinter Review
Bug 13993 - Add tests to confirm 'new' and 'cancelled' (1.79 KB, patch)
2015-04-16 12:58 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 13993 - Transfer order from one vendor to another vendor Previous orderstatus is not changed (1.42 KB, patch)
2015-04-16 12:59 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 13993 - Correct poorly transferred orders (1.21 KB, patch)
2015-04-16 13:17 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 13993 - (1) Add tests to confirm 'new' and 'cancelled' (1.82 KB, patch)
2015-04-16 16:50 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 13993 - (2) Correct poorly transferred orders (1.31 KB, patch)
2015-04-16 16:51 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 13993 - (3) Transfer order leaves incorrect orderstatus (1.26 KB, patch)
2015-04-16 16:51 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 13993 - (1) Add tests to confirm 'new' and 'cancelled' (1.82 KB, patch)
2015-04-29 15:04 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 13993 - (2) Correct poorly transferred orders (1.31 KB, patch)
2015-04-29 15:04 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 13993 - (3) Transfer order leaves incorrect orderstatus (1.26 KB, patch)
2015-04-29 15:04 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 13993 - (1) Add tests to confirm 'new' and 'cancelled' (1.82 KB, patch)
2015-04-29 18:56 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 13993 - (2) Correct poorly transferred orders (1.33 KB, patch)
2015-04-29 18:56 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 13993 - (3) Transfer order leaves incorrect orderstatus (1.26 KB, patch)
2015-04-29 18:56 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 13993 - (1) Add tests to confirm 'new' and 'cancelled' (1.90 KB, patch)
2015-05-10 15:26 UTC, Indranil Das Gupta
Details | Diff | Splinter Review
Bug 13993 - (2) Correct poorly transferred orders (1.40 KB, patch)
2015-05-10 15:26 UTC, Indranil Das Gupta
Details | Diff | Splinter Review
Bug 13993 - (3) Transfer order leaves incorrect orderstatus (1.39 KB, patch)
2015-05-10 15:27 UTC, Indranil Das Gupta
Details | Diff | Splinter Review
Bug 13993 - (1) Add tests to confirm 'new' and 'cancelled' (1.96 KB, patch)
2015-05-26 16:12 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 13993 - (2) Correct poorly transferred orders (1.47 KB, patch)
2015-05-26 16:13 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 13993 - (3) Transfer order leaves incorrect orderstatus (1.46 KB, patch)
2015-05-26 16:13 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 13993: Clarify test messages (1.33 KB, patch)
2015-05-26 16:13 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 Amit Gupta 2015-04-14 08:24:30 UTC

    
Comment 1 Amit Gupta 2015-04-14 08:36:18 UTC
Created attachment 37797 [details]
Order transfer

Suppose if we transfer order from one vendor to another vendor previous orderstatus is not changed still is showing new but if we see order in basket level it shown under cancelled order section.
Comment 2 Amit Gupta 2015-04-14 08:43:10 UTC Comment hidden (obsolete)
Comment 3 Mark Tompsett 2015-04-16 12:58:49 UTC Comment hidden (obsolete)
Comment 4 Mark Tompsett 2015-04-16 12:59:20 UTC Comment hidden (obsolete)
Comment 5 Mark Tompsett 2015-04-16 13:17:24 UTC Comment hidden (obsolete)
Comment 6 Mark Tompsett 2015-04-16 16:50:52 UTC Comment hidden (obsolete)
Comment 7 Mark Tompsett 2015-04-16 16:51:05 UTC Comment hidden (obsolete)
Comment 8 Mark Tompsett 2015-04-16 16:51:18 UTC Comment hidden (obsolete)
Comment 9 Jonathan Druart 2015-04-29 09:47:08 UTC
Comment on attachment 37978 [details] [review]
Bug 13993 - (2) Correct poorly transferred orders

Review of attachment 37978 [details] [review]:
-----------------------------------------------------------------

::: installer/data/mysql/atomicupdate/Bug-13993-Correct-OrderStatus-Of-Poorly-Transferred-Orders.sql
@@ +1,2 @@
> +UPDATE aqorders SET orderstatus='cancelled'
> +                WHERE (NOT datecancellationprinted IS NULL OR

The correct syntax is
  field is not null
Comment 10 Mark Tompsett 2015-04-29 15:04:30 UTC Comment hidden (obsolete)
Comment 11 Mark Tompsett 2015-04-29 15:04:36 UTC Comment hidden (obsolete)
Comment 12 Mark Tompsett 2015-04-29 15:04:40 UTC Comment hidden (obsolete)
Comment 13 Mark Tompsett 2015-04-29 15:41:51 UTC
Still debugging/testing...
Comment 14 Mark Tompsett 2015-04-29 18:56:23 UTC Comment hidden (obsolete)
Comment 15 Mark Tompsett 2015-04-29 18:56:31 UTC Comment hidden (obsolete)
Comment 16 Mark Tompsett 2015-04-29 18:56:45 UTC Comment hidden (obsolete)
Comment 17 Indranil Das Gupta 2015-05-10 15:26:21 UTC Comment hidden (obsolete)
Comment 18 Indranil Das Gupta 2015-05-10 15:26:32 UTC Comment hidden (obsolete)
Comment 19 Indranil Das Gupta 2015-05-10 15:27:00 UTC Comment hidden (obsolete)
Comment 20 Jonathan Druart 2015-05-26 16:12:54 UTC
Created attachment 39535 [details] [review]
Bug 13993 - (1) Add tests to confirm 'new' and 'cancelled'

This adds 2 tests to t/db_dependent/Acquisition/TransferOrder.t
in order to confirm the order's status is properly marked.

TEST PLAN
---------
1) Log into staff client
2) Acquisitions
3) Create a basket for two differing vendors.
4) Place an order in one of the baskets.
5) Transfer the order from one vendor's basket to the others.
6) Apply this patch (1) only
7) prove -v t/db_dependent/Acquisition/TransferOrder.t
   -- should fail one test: not marked as 'cancelled'.

Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Comment 21 Jonathan Druart 2015-05-26 16:13:00 UTC
Created attachment 39536 [details] [review]
Bug 13993 - (2) Correct poorly transferred orders

Added Atomic Update to fix poorly transferred orders

TEST PLAN
---------
8) Apply patch (2)
9) Run the database updates
   $ ./installer/data/mysql/updatedatabase.pl
   -- This should run without error
10) prove -v t/db_dependent/Acquisition/TransferOrder.t
    -- This should fail, because the transfer function is still
       not fixed.

Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Comment 22 Jonathan Druart 2015-05-26 16:13:05 UTC
Created attachment 39537 [details] [review]
Bug 13993 - (3) Transfer order leaves incorrect orderstatus

11) Apply patch (3)
12) Log in to staff client
13) Acquisitions
14) Create a basket for two different vendors
15) Place an order in one vendor's basket.
16) Transfer the order to the other vendor's basket.
17) prove -v t/db_dependent/Acquisition/TransferOrder.t
    -- This should succeed without intervention.
18) Run koha qa test tools for the last 3 commits.

Signed-off-by: Indranil Das Gupta <indradg@gmail.com>

Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Comment 23 Jonathan Druart 2015-05-26 16:13:10 UTC
Created attachment 39538 [details] [review]
Bug 13993: Clarify test messages

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Comment 24 Tomás Cohen Arazi 2015-06-19 14:51:57 UTC
Patches pushed to master.

Thanks Mark and Amit!
Comment 25 Katrin Fischer 2015-07-15 12:16:05 UTC
Problem also appears in 3.18 - Chris and Liz - can you consider this for backporting please?
Comment 26 Liz Rea 2015-07-15 21:27:51 UTC
Yep, will have a look.
Comment 27 Chris Cormack 2015-07-15 23:43:58 UTC
Pushed to 3.20.x will be in 3.20.2