Bug 7593: Move orders on the destination record when merging 2 records
authorMathieu Saby <mathieu.saby@univ-rennes2.fr>
Wed, 13 Mar 2013 15:12:03 +0000 (16:12 +0100)
committerJared Camins-Esakov <jcamins@cpbibliography.com>
Sun, 12 May 2013 14:29:57 +0000 (10:29 -0400)
commitb1a52b29181137791784fe20313efe8bce98b1fa
treed17b1661989d0b743777ba5137e225e890aaf3b1
parent34d5b7de89dc394c0c71652678f5d7b7fa793e35
Bug 7593: Move orders on the destination record when merging 2 records

Revised patch according to QA comments. No more dependent from bz 9780.

At present, merging records breaks the link order/record, except
if an item of the deleted record is used in the order.
This is a serious issue for libraries creating items on receipt.
This patch moves existing orders from deleted record to destination record.
It creates a new function Acquisitions::GetOrdersByBiblionumber,
that could be used by other patches later.

To test :
Check the problem :
1. Set syspref AcqCreateItem = Create an item when receiving an order
1. Create a basket with one order
2. Put the record used by this order in a list
3. Put an other record in the list
4. Merge the 2 records, keeping as a reference the record NOT used in the order
5. In the order, you will see for that order "Deleted bibliographic information..."
6. Apply the patch
7. Repeat steps 1-4
8. In the order, you will see the title/author of the kept record.
9. Set syspref AcqCreateItem = Create an item when placing an order
10. Repeat steps 1-4 (an item will be created)
11. In the oreder, you will see the title/author of the kept record
    (it is already the case at present. the patch should not alter this behavior)

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Test plan, test suite and QA script pass.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
C4/Acquisition.pm
cataloguing/merge.pl
t/db_dependent/Acquisition.t