[Bug 36068] New: Add maintenance script acq_cancel_obsolete_orders.pl
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36068 Bug ID: 36068 Summary: Add maintenance script acq_cancel_obsolete_orders.pl Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Command-line Utilities Assignee: koha-bugs@lists.koha-community.org Reporter: m.de.rooy@rijksmuseum.nl QA Contact: testopia@bugs.koha-community.org CC: robin@catalyst.net.nz i.e. Cancel order lines that have no biblio anymore but are still considered open (received < ordered, not cancelled). Note that Koha still is a bit hybrid to determine if an order has been cancelled: we have orderstatus and we have datecancellationprinted.. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36068 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |m.de.rooy@rijksmuseum.nl |ity.org | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36068 --- Comment #1 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Marcel de Rooy from comment #0)
Note that Koha still is a bit hybrid to determine if an order has been cancelled: we have orderstatus and we have datecancellationprinted..
And in production data I come across both flavors: status=ordered and date cancellation filled status=cancelled and date is not filled. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36068 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36068 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36068 --- Comment #2 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Hm, I would assume this should not happen with "today's" code, but could be from earlier versions. Can you maybe tell form the dates/ordernumbers if this is older or more recnt? Or could it be migration/imported data? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36068 --- Comment #3 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Katrin Fischer from comment #2)
Hm, I would assume this should not happen with "today's" code, but could be from earlier versions.
Can you maybe tell form the dates/ordernumbers if this is older or more recnt? Or could it be migration/imported data?
No migrated data. Yes, it seems that by far most occurrences are from 5-10 years ago. But I think that I had at least a few more recent. Many installs will probably have such historical cases and this script lets you cleanup. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36068 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36068 --- Comment #4 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 162259 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=162259&action=edit Bug 36068: Add maint script acq_cancel_obsolete_orders.pl Introducing $orders->filter_by_obsolete and $orders->cancel. Test plan: Run t/db_dependent/Koha/Acquisition/Orders.t Create basket with few orders. Remove some biblio records. Run acq_cancel_obsolete_orders.pl -c -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36068 --- Comment #5 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 162260 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=162260&action=edit Bug 36068: Do not overwrite cancellation date in ->cancel Test plan: Run t/db_dependent/Koha/Acquisition/Order.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36068 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #162259|0 |1 is obsolete| | --- Comment #6 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 162261 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=162261&action=edit Bug 36068: Add maint script acq_cancel_obsolete_orders.pl Introducing $orders->filter_by_obsolete and $orders->cancel. Test plan: Run t/db_dependent/Koha/Acquisition/Orders.t Create basket with few orders. Remove some biblio records. Run acq_cancel_obsolete_orders.pl -c Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36068 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #162260|0 |1 is obsolete| | --- Comment #7 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 162262 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=162262&action=edit Bug 36068: Do not overwrite cancellation date in ->cancel Test plan: Run t/db_dependent/Koha/Acquisition/Order.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36068 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |27893 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27893 [Bug 27893] Delete of biblio should warn about attached acq orders and cancel them -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36068 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |35994 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35994 [Bug 35994] Need an easy way to see if biblio record or item is still in acquisition -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36068 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36068 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #162261|0 |1 is obsolete| | --- Comment #8 from David Nind <david@davidnind.com> --- Created attachment 163721 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=163721&action=edit Bug 36068: Add maint script acq_cancel_obsolete_orders.pl Introducing $orders->filter_by_obsolete and $orders->cancel. Test plan: Run t/db_dependent/Koha/Acquisition/Orders.t Create basket with few orders. Remove some biblio records. Run acq_cancel_obsolete_orders.pl -c Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36068 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #162262|0 |1 is obsolete| | --- Comment #9 from David Nind <david@davidnind.com> --- Created attachment 163722 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=163722&action=edit Bug 36068: Do not overwrite cancellation date in ->cancel Test plan: Run t/db_dependent/Koha/Acquisition/Order.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36068 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #163721|0 |1 is obsolete| | --- Comment #10 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 165000 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=165000&action=edit Bug 36068: Add maint script acq_cancel_obsolete_orders.pl Introducing $orders->filter_by_obsolete and $orders->cancel. Test plan: Run t/db_dependent/Koha/Acquisition/Orders.t Create basket with few orders. Remove some biblio records. Run acq_cancel_obsolete_orders.pl -c Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36068 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #163722|0 |1 is obsolete| | --- Comment #11 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 165001 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=165001&action=edit Bug 36068: Do not overwrite cancellation date in ->cancel Test plan: Run t/db_dependent/Koha/Acquisition/Order.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36068 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com --- Comment #12 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- All works as described.. QA scripts are happy and new methods are tested. Passing QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36068 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36068 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Failed QA --- Comment #13 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Hi Marcel, trying to understand the logic here I stumbled on this line: + [1] Order lines that have no biblio anymore but are still considered open + (received < ordered, not cancelled). Can you please explain especially the second part? Similar here: + [1] Biblionumber is null but received < ordered and not cancelled. Thanks for writing a lot of documentation on these scripts. A note: -c is logical, but often reserves for "confirm". Should we maybe switch it? ./misc/maintenance/acq_cancel_obsolete_orders.pl -h Gives me the documentation, but it doesn't contain the typical list of parameter the script accepts. I think it would be nice to be consistent here with the other scripts. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36068 --- Comment #14 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Katrin Fischer from comment #13)
Hi Marcel, trying to understand the logic here I stumbled on this line:
+ [1] Order lines that have no biblio anymore but are still considered open + (received < ordered, not cancelled).
Can you please explain especially the second part?
The biblio has been already deleted. But somehow we had order lines that were still 'open'. They were not cancelled. (Note that Koha is confused about that status because we have two fields: datecancellationprinted and status.) What also was possible (perhaps by older bugs) is quantity undefined or received < quantity. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36068 --- Comment #15 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Katrin Fischer from comment #13)
Similar here:
+ [1] Biblionumber is null but received < ordered and not cancelled.
Thats referring to the same. The script calls the module. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36068 --- Comment #16 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Katrin Fischer from comment #13)
A note: -c is logical, but often reserves for "confirm". Should we maybe switch it?
+GetOptions( + 'confirm' => \$params->{confirm}, 'help' => \$params->{help}, 'age:i' => \$params->{age}, +); The c stands for confirm but it is confirming a cancellation. Script name is helpful too: acq_cancel_obsolete_orders.pl. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36068 --- Comment #17 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Katrin Fischer from comment #13)
./misc/maintenance/acq_cancel_obsolete_orders.pl -h
Gives me the documentation, but it doesn't contain the typical list of parameter the script accepts. I think it would be nice to be consistent here with the other scripts.
Will have a look. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36068 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36068 --- Comment #18 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 165113 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=165113&action=edit Bug 36068: (QA follow-up) Add OPTIONS section in POD Test plan: Run script with --help. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36068 --- Comment #19 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I think my issue is, I don't understand your syntax here: (received < ordered, not cancelled). How do you read the < ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36068 --- Comment #20 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Katrin Fischer from comment #19)
I think my issue is, I don't understand your syntax here:
(received < ordered, not cancelled).
How do you read the < ?
Simply as lower than. The number of received items is lower than the number ordered :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36068 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to main Version(s)| |24.05.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36068 --- Comment #21 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 24.05! Well done everyone, thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36068 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m Status|Pushed to main |Needs documenting --- Comment #22 from Fridolin Somers <fridolin.somers@biblibre.com> --- Not backported to 23.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36068 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This adds a new CLI script release notes| |`acq_cancel_obsolete_orders | |.pl` that allows to clean | |up older acquisition data | |with conflicting | |information on the order | |status. This will also | |cancel order lines that are | |no longer linked to a | |bibliographic record, but | |are still considered | |pending. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36068 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC|martin.renvoize@ptfs-europe | |.com | -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org