[Bug 12555] New: Call DelItem on cancelling a receipt
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12555 Bug ID: 12555 Summary: Call DelItem on cancelling a receipt Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Acquisitions Assignee: koha-bugs@lists.koha-community.org Reporter: jonathan.druart@biblibre.com QA Contact: testopia@bugs.koha-community.org Bug 11744 needs some additional work. The routine _cancel_items_receipt should call C4::Items::DelItem. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12555 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |11744 Assignee|koha-bugs@lists.koha-commun |jonathan.druart@biblibre.co |ity.org |m -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12555 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |12583 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12555 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12555 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12555 --- Comment #1 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 29752 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=29752&action=edit Bug 12555: Call DelItem on cancelling a receipt On cancelling a receipt, the items should be deleted using the C4::Items::DelItem subroutine in order to update zebra and sent the items in the deleteditems table. The entries in aqorders_items will automatically deleted by the DBMS (on delete cascade). Test plan: 0/ Set the AcqCreateItem pref to "on receiving" 1/ Create an order with some items 2/ Receive the items 3/ Note the itemnumber in the items table 4/ Cancel the receipt 5/ Verify the itemnumbers are present in the deleteditems table and the items have been deleted. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12555 Jacek Ablewicz <abl@biblos.pk.edu.pl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |abl@biblos.pk.edu.pl -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12555 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Call DelItem on cancelling |The DelItem subroutine |a receipt |should be called on | |canceling a receipt -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12555 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12555 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #29752|0 |1 is obsolete| | --- Comment #2 from Chris Cormack <chris@bigballofwax.co.nz> --- Created attachment 30613 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=30613&action=edit Bug 12555: Call DelItem on cancelling a receipt On cancelling a receipt, the items should be deleted using the C4::Items::DelItem subroutine in order to update zebra and sent the items in the deleteditems table. The entries in aqorders_items will automatically deleted by the DBMS (on delete cascade). Test plan: 0/ Set the AcqCreateItem pref to "on receiving" 1/ Create an order with some items 2/ Receive the items 3/ Note the itemnumber in the items table 4/ Cancel the receipt 5/ Verify the itemnumbers are present in the deleteditems table and the items have been deleted. Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12555 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA CC| |katrin.fischer@bsz-bw.de --- Comment #3 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- It worked nicely in my tests, but makes one of the tests fail in my database: $ perl t/db_dependent/Acquisition/CancelReceipt.t 1..2 not ok 1 - Create items on receiving: 0 item exist after cancelling a receipt # Failed test 'Create items on receiving: 0 item exist after cancelling a receipt' # at t/db_dependent/Acquisition/CancelReceipt.t line 70. # got: '1' # expected: '0' DBD::mysql::st execute failed: Duplicate entry '4126' for key 'PRIMARY' at /home/katrin/kohaclone/C4/Acquisition.pm line 1317. DBD::mysql::st execute failed: Duplicate entry '4126' for key 'PRIMARY' at /home/katrin/kohaclone/C4/Acquisition.pm line 1317. # Looks like you planned 2 tests but ran 1. # Looks like you failed 1 test of 1 run. # Looks like your test exited with 255 just after 1. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12555 --- Comment #4 from Jonathan Druart <jonathan.druart@biblibre.com> --- (In reply to Jonathan Druart from comment #1)
The entries in aqorders_items will automatically deleted by the DBMS (on delete cascade).
Actually it's not true at the moment, aqorders_items.itemnumber does not have a foreign key on items.itemnumber. But it should, isn't it? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12555 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12555 --- Comment #5 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 31008 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=31008&action=edit Bug 12555: Add a FK on aqorders_items.itemnumber The previous patch assumed that deleting an item will delete the entry in aqorders_items. But the FK did not exist. Looking at the code, we never join aqorders_items and deleteditems, so I think we can add this constraint. Before adding this constraint, we need to delete all entries in aqorders_items if the item has already been deleted. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12555 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |5334 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12555 Liz Rea <wizzyrea@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Patch doesn't apply CC| |wizzyrea@gmail.com --- Comment #6 from Liz Rea <wizzyrea@gmail.com> --- Applying: Bug 12555: Add a FK on aqorders_items.itemnumber fatal: sha1 information is lacking or useless (installer/data/mysql/kohastructure.sql). Repository lacks necessary blobs to fall back on 3-way merge. Sorry Jonathan :/ Liz -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12555 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #30613|0 |1 is obsolete| | --- Comment #7 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 33290 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=33290&action=edit Bug 12555: Call DelItem on cancelling a receipt On cancelling a receipt, the items should be deleted using the C4::Items::DelItem subroutine in order to update zebra and sent the items in the deleteditems table. The entries in aqorders_items will automatically deleted by the DBMS (on delete cascade). Test plan: 0/ Set the AcqCreateItem pref to "on receiving" 1/ Create an order with some items 2/ Receive the items 3/ Note the itemnumber in the items table 4/ Cancel the receipt 5/ Verify the itemnumbers are present in the deleteditems table and the items have been deleted. Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12555 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #31008|0 |1 is obsolete| | --- Comment #8 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 33291 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=33291&action=edit Bug 12555: Add a FK on aqorders_items.itemnumber The previous patch assumed that deleting an item will delete the entry in aqorders_items. But the FK did not exist. Looking at the code, we never join aqorders_items and deleteditems, so I think we can add this constraint. Before adding this constraint, we need to delete all entries in aqorders_items if the item has already been deleted. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12555 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12555 Paola Rossi <paola.rossi@cineca.it> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA CC| |paola.rossi@cineca.it --- Comment #9 from Paola Rossi <paola.rossi@cineca.it> ---
Before adding this constraint, we need to delete all entries in aqorders_items if the item has already been deleted.
Before applying, : 0/ Set the AcqCreateItem pref to "on receiving" 1/ Create an order with 1 item 2/ On Catalog "Delete the items" of the biblio record. In the DB I saw an aqorders_items's record and a deleteditems's record with the same itemnumber entry. Then I've applied the patches against master 3.17.00.057 HEAD 13229. And I upgraded the DB as required. [In the DB the aqorders_items record was deleted as required.] Then I tried to create an order with an item, but no item was created. So I pass the patch to "Failed QA" status. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12555 --- Comment #10 from Jonathan Druart <jonathan.druart@biblibre.com> --- (In reply to Paola Rossi from comment #9)
Then I tried to create an order with an item, but no item was created.
If AcqCreateItem is set to "on receiving", it's normal that no item is created on ordering. Did you mean the item is not created on receiving neither? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12555 Paola Rossi <paola.rossi@cineca.it> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12555 Paola Rossi <paola.rossi@cineca.it> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #33290|0 |1 is obsolete| | --- Comment #11 from Paola Rossi <paola.rossi@cineca.it> --- Created attachment 34016 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=34016&action=edit Bug 12555: Call DelItem on cancelling a receipt I've tried to test the patches againt master 3.17.00.060 HEAD 13353. Before applying, : 0/ Set the AcqCreateItem pref to "on receiving" 1/ Create an order with 1 item 2/ On Catalog "Delete the items" of the biblio record. In the DB I saw an aqorders_items's record and a deleteditems's record with the same itemnumber entry. Then I've applied the patches against master 3.17.00.060 HEAD 13353. I upgraded the DB as required. [In the DB the aqorders_items record was deleted as required.] Everything is OK as required by the test plan. So I pass the patches to "Signed Off" status. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12555 Paola Rossi <paola.rossi@cineca.it> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #33291|0 |1 is obsolete| | --- Comment #12 from Paola Rossi <paola.rossi@cineca.it> --- Created attachment 34017 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=34017&action=edit Bug 12555: Add a FK on aqorders_items.itemnumber -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12555 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12555 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #34016|0 |1 is obsolete| | Attachment #34017|0 |1 is obsolete| | --- Comment #13 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 34157 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=34157&action=edit [PASSED QA] Bug 12555: Call DelItem on cancelling a receipt On cancelling a receipt, the items should be deleted using the C4::Items::DelItem subroutine in order to update zebra and sent the items in the deleteditems table. The entries in aqorders_items will automatically deleted by the DBMS (on delete cascade). Test plan: 0/ Set the AcqCreateItem pref to "on receiving" 1/ Create an order with some items 2/ Receive the items 3/ Note the itemnumber in the items table 4/ Cancel the receipt 5/ Verify the itemnumbers are present in the deleteditems table and the items have been deleted. Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> Signed-off-by: Paola Rossi <paola.rossi@cineca.it> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12555 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #34157|0 |1 is obsolete| | --- Comment #14 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 34158 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=34158&action=edit [PASSED QA] Bug 12555: Call DelItem on cancelling a receipt On cancelling a receipt, the items should be deleted using the C4::Items::DelItem subroutine in order to update zebra and sent the items in the deleteditems table. The entries in aqorders_items will automatically deleted by the DBMS (on delete cascade). Test plan: 0/ Set the AcqCreateItem pref to "on receiving" 1/ Create an order with some items 2/ Receive the items 3/ Note the itemnumber in the items table 4/ Cancel the receipt 5/ Verify the itemnumbers are present in the deleteditems table and the items have been deleted. Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> Signed-off-by: Paola Rossi <paola.rossi@cineca.it> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12555 --- Comment #15 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 34159 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=34159&action=edit [PASSED QA] Bug 12555: Add a FK on aqorders_items.itemnumber The previous patch assumed that deleting an item will delete the entry in aqorders_items. But the FK did not exist. Looking at the code, we never join aqorders_items and deleteditems, so I think we can add this constraint. Before adding this constraint, we need to delete all entries in aqorders_items if the item has already been deleted. Signed-off-by: Paola Rossi <paola.rossi@cineca.it> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12555 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |In Discussion --- Comment #16 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I am not sure about deleting in aqorders_items when the items are deleted/the order is cancelled. We keep the record, the items and even the cancelled order - so not sure we should delete what ties them together. For library statistics often the items that were deleted/removed from the collection are queried/counted - so the library would want to differentiate between an item that really existed in the library or didn't. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12555 --- Comment #17 from Jonathan Druart <jonathan.druart@biblibre.com> --- The aqorders_items entries are already removed on canceling a receipt. Before this patch, the items were deleted too. With the patch, they are moved to deleteditems. I am not sure to understand what is the info you loose, could you please detail? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12555 --- Comment #18 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I am afraid I won't be able to tell which deleted items were non-existant in the library - belonged to a cancelled order - and which items were removed for other reasons (damaged, outdated). Biblionumber might not be enough, as you might have cancelled an order and at a later point in time the existing items get thrown out because the book gets outdated/replaces by a newer edition. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12555 --- Comment #19 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I think for me it would make sense to either delete both - the item and the linking, or keep both. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12555 --- Comment #20 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- What can I do to unblock this one? -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org