Bugzilla – Attachment 44551 Details for
Bug 15036
Closing and reopening a basket should not alter status of completed orders
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 15036: Do not overwrite complete status in basket ops
PASSED-QA-Bug-15036-Do-not-overwrite-complete-stat.patch (text/plain), 2.75 KB, created by
Kyle M Hall (khall)
on 2015-11-06 12:45:44 UTC
(
hide
)
Description:
[PASSED QA] Bug 15036: Do not overwrite complete status in basket ops
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2015-11-06 12:45:44 UTC
Size:
2.75 KB
patch
obsolete
>From 3edb4e9f63ac0480879646c8ccd7eb4d818cf65e Mon Sep 17 00:00:00 2001 >From: Colin Campbell <colin.campbell@ptfs-europe.com> >Date: Tue, 20 Oct 2015 14:19:35 +0100 >Subject: [PATCH] [PASSED QA] Bug 15036: Do not overwrite complete status in basket ops > >Reopening or closing a basket should preserve the completed >status for receipted orders. > >This patch excludes orderlines with the completed status >from having their status rewritten as a result of the >change in basket status > >Made the subroutines involved more efficient by removing an >unnecessary loop and by not fetching a large amount of >superfluous data > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > C4/Acquisition.pm | 48 +++++++++++++----------------------------------- > 1 files changed, 13 insertions(+), 35 deletions(-) > >diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm >index 0f2b161..4044556 100644 >--- a/C4/Acquisition.pm >+++ b/C4/Acquisition.pm >@@ -236,24 +236,11 @@ close a basket (becomes unmodifiable, except for receives) > sub CloseBasket { > my ($basketno) = @_; > my $dbh = C4::Context->dbh; >- my $query = " >- UPDATE aqbasket >- SET closedate=now() >- WHERE basketno=? >- "; >- my $sth = $dbh->prepare($query); >- $sth->execute($basketno); >+ $dbh->do('UPDATE aqbasket SET closedate=now() WHERE basketno=?', {}, $basketno ); > >- my @orders = GetOrders($basketno); >- foreach my $order (@orders) { >- $query = qq{ >- UPDATE aqorders >- SET orderstatus = 'ordered' >- WHERE ordernumber = ?; >- }; >- $sth = $dbh->prepare($query); >- $sth->execute($order->{'ordernumber'}); >- } >+ $dbh->do( q{UPDATE aqorders SET orderstatus = 'ordered' WHERE basketno = ? AND orderstatus != 'complete'}, >+ {}, $basketno); >+ return; > } > > =head3 ReopenBasket >@@ -267,24 +254,15 @@ reopen a basket > sub ReopenBasket { > my ($basketno) = @_; > my $dbh = C4::Context->dbh; >- my $query = " >- UPDATE aqbasket >- SET closedate=NULL >- WHERE basketno=? >- "; >- my $sth = $dbh->prepare($query); >- $sth->execute($basketno); >+ $dbh->do( q{UPDATE aqbasket SET closedate=NULL WHERE basketno=?}, {}, $basketno ); > >- my @orders = GetOrders($basketno); >- foreach my $order (@orders) { >- $query = qq{ >- UPDATE aqorders >- SET orderstatus = 'new' >- WHERE ordernumber = ?; >- }; >- $sth = $dbh->prepare($query); >- $sth->execute($order->{'ordernumber'}); >- } >+ $dbh->do( q{ >+ UPDATE aqorders >+ SET orderstatus = 'new' >+ WHERE basketno = ? >+ AND orderstatus != 'complete' >+ }, {}, $basketno); >+ return; > } > > #------------------------------------------------------------# >-- >1.7.2.5
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 15036
:
43682
| 44551