Bugzilla – Attachment 165620 Details for
Bug 27893
Deleting a bibliographic record should warn about attached acquisition orders and cancel them
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27893: (follow-up) Check orderstatus in orders->cancel
Bug-27893-follow-up-Check-orderstatus-in-orders-ca.patch (text/plain), 2.25 KB, created by
Marcel de Rooy
on 2024-04-26 09:21:29 UTC
(
hide
)
Description:
Bug 27893: (follow-up) Check orderstatus in orders->cancel
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2024-04-26 09:21:29 UTC
Size:
2.25 KB
patch
obsolete
>From d221f0991d6abefd4288972823a6639d70593cd5 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 26 Apr 2024 09:19:29 +0000 >Subject: [PATCH] Bug 27893: (follow-up) Check orderstatus in orders->cancel >Content-Type: text/plain; charset=utf-8 > >Test plan: >Run t/db_dependent/Koha/Acquisition/Orders.t > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > Koha/Acquisition/Orders.pm | 1 + > t/db_dependent/Koha/Acquisition/Orders.t | 4 ++-- > 2 files changed, 3 insertions(+), 2 deletions(-) > >diff --git a/Koha/Acquisition/Orders.pm b/Koha/Acquisition/Orders.pm >index 69fe134ba6..598790d414 100644 >--- a/Koha/Acquisition/Orders.pm >+++ b/Koha/Acquisition/Orders.pm >@@ -287,6 +287,7 @@ sub cancel { > my $count = 0; > my @messages; > while ( my $order = $self->next ) { >+ next if $order->orderstatus =~ /complete|cancelled/; > _correct_quantity($order); # historical ballast > $order->cancel( { delete_biblio => $delete_biblio } ); > if ( @{ $order->object_messages } ) { >diff --git a/t/db_dependent/Koha/Acquisition/Orders.t b/t/db_dependent/Koha/Acquisition/Orders.t >index 0fb2bc4031..997110928a 100755 >--- a/t/db_dependent/Koha/Acquisition/Orders.t >+++ b/t/db_dependent/Koha/Acquisition/Orders.t >@@ -196,11 +196,11 @@ subtest 'filter_by_obsolete and cancel' => sub { > $rs = Koha::Acquisition::Orders->filter_by_obsolete->search($limit); > is( $rs->count, 3, 'Three obsolete' ); > my @results = $rs->cancel; >- is( $results[0], 3, 'All should be cancelled' ); >+ is( $results[0], 2, 'Two should be cancelled, one was cancelled already' ); > is( @{ $results[1] }, 0, 'No messages' ); > is( $order_1->discard_changes->orderstatus, 'cancelled', 'Check orderstatus of order_1' ); > isnt( $order_2->discard_changes->datecancellationprinted, undef, 'Cancellation date of order_2 filled' ); >- isnt( $order_3->discard_changes->datecancellationprinted, undef, 'Cancellation date of order_3 filled' ); >+ is( $order_3->discard_changes->datecancellationprinted, undef, 'order_3 was skipped, so date not touched' ); > > $schema->storage->txn_rollback; > }; >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 27893
:
118025
|
162271
|
162272
|
163669
|
163670
|
163676
|
163677
|
165002
|
165003
|
165151
|
165152
|
165620
|
165621