Bugzilla – Attachment 114941 Details for
Bug 25670
Add useful methods to Koha::Acquisition::Orders
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25670: New orders included only if standing
Bug-25670-New-orders-included-only-if-standing.patch (text/plain), 1.50 KB, created by
Tomás Cohen Arazi (tcohen)
on 2021-01-07 19:38:11 UTC
(
hide
)
Description:
Bug 25670: New orders included only if standing
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2021-01-07 19:38:11 UTC
Size:
1.50 KB
patch
obsolete
>From a3ec3c6cbbbd14fcef441f7f50ffe3bd295dbbc6 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 7 Jan 2021 16:16:00 -0300 >Subject: [PATCH] Bug 25670: New orders included only if standing > >The original implementation included new orders regardless they were >standing orders. > >This patch makes the query respect that conditions found on >C4::Acquisitions::SearchOrders. > >To test: >1. Apply the regression tests patch >2. Run: > $ kshell > k$ prove t/db_dependent/Koha/Acquisition/Orders.t >=> FAIL: More orders than expected are returned >3. Apply this patch >4. Repeat 2 >=> SUCCESS: Tests pass! New orders are only considered if the basket >they are attached to, is marked as standing! >5. Verify the tests make sense >6. Sign off :-D > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > Koha/Acquisition/Orders.pm | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > >diff --git a/Koha/Acquisition/Orders.pm b/Koha/Acquisition/Orders.pm >index 67b5dd0244..2b06b81d1e 100644 >--- a/Koha/Acquisition/Orders.pm >+++ b/Koha/Acquisition/Orders.pm >@@ -143,8 +143,13 @@ sub filter_by_active { > my ($self) = @_; > return $self->search( > { >- orderstatus => [ 'new', 'ordered', 'partial' ] >- } >+ '-or' => [ >+ { 'basket.is_standing' => 1, >+ 'orderstatus' => [ 'new', 'ordered', 'partial' ] }, >+ { 'orderstatus' => [ 'ordered', 'partial' ] } >+ ] >+ }, >+ { join => 'basket' } > ); > } > >-- >2.30.0
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 25670
:
105534
|
105535
|
109859
|
109860
|
110643
|
110644
|
110700
|
110701
|
114940
| 114941 |
116141