Bugzilla – Attachment 33290 Details for
Bug 12555
The DelItem subroutine should be called on canceling a receipt
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12555: Call DelItem on cancelling a receipt
Bug-12555-Call-DelItem-on-cancelling-a-receipt.patch (text/plain), 2.12 KB, created by
Jonathan Druart
on 2014-11-06 08:49:27 UTC
(
hide
)
Description:
Bug 12555: Call DelItem on cancelling a receipt
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2014-11-06 08:49:27 UTC
Size:
2.12 KB
patch
obsolete
>From 013036838a62f0e162c5334357bae2be847547f1 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Wed, 16 Jul 2014 15:09:31 +0200 >Subject: [PATCH] Bug 12555: Call DelItem on cancelling a receipt > >On cancelling a receipt, the items should be deleted using the >C4::Items::DelItem subroutine in order to update zebra and sent the >items in the deleteditems table. > >The entries in aqorders_items will automatically deleted by the DBMS (on >delete cascade). > >Test plan: >0/ Set the AcqCreateItem pref to "on receiving" >1/ Create an order with some items >2/ Receive the items >3/ Note the itemnumber in the items table >4/ Cancel the receipt >5/ Verify the itemnumbers are present in the deleteditems table and the >items have been deleted. > >Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> >--- > C4/Acquisition.pm | 20 ++++++-------------- > 1 file changed, 6 insertions(+), 14 deletions(-) > >diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm >index f9e8c49..c07fcd7 100644 >--- a/C4/Acquisition.pm >+++ b/C4/Acquisition.pm >@@ -1605,21 +1605,13 @@ sub _cancel_items_receipt { > $parent_ordernumber ||= $ordernumber; > > my @itemnumbers = GetItemnumbersFromOrder($ordernumber); >- if(C4::Context->preference('AcqCreateItem') eq 'receiving') { >- # Remove items that were created at receipt >- my $query = qq{ >- DELETE FROM items, aqorders_items >- USING items, aqorders_items >- WHERE items.itemnumber = ? AND aqorders_items.itemnumber = ? >- }; >- my $dbh = C4::Context->dbh; >- my $sth = $dbh->prepare($query); >- foreach my $itemnumber (@itemnumbers) { >- $sth->execute($itemnumber, $itemnumber); >+ foreach my $itemnumber (@itemnumbers) { >+ if(C4::Context->preference('AcqCreateItem') eq 'receiving') { >+ # Remove items that were created at receipt >+ C4::Items::DelItem({ itemnumber => $itemnumber }); > } >- } else { >- # Update items >- foreach my $itemnumber (@itemnumbers) { >+ else { >+ # Update items > ModItemOrder($itemnumber, $parent_ordernumber); > } > } >-- >2.1.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 12555
:
29752
|
30613
|
31008
|
33290
|
33291
|
34016
|
34017
|
34157
|
34158
|
34159