Bugzilla – Attachment 67911 Details for
Bug 15685
Allow creation of items (AcqCreateItem) to be customizable per-basket
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15685: Send the basket to _cancel_items_receipt
Bug-15685-Send-the-basket-to-cancelitemsreceipt.patch (text/plain), 2.77 KB, created by
Jonathan Druart
on 2017-10-10 21:17:15 UTC
(
hide
)
Description:
Bug 15685: Send the basket to _cancel_items_receipt
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2017-10-10 21:17:15 UTC
Size:
2.77 KB
patch
obsolete
>From 4da7f3716a8fa79488248be1df7130afedb3c9f7 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 10 Oct 2017 18:15:01 -0300 >Subject: [PATCH] Bug 15685: Send the basket to _cancel_items_receipt > >--- > C4/Acquisition.pm | 16 ++++++++-------- > 1 file changed, 8 insertions(+), 8 deletions(-) > >diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm >index 4d12bc7e80..2c48f4e637 100644 >--- a/C4/Acquisition.pm >+++ b/C4/Acquisition.pm >@@ -1590,7 +1590,7 @@ sub CancelReceipt { > my $parent_ordernumber = $order->{'parent_ordernumber'}; > > my @itemnumbers = GetItemnumbersFromOrder( $ordernumber ); >- my $basket = Koha::Acquisition::Orders->find({ordernumber => $ordernumber})->basket; >+ my $order_obj = Koha::Acquisition::Orders->find( $ordernumber ); # FIXME rewrite all this subroutine using this object > > if($parent_ordernumber == $ordernumber || not $parent_ordernumber) { > # The order line has no parent, just mark it as not received >@@ -1604,7 +1604,7 @@ sub CancelReceipt { > }; > $sth = $dbh->prepare($query); > $sth->execute(0, undef, undef, $ordernumber); >- _cancel_items_receipt( $basket->effective_create_items, $ordernumber ); >+ _cancel_items_receipt( $order_obj ); > } else { > # The order line has a parent, increase parent quantity and delete > # the order line. >@@ -1651,7 +1651,7 @@ sub CancelReceipt { > WHERE ordernumber = ? > |, undef, $parent_ordernumber); > >- _cancel_items_receipt( $basket->effective_create_items, $ordernumber, $parent_ordernumber ); >+ _cancel_items_receipt( $order_obj, $parent_ordernumber ); > # Delete order line > $query = qq{ > DELETE FROM aqorders >@@ -1662,7 +1662,7 @@ sub CancelReceipt { > > } > >- if( $basket->effective_create_items eq 'ordering' ) { >+ if( $order_obj->basket->effective_create_items eq 'ordering' ) { > my @affects = split q{\|}, C4::Context->preference("AcqItemSetSubfieldsWhenReceiptIsCancelled"); > if ( @affects ) { > for my $in ( @itemnumbers ) { >@@ -1685,11 +1685,11 @@ sub CancelReceipt { > } > > sub _cancel_items_receipt { >- my ( $effective_create_items, $ordernumber, $parent_ordernumber ) = @_; >- $parent_ordernumber ||= $ordernumber; >+ my ( $order, $parent_ordernumber ) = @_; >+ $parent_ordernumber ||= $order->ordernumber; > >- my @itemnumbers = GetItemnumbersFromOrder($ordernumber); >- if ( $effective_create_items eq 'receiving' ) { >+ my @itemnumbers = GetItemnumbersFromOrder($order->ordernumber); # FIXME Must be $order->items >+ if ( $order->basket->effective_create_items eq 'receiving' ) { > # Remove items that were created at receipt > my $query = qq{ > DELETE FROM items, aqorders_items >-- >2.11.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 15685
:
47783
|
55094
|
55096
|
57390
|
57392
|
57395
|
57424
|
57425
|
57426
|
57427
|
64918
|
64919
|
64920
|
64921
|
64922
|
65119
|
65120
|
65121
|
65122
|
65895
|
65896
|
65897
|
65898
|
65899
|
65900
|
66119
|
66120
|
66121
|
66122
|
66123
|
66124
|
67638
|
67639
|
67640
|
67641
|
67642
|
67643
|
67644
|
67645
|
67646
|
67647
|
67689
|
67690
|
67691
|
67692
|
67693
|
67694
|
67695
|
67696
|
67697
|
67698
|
67884
|
67898
|
67899
|
67900
|
67901
|
67902
|
67903
|
67904
|
67905
|
67906
|
67907
|
67908
|
67909
|
67910
| 67911