Bugzilla – Attachment 99655 Details for
Bug 20728
Remove subroutines GetLastOrder*
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20728: Proof that there is no cheating
Bug-20728-Proof-that-there-is-no-cheating.patch (text/plain), 2.11 KB, created by
Martin Renvoize (ashimema)
on 2020-02-26 15:54:05 UTC
(
hide
)
Description:
Bug 20728: Proof that there is no cheating
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2020-02-26 15:54:05 UTC
Size:
2.11 KB
patch
obsolete
>From 0445ff47aea8cbe01e5fbb212aebe4885b65deb3 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 15 Mar 2019 19:24:19 -0300 >Subject: [PATCH] Bug 20728: Proof that there is no cheating > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > C4/Acquisition.pm | 35 +++++++++++------------------------ > 1 file changed, 11 insertions(+), 24 deletions(-) > >diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm >index 4a84ddc6ae..1d63448131 100644 >--- a/C4/Acquisition.pm >+++ b/C4/Acquisition.pm >@@ -1283,30 +1283,17 @@ Returns a reference-to-hash describing the last order received for a subscriptio > > sub GetLastOrderReceivedFromSubscriptionid { > my ( $subscriptionid ) = @_; >- my $dbh = C4::Context->dbh; >- my $query = qq| >- SELECT * FROM aqorders >- LEFT JOIN subscription >- ON ( aqorders.subscriptionid = subscription.subscriptionid ) >- WHERE aqorders.subscriptionid = ? >- AND aqorders.datereceived = >- ( >- SELECT MAX( aqorders.datereceived ) >- FROM aqorders >- LEFT JOIN subscription >- ON ( aqorders.subscriptionid = subscription.subscriptionid ) >- WHERE aqorders.subscriptionid = ? >- AND aqorders.datereceived IS NOT NULL >- ) >- ORDER BY ordernumber DESC >- LIMIT 1 >- |; >- my $result_set = >- $dbh->selectall_arrayref( $query, { Slice => {} }, $subscriptionid, $subscriptionid ); >- >- # result_set assumed to contain 1 match >- return $result_set->[0]; >- >+ my $lastOrderReceived = Koha::Acquisition::Orders->search( >+ { >+ subscriptionid => $subscriptionid, >+ datereceived => { '!=' => undef } >+ }, >+ { >+ order_by => >+ [ { -desc => 'datereceived' }, { -desc => 'ordernumber' } ] >+ } >+ ); >+ return $lastOrderReceived->count ? $lastOrderReceived->next->unblessed : undef; > } > > #------------------------------------------------------------# >-- >2.20.1
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 20728
:
86693
|
86694
|
86695
|
99655
|
99656
|
99657
|
99877
|
99878
|
99879
|
102873
|
102874
|
102875