Bug 23927

Summary: Duplicate a "Complete" order link the "New" one to the invoice
Product: Koha Reporter: Séverine Queune <severine.queune>
Component: AcquisitionsAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Martin Renvoize <martin.renvoize>
Severity: major    
Priority: P5 - low CC: jonathan.druart, katrin.fischer, martin.renvoize
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
19.11.00
Bug Depends on: 15184    
Bug Blocks:    
Attachments: Bug 23927: Add tests
Bug 23927: Do not copy invoiceid for a new duplicated order
Bug 23927: Add tests
Bug 23927: Do not copy invoiceid for a new duplicated order
Bug 23927: Add tests
Bug 23927: Do not copy invoiceid for a new duplicated order

Description Séverine Queune 2019-10-30 15:38:48 UTC
To reproduce :
- receive an order, remember the amount of your invoice
- in a new basket, add an order "From exisitions orders (copy)"
- search your received order
- duplicate
- go to the bibliographic record "Acquisition details" tab : you can see the "New" order as the same invoice number as the original order
- go to the invoice : you can see the 2 orders are mentioned and added to the total amount

Sorry Jonathan I didn't catch that point when testing the new feature...
Comment 1 Jonathan Druart 2019-11-04 14:19:24 UTC
Hi Séverine, can you detail what is the behavior you expect?
Comment 2 Séverine Queune 2019-11-20 09:57:02 UTC
To me, as it's supposed to be a new order, status should be "NEW".
The fact we use an other order is just a way to ease the acquisition process (e.g dictionaries, references items or subscriptions we want to buy each year), so it should not have effect on the new order.
Comment 3 Katrin Fischer 2019-11-25 06:57:52 UTC
(In reply to Séverine Queune from comment #2)
> To me, as it's supposed to be a new order, status should be "NEW".
> The fact we use an other order is just a way to ease the acquisition process
> (e.g dictionaries, references items or subscriptions we want to buy each
> year), so it should not have effect on the new order.

+1

The status should be new and the datereceived and invoiceid etc. should be empty.
Comment 4 Jonathan Druart 2019-11-25 10:56:52 UTC
Created attachment 95777 [details] [review]
Bug 23927: Add tests
Comment 5 Jonathan Druart 2019-11-25 10:56:55 UTC
Created attachment 95778 [details] [review]
Bug 23927: Do not copy invoiceid for a new duplicated order

When an order is created from an existing one (duplication), then the
invoice should be set to null instead of retrieved.

Test plan:
- receive an order
- in a new basket, add an order "From exisitions orders (copy)"
- search your received order
- duplicate
- go to the bibliographic record "Acquisition details" tab
=> Without this patch you will see that the invoice is the same for the
two orders
=> With this patch the invoice for the new order is not set
Comment 6 Séverine Queune 2019-11-26 10:20:51 UTC
Created attachment 95815 [details] [review]
Bug 23927: Add tests

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 7 Séverine Queune 2019-11-26 10:20:54 UTC
Created attachment 95816 [details] [review]
Bug 23927: Do not copy invoiceid for a new duplicated order

When an order is created from an existing one (duplication), then the
invoice should be set to null instead of retrieved.

Test plan:
- receive an order
- in a new basket, add an order "From exisitions orders (copy)"
- search your received order
- duplicate
- go to the bibliographic record "Acquisition details" tab
=> Without this patch you will see that the invoice is the same for the
two orders
=> With this patch the invoice for the new order is not set

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 8 Martin Renvoize 2019-11-27 09:15:28 UTC
Created attachment 95844 [details] [review]
Bug 23927: Add tests

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 9 Martin Renvoize 2019-11-27 09:15:31 UTC
Created attachment 95845 [details] [review]
Bug 23927: Do not copy invoiceid for a new duplicated order

When an order is created from an existing one (duplication), then the
invoice should be set to null instead of retrieved.

Test plan:
- receive an order
- in a new basket, add an order "From exisitions orders (copy)"
- search your received order
- duplicate
- go to the bibliographic record "Acquisition details" tab
=> Without this patch you will see that the invoice is the same for the
two orders
=> With this patch the invoice for the new order is not set

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 10 Martin Renvoize 2019-11-27 09:17:51 UTC
Works as expected, contains tests (which all pass) and passes QA scripts.

Passing QA
Comment 11 Martin Renvoize 2019-11-27 09:18:42 UTC
Nice work!

Pushed to master for 19.11.00