[Koha-bugs] [Bug 10869] can't delete order line if title deleted

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Sat Sep 15 19:28:29 CEST 2018


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10869

--- Comment #85 from Chris Cormack <chris at bigballofwax.co.nz> ---
Created attachment 78864
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=78864&action=edit
Bug 10869 Followup: Unit tests for DelOrder

[The best would be to add a second sign-off to this patch, as I had to to a
little change, to take into account the recent rewrite of
t/db_dependent/Acquisition.t:
$ordernumber3 is now $ordernumbers[2]
Mathieu Saby]

DelOrder now returns undef if no ordernumber passed.
This patch also adds unit tests for DelOrder.

Test plan:
A. With syspref  AcqCreateItem  = on placing an order

1. Fill a basket with some orders (some records with already existing items or
holds, some without items). New items linked with the order will be created
2. Keep the basket open
3. In the catalog, supress all the items attached to one of the record used in
the basket, then suppress the record
4. In the basket, check you can delete the order that was using deleted record
(click on link "Delete order" in the right column of the table)
5. After deleting the order, check there is a new line in the "Deleted orders"
table
6. Regression test : try to delete other orders, and check the deletion of the
order implies the deletion of items created when ordering
a/ If no items were attached to the record before you created the basket, you
can delete some other orders, AND their record. Try to delete order and record.
b/ If some items were attached to the record before you created the basket, you
can delete some other orders, BUT NOT their record. Try to delete only order.
After you have deleted it, the items created when ordering must have been
deleted.

7. Add some other orders to your basket  (some records with already existing
items or holds, some without items). New items linked with the order will be
created
8. In the catalog, supress all the items attached to one of the record used in
the basket, then suppress the record
9. Close the basket
10. Go on receipt page
11. Search the orders of your basket
12. In receipt page, check you can delete the order that was using deleted
record (click on link "Delete order" in the right column of the table)
13. Regression test : try to delete other orders
a/ If no items were attached to the record before you created the basket, you
can delete some other orders, AND their record. Try to delete order and record.
b/ If some items were attached to the record before you created the basket, you
can delete some other orders, BUT NOT their record. Try to delete only order.
After you have deleted it, the items created when ordering must have been
deleted.

B. With syspref  AcqCreateItem  = on receiving an order

1. Fill a basket with some orders (some records with already existing items or
holds, some without items).
2. Keep the basket open
3. In the catalog, supress all the items attached to one of the record used in
the basket, then suppress the record
4. In the basket, check you can delete the order that was using deleted record
(click on link "Delete order" in the right column of the table)
5. After deleting the order, check there is a new line in the "Deleted orders"
table
6. Regression test : try to delete other orders
a/ If no items were attached to the record before you created the basket, you
can delete some other orders, AND their record. Try to delete order and record.
b/ If some items were attached to the record before you created the basket, you
can delete some other orders, BUT NOT their record. Try to delete only order.
7. Add some other orders to your basket  (some records with already existing
items or holds, some without items).
8. In the catalog, supress all the items attached to one of the record used in
the basket, then suppress the record
9. Close the basket
10. Go on receipt page
11. Search the orders of your basket
12. In receipt page, check you can delete the order that was using deleted
record (click on link "Delete order" in the right column of the table)
13. Regression test : try to delete other orders
a/ If no items were attached to the record before you created the basket, you
can delete some other orders, AND their record. Try to delete order and record.
b/ If some items were attached to the record before you created the basket, you
can delete some other orders, BUT NOT their record. Try to delete only order.

And to test the UT: prove t/db_dependent/Acquisition.t

Signed-off-by: Marcel de Rooy <m.de.rooy at rijksmuseum.nl>
Amended the patch as to removing biblio parameter in DelOrder.
There is no need to remove the parameter if you will search for
biblionumber later on.
Deleting records in aqorders_items is discussed on bug 11617.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list