Bugzilla – Attachment 163769 Details for
Bug 36018
Improve consistency in Acquisition/Order(s) regarding active/current orders
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36018: Rename orders->filter_by_current
Bug-36018-Rename-orders-filterbycurrent.patch (text/plain), 3.02 KB, created by
Marcel de Rooy
on 2024-03-25 09:49:16 UTC
(
hide
)
Description:
Bug 36018: Rename orders->filter_by_current
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2024-03-25 09:49:16 UTC
Size:
3.02 KB
patch
obsolete
>From 0e64dfc65f7cbe67b4d28f8504a26e5131dda408 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Wed, 21 Feb 2024 12:34:50 +0000 >Subject: [PATCH] Bug 36018: Rename orders->filter_by_current >Content-Type: text/plain; charset=utf-8 > >Current is a bit misleading here. It means the ones that are not >cancelled. >We already use the filter_out_etc naming schema. So in harmony with >that, we switch it to filter_out_cancelled. > >Test plan: >Run t/db_dependent/Koha/Acquisition/Order.t >Run git grep -l '::Orders' | xargs grep filter_by_current >* All occurrences should be related to Recalls, not Orders. >Go to acqui/basket.pl. Delete a whole basket who has some active >and some cancelled lines. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > Koha/Acquisition/Orders.pm | 11 +++++++---- > acqui/basket.pl | 2 +- > t/db_dependent/Koha/Acquisition/Order.t | 4 ++-- > 3 files changed, 10 insertions(+), 7 deletions(-) > >diff --git a/Koha/Acquisition/Orders.pm b/Koha/Acquisition/Orders.pm >index 2438886ac8..8672de10c9 100644 >--- a/Koha/Acquisition/Orders.pm >+++ b/Koha/Acquisition/Orders.pm >@@ -149,7 +149,10 @@ sub filter_by_lates { > > my $new_rs = $orders->filter_by_active; > >-Returns a new resultset filtering orders that are not active. >+Returns a new resultset containing active orders only. >+ >+Note: An active order (line) has status ordered or partial, or it has status new >+and the basket is marked as standing order. > > =cut > >@@ -167,15 +170,15 @@ sub filter_by_active { > ); > } > >-=head3 filter_by_current >+=head3 filter_out_cancelled > >- $orders->filter_by_current >+ $orders->filter_out_cancelled > > Return the orders of the set that have not been cancelled. > > =cut > >-sub filter_by_current { >+sub filter_out_cancelled { > my ($self) = @_; > return $self->search( > { >diff --git a/acqui/basket.pl b/acqui/basket.pl >index 6401125d01..61b077d38b 100755 >--- a/acqui/basket.pl >+++ b/acqui/basket.pl >@@ -127,7 +127,7 @@ if ( $op eq 'cud-delete_confirm' ) { > my $delbiblio = $query->param('delbiblio'); > my $basket_obj = Koha::Acquisition::Baskets->find($basketno); > >- my $orders = $basket_obj->orders->filter_by_current; >+ my $orders = $basket_obj->orders->filter_out_cancelled; > > my @cannotdelbiblios; > >diff --git a/t/db_dependent/Koha/Acquisition/Order.t b/t/db_dependent/Koha/Acquisition/Order.t >index 10fdfa4685..94c30fa3d4 100755 >--- a/t/db_dependent/Koha/Acquisition/Order.t >+++ b/t/db_dependent/Koha/Acquisition/Order.t >@@ -590,7 +590,7 @@ subtest 'filter_by_late' => sub { > $schema->storage->txn_rollback; > }; > >-subtest 'filter_by_current & filter_by_cancelled' => sub { >+subtest 'filter_out_cancelled & filter_by_cancelled' => sub { > plan tests => 2; > > $schema->storage->txn_begin; >@@ -631,7 +631,7 @@ subtest 'filter_by_current & filter_by_cancelled' => sub { > } > ); > >- is( $orders->filter_by_current->count, 2); >+ is( $orders->filter_out_cancelled->count, 2); > is( $orders->filter_by_cancelled->count, 1); > > >-- >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 36018
:
162318
|
162320
|
162321
|
163769
|
163770
|
163771
|
163772
|
164953
|
164954
|
164955
|
164956
|
165153
|
166503
|
166504
|
166505
|
166506
|
166507
|
166677